From 1abb22825fe46266bc2634a753164f0878c08e67 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 28 三月 2024 11:16:45 +0800
Subject: [PATCH] 销售明细单新建的表头配置功能问题修改+可编辑表格组件的样式调整+可配置表头之后小计功能的显示逻辑修改

---
 src/components/makepager/CommonFormTableView.vue       |   45 +++++++++++----
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |   56 ++++++++++--------
 src/views/sales/salesDetails/shipmentsDialog.vue       |   22 +++---
 3 files changed, 75 insertions(+), 48 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index ca08f1f..12d33a5 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -9,6 +9,7 @@
         :summary-method="getSummaries"
         :span-method="arraySpanMethod"
         style="width: 100%"
+        :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '14px', 'font-family': 'PingFangSC' }"
         @selection-change="handleSelectionChange"
         :row-key="(row) => row.productId"
       >
@@ -16,15 +17,17 @@
         </el-table-column>
         <el-table-column v-if="tableList.isReturn" type="index" label="#" width="50" align="center"></el-table-column>
         <el-table-column
+          align="center"
           v-for="(item, i) in tableList.tableColumn"
           :key="i"
           :prop="item.prop"
           :label="item.label"
           :width="item.width"
           :min-width="item.min"
+          show-overflow-tooltip
+          :sortable="item.sortable"
           v-if="item.isShowColumn"
-          align="center"
-        >
+        > 
           <!-- 琛ㄥご鏍峰紡 -->
           <template slot="header">
             <span v-if="item.isRequird" style="color: #f56c6c">*</span>
@@ -200,7 +203,7 @@
             <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="鎿嶄綔" width="40" v-if="!detailEnter" align="center">
+        <el-table-column label="鎿嶄綔" width="70" v-if="!detailEnter" align="center" fixed='right'>
           <template slot-scope="scope">
             <el-button type="text" size="small" :disabled="!isOperate" @click="deleteClick(scope)">鍒犻櫎</el-button>
           </template>
@@ -327,7 +330,8 @@
       productIndex: 0,
       isRecalculate: true,
       iscolopen: false,
-      showcol: []
+      showcol: [],
+      mergeNumber:1
     }
   },
   created() {
@@ -346,16 +350,30 @@
     "productTableList.showcol": {
       handler(newVal) {
         this.showcol = newVal
+        this.getMergeNumber()
       },
       immediate: true
-    }
+    },
   },
   computed: {},
   methods: {
+    getMergeNumber(){
+      let pattern=new RegExp("[0-9]+");
+        if(pattern.test(this.showSummary.mergeNumber)){
+          this.mergeNumber=this.showSummary.mergeNumber
+        }else{
+          for(let i in this.showcol){
+            if(this.showcol[i]==this.showSummary.mergeNumber){
+              this.mergeNumber=Number(i)+1;
+            }
+          }
+        } 
+    },
     checkCol() {
       this.iscolopen = !this.iscolopen
     },
     selectCheckBoxList(val) {
+      this.getMergeNumber()
       this.$emit("selTableCol", val)
     },
     getTableInfo(){
@@ -396,11 +414,11 @@
           if (this.$refs.table) {
             var current = this.$refs.table.querySelector(".el-table__footer-wrapper").querySelector(".el-table__footer")
             var cell = current.rows[0].cells
-            for (let i = 0; i < this.showSummary.mergeNumber; i++) {
+            for (let i = 0; i < this.mergeNumber; i++) {
               cell[i].style.display = "none"
             }
-            cell[this.showSummary.mergeNumber].classList.remove("is-left")
-            cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString()
+            cell[this.mergeNumber].classList.remove("is-left")
+            cell[this.mergeNumber].colSpan = this.mergeNumber.toString()
           }
         })
       }
