diff --git a/src/views/modules/ecss/codelnotifyConfirm.vue b/src/views/modules/ecss/codelnotifyConfirm.vue
index 919ae86..83b3222 100644
--- a/src/views/modules/ecss/codelnotifyConfirm.vue
+++ b/src/views/modules/ecss/codelnotifyConfirm.vue
@@ -356,12 +356,12 @@
-
+
-
+
@@ -2750,6 +2750,68 @@
this.palletModelData.grossWeight = parseFloat(grossWeight.toFixed(2));
this.palletModelData.netWeight = parseFloat(netWeight.toFixed(2));
},
+
+ /**
+ * 毛重改变时自动计算净重
+ * 计算公式:净重 = 毛重 - (箱数 / 2)
+ */
+ onPalletGrossWeightChange(value) {
+ // 防止循环触发,使用标志位
+ if (this._isPalletWeightCalculating) {
+ return;
+ }
+
+ this._isPalletWeightCalculating = true;
+
+ try {
+ const grossWeight = parseFloat(value) || 0;
+ const boxQty = parseFloat(this.palletModelData.boxQty) || 0;
+
+ if (grossWeight <= 0) {
+ this.palletModelData.netWeight = '';
+ return;
+ }
+
+ // 计算净重:净重 = 毛重 - (箱数 / 2)
+ const netWeight = grossWeight - (boxQty / 2);
+
+ // 保留2位小数
+ this.palletModelData.netWeight = parseFloat(netWeight.toFixed(2));
+ } finally {
+ this._isPalletWeightCalculating = false;
+ }
+ },
+
+ /**
+ * 净重改变时自动计算毛重
+ * 反向计算公式:毛重 = 净重 + (箱数 / 2)
+ */
+ onPalletNetWeightChange(value) {
+ // 防止循环触发,使用标志位
+ if (this._isPalletWeightCalculating) {
+ return;
+ }
+
+ this._isPalletWeightCalculating = true;
+
+ try {
+ const netWeight = parseFloat(value) || 0;
+ const boxQty = parseFloat(this.palletModelData.boxQty) || 0;
+
+ if (netWeight <= 0) {
+ this.palletModelData.grossWeight = '';
+ return;
+ }
+
+ // 反向计算毛重:毛重 = 净重 + (箱数 / 2)
+ const grossWeight = netWeight + (boxQty / 2);
+
+ // 保留2位小数
+ this.palletModelData.grossWeight = parseFloat(grossWeight.toFixed(2));
+ } finally {
+ this._isPalletWeightCalculating = false;
+ }
+ },
savePalletHeader(type) {
// 过滤出 useQty > 0 的行
const selectedRows = this.dataList8.filter(item => item.useQty && item.useQty > 0);