From 91b973e372cba6d8f16521de0a0ca8761b994ce9 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Sun, 18 Aug 2024 11:24:35 +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/views/collect/DealOrder.vue | 39 ++++++++++++++++++++----- src/views/collect/PanelOrderTagCode.vue | 4 +++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/views/collect/DealOrder.vue b/src/views/collect/DealOrder.vue index 5d304017..8b0a255b 100644 --- a/src/views/collect/DealOrder.vue +++ b/src/views/collect/DealOrder.vue @@ -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); diff --git a/src/views/collect/PanelOrderTagCode.vue b/src/views/collect/PanelOrderTagCode.vue index 3b941fea..3cf55a60 100644 --- a/src/views/collect/PanelOrderTagCode.vue +++ b/src/views/collect/PanelOrderTagCode.vue @@ -167,6 +167,7 @@ export default { page: 1, limit: 10, }, + splitType: true, } }, methods: { @@ -237,6 +238,9 @@ export default { }, created() { + if (this.fifoSplit == 2 || this.fifoSplit == 1) { + this.splitType = false + } getHead("prescribePanel-2", "1").then((re) => { // 处理返回的数据 this.tableObj2 = re.data;