From 6877dcc229f0592427c367ec58272414a20aabcd Mon Sep 17 00:00:00 2001 From: chenhc <2369838784@qq.com> Date: Mon, 9 Dec 2024 10:44:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A2=86=E7=94=A8?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E9=80=89=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inout/DialogSelectInvProduct.vue | 77 +++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/src/views/inout/DialogSelectInvProduct.vue b/src/views/inout/DialogSelectInvProduct.vue index d777b63b..469abc3c 100644 --- a/src/views/inout/DialogSelectInvProduct.vue +++ b/src/views/inout/DialogSelectInvProduct.vue @@ -392,7 +392,82 @@ export default { + "#" + expireDate + "#" + batchNo + "#" + "#" + "#"; this.closeDialog(udiCode); - } else { + } else if (this.type == 1) { + let selection = this.$refs.multipleTable.selection; + if (selection.length < 1) { + this.$message.error('未选择产品'); + return; + } + var idster = []; + if (this.codeArray != null || this.codeArray != undefined) { + if (this.codeArray.length > 0) { + for (var i = 0; i < this.codeArray.length; i++) { + idster.push(this.codeArray[i].relIdFk + '--' + this.codeArray[i].batchNo); + } + } + if (idster.length > 0) { + for (var i = 0; i < idster.length; i++) { + for (var j = 0; j < selection.length; j++) { + if (idster[i] == selection[j].relIdFk + '--' + selection[j].batchNo) { + this.$message.error("该产品已录入!"); + return + } + } + } + } + } + + var ids = []; + selection.forEach((obj, index) => { + let data = { + relId: obj.relIdFk, + batchNo: obj.batchNo, + productDate: obj.productionDate, + expireDate: obj.expireDate, + supId: obj.supId, + price: obj.price, + nameCode: obj.nameCode, + } + ids.push(data); + }); + + if (this.type == 2) { //新增业务单据选入 + let data = { + datas: ids, + orderEntity: this.orderQuery, + } + this.loading = true; + addBizProduct(data) + .then((response) => { + this.loading = false; + if (response.code === 20000) { + this.closeDialog(response.data); + } else { + this.$message.error(response.message); + } + }) + .catch(() => { + this.loading = false; + }); + + } else { + this.loading = true; + let tQuery = { + datas: ids, + purReceiveEntity: this.invQueryData, + }; + addDetail(tQuery).then((response) => { + this.loading = false; + if (response.code === 20000) { + this.closeDialog(response.data); + } else { + this.$message.error(response.message); + } + }).catch(() => { + this.loading = false; + }); + } + }else { let selection = this.$refs.multipleTable.selection; if (selection.length < 1) { this.$message.error('未选择产品');