From 35b2831481711a10cdb59e683c306e56e54fb41d Mon Sep 17 00:00:00 2001 From: liuxy Date: Sun, 27 Nov 2022 11:57:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/wms/st/outbill/AddDialog.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue b/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue index 892592246..372291bf5 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue @@ -450,11 +450,24 @@ export default { this.form.detail_count = this.form.tableData.length }, deleteRow(index, rows) { - this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) + /* this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) rows.splice(index, 1) this.nowindex = '' this.nowrow = {} - this.form.detail_count = this.form.tableData.length + this.form.detail_count = this.form.tableData.length*/ + const box_no = rows[index].box_no + let len = rows.length + while (len--) { + const obj = rows[len] + if (box_no === obj.box_no) { + const index = rows.indexOf(obj) + if (index > -1) { // 移除找到的指定元素 + this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) + rows.splice(index, 1) + this.form.detail_count = this.form.tableData.length + } + } + } } } }