From 70e930ec5a903663596799f2449e7fde9dacd51f Mon Sep 17 00:00:00 2001 From: zelian_wu Date: Thu, 14 Mar 2024 15:24:52 +0800 Subject: [PATCH] =?UTF-8?q?24-03-14=20=E5=87=BA=E5=BA=93=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/production/generateReport.js | 1 + src/views/modules/production/bagLabels.vue | 24 ++++++ .../modules/production/outboundLabelScan.vue | 84 +++++++++++++++++++ src/views/modules/production/scanForm.vue | 44 +++++++--- src/views/modules/production/shippingScan.vue | 12 ++- 5 files changed, 150 insertions(+), 15 deletions(-) create mode 100644 src/views/modules/production/outboundLabelScan.vue diff --git a/src/api/production/generateReport.js b/src/api/production/generateReport.js index 2767561..40405de 100644 --- a/src/api/production/generateReport.js +++ b/src/api/production/generateReport.js @@ -71,4 +71,5 @@ export const saveScanLabel = data=>createAPI('/board/saveScanLabel','post',data) export const removeScanLabel = data=>createAPI('/board/removeScanLabel','post',data); export const scanLabel = data=>createAPI('/board/scanLabel','post',data); export const checkIsPacking = data=>createAPI('/board/checkIsPacking','get',data); +export const searchOutboundLabelScanList = data=>createAPI('/outbound/label/list','post',data); diff --git a/src/views/modules/production/bagLabels.vue b/src/views/modules/production/bagLabels.vue index f159072..08eaef2 100644 --- a/src/views/modules/production/bagLabels.vue +++ b/src/views/modules/production/bagLabels.vue @@ -56,6 +56,10 @@ export default { this.soScheduleRouting = data.rows.find((item)=>item.site===this.$store.state.user.site && item.seqNo === this.searchData.seqNo) this.checkIsPacking() } + this.soScheduleRouting.qtyBag = data.row.qtyBag + this.soScheduleRouting.bag = data.row.bag + this.soScheduleRouting.qty = data.row.qty + this.soScheduleRouting.carton = data.row.carton }else { this.$message.warning(data.msg) } @@ -230,6 +234,26 @@ export default { + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/modules/production/outboundLabelScan.vue b/src/views/modules/production/outboundLabelScan.vue new file mode 100644 index 0000000..9ca41d3 --- /dev/null +++ b/src/views/modules/production/outboundLabelScan.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/views/modules/production/scanForm.vue b/src/views/modules/production/scanForm.vue index 4ef4b85..4ae9586 100644 --- a/src/views/modules/production/scanForm.vue +++ b/src/views/modules/production/scanForm.vue @@ -17,6 +17,10 @@ export default { allNum:{ type:Number, default: 0, + }, + notifyQty:{ + type:Number, + default:0, } }, computed:{ @@ -28,10 +32,19 @@ export default { this.$emit("update:scanFlag",val) } }, + total:{ + get(){ + return this.scanLabelDetailList.reduce((pre, cur) => { + return pre + new Decimal(cur.scanQty).toNumber() + }, 0); + }, + set(val) { + // this.scanLabelDetailList = v + } + } }, data(){ return{ - total:0, model:{ flag:"", label:'', @@ -82,10 +95,9 @@ export default { scanLabel(paramsScan).then(({data})=>{ if (data && data.code === 0){ this.scanLabelDetailList = data.rows; - let total = this.scanLabelDetailList.reduce((pre,cur)=>{ - return pre+new Decimal(cur.scanQty).toNumber() - },0) - this.total = total + this.$emit("changeAllNum",this.scanLabelDetailList.reduce((pre, cur) => { + return pre + new Decimal(cur.scanQty).toNumber() + }, 0)) }else { this.$message.warning(data.msg) } @@ -94,6 +106,10 @@ export default { }) }, scanLabelEnter(){ + if (this.total > this.notifyQty){ + this.$message.warning("扫描累计数量不允许超过要求发货数量") + return; + } let arr = this.model.label.split(";"); if (arr.length !== 3){ this.$message.warning("标签格式错误") @@ -111,6 +127,10 @@ export default { this.$message.warning(`标签数量与标准袋装数量不匹配`) return; } + if (new Decimal(this.total).add(new Decimal(arr[2])).toNumber()> this.notifyQty){ + this.$message.warning("扫描累计数量不允许超过要求发货数量") + return; + } // 保存数据 通知单数量:this.detail.notifyQty let params={ site:this.detail.site, @@ -176,17 +196,17 @@ export default { 删除 - - - + + + - - - - + + + +
diff --git a/src/views/modules/production/shippingScan.vue b/src/views/modules/production/shippingScan.vue index 1e1a2e1..a41a658 100644 --- a/src/views/modules/production/shippingScan.vue +++ b/src/views/modules/production/shippingScan.vue @@ -15,6 +15,7 @@ export default { data() { return { allNum:0, + notifyQty:0, height:200, delNotifyHeaderTableLoading:false, // 搜索表单对象 @@ -122,9 +123,14 @@ export default { }, clickScan(row){ this.delNotifyDetail = JSON.parse(JSON.stringify(row)) - this.allNum = this.delNotifyDetail.scanQty + this.allNum = this.delNotifyDetail.allNum + this.notifyQty = this.delNotifyDetail.notifyQty this.scanFlag = true }, + changeAllNum(val){ + this.allNum = val; + this.delNotifyDetail.allNum = val; + } }, created() { this.searchDelHeaderList(); @@ -317,7 +323,7 @@ export default { 不 合 格 - +