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

---
 src/components/makepager/CommonFormTableView.vue |    5 +
 src/views/sales/salesDetails/shipmentsDialog.vue |  141 +++++++++++++++++++++++-----------
 src/views/sales/salesDetails/index.vue           |   78 +++++++++++++++++--
 3 files changed, 170 insertions(+), 54 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 32876d8..0fb598e 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -3,6 +3,7 @@
     <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
       <el-table
         ref="fromTable"
+        :border="isBorder"
         :data="tableList.tableData"
         :show-summary="showSummary.show"
         :summary-method="getSummaries"
@@ -273,6 +274,10 @@
       type: Boolean,
       default: true
     },
+    isBorder:{
+      type: Boolean,
+      default: false
+    },
     productTableList: {
       type: Object,
       default: () => {
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) {
diff --git a/src/views/sales/salesDetails/shipmentsDialog.vue b/src/views/sales/salesDetails/shipmentsDialog.vue
index 99b4e18..79dcc11 100644
--- a/src/views/sales/salesDetails/shipmentsDialog.vue
+++ b/src/views/sales/salesDetails/shipmentsDialog.vue
@@ -12,7 +12,7 @@
         ref="form"
         :model="editConfig.infomation"
         :rules="rules"
-        label-position="right"
+        label-position="left"
         label-width="10%"
         size="mini"
         style="height: 60vh; overflow-x: hidden"
@@ -69,15 +69,10 @@
               :selectBox="false"
               :addTypeIdMultiple="true"
               pageName="quotation"
+              :isBorder="true"
               :detailEnter="true"
-              :isOperate="
-                (autoCodeHeadersObj.Bjd == 'yes' && editConfig.infomation.quotation_number) ||
-                autoCodeHeadersObj.Bjd != 'yes'
-                  ? true
-                  : false
-              "
-              :quotationNumber="autoCodeHeadersObj.Bjd == 'yes' ? editConfig.infomation.quotation_number : ''"
               :product-table-list="productTableList"
+              :isOperate="true"
               @inputContent="inputContent"
               @addProductClick="addProductClick"
               @getSelectArray="getSelectArray"
@@ -277,8 +272,10 @@
           let shipmentsNum=false
           this.shipmentsList.map((item)=>{
             if(this.shipmentsType===1){
-              if(item.leftAmount<item.availableAmount){
+              if(item.leftAmount<item.availableAmount&&item.leftAmount>0){
                 isShipments=false
+              }else if(item.leftAmount<=0){
+                shipmentsNum=true
               }else{
                 isShipments=true
               }
@@ -289,6 +286,8 @@
                 shipmentsNum=true
               }else if(!item.outputAmount){
                 shipmentsNum=true
+              }else if(item.leftAmount<=0){
+                isShipments=true
               }else{
                 isShipments=false
               }
@@ -544,26 +543,42 @@
         ]
         this.dissatisfy=false
         let portion=0
+        // let noUsable=false
         this.productTableList.tableData.map((item)=>{
-          if(item.availableAmount>=item.leftAmount&&item.availableAmount>0){
+          item.availableAmount=Number(item.availableAmount)
+          item.leftAmount=Number(item.leftAmount)
+          item.finishAmount=Number(item.finishAmount)
+          item.orderAmount=Number(item.orderAmount)
+          console.log(item,"item")
+          if(item.availableAmount>=item.leftAmount&&item.availableAmount>0&&item.leftAmount>0){
             portion++
             this.shipmentsList.push(item)
           }
+          // if(item.availableAmount<item.leftAmount){
+          //   noUsable=true
+          // }
+        })
           if(portion===0){// 娌℃湁浜у搧婊¤冻鍙戣揣鏉′欢
             this.completely=false
             this.dissatisfy=true
-            this.shipmentsMsg="褰撳墠浠撳簱搴撳瓨涓嶈冻,涓嶈兘瀹屾垚涓�娆″彂璐�"
+            // if(noUsable){
+            //   this.shipmentsMsg="鍙敤搴撳瓨涓嶆弧瓒虫湭鍙戣揣鏁伴噺,鏃犳硶鍙戣揣"
+            // }else{
+            // }
+            this.shipmentsMsg="鍙敤搴撳瓨鎴栨湭鍙戣揣鏁伴噺涓�0鎴栧綋鍓嶅彲鐢ㄥ簱瀛樹笉婊¤冻鏈彂璐ф暟閲忥紝涓嶈兘瀹屾垚涓�娆″彂璐�"
+
           }else if(portion>0&&portion<this.productTableList.tableData.length){// 閮ㄥ垎浜у搧婊¤冻鍙戣揣鏉′欢
             this.dissatisfy=false
             this.completely=true
             this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
             
-          }else if(portion===this.productTableList.tableData.length){// 鍏呭垎婊¤冻
+          }else if(portion!==0){
             this.dissatisfy=false
             this.completely=true
+            console.log(portion,"portion")
             this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
           }
-        })
+
         if(portion===this.productTableList.tableData.length){ // 鍏ㄩ儴婊¤冻鍙戣揣鏉′欢
           this.dissatisfy=false
           this.completely=false
@@ -582,24 +597,28 @@
         ]
         let portion=0
         this.productTableList.tableData.map((item)=>{
-          if(item.availableAmount>0){ 
+          item.availableAmount=Number(item.availableAmount)
+          item.leftAmount=Number(item.leftAmount)
+          item.finishAmount=Number(item.finishAmount)
+          item.orderAmount=Number(item.orderAmount)
+          if(item.availableAmount>0&&item.leftAmount>0){ 
             portion++
             this.shipmentsList.push(item)
           }
-          if(portion===0){ // 娌℃湁涓�浠朵骇鍝佽兘婊¤冻鍙戣揣鏉′欢
-            this.completely=false
-            this.dissatisfy=true
-            this.shipmentsMsg="褰撳墠浠撳簱搴撳瓨涓�0,鏃犳硶鍙戣揣"
-          }else if(portion>0&&portion<this.productTableList.tableData.length){
-            this.dissatisfy=false
-            this.completely=true
-            this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
-          }else if(portion===this.productTableList.tableData.length){
-            this.dissatisfy=false
-            this.completely=true
-            this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
-          }
         })
+        if(portion===0){ // 娌℃湁涓�浠朵骇鍝佽兘婊¤冻鍙戣揣鏉′欢
+          this.completely=false
+          this.dissatisfy=true
+            this.shipmentsMsg="鍙敤搴撳瓨鎴栨湭鍙戣揣鏁伴噺涓�0,鏃犳硶鍙戣揣"
+        }else if(portion>0&&portion<this.productTableList.tableData.length){
+          this.dissatisfy=false
+          this.completely=true
+          this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
+        }else if(portion===this.productTableList.tableData.length){
+          this.dissatisfy=false
+          this.completely=true
+          this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
+        }
       }
     },
     // 浜у搧鍏ュ簱淇℃伅
@@ -611,25 +630,30 @@
           if(this.shipmentsType===1){
             let portion=0
             this.productTableList.tableData.map((item)=>{
-              if(item.availableAmount>=item.leftAmount&&item.availableAmount>0){
+              item.availableAmount=Number(item.availableAmount)
+              item.leftAmount=Number(item.leftAmount)
+              item.finishAmount=Number(item.finishAmount)
+              item.orderAmount=Number(item.orderAmount)
+              if(item.availableAmount>=item.leftAmount&&item.availableAmount>0&&item.leftAmount>0){
                 portion++
                 this.shipmentsList.push(item)
               }
-              if(portion===0){// 娌℃湁浜у搧婊¤冻鍙戣揣鏉′欢
-                this.completely=false
-                this.dissatisfy=true
-                this.shipmentsMsg="褰撳墠浜у搧鍙敤搴撳瓨涓�0,鏃犳硶鍙戣揣"
-              }else if(portion>0&&portion<this.productTableList.tableData.length){
-                this.dissatisfy=false
-                this.completely=true
-                this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
-                // 閮ㄥ垎浜у搧婊¤冻鍙戣揣鏉′欢
-              }else if(portion===this.productTableList.tableData.length){
-                this.dissatisfy=false
-                this.completely=true
-                this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
-              }
             })
+            console.log(portion,"portion2")
+            if(portion===0){// 娌℃湁浜у搧婊¤冻鍙戣揣鏉′欢
+              this.completely=false
+              this.dissatisfy=true
+              this.shipmentsMsg="鍙敤搴撳瓨鎴栨湭鍙戣揣鏁伴噺涓�0鎴栧綋鍓嶅彲鐢ㄥ簱瀛樹笉婊¤冻鏈彂璐ф暟閲忥紝涓嶈兘瀹屾垚涓�娆″彂璐�"
+            }else if(portion>0&&portion<this.productTableList.tableData.length){
+              this.dissatisfy=false
+              this.completely=true
+              this.shipmentsMsg="鍙兘婊¤冻閮ㄥ垎鍙戣揣闇�姹傦紝鏄惁纭鍙戣揣"
+              // 閮ㄥ垎浜у搧婊¤冻鍙戣揣鏉′欢
+            }else{
+              this.dissatisfy=false
+              this.completely=true
+              this.shipmentsMsg="鑳芥弧瓒冲彂璐ч渶姹傦紝鐩存帴鍙戣揣鍚�"
+            }
           }
         }
       })
@@ -648,6 +672,9 @@
       }
     }
     .basic-info {
+      padding: 0px 20px ;
+      .product-view{
+      }
       .basic-info-title {
         background-color: #f4f8fe;
         padding-left: 10px;
@@ -683,7 +710,6 @@
       .tips{
         font-size: 16px;
         display: flex;
-        margin-left: 20px;
         i{
           font-size: 24px;
           margin-right: 10px;
@@ -710,10 +736,33 @@
       background-color: #f5f5f5;
       height: 55px;
       line-height: 55px;
+      text-align: right !important;
     }
-    .el-input__inner {
-      text-align: left;
-    }
+    // .el-input__inner {
+    //   text-align: left;
+    // }
   }
+  .el-table tr {
+    background-color: #fff;
+  }
+  .el-table th.el-table__cell.is-leaf{
+    background-color: #F1F3F8 !important;
+  }
+  .el-dialog__footer{
+    text-align: right !important;
+    padding-right: 20px;
+  }
+  .el-dialog__header {
+    background: #f5f7fa;
+    height: 50px !important;
+    line-height: 50px !important;
+    padding: 0;
+    font-weight: 600 !important;
+    font-size: 15px !important;
+    padding-left: 20px !important;
+  }
+  // .el-table{
+  //   border: 1px solid #e1e1e1;
+  // }
 }
 </style>

--
Gitblit v1.8.0