Commit 609cfc9a by linjinhong Committed by qinjianhui

fix:修改提示问题

parent 87b70878
...@@ -281,7 +281,7 @@ const weightChange = async () => { ...@@ -281,7 +281,7 @@ const weightChange = async () => {
const weightGet = async () => { const weightGet = async () => {
if (tableData.value.length < 1) { if (tableData.value.length < 1) {
ElMessage.warning('请先导出数据') ElMessage.warning('当前没有可提交的数据!')
return return
} }
for (const iterator of tableData.value) { for (const iterator of tableData.value) {
......
...@@ -27,6 +27,7 @@ interface WeighItem { ...@@ -27,6 +27,7 @@ interface WeighItem {
shopNumber?: string shopNumber?: string
platform?: string platform?: string
logisticsCompanyName?: string logisticsCompanyName?: string
logisticsCompanyCode?: string
logisticsCompanyId?: string logisticsCompanyId?: string
wgap?: number | string wgap?: number | string
weight?: string weight?: string
...@@ -38,6 +39,7 @@ interface SearchItem { ...@@ -38,6 +39,7 @@ interface SearchItem {
} }
interface Data { interface Data {
data: WeighItem[] data: WeighItem[]
code: number
} }
type AudioKey = type AudioKey =
...@@ -239,31 +241,54 @@ class Weigh extends Lock { ...@@ -239,31 +241,54 @@ class Weigh extends Lock {
try { try {
const response = await apiCall(params) const response = await apiCall(params)
console.log(211, response)
const { data } = response const { data } = response
console.log(211, data)
const waitWeighingList = data.filter( if (!data.length) {
(el) => el.status === 'WAIT_WEIGHING', this.playAudio('weight_search_error', '查询失败')
return
}
// const waitWeighingList = data.filter(
// (el) => el.status === 'WAIT_WEIGHING',
// )
// if (waitWeighingList.length === 0) {
// this.playAudio(
// 'weight_search_error',
// `必须是待称重状态的订单下的${
// this.selectType === 'trackingNumber' ? '跟踪号' : '店铺单号'
// }才能使用`,
// )
// return
// }
if (this.list?.length) {
const firstLogisticsCode = data[0]?.logisticsCompanyCode
const hasDifferentLogistics = this.list.some(
(el) =>
// 如果两个代码不都是undefined,并且它们不相等
!(
el.logisticsCompanyCode === undefined &&
firstLogisticsCode === undefined
) && el.logisticsCompanyCode !== firstLogisticsCode,
) )
if (waitWeighingList.length === 0) { if (hasDifferentLogistics) {
this.playAudio( this.playAudio(
'weight_search_error', 'weight_search_error',
`必须是待称重状态的订单下的${ '当前查询的订单不属于所选择的物流公司,请核实后再试',
this.selectType === 'trackingNumber' ? '跟踪号' : '店铺单号'
}才能使用`,
) )
return return
} }
if (!waitWeighingList.length) {
this.playAudio('weight_search_error', '查询失败')
return
} }
// 最终去重检查 // 最终去重检查
if ( if (
this.deduplicate( this.deduplicate(
(waitWeighingList[0] as WeighItem).trackingNumber as string, (data[0] as WeighItem).trackingNumber as string,
callback, callback,
) )
) { ) {
...@@ -271,10 +296,10 @@ class Weigh extends Lock { ...@@ -271,10 +296,10 @@ class Weigh extends Lock {
} }
// 添加新项目 // 添加新项目
this.addNewItem(waitWeighingList, callback) this.addNewItem(data, callback)
} catch (error) { } catch (error) {
console.error('跟踪号查询错误:', error) console.error('跟踪号查询错误:', error)
this.playAudio('weight_search_error') // this.playAudio('weight_search_error')
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment