Commit 169b5366 by wusiyi

fix: 称重分拣token过期退出后可保存表格数据

parent 9f5792ba
<template>
<div>
<el-dialog
v-model="isweight"
:close-on-click-modal="false"
:close-on-press-escape="false"
title="称重分拣"
:before-close="handleClose"
v-model="isweight"
width="1200px"
>
<div
......@@ -17,18 +17,18 @@
"
>
<el-select
style="width: 100px; height: 100%; margin-right: 5px"
v-model="selectType"
style="width: 100px; height: 100%; margin-right: 5px"
placeholder=""
>
<el-option label="跟踪号" value="trackingNumber"></el-option>
<el-option label="店铺单号" value="shopNumber"></el-option>
</el-select>
<input
ref="weighInput"
v-model.lazy="weightText"
class="inputWeight"
@keyup.enter="weightChange"
style="flex: 1; border: 3px solid blue"
ref="weighInput"
:placeholder="
weight.weightInput
? selectType === 'trackingNumber'
......@@ -36,12 +36,12 @@
: '请输入店铺单号'
: '请输入重量'
"
v-model.lazy="weightText"
@keyup.enter="weightChange"
/>
<el-select
style="flex: 1"
v-model="logisticsCompanyCode"
style="flex: 1"
placeholder="物流公司"
filterable
clearable
......@@ -59,9 +59,9 @@
<div>
<CustomizeTable
ref="tableRef"
border
:isShowCheckBox="false"
v-model="tableData"
border
:is-show-check-box="false"
height="400px"
:config="tableConfig"
align="center"
......@@ -302,10 +302,18 @@ const weightGet = async () => {
background: 'rgba(0, 0, 0, 0.3)',
})
try {
await orderWeighingApi({ podCnWeighingParams: tableData.value })
ElMessage.success('保存称重分拣成功')
handleClose()
emits('updateList')
orderWeighingApi({ podCnWeighingParams: tableData.value }).then((res) => {
if (res.code === 200) {
weight.clear()
ElMessage.success('保存称重分拣成功')
handleClose()
emits('updateList')
} else {
ElMessage.error(res.message)
handleClose()
emits('updateList')
}
})
} catch (error) {
console.log(error)
} finally {
......@@ -315,7 +323,6 @@ const weightGet = async () => {
const open = () => {
isweight.value = true
weight.clear()
tableData.value = []
selectType.value = 'trackingNumber'
logisticsCompanyCode.value = ''
......
......@@ -323,14 +323,12 @@ class Weigh extends Lock {
playAudio(key: AudioKey, message?: string): void {
const messageMap: Record<AudioKey, string> = {
weight_warning: `请录入${
this.selectType === 'trackingNumber' ? '跟踪号' : '店铺单号'
}或重量`,
weight_warning: `请录入${this.selectType === 'trackingNumber' ? '跟踪号' : '店铺单号'
}或重量`,
weight_success: '',
weight_repeat: '重复录入',
weight_search_error: `请录入${
this.selectType === 'trackingNumber' ? '跟踪号' : '店铺单号'
}或重量`,
weight_search_error: `请录入${this.selectType === 'trackingNumber' ? '跟踪号' : '店铺单号'
}或重量`,
weight_search_success: '',
}
......
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