From 7fbfeddedebd05e2d23ce411be887106d31e8eff Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期三, 27 三月 2024 15:02:18 +0800
Subject: [PATCH] 销售明细单产品列表添加动态表头,产品信息列表根据完成数量展示字体色

---
 src/components/makepager/CommonFormTableView.vue |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue
index 0fb598e..ca08f1f 100644
--- a/src/components/makepager/CommonFormTableView.vue
+++ b/src/components/makepager/CommonFormTableView.vue
@@ -22,6 +22,7 @@
           :label="item.label"
           :width="item.width"
           :min-width="item.min"
+          v-if="item.isShowColumn"
           align="center"
         >
           <!-- 琛ㄥご鏍峰紡 -->
@@ -206,6 +207,12 @@
         </el-table-column>
         <slot name="tableButton" />
       </el-table>
+      <div class="styleBtn">
+        <i @click="checkCol()" class="label">...</i>
+        <el-checkbox-group v-model="showcol" v-show="iscolopen" class="checkbox-group" @change="selectCheckBoxList">
+          <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item">{{ item }} </el-checkbox>
+        </el-checkbox-group>
+      </div>
     </el-form>
     <div v-if="!detailEnter" style="margin: 10px">
       <el-button size="small" type="primary" :disabled="!isOperate" @click="add">鏂板</el-button>
@@ -284,6 +291,8 @@
         return {
           tableData: [], // 鎺ュ彛杩斿洖鏁版嵁
           isReturn: false,
+          allcol: [],
+          showcol: [],
           tableColumn: [
             // table琛ㄥ崟
             { label: "", prop: "", min: 200, tooltip: true }
@@ -316,7 +325,9 @@
         infomation: {}
       },
       productIndex: 0,
-      isRecalculate: true
+      isRecalculate: true,
+      iscolopen: false,
+      showcol: []
     }
   },
   created() {
@@ -331,10 +342,22 @@
         this.getTableInfo()
       },
       immediate: true
+    },
+    "productTableList.showcol": {
+      handler(newVal) {
+        this.showcol = newVal
+      },
+      immediate: true
     }
   },
   computed: {},
   methods: {
+    checkCol() {
+      this.iscolopen = !this.iscolopen
+    },
+    selectCheckBoxList(val) {
+      this.$emit("selTableCol", val)
+    },
     getTableInfo(){
       this.tableList = this.productTableList
       if (this.tableList.tableData.length === 1 && this.tableList.tableData[0].name === "") {
@@ -617,6 +640,7 @@
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style lang="scss" scoped>
 .page-view {
+  position: relative;
   .el-form-item {
     margin-bottom: 0;
     .custom-name {
@@ -649,5 +673,40 @@
     // text-align: left;
     text-align: center !important;
   }
+  .styleBtn {
+    position: absolute;
+    width: 30px;
+    height: 36px;
+    // line-height: 26px;
+    // background: #06c062;
+    top: 0;
+    right: -6px;
+    z-index: 11;
+    .label {
+      position: absolute;
+      top: 6px;
+      font-size: 20px;
+      // line-height: 5px;
+      cursor: pointer;
+      color: #000;
+      transform: rotate(-90deg);
+    }
+    .checkbox-group {
+      width: 160px;
+      height: 300px;
+      overflow: auto;
+      display: flex;
+      flex-direction: column;
+      line-height: 25px;
+      background: #ffffff;
+      border-radius: 16px;
+      padding: 12px;
+      position: absolute;
+      right: 0;
+      top: 30px;
+      z-index: 99;
+      box-shadow: 0 0 2px 2px #f8f8f8;
+    }
+  }
 }
 </style>

--
Gitblit v1.8.0