From ec6857c9e95fbe1b175d7f697a836c210c0c2b2c Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 29 三月 2024 10:32:19 +0800 Subject: [PATCH] 公共组件选择产品信息处理 --- src/views/purchaseManage/purchase/DetailSupplier.vue | 42 ++++++++++++++++++++++++++++++------------ 1 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/views/purchaseManage/purchase/DetailSupplier.vue b/src/views/purchaseManage/purchase/DetailSupplier.vue index b13839c..75feb1e 100644 --- a/src/views/purchaseManage/purchase/DetailSupplier.vue +++ b/src/views/purchaseManage/purchase/DetailSupplier.vue @@ -121,6 +121,7 @@ ref="tableListRef" :showSummary="showSummary" :table-list="tableList" + @selTableCol="selTableCol" > </TableCommonView> <div class="table-bottom"> @@ -189,7 +190,18 @@ mergeNumber: 5, totalName:'灏忚' }, + showCol: ['浜у搧鍚嶇О', '浜у搧缂栫爜', '璁¢噺鍗曚綅', '瑙勬牸鍨嬪彿', '鏁伴噺', '閿�鍞崟浠�','浠风◣鍚堣','鎻忚堪'], purchaseStatusList:getDataByType('purchaseStatus'), + tableColumn: [ + { label: "浜у搧鍚嶇О", prop: "name", min: 160, }, + { label: "浜у搧缂栫爜", prop: "number", min: 130, }, + { label: "璁¢噺鍗曚綅", prop: "unit", min: 130 }, + { label: "瑙勬牸鍨嬪彿", prop: "specifications", min: 130 }, + { label: "鏁伴噺", prop: "amount", min: 130 }, + { label: "閿�鍞崟浠�", prop: "price", min: 130 }, + { label: "浠风◣鍚堣", prop: "total", min: 130 }, + { label: "鎻忚堪", prop: "remark", min: 130 }, + ], }; }, created() { @@ -240,7 +252,7 @@ this.formInfoList = [ { str: "渚涘簲鍟嗗悕绉�", - value: item.name, + value: item.supplier.name, }, { str: "鍚堣", @@ -276,7 +288,7 @@ leftStr: "閲囪喘璁㈠崟缂栧彿", leftValue: item.number, rightStr: "渚涘簲鍟嗗悕绉�", - rightValue: item.name, + rightValue: item.supplier.name, }, { leftStr: "閲囪喘鍗曠姸鎬�", @@ -326,17 +338,23 @@ this.tableList = { tableInfomation: item.productList?item.productList:[], selectIndex: true, - tableColumn: [ - { label: "浜у搧鍚嶇О", prop: "name", min: 160, }, - { label: "浜у搧缂栫爜", prop: "number", min: 130, }, - { label: "璁¢噺鍗曚綅", prop: "unit", min: 130 }, - { label: "瑙勬牸鍨嬪彿", prop: "specifications", min: 130 }, - { label: "鏁伴噺", prop: "amount", min: 130 }, - { label: "閿�鍞崟浠�", prop: "price", min: 130 }, - { label: "浠风◣鍚堣", prop: "total", min: 130 }, - { label: "鎻忚堪", prop: "remark", min: 130 }, - ], + showcol: this.showCol, + allcol:[], + tableColumn:this.setColumnVisible(this.showCol) }; + this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.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.detailConfig.visible = false; -- Gitblit v1.8.0