Commit 169b5366 by wusiyi

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

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