From 61883fcf237024ceb7622daf5b23434e3eb1be74 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期一, 16 十月 2023 10:38:50 +0800
Subject: [PATCH] 产品获取值修改

---
 src/views/other/commonDialog/SelectChanceDialog.vue |   61 +++++++++++++++++++++++-------
 1 files changed, 47 insertions(+), 14 deletions(-)

diff --git a/src/views/other/commonDialog/SelectChanceDialog.vue b/src/views/other/commonDialog/SelectChanceDialog.vue
index 34c450d..2814fbc 100644
--- a/src/views/other/commonDialog/SelectChanceDialog.vue
+++ b/src/views/other/commonDialog/SelectChanceDialog.vue
@@ -27,10 +27,14 @@
           :table-list="tableList"
           :select-box="false"
           @selCommonClick="selNameClick"
+          @selTableCol="selTableCol"
         >
         </TableCommonView>
         <div slot="footer" class="dialog-footer">
-          <div class="remark">璇存槑锛氭敮鎸佸瀛楁妯$硦鏌ヨ锛屼粎鏄剧ず绗﹀悎鏉′欢鐨勫墠5鏉℃暟鎹�</div>
+          <!-- <div class="remark">璇存槑锛氭敮鎸佸瀛楁妯$硦鏌ヨ锛屼粎鏄剧ず绗﹀悎鏉′欢鐨勫墠5鏉℃暟鎹�</div> -->
+          <div class="btn-pager">
+            <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+          </div>
         </div>
       </div>
     </el-dialog>
@@ -39,8 +43,10 @@
 
 <script>
 import { getSaleChanceList } from "@/api/sales/salesOpportunity"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 export default {
   name: "EditSelChanceDialog",
+  mixins: [pageMixin],
   props: {
     editCommonConfig: {
       type: Object,
@@ -64,7 +70,15 @@
       tableList: [],
       searchSelOptions: [],
       loading: false,
-      search_map: {}
+      search_map: {},
+      tableColumn: [
+        { label: "閿�鍞満浼氱紪鍙�", prop: "number" }, // 閿�鍞満浼氱紪鍙�
+        { label: "鏈轰細鍚嶇О", prop: "name", isCommonClick: true, default: true }, // 鏈轰細鍚嶇О
+        { label: "閿�鍞樁娈�", prop: "sale_stage_name" }, // 閿�鍞樁娈�
+        { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
+        { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time" } // 棰勮鎴愪氦鏃ユ湡
+      ],
+      showCol: ["閿�鍞満浼氱紪鍙�", "鏈轰細鍚嶇О", "閿�鍞樁娈�", "閿�鍞礋璐d汉", "棰勮鎴愪氦鏃ユ湡"]
     }
   },
   created() {
@@ -74,21 +88,31 @@
   methods: {
     setTable() {
       this.tableList = {
+        selectIndex: true,
         tableInfomation: [],
-        tableColumn: [
-          { label: "閿�鍞満浼氱紪鍙�", prop: "number" }, // 閿�鍞満浼氱紪鍙�
-          { label: "鏈轰細鍚嶇О", prop: "name", isCommonClick: true }, // 鏈轰細鍚嶇О
-          { label: "閿�鍞樁娈�", prop: "sale_stage_name" }, // 閿�鍞樁娈�
-          { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉
-          { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time" } // 棰勮鎴愪氦鏃ユ湡
-        ]
+        allcol: [],
+        showcol: this.showCol,
+        tableColumn: this.setColumnVisible(this.showCol)
       }
+      this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
       this.searchOptions = []
       for (let i = 0; i < this.tableList.tableColumn.length; i++) {
         const label = this.tableList.tableColumn[i].label
         const value = this.tableList.tableColumn[i].prop
         this.searchOptions.push({ value: value, label: label })
       }
+    },
+    setColumnVisible(showCol) {
+      return this.tableColumn.map((ele) => {
+        return {
+          ...ele,
+          isShowColumn: showCol.includes(ele.label)
+        }
+      })
+    },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setColumnVisible(val)
     },
     handleClose() {
       this.editConfig.editVisible = false
@@ -98,8 +122,8 @@
       this.loading = true
       await getSaleChanceList({
         search_map: this.search_map,
-        page: 0,
-        pageSize: 0
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
       })
         .then((res) => {
           console.log(res)
@@ -112,7 +136,8 @@
                   sale_stage_name: item.sale_stage.name
                 }
               })
-              this.tableList.tableInfomation = list.slice(0, 5) || []
+              this.tableList.tableInfomation = list || []
+              this.pagerOptions.totalCount = res.data.count
             } else {
               this.tableList.tableInfomation = []
             }
@@ -153,6 +178,7 @@
 .bg-view {
   margin: 10px;
   .query-bg {
+    margin-left: -20px;
     margin-bottom: 10px;
     display: flex;
     justify-content: space-between;
@@ -172,9 +198,16 @@
   cursor: pointer;
 }
 .dialog-footer {
-  height: 40px;
-  line-height: 40px;
+  height: 50px;
+  line-height: 50px;
   color: red;
+  .btn-pager {
+    display: flex;
+    margin-top: 0px;
+    .page {
+      margin-left: auto;
+    }
+  }
 }
 ::v-deep {
   .input-with-select .el-input-group__prepend {

--
Gitblit v1.8.0