From 2260b47026088827f177bec0931ded0fd73d97ba Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期二, 26 三月 2024 10:48:43 +0800
Subject: [PATCH] 销售明细单发货弹窗样式优化

---
 src/views/sales/salesDetails/index.vue |   78 +++++++++++++++++++++++++++++++++++----
 1 files changed, 70 insertions(+), 8 deletions(-)

diff --git a/src/views/sales/salesDetails/index.vue b/src/views/sales/salesDetails/index.vue
index 82b47e0..928d62b 100644
--- a/src/views/sales/salesDetails/index.vue
+++ b/src/views/sales/salesDetails/index.vue
@@ -433,7 +433,7 @@
       TabsIndex: "0",
       productTableList: {},
       productColumn: productColumn,
-      showProductCol: ["浜у搧缂栧彿", "浜у搧鍚嶇О","浜у搧瑙勬牸", "鍗曚綅", "璁㈠崟鏁伴噺", "宸插畬鎴愭暟閲�", "宸插彂璐ф暟閲�", "閲囪喘鏁伴噺", "鐢熶骇鏁伴噺", "濮斿鏁伴噺","閿�鍞崟浠�","鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�","浠风◣鍚堣"],
+      showProductCol: ["浜у搧缂栧彿", "浜у搧鍚嶇О","浜у搧瑙勬牸", "鍗曚綅", "璁㈠崟鏁伴噺", "宸插畬鎴愭暟閲�", "宸插彂璐ф暟閲�", "閲囪喘鏁伴噺", "鐢熶骇鏁伴噺", "濮斿鏁伴噺","閿�鍞崟浠�","鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�(%)","浠风◣鍚堣"],
       inventoryColumn: inventoryColumn,
       showInventoryCol: [
         "鍑哄簱鍗�",
@@ -450,7 +450,7 @@
         "鐘舵��"
       ],
       makeColumn: makeColumn,
-      showMakeCol: ["鐢熶骇璁㈠崟", "浜у搧鍚嶇О", "璁㈠崟鐘舵��", "宸ュ崟缂栧彿", "宸ュ崟鐘舵��", "璁″垝寮�濮嬫椂闂�", "璁″垝缁撴潫鏃堕棿"],
+      showMakeCol: ["鐢熶骇璁㈠崟", "浜у搧缂栧彿", "浜у搧鍚嶇О", "浜у搧瑙勬牸", "浜у搧鍗曚綅", "璁㈠崟鏁伴噺", "瀹屾垚鏁伴噺","宸ュ崟缂栧彿","宸ュ崟鐘舵��","璁″垝寮�濮嬫椂闂�","璁″垝缁撴潫鏃堕棿"],
       // 閲囪喘
       purchaseColumn: purchaseColumn,
       outsourceColumn:outsourceColumn,
@@ -627,6 +627,7 @@
           this.loading = true
           await getProductInventoryInfo(row.number)
             .then((res) => {
+              console.log(res,"resss")
               this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : []
               this.loading = false
             })
@@ -732,12 +733,72 @@
     },
     // 纭鍙戣揣瀹屾垚
     async confirmClick(row){
-      await confirmOutputOver({saleDetailNumber:row.number}).then((res)=>{
-        if(res&&res.code===200){
-          this.$message.success("纭鍙戣揣瀹屾垚")
-          this.getData()
-        }
-      })
+      this.selectRow = row
+      await getProductInventoryInfo(this.selectRow.number)
+        .then((res) => {
+          console.log(res,"resss")
+          if(res.data){
+          this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : []
+            // let accumulator=res.data
+            // const reducedArray = array.reduce((accumulator, currentItem) => {  
+            //   // 鏌ユ壘褰撳墠number鏄惁宸插瓨鍦ㄤ簬accumulator涓�  
+            //   const existingItem = accumulator.find(item => item.number === currentItem.number);  
+            //   if (existingItem) {  
+            //     // 濡傛灉瀛樺湪锛岀疮鍔爊um  
+            //     existingItem.amount += currentItem.amount;  
+            //   } else {  
+            //     // 濡傛灉涓嶅瓨鍦紝灏嗗綋鍓嶉」娣诲姞鍒癮ccumulator涓�  
+            //     accumulator.push(currentItem);  
+            //   }  
+            //   return accumulator;  
+            // }, []); // 鍒濆鍖朼ccumulator涓轰竴涓┖鏁扮粍  
+              
+            // console.log(reducedArray,"鏂版暟缁�");
+          }
+          this.loading = false
+        })
+        // let obj=[
+        //   {
+        //     name:"灏忔槑",
+        //     id:1,
+        //     num:10
+        //   },
+        //   {
+        //     name:"灏忔槑",
+        //     id:1,
+        //     num:20
+        //   },
+        //   {
+        //     name:"灏忔槑",
+        //     id:1,
+        //     num:5
+        //   },
+        //   {
+        //     name:"灏忕孩",
+        //     id:1,
+        //     num:5
+        //   },
+        //   {
+        //     name:"灏忕孩",
+        //     id:1,
+        //     num:10
+        //   },
+        //   {
+        //     name:"灏忔埧",
+        //     id:5,
+        //     num:3
+        //   },
+        // ]
+        .catch(() => {
+          this.productTableList.tableInfomation = []
+          this.loading = false
+        })
+      // await confirmOutputOver({saleDetailNumber:row.number}).then((res)=>{
+      //   if(res&&res.code===200){
+      //     this.$message.success("纭鍙戣揣瀹屾垚")
+      //     this.getData()
+      //   }
+      // })
     },
     // 鍏抽棴
     closeClick(row) {
@@ -829,6 +890,7 @@
         if (this.selectRow.status == 1) {
           this.productTableList.tableInfomation = []
         } else {
+          console.log(this.selectRow,"鐪嬬湅")
           this.getProductInventoryInfo(this.selectRow)
         }
       } else if (this.TabsIndex == 2) {

--
Gitblit v1.8.0