From 75b4bf4554da6622cfe00f577829b256fc44f32c Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 19 四月 2024 11:55:34 +0800
Subject: [PATCH] 产品清空操作选择下拉数据之后列表数据对不上的问题修改

---
 src/views/overview/AddOverviewDialog.vue |   46 ++++++++++++++++++++++++++++++++--------------
 1 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue
index 31446e2..e23fced 100644
--- a/src/views/overview/AddOverviewDialog.vue
+++ b/src/views/overview/AddOverviewDialog.vue
@@ -473,6 +473,7 @@
                 :addTypeIdMultiple="true"
                 :product-table-list="productTableList"
                 :detail-enter="!showFooter"
+                @selProductClick="selProductClick"
                 @inputContent="inputContent"
                 @addProductClick="addProductClick('鎿嶄綔')"
                 @getSelectArray="getSelectArray"
@@ -1044,6 +1045,8 @@
                     productId: item.productId,
                     auxiliaryUnit:item.auxiliaryUnit,
                     auxiliaryAmount:item.auxiliaryAmount,
+                    totalNetWeight:item.totalNetWeight,
+                    totalGrossWeight:item.totalGrossWeight,
                   });
                 });
                 params.details = arr;
@@ -1057,6 +1060,8 @@
                       productId: item.productId,
                       auxiliaryUnit:item.auxiliaryUnit,
                       auxiliaryAmount:item.auxiliaryAmount,
+                      totalNetWeight:item.totalNetWeight,
+                     totalGrossWeight:item.totalGrossWeight,
                     });
                   } else {
                     arr.push({
@@ -1066,6 +1071,8 @@
                       productId: item.productId,
                       auxiliaryUnit:item.auxiliaryUnit,
                       auxiliaryAmount:item.auxiliaryAmount,
+                      totalNetWeight:item.totalNetWeight,
+                     totalGrossWeight:item.totalGrossWeight,
                     });
                   }
                 });
@@ -1085,6 +1092,8 @@
                     productId: item.productId,
                     auxiliaryUnit:item.auxiliaryUnit,
                     auxiliaryAmount:item.auxiliaryAmount,
+                    totalNetWeight:item.totalNetWeight,
+                    totalGrossWeight:item.totalGrossWeight,
                   });
                   // if(item.fromLocationId.value){
                   //   arr.push({
@@ -1196,7 +1205,7 @@
         params = {
           baseOperationType: data.baseOperationType,
           comment: data.comment || "",
-          companyID: companyID,
+          companyID: companyID+'',
           companyName: companyName,
           contacterID: contacterID,
           contacterName: contacterName,
@@ -1230,7 +1239,7 @@
         params = {
           baseOperationType: data.baseOperationType,
           comment: data.comment || "",
-          companyID: companyID,
+          companyID: companyID+'',
           companyName: companyName,
           contacterID: contacterID,
           contacterName: contacterName,
@@ -1293,13 +1302,14 @@
           {
             label: "浜у搧鍚嶇О",
             prop: "productName",
+            min:150,
             productName: true,
             isRequird: true,
           },
           { label: "浜у搧缂栫爜", prop: "productId" },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "璁¢噺鍗曚綅", prop: "unit" },
           { label: "杈呭姪鏁伴噺", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' },
           { label: "杈呭姪鍗曚綅", prop: "auxiliaryUnit" },
@@ -1313,11 +1323,11 @@
           {
             label: "浜у搧鍚嶇О",
             prop: "productName",
+            min:150,
             productName: true,
             isRequird: true,
           },
           { label: "浜у搧缂栫爜", prop: "productId" },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
           {
@@ -1326,6 +1336,7 @@
             sonLocation: true,
             isRequird: true,
           },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "璁¢噺鍗曚綅", prop: "unit" },
           { label: "杈呭姪鏁伴噺", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' },
           { label: "杈呭姪鍗曚綅", prop: "auxiliaryUnit" },
@@ -1339,11 +1350,11 @@
           {
             label: "浜у搧鍚嶇О",
             prop: "productName",
+            min:150,
             productName: true,
             isRequird: true,
           },
           { label: "浜у搧缂栫爜", prop: "productId" },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
           {
@@ -1358,6 +1369,7 @@
             toLocation: true,
             isRequird: true,
           },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "璁¢噺鍗曚綅", prop: "unit" },
           { label: "杈呭姪鏁伴噺", prop: "auxiliaryAmount",inputFloatValue:true,isInputFloat:'inputFloatAuxiliaryAmount' },
           { label: "杈呭姪鍗曚綅", prop: "auxiliaryUnit" },
@@ -1371,11 +1383,11 @@
           {
             label: "浜у搧鍚嶇О",
             prop: "productName",
+            min:150,
             productName: true,
             isRequird: true,
           },
           { label: "浜у搧缂栫爜", prop: "productId" },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
           {
@@ -1390,6 +1402,7 @@
             toLocation: true,
             isRequird: true,
           },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "璁¢噺鍗曚綅", prop: "unit" },
         ];
       } else if (this.workType == 5) {
@@ -1397,11 +1410,11 @@
           {
             label: "浜у搧鍚嶇О",
             prop: "productName",
+            min:150,
             productName: true,
             isRequird: true,
           },
           { label: "浜у搧缂栫爜", prop: "productId" },
-          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "浜у搧瑙勬牸", prop: "specs" },
           { label: "浜у搧鍨嬪彿", prop: "model" },
           {
@@ -1416,6 +1429,7 @@
             toLocation: true,
             isRequird: true,
           },
+          { label: "鏁伴噺", prop: "amount", inputFloat: true },
           { label: "璁¢噺鍗曚綅", prop: "unit" },
         ];
       }
@@ -1471,12 +1485,13 @@
             moreUnit:res.product.moreUnit,
             moreUnitList:res.product.moreUnitList,
             auxiliaryUnit:res.auxiliaryUnit,
-            auxiliaryAmount:res.amount&&adjunctAmount?Number(adjunctAmount)*Number(res.amount):0,
+            // auxiliaryAmount:res.amount&&adjunctAmount?Number(adjunctAmount)*Number(res.amount):0,
+            auxiliaryAmount:res.auxiliaryAmount,
             auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0,
             inputFloatAuxiliaryAmount:isValue,
-            grossWeight:res.product.grossWeight,
+            grossWeight:res.product.grossWeight==0?'':res.product.grossWeight,
             totalGrossWeight:res.totalGrossWeight,
-            netWeight:res.product.netWeight, 
+            netWeight:res.product.netWeight==0?'':res.product.netWeight, 
             totalNetWeight:res.totalNetWeight,  
           };
         }else{
@@ -1489,9 +1504,9 @@
             auxiliaryAmount:adjunctAmount?Number(adjunctAmount)*1:0,
             auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0,
             inputFloatAuxiliaryAmount:isValue,
-            grossWeight:res.grossWeight,
+            grossWeight:res.grossWeight==0?'':res.grossWeight,
             totalGrossWeight:res.grossWeight?Number(res.grossWeight)*1:'',
-            netWeight:res.netWeight, 
+            netWeight:res.netWeight==0?'':res.netWeight, 
             totalNetWeight:res.netWeight?Number(res.netWeight)*1:'', 
           };
         }
@@ -1535,7 +1550,6 @@
       this.countId = row.countId;
       this.tableData.map((item) => {
         if (item.id == row.id) {
-          debugger
           item[prop] = val;
           let auxiliaryAmountObject=this.getAuxiligyAmount(item.moreUnit,item.moreUnitList)
           if(prop=='amount'){
@@ -1594,9 +1608,13 @@
       //   }
       // }
     },
+    selProductClick(value, prop,row,scope){
+      this.getSelectArray([value],scope.$index)
+    },
     // 鏂板鏂瑰紡淇敼
     getSelectArray(val, index) {
-      if (this.tableData.length == 1 && this.tableData[0].number.length == 0) {
+      debugger
+      if (this.tableData.length == 1 && this.tableData[0].number&&this.tableData[0].number.length == 0) {
         this.tableData = [];
       }
       if (index < this.tableData.length) {

--
Gitblit v1.8.0