From 98d4e2b26ce3a542b8ab6f2c04b9e56f9dd95f42 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 29 三月 2024 10:36:27 +0800
Subject: [PATCH] 供应商管理列表搜索功能修改6202
---
src/views/other/commonDialog/SelectCommonDialog.vue | 82 +++++++++++++++++++++++++++++++----------
1 files changed, 62 insertions(+), 20 deletions(-)
diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue
index 2e31f18..e0e3748 100644
--- a/src/views/other/commonDialog/SelectCommonDialog.vue
+++ b/src/views/other/commonDialog/SelectCommonDialog.vue
@@ -28,7 +28,16 @@
<el-button type="primary" size="mini" disabled>蹇�熷垱寤�</el-button> -->
</div>
</div>
- <TableCommonView ref="tableListRef" :table-list="tableList" :select-box="false" @selCommonClick="selNameClick">
+ <TableCommonView
+ class="bg-list"
+ ref="tableListRef"
+ :table-list="tableList"
+ :select-box="editCommonConfig.isSelectBox"
+ :selectBoxList="selectBoxList"
+ @selCommonClick="selNameClick"
+ @selTableCol="selTableCol"
+ @getSelectArray="getSelectArray"
+ >
</TableCommonView>
<div slot="footer" class="dialog-footer">
<!-- <div class="remark">璇存槑锛氭敮鎸佸瀛楁妯$硦鏌ヨ锛屼粎鏄剧ず绗﹀悎鏉′欢鐨勫墠5鏉℃暟鎹�</div> -->
@@ -36,6 +45,10 @@
<PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
</div>
</div>
+ </div>
+ <div slot="footer" class="dialog-footer" v-if="editCommonConfig.isSelectBox">
+ <el-button type="primary" size="small" @click="saveClick()">纭畾</el-button>
+ <el-button size="small" @click="editConfig.editVisible = false">鍙栨秷</el-button>
</div>
</el-dialog>
</div>
@@ -54,7 +67,11 @@
default: () => {
return {
editVisible: false,
+ isSelectBox: false,
title: "",
+ clientId: 0,
+ isRequest: true,
+ client_name: "",
tableInfomation: []
}
}
@@ -62,6 +79,10 @@
sign: {
type: String,
default: ""
+ },
+ selectBoxList: {
+ type: Array,
+ default: () => []
}
},
components: {},
@@ -81,13 +102,20 @@
searchSel: {},
keyword: "",
keywordType: "",
- showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿"],
+ showPurchaseCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "渚涘簲鍟�", "閲囪喘鍗曚环", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"],
+ showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "閲囪喘鍗曚环", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"],
tableProductColumn: [
{ label: "浜у搧鍚嶇О", prop: "name", isClick: true },
- { label: "浜у搧缂栧彿", prop: "number" }
+ { label: "浜у搧缂栧彿", prop: "number" },
+ { label: "渚涘簲鍟�", prop: "supplierName" },
+ { label: "閲囪喘鍗曚环", prop: "purchasePrice" },
+ { label: "鍗曚綅", prop: "unit" },
+ { label: "浜у搧瑙勬牸", prop: "specifications" },
+ { label: "鍨嬪彿", prop: "modelNumber" }
],
showCol: [],
- tableColumn: []
+ tableColumn: [],
+ selectArray: []
}
},
created() {
@@ -105,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 = {
@@ -130,6 +163,14 @@
this.showcol = val
this.tableList.tableColumn = this.setColumnVisible(val)
},
+ // 鍒楄〃澶氶��
+ getSelectArray(val) {
+ this.selectArray = val
+ },
+ saveClick() {
+ this.$emit("getSelectArray", this.selectArray)
+ this.editConfig.editVisible = false
+ },
// 璇锋眰鏁版嵁
async getData() {
this.loading = true
@@ -141,21 +182,26 @@
async getProductList() {
let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc
await fn({
- productName: this.keywordType === "浜у搧鍚嶇О" ? this.keyword : "",
- productNumber: this.keywordType === "浜у搧缂栧彿" ? this.keyword : "",
+ keyword: this.keyword,
page: this.pagerOptions.currPage,
pageSize: this.pagerOptions.pageSize
}).then((res) => {
- console.log(res.data)
- if (res.data.code === 200) {
- if (res.data.data.list && res.data.data.list.length > 0) {
- const list = res.data.data.list.map((item) => {
- return {
- ...item
+ if (res.code === 200) {
+ if (res.data.list && res.data.list.length > 0) {
+ const list = res.data.list.map((item) => {
+ if (this.sign == "purchase") {
+ return {
+ ...item,
+ supplierName: item.supplier?.name
+ }
+ } else {
+ return {
+ ...item
+ }
}
})
this.tableList.tableInfomation = list
- this.pagerOptions.totalCount = res.data.data.total
+ this.pagerOptions.totalCount = res.data.total
} else {
this.tableList.tableInfomation = []
}
@@ -173,13 +219,9 @@
}
},
// 鎼滅储
- searchClick(val, content) {
- console.log(val, content)
- this.search_map = {
- [val.value]: content
- }
+ searchClick(content) {
+ console.log(content)
this.keyword = content
- this.keywordType = val.label
this.getData()
},
resetClick() {
--
Gitblit v1.8.0