From a7f37d5a76f80df4bad37a58ad95ab41ba0be22e Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期四, 02 十一月 2023 09:40:53 +0800 Subject: [PATCH] 修改采购管理,供应商列表和产品名称列表展示 --- src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue | 46 ++++++++++++++++++++++++++++++++++------------ 1 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue index a5dd842..0c11b8c 100644 --- a/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue +++ b/src/views/purchaseManage/purchase/components/SelectSupplierDialog.vue @@ -27,6 +27,7 @@ :table-list="tableList" :select-box="false" @selCommonClick="selNameClick" + @selTableCol="selTableCol" > </TableCommonView> <div slot="footer" class="dialog-footer"> @@ -66,34 +67,54 @@ loading: false, searchOptions: [], tableList: {}, - search_map: {} + search_map: {}, + 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 } + ], + 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 const value = this.tableList.tableColumn[i].prop 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 @@ -115,7 +136,8 @@ status_name: item.status === 0 ? "鏈惎鐢�" : "鍚敤" } }) - this.tableList.tableInfomation = list.slice(0, 5) || [] + // this.tableList.tableInfomation = list.slice(0, 5) || [] + this.tableList.tableInfomation = list } else { this.tableList.tableInfomation = [] } -- Gitblit v1.8.0