From f82191cc555c06c66b8a7fdb65b33701b24e9ac9 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Mon, 19 Aug 2024 09:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/collect/splitCreateOrder.js | 10 +++++ src/views/collect/DealOrder.vue | 63 +++++++++++++++++++--------- src/views/collect/DealOrderBlank.vue | 45 +++++++++++++++----- 3 files changed, 89 insertions(+), 29 deletions(-) diff --git a/src/api/collect/splitCreateOrder.js b/src/api/collect/splitCreateOrder.js index 4c2403e5..88188368 100644 --- a/src/api/collect/splitCreateOrder.js +++ b/src/api/collect/splitCreateOrder.js @@ -46,3 +46,13 @@ export function draftOrder(query) { }); } +export function updateOrder(query) { + return axios({ + url: "/udiwms/basic/collect/order/update", + method: "post", + data: query + }); +} + + + diff --git a/src/views/collect/DealOrder.vue b/src/views/collect/DealOrder.vue index 8b0a255b..f9aaaddd 100644 --- a/src/views/collect/DealOrder.vue +++ b/src/views/collect/DealOrder.vue @@ -45,19 +45,19 @@ type="primary" :disabled="isSelectOrder" @click.native="selectPrescribe()" - >选入单据1 + >选入单据 单据挂起1 + >单据挂起 处理完成1 + >处理完成 @@ -142,14 +142,24 @@ > - - 添加 - + + + 添加 + + 清空 + + { + this.loading = false + }).catch(() => { + this.loading = false + }) + + }, + //选择单据 selectPrescribe() { console.log(this.formData.workPlaceCode) @@ -546,7 +565,10 @@ export default { //获取下一单据 nextCollectOrder() { - getNextOrder(this.formData).then(res => { + let nextQuery = { + workPlaceCode: this.formData.workPlaceCode + } + getNextOrder(nextQuery).then(res => { this.loading = false if (res.code == 20000) { this.formData = res.data; @@ -568,6 +590,9 @@ export default { this.formData = row; this.curRow = row; this.dealSplitOrder() + this.formData.tagStatus = 2; + this.updateOrder(); + this.refreshCodesPanel(this); this.refreshCodesPanel(this); }, @@ -576,10 +601,8 @@ export default { startSplit(this.formData).then(res => { this.loading = false if (res.code == 20000) { - console.log(res.data) this.refreshCodesPanel(this); } else { - console.log(res.message) } }).catch(() => { @@ -617,7 +640,12 @@ export default { }, handleCommand(command) { // this.$message('click on item ' + command); - } + }, + clearCode() { + this.originCode = ""; + this.formData.code = ""; + this.scanCode = ""; + }, }, created() { getHead("prescribeTagCodeDeal", "1").then((re) => { @@ -633,10 +661,7 @@ export default { this.corpOrderIdDisabled = true this.formData.workPlaceCode = Number(this.$route.query.workplaceId); } - this.findCurWorkPlaces(); - - } } diff --git a/src/views/collect/DealOrderBlank.vue b/src/views/collect/DealOrderBlank.vue index 5d304017..ff3f1593 100644 --- a/src/views/collect/DealOrderBlank.vue +++ b/src/views/collect/DealOrderBlank.vue @@ -45,19 +45,19 @@ type="primary" :disabled="isSelectOrder" @click.native="selectPrescribe()" - >选入单据1 + >选入单据 单据挂起1 + >单据挂起 处理完成1 + >处理完成 @@ -153,9 +153,10 @@ @@ -295,6 +296,7 @@ export default { //扫码相关 scanCode: "", isSuccess: false, + scanTitle: "扫码结果:", result: " \n", msgTip: "信息提醒:", originCode: "", @@ -408,14 +410,14 @@ export default { this.$refs.inputRef.focus(); this.$refs.inputRef.select(); this.isSuccess = true; - this.printCodeResult(response.data) + this.printCodeResult(response.data, response.message) this.filterQuery.code = response.data.code; this.addCode(); } else { if (response.code == 502) { this.checkSuccess = false; this.isSuccess = false; - this.printCodeResult(response.data) + this.printCodeResult(response.data, response.message) this.filterQuery.code = response.data.code; this.originCode = this.filterQuery.code; } else if (response.code == 501) { @@ -424,7 +426,7 @@ export default { } else if (response.code == 503) { this.checkSuccess = false; this.isSuccess = false; - this.printCodeResult(response.data) + this.printCodeResult(response.data, response.message) this.filterQuery.code = response.data.code; this.$confirm(response.message, "提示", { type: "warning", @@ -463,20 +465,36 @@ export default { if (this.$isBlank(this.filterQuery.code) && this.$isBlank(this.scanCode)) { return; } + if (this.$isNotBlank(this.scanCode)) { + this.filterQuery.code = this.scanCode.trim(); + } let tagQuery = { workPlaceCode: this.formData.workPlaceCode, fromCorp: this.formData.fromCorp, billNo: this.formData.billNo, code: this.filterQuery.code.trim(), + insert: this.formData.insert }; tagCode(tagQuery).then(res => { this.loading = false if (res.code == 20000) { this.formData.tagStatus = 2; + this.formData.insert = false; this.formData = res.data; this.refreshCodesPanel(this); } else { - this.$message.error(res.message) + if (res.code == 502) { + this.$confirm(res.message + '是否强制添加?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.formData.insert = true; + this.addCode(); + }).catch(() => { + }); + } else + this.$message.error(res.message) } }).catch(() => { this.loading = false @@ -570,8 +588,8 @@ export default { }, - printCodeResult(data, isSuccess) { - const resultParts = ["追溯码:" + data.code + "\r\n"]; + printCodeResult(data, message) { + const resultParts = []; if (data.udi) { resultParts.push("层级标识: " + data.udi); @@ -588,7 +606,14 @@ export default { if (data.serialNo) { resultParts.push("序列号: " + data.serialNo); } + this.scanTitle = "扫码结果:" + data.code; this.result = resultParts.join(" , "); + if (message == 'success') { + this.scanResultType = "success"; + } else { + this.scanResultType = "warning"; + this.result = this.result + "\n" + message; + } }, handleCommand(command) { // this.$message('click on item ' + command);