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/other/commonDialog/SelectCommonDialog.vue | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue index aa2a6a4..e0e3748 100644 --- a/src/views/other/commonDialog/SelectCommonDialog.vue +++ b/src/views/other/commonDialog/SelectCommonDialog.vue @@ -102,7 +102,8 @@ searchSel: {}, keyword: "", keywordType: "", - showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "渚涘簲鍟�", "閲囪喘鍗曚环", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"], + showPurchaseCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "渚涘簲鍟�", "閲囪喘鍗曚环", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"], + showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "閲囪喘鍗曚环", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"], tableProductColumn: [ { label: "浜у搧鍚嶇О", prop: "name", isClick: true }, { label: "浜у搧缂栧彿", prop: "number" }, @@ -132,7 +133,12 @@ }, setTable() { if (this.editConfig.title === "浜у搧鍚嶇О") { - this.showCol = this.showProductCol + if (this.sign == "purchase") { + this.showCol = this.showPurchaseCol + } else { + this.showCol = this.showProductCol + } + this.tableColumn = this.tableProductColumn } this.tableList = { @@ -183,9 +189,15 @@ if (res.code === 200) { if (res.data.list && res.data.list.length > 0) { const list = res.data.list.map((item) => { - return { - ...item, - supplierName: item.supplier.name + if (this.sign == "purchase") { + return { + ...item, + supplierName: item.supplier?.name + } + } else { + return { + ...item + } } }) this.tableList.tableInfomation = list -- Gitblit v1.8.0