This commit is contained in:
2022-11-27 11:18:19 +08:00
parent 48f42dd3c4
commit 5e8cc534dc
19 changed files with 1663 additions and 42 deletions

View File

@@ -323,9 +323,20 @@ 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)
rows.splice(index, 1)
this.form.detail_count = this.form.tableData.length
debugger
const package_box_sn = rows[index].package_box_sn
let len = rows.length
while (len--) {
const obj = rows[len]
if (package_box_sn === obj.package_box_sn) {
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
}
}
}
},
tableChanged(rows) {
debugger
@@ -341,7 +352,6 @@ export default {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
item.plan_qty = item.need_qty
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}