@@ -411,7 +429,7 @@
       const sums = []
       columns.forEach((column, index) => {
         // // 鏇存敼琛屽悕绉�
-        if (index === this.showSummary.mergeNumber) {
+        if (index === this.mergeNumber) {
           sums[index] = "灏忚:"
           return
         }
@@ -669,6 +687,9 @@
   .el-table th.el-table__cell > .cell {
     padding: 0 5px;
   }
+  .el-table__fixed-footer-wrapper tbody td.el-table__cell{
+    background:#fff;
+  }
   .el-input__inner {
     // text-align: left;
     text-align: center !important;
@@ -676,7 +697,7 @@
   .styleBtn {
     position: absolute;
     width: 30px;
-    height: 36px;
+    height: 48px;
     // line-height: 26px;
     // background: #06c062;
     top: 0;
@@ -684,7 +705,7 @@
     z-index: 11;
     .label {
       position: absolute;
-      top: 6px;
+      top: 11px;
       font-size: 20px;
       // line-height: 5px;
       cursor: pointer;
@@ -693,7 +714,7 @@
     }
     .checkbox-group {
       width: 160px;
-      height: 300px;
+      height: 180px;
       overflow: auto;
       display: flex;
       flex-direction: column;
diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 3422c40..72ed3b9 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -584,12 +584,17 @@
       wechatOrderStatusOptions: [], // 寰俊璁㈠崟鐘舵��
       currencyOptions: [{ id: 1, name: "浜烘皯甯�" }], // 甯佺
       approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
-      productTableList: {},
+      productTableList: {
+        allcol: [],
+        showcol:  ["浜у搧鍚嶇О", "瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "閿�鍞崟浠�", "鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�(%)","鏁伴噺","浠风◣鍚堣"],
+        tableData: [],
+        tableColumn: []
+      },
       showSummary: {
         show: true,
         total: true,
         sumProp: ["Amount", "total"],
-        mergeNumber: 7
+        mergeNumber: "鎴愭湰鍗曚环"
       },
       editSelectClientConfig: {
         editVisible: false,
@@ -643,20 +648,19 @@
       isBjdRequird : false,
       tableColumn: [
         // { label: "#", prop: "productId", width: 40 },
-        { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true, min: 110 },
-        { label: "瑙勬牸", prop: "specs" , },
-        { label: "鍨嬪彿", prop: "type" },
-        { label: "浜у搧缂栧彿", prop: "number" },
-        { label: "鍗曚綅", prop: "unit" },
-        { label: "閿�鍞崟浠�", prop: "price", inputFloat: !this.isBjdRequird, },
-        { label: "鎴愭湰鍗曚环", prop: "cost", input: !this.isBjdRequird },
-        { label: "姣涘埄", prop: "profit" },
-        { label: "姣涘埄鐜�(%)", prop: "margin", min: 90 },
-        { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
-        { label: "浠风◣鍚堣", prop: "total" }
+        { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true, min: 110,},
+        { label: "瑙勬牸", prop: "specs" ,  },
+        { label: "鍨嬪彿", prop: "type",  },
+        { label: "浜у搧缂栧彿", prop: "number", },
+        { label: "鍗曚綅", prop: "unit" ,},
+        { label: "閿�鍞崟浠�", prop: "price", inputFloat: !this.isBjdRequird,},
+        { label: "鎴愭湰鍗曚环", prop: "cost", input: !this.isBjdRequird, },
+        { label: "姣涘埄", prop: "profit", },
+        { label: "姣涘埄鐜�(%)", prop: "margin", min: 90,},
+        { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true,},
+        { label: "浠风◣鍚堣", prop: "total", }
       ],
-      showCol: ["浜у搧鍚嶇О", "瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "閿�鍞崟浠�", "鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�(%)","鏁伴噺","浠风◣鍚堣"],
-    }
+     }
   },
   mounted(){
     this.getSaleChanceList()
@@ -696,6 +700,7 @@
   watch: {
     "editClientManageConfig.visible"(val) {
       if (val) {
+        this.setTableForm()
         this.formInfo()
       }
     }
@@ -726,8 +731,8 @@
       })
     },
     selTableCol(val) {
-      this.showcol = val
-      this.productTableList.tableColumn = this.setColumnVisible(val, this.tableColumn)
+      this.productTableList.showcol = val
+      this.productTableList.tableColumn = this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
     },
     checkValueById(data, id) {  
       for (const key in data) {  
@@ -1152,8 +1157,6 @@
       this.productTableList = {
         tableData: this.tableData,
         isReturn: true,
-        allcol: [],
-        showcol: this.showCol,
         // tableColumn: [
         //   // { label: "#", prop: "productId", width: 40 },
         //   { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true, min: 110 },
@@ -1168,16 +1171,19 @@
         //   { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
         //   { label: "浠风◣鍚堣", prop: "total" }
         // ],
-        tableColumn: this.setColumnVisible(this.showCol, this.tableColumn)
+        tableColumn: []
       }
       this.setTableList(this.productTableList)
+      this.productTableList.showcol= ["浜у搧鍚嶇О", "瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "閿�鍞崟浠�", "鎴愭湰鍗曚环","姣涘埄","姣涘埄鐜�(%)","鏁伴噺","浠风◣鍚堣"],
+      this.productTableList.tableColumn = this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
+      this.productTableList.allcol=["瑙勬牸", "鍨嬪彿", "浜у搧缂栧彿", "鍗曚綅", "姣涘埄",] 
     },
-    setTableList(productTableList) {
-      productTableList.allcol = productTableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
+    setTableList(tableList) {
+      tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
       this.searchOptions = []
-      for (let i = 0; i < productTableList.tableColumn.length; i++) {
-        const label = productTableList.tableColumn[i].label
-        const value = productTableList.tableColumn[i].prop
+      for (let i = 0; i < tableList.tableColumn.length; i++) {
+        const label = tableList.tableColumn[i].label
+        const value = tableList.tableColumn[i].prop
         this.searchOptions.push({ value: value, label: label })
       }
     },
diff --git a/src/views/sales/salesDetails/shipmentsDialog.vue b/src/views/sales/salesDetails/shipmentsDialog.vue
index c6dc1d6..62ee623 100644
--- a/src/views/sales/salesDetails/shipmentsDialog.vue
+++ b/src/views/sales/salesDetails/shipmentsDialog.vue
@@ -130,12 +130,12 @@
     const productColumn = [
           { label: "浜у搧缂栧彿", prop: "number", isShowColumn:true, },
           { label: "浜у搧鍚嶇О", prop: "name",isShowColumn:true, min: 110 },
-          { label: "璁㈠崟鏁伴噺", prop: "orderAmount", isShowColumn:true,},
-          { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount",isShowColumn:true, },
+          { label: "璁㈠崟鏁伴噺", prop: "orderAmount",min:110, isShowColumn:true,},
+          { label: "璁㈠崟瀹屾垚鏁伴噺", min:120,prop: "finishAmount",isShowColumn:true, },
           { label: "鍙敤搴撳瓨", prop: "availableAmount",isShowColumn:true, },
-          { label: "鏈彂璐ф暟閲�", prop: "leftAmount", isShowColumn:true, },
-          { label: "鏈鍙戣揣鏁伴噺", prop: "outputAmount", inputFloat: true,isRequird:true,isShowColumn:true,},
-          { label: "鍓╀綑鍙戣揣鏁伴噺", prop: "availableAmount",isShowColumn:true,},
+          { label: "鏈彂璐ф暟閲�", prop: "leftAmount", min:120,isShowColumn:true, },
+          { label: "鏈鍙戣揣鏁伴噺", prop: "outputAmount", min:120,inputFloat: true,isRequird:true,isShowColumn:true,},
+          { label: "鍓╀綑鍙戣揣鏁伴噺", prop: "availableAmount",min:120,isShowColumn:true,},
         ]
     return {
       dialogWidth: "60%",
@@ -471,7 +471,7 @@
           { label: "浜у搧缂栧彿", prop: "number", isShowColumn:true, },
           { label: "浜у搧鍚嶇О", prop: "name",isShowColumn:true, min: 110 },
           { label: "璁㈠崟鏁伴噺", prop: "orderAmount", isShowColumn:true,},
-          { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount",isShowColumn:true, }
+          { label: "璁㈠崟瀹屾垚鏁伴噺", min:120, prop: "finishAmount",isShowColumn:true, }
         ]
       this.productTableList = {
         tableData: this.tableData,
@@ -591,7 +591,7 @@
           { label: "浜у搧缂栧彿", prop: "number",isShowColumn:true,  },
           { label: "浜у搧鍚嶇О", prop: "name",isShowColumn:true,  min: 110 },
           { label: "璁㈠崟鏁伴噺", prop: "orderAmount",isShowColumn:true, },
-          { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount",isShowColumn:true, },
+          { label: "璁㈠崟瀹屾垚鏁伴噺", min:120, prop: "finishAmount",isShowColumn:true, },
           { label: "鍙敤搴撳瓨", prop: "availableAmount",isShowColumn:true, },
         ]
         this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
@@ -645,11 +645,11 @@
           { label: "浜у搧缂栧彿", prop: "number",isShowColumn:true, },
           { label: "浜у搧鍚嶇О", prop: "name",  min: 110 ,isShowColumn:true,},
           { label: "璁㈠崟鏁伴噺", prop: "orderAmount",isShowColumn:true, },
-          { label: "璁㈠崟瀹屾垚鏁伴噺", prop: "finishAmount" ,isShowColumn:true,},
+          { label: "璁㈠崟瀹屾垚鏁伴噺", min:120, prop: "finishAmount" ,isShowColumn:true,},
           { label: "鍙敤搴撳瓨", prop: "availableAmount",isShowColumn:true, },
-          { label: "鏈彂璐ф暟閲�", prop: "leftAmount", isShowColumn:true, },
-          { label: "鏈鍙戣揣鏁伴噺", prop: "outputAmount", inputFloat: true,isRequird:true,isShowColumn:true,},
-          { label: "鍓╀綑鍙戣揣鏁伴噺", prop: "availableAmount",isShowColumn:true,},
+          { label: "鏈彂璐ф暟閲�", prop: "leftAmount", min:120, isShowColumn:true, },
+          { label: "鏈鍙戣揣鏁伴噺", prop: "outputAmount",  min:120,inputFloat: true,isRequird:true,isShowColumn:true,},
+          { label: "鍓╀綑鍙戣揣鏁伴噺", prop: "availableAmount", min:120,isShowColumn:true,},
         ]
         this.productTableList.tableColumn=this.setColumnVisible(this.productTableList.showcol, this.tableColumn)
         let portion=0

--
Gitblit v1.8.0