From a6649a3319e9f5e9260848872d8cddabfcfc7553 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 15 十一月 2023 10:42:55 +0800
Subject: [PATCH] Merge branch 'master' of ssh://192.168.5.5:29418/web/SRM

---
 src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue |   75 +++++++++++++++++++++++++++----------
 1 files changed, 54 insertions(+), 21 deletions(-)

diff --git a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
index a5dd842..9e553ad 100644
--- a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
+++ b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue
@@ -27,10 +27,13 @@
           :table-list="tableList"
           :select-box="false"
           @selCommonClick="selNameClick"
+          @selTableCol="selTableCol"
         >
         </TableCommonView>
         <div slot="footer" class="dialog-footer">
-          <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 +42,11 @@
 
 <script>
 import { getSupplierList } from "@/api/supplierManage/supplier"
+import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
+
 export default {
   name: "EditSelClientDialog",
+  mixins: [pageMixin],
   props: {
     editCommonConfig: {
       type: Object,
@@ -57,7 +63,7 @@
   computed: {},
   data() {
     return {
-      dialogWidth: "50%",
+      dialogWidth: "40%",
       editConfig: this.editCommonConfig,
       queryInput: "",
       select: "1",
@@ -66,28 +72,34 @@
       loading: false,
       searchOptions: [],
       tableList: {},
-      search_map: {}
+      search_map: {},
+      tableColumn: [
+        { label: "渚涘簲鍟嗙紪鍙�", prop: "number", min: 190 },
+        { label: "渚涘簲鍟嗗悕绉�", prop: "name", min: 130, isCommonClick: true },
+        { label: "渚涘簲鍟嗙被鍨�", prop: "supplierType", min: 130 },
+        { label: "鎵�灞炶涓�", prop: "industry", min: 130 },
+        { label: "鑱旂郴浜�", prop: "contact", min: 130 },
+        { label: "鑱旂郴鐢佃瘽", prop: "phone", min: 130 },
+        { label: "鐘舵��", prop: "status_name", min: 130 },
+        { label: "鍒涘缓鏃堕棿", prop: "member_name", min: 130 }
+      ],
+      showCol: ["渚涘簲鍟嗙紪鍙�", "渚涘簲鍟嗗悕绉�", "渚涘簲鍟嗙被鍨�", "鑱旂郴浜�", "鑱旂郴鐢佃瘽", "鐘舵��"]
     }
   },
   created() {
     this.setTable()
     this.getData()
   },
+  mounted() {},
   methods: {
     setTable() {
       this.tableList = {
         tableInfomation: [],
-        tableColumn: [
-         { label: "渚涘簲鍟嗙紪鍙�", prop: "number", min: 190, isCommonClick: true },
-          { label: "渚涘簲鍟嗗悕绉�", prop: "name", min: 130 },
-          { label: "渚涘簲鍟嗙被鍨�", prop: "supplierType", min: 130 },
-          { label: "鎵�灞炶涓�", prop: "industry", min: 130 },
-          { label: "鑱旂郴浜�", prop: "contact", min: 130 },
-          { label: "鑱旂郴鐢佃瘽", prop: "phone", min: 130 },
-          { label: "鐘舵��", prop: "status_name", min: 130 },
-          { label: "鍒涘缓鏃堕棿", prop: "member_name", min: 130 }
-        ]
+        tableColumn: this.setColumnVisible(this.showCol),
+        showcol: this.showCol,
+        allcol: []
       }
+      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
@@ -95,27 +107,41 @@
         this.searchOptions.push({ value: value, label: label })
       }
     },
+    selTableCol(val) {
+      this.showcol = val
+      this.tableList.tableColumn = this.setColumnVisible(val)
+    },
+    setColumnVisible(showCol) {
+      return this.tableColumn.map((ele) => {
+        return {
+          ...ele,
+          isShowColumn: showCol.includes(ele.label)
+        }
+      })
+    },
     handleClose() {
       this.editConfig.editVisible = false
     },
     // 璇锋眰鏁版嵁
     async getData(val, content) {
       this.loading = true
+
       await getSupplierList({
         [val]: content,
-        page:1,
-        pageSize: 10
+        page: this.pagerOptions.currPage,
+        pageSize: this.pagerOptions.pageSize
       })
         .then((res) => {
-          if (res.data.code == 200) {
-            if (res.data.data.list && res.data.data.list.length > 0) {
-              const list = res.data.data.list.map((item) => {
+          if (res.code == 200) {
+            if (res.data.list && res.data.list.length > 0) {
+              const list = res.data.list.map((item) => {
                 return {
                   ...item,
                   status_name: item.status === 0 ? "鏈惎鐢�" : "鍚敤"
                 }
               })
-              this.tableList.tableInfomation = list.slice(0, 5) || []
+              this.tableList.tableInfomation = list
+              this.pagerOptions.totalCount = res.data.total
             } else {
               this.tableList.tableInfomation = []
             }
@@ -170,9 +196,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