Commit 6a121254 by LJM

bug

parent 152ea7e7
...@@ -897,7 +897,7 @@ ...@@ -897,7 +897,7 @@
total += parseFloat(item.net_weight); total += parseFloat(item.net_weight);
} }
return total; return total;
}, 0); }, 0).toFixed(2); // 保留两位小数s;
this.title = `入仓号${this.erp_order_sn}已经全部验货完毕是否更换新的箱子?\n\n 箱子:${this.box_sn} 总净重:${this.net_weight_total}`; this.title = `入仓号${this.erp_order_sn}已经全部验货完毕是否更换新的箱子?\n\n 箱子:${this.box_sn} 总净重:${this.net_weight_total}`;
this.$refs.inputDialog.open(); this.$refs.inputDialog.open();
}, },
......
...@@ -768,9 +768,13 @@ ...@@ -768,9 +768,13 @@
* 关单封箱 * 关单封箱
*/ */
closeBox() { closeBox() {
this.net_weight_total = this.form this.net_weight_total = this.form.reduce((total, item) => {
.filter(item => item.tally_status === 3) // 筛选出 tally_status 等于 3 的数据 // 如果 tally_status 等于 3 并且 box_sn 等于 box_sn 变量,则累加 net_weight 到总和中
.reduce((acc, curr) => acc + parseFloat(curr.net_weight), 0); // 将 net_weight 转换为数字并计算总和 if (item.tally_status === 3 && item.box_sn === this.box_sn) {
total += parseFloat(item.net_weight);
}
return total;
}, 0).toFixed(2); // 保留两位小数s;
this.title = `箱号${this.box_sn}已经全部验货完毕是否更换新的箱子?\n\n总净重:${this.net_weight_total}`; this.title = `箱号${this.box_sn}已经全部验货完毕是否更换新的箱子?\n\n总净重:${this.net_weight_total}`;
this.$refs.inputDialog.open(); this.$refs.inputDialog.open();
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment