Commit 609cfc9a by linjinhong Committed by qinjianhui

fix:修改提示问题

parent 87b70878
......@@ -281,7 +281,7 @@ const weightChange = async () => {
const weightGet = async () => {
if (tableData.value.length < 1) {
ElMessage.warning('请先导出数据')
ElMessage.warning('当前没有可提交的数据!')
return
}
for (const iterator of tableData.value) {
......
......@@ -27,6 +27,7 @@ interface WeighItem {
shopNumber?: string
platform?: string
logisticsCompanyName?: string
logisticsCompanyCode?: string
logisticsCompanyId?: string
wgap?: number | string
weight?: string
......@@ -38,6 +39,7 @@ interface SearchItem {
}
interface Data {
data: WeighItem[]
code: number
}
type AudioKey =
......@@ -239,31 +241,54 @@ class Weigh extends Lock {
try {
const response = await apiCall(params)
console.log(211, response)
const { data } = response
console.log(211, data)
const waitWeighingList = data.filter(
(el) => el.status === 'WAIT_WEIGHING',
)
if (waitWeighingList.length === 0) {
this.playAudio(
'weight_search_error',
`必须是待称重状态的订单下的${
this.selectType === 'trackingNumber' ? '跟踪号' : '店铺单号'
}才能使用`,
)
if (!data.length) {
this.playAudio('weight_search_error', '查询失败')
return
}
if (!waitWeighingList.length) {
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 (hasDifferentLogistics) {
this.playAudio(
'weight_search_error',
'当前查询的订单不属于所选择的物流公司,请核实后再试',
)
return
}
}
// 最终去重检查
if (
this.deduplicate(
(waitWeighingList[0] as WeighItem).trackingNumber as string,
(data[0] as WeighItem).trackingNumber as string,
callback,
)
) {
......@@ -271,10 +296,10 @@ class Weigh extends Lock {
}
// 添加新项目
this.addNewItem(waitWeighingList, callback)
this.addNewItem(data, callback)
} catch (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