From 26c39cd359bc0d2edc88408ff51ef70554e32a90 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 29 二月 2024 09:48:17 +0800
Subject: [PATCH] 跟进记录明细报价单没点击弹框下拉数据为空的问题选择机会或者报价单赋值客户名称

---
 src/views/other/commonDialog/SelectContactDialog.vue |   96 +++++++++++++++++++++++++-----------------------
 1 files changed, 50 insertions(+), 46 deletions(-)

diff --git a/src/views/other/commonDialog/SelectContactDialog.vue b/src/views/other/commonDialog/SelectContactDialog.vue
index cc8f874..5d97367 100644
--- a/src/views/other/commonDialog/SelectContactDialog.vue
+++ b/src/views/other/commonDialog/SelectContactDialog.vue
@@ -10,39 +10,6 @@
     >
       <div class="bg-view">
         <div class="query-bg">
-          <!-- <el-input placeholder="璇疯緭鍏ュ唴瀹�" v-model="queryInput" size="mini" class="input-with-select">
-            <el-select v-model="select" slot="prepend" placeholder="璇烽�夋嫨" disabled>
-              <el-option label="鍏ㄩ儴瀛楁" value="1"></el-option>
-              <el-option label="鑱旂郴浜哄鍚�" value="2"></el-option>
-              <el-option label="鑱旂郴浜虹紪鍙�" value="3"></el-option>
-              <el-option label="瀹㈡埛鍚嶇О" value="4"></el-option>
-              <el-option label="鎵嬫満" value="5"></el-option>
-            </el-select>
-          </el-input>
-          <div class="btn">
-            <el-button type="primary" size="mini" disabled>璁剧疆瀛楁</el-button>
-            <el-button type="primary" size="mini" disabled>蹇�熷垱寤�</el-button>
-          </div>
-        </div>
-        <el-table
-          :data="tableData"
-          border
-          size="mini"
-          v-loading="loading"
-          :header-cell-style="{ background: '#f7f7f7' }"
-        >
-          <el-table-column label="鑱旂郴浜哄鍚�" prop="name" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <span class="sel-name" @click="selNameClick(scope.row)">{{ scope.row.name }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="鑱旂郴浜虹紪鍙�" prop="number"></el-table-column>
-          <el-table-column label="瀹㈡埛鍚嶇О" prop="client_name"></el-table-column>
-          <el-table-column label="鎵嬫満" prop="phone"></el-table-column>
-          <div slot="empty">
-            <el-empty :image-size="100"></el-empty>
-          </div>
-        </el-table> -->
           <SearchCommonView
             ref="searchCommonView"
             :search-options="searchOptions"
@@ -60,10 +27,14 @@
           :table-list="tableList"
           :select-box="false"
           @selContactsClick="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>
@@ -72,8 +43,10 @@
 
 <script>
 import { getContactList } from "@/api/client/contacts"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 export default {
   name: "EditSelClientDialog",
+  mixins: [pageMixin],
   props: {
     editCommonConfig: {
       type: Object,
@@ -81,6 +54,7 @@
         return {
           editVisible: false,
           title: "",
+          clientId: 0,
           infomation: {}
         }
       }
@@ -97,30 +71,51 @@
       tableList: [],
       searchSelOptions: [],
       loading: false,
-      search_map: {}
+      search_map: {},
+      tableColumn: [
+        { label: "鑱旂郴浜哄鍚�", prop: "name", isContactClick: true, default: true }, // 鑱旂郴浜哄鍚�
+        // { label: "鑱旂郴浜虹紪鍙�", prop: "number" }, // 鑱旂郴浜虹紪鍙�
+        { label: "瀹㈡埛鍚嶇О", prop: "client_name" }, // 瀹㈡埛鍚嶇О
+        { label: "鎵嬫満", prop: "phone" } // 鎵嬫満鍙风爜
+      ],
+      showCol: ["鑱旂郴浜哄鍚�",  "瀹㈡埛鍚嶇О", "鎵嬫満"]
     }
   },
   created() {
+    this.search_map = {
+      client_id: this.editConfig.clientId
+    }
     this.setTable()
     this.getData()
   },
   methods: {
     setTable() {
       this.tableList = {
+        selectIndex: true,
         tableInfomation: [],
-        tableColumn: [
-          { label: "鑱旂郴浜哄鍚�", prop: "name", isContactClick: true }, // 鑱旂郴浜哄鍚�
-          { label: "鑱旂郴浜虹紪鍙�", prop: "number" }, // 鑱旂郴浜虹紪鍙�
-          { label: "瀹㈡埛鍚嶇О", prop: "client_name" }, // 瀹㈡埛鍚嶇О
-          { label: "鎵嬫満", prop: "phone" } // 鎵嬫満鍙风爜
-        ]
+        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
@@ -130,8 +125,8 @@
       this.loading = true
       await getContactList({
         search_map: this.search_map,
-        page: 0,
-        pageSize: 0
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
       })
         .then((res) => {
           console.log(res)
@@ -143,7 +138,8 @@
                   client_name: item.Client.name
                 }
               })
-              this.tableList.tableInfomation = list.slice(0, 5) || []
+              this.tableList.tableInfomation = list || []
+              this.pagerOptions.totalCount = res.data.count
             } else {
               this.tableList.tableInfomation = []
             }
@@ -183,6 +179,7 @@
 .bg-view {
   margin: 10px;
   .query-bg {
+    margin-left: -20px;
     margin-bottom: 10px;
     display: flex;
     justify-content: space-between;
@@ -202,9 +199,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