From 46d46b7159c3f97e3e4cb0bf00e90e27b5367325 Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期五, 29 三月 2024 18:08:22 +0800 Subject: [PATCH] 采购管理产品名称列表绑定供应商列表 --- src/views/purchaseManage/purchase/components/AddPurchase.vue | 18 +++++++++++++++++- src/views/purchaseManage/purchase/index.vue | 5 +++-- src/components/makepager/CommonFormTableView.vue | 21 +++++++++++++-------- src/views/other/commonDialog/SelectCommonDialog.vue | 14 ++++++++------ 4 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/components/makepager/CommonFormTableView.vue b/src/components/makepager/CommonFormTableView.vue index c48c044..b722ac6 100644 --- a/src/components/makepager/CommonFormTableView.vue +++ b/src/components/makepager/CommonFormTableView.vue @@ -315,9 +315,11 @@ editVisible: false, isSelectBox: false, title: "", - infomation: {} + infomation: {}, + supplierId:null, }, - productIndex: 0 + productIndex: 0, + supplierId:null, } }, created() { @@ -332,7 +334,11 @@ this.getTableInfo() }, immediate: true - } + }, + supplierId(n,o) { + this.editSelCommonConfig.supplierId=n + console.log(n,o,"鐪嬬湅閭�") + } }, computed: {}, methods: { @@ -371,9 +377,9 @@ async getProductList() { let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc await fn({ - page: 1, - pageSize: 100 - }).then((res) => { + page: 1, + pageSize: 100, + }).then((res) => { if (res.code === 200) { if (res.data.list && res.data.list.length > 0) { this.productList = res.data.list @@ -559,8 +565,7 @@ }) }, // 鏂板 - selClientClick(scope, prop) { - console.log(scope, prop) + selClientClick(scope) { this.productIndex = scope.$index this.editSelCommonConfig.title = "浜у搧鍚嶇О" this.editSelCommonConfig.isSelectBox = true diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue index 74d664a..8b0fedd 100644 --- a/src/views/other/commonDialog/SelectCommonDialog.vue +++ b/src/views/other/commonDialog/SelectCommonDialog.vue @@ -72,7 +72,8 @@ clientId: 0, isRequest: true, client_name: "", - tableInfomation: [] + tableInfomation: [], + supplierId:null, } } }, @@ -115,7 +116,7 @@ tableColumn: [], selectArray: [] } - }, + }, created() { this.setTable() this.getData() @@ -175,10 +176,11 @@ async getProductList() { let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc await fn({ - keyword: this.keyword, - page: this.pagerOptions.currPage, - pageSize: this.pagerOptions.pageSize - }).then((res) => { + keyword: this.keyword, + page: this.pagerOptions.currPage, + supplierId:this.editConfig.supplierId, + pageSize: this.pagerOptions.pageSize, + }).then((res) => { if (res.code === 200) { if (res.data.list && res.data.list.length > 0) { const list = res.data.list.map((item) => { diff --git a/src/views/purchaseManage/purchase/components/AddPurchase.vue b/src/views/purchaseManage/purchase/components/AddPurchase.vue index ed08a9b..1985dc6 100644 --- a/src/views/purchaseManage/purchase/components/AddPurchase.vue +++ b/src/views/purchaseManage/purchase/components/AddPurchase.vue @@ -230,6 +230,7 @@ <div class="basic-info-title" style="display: flex">浜у搧淇℃伅</div> <div class="product-view"> <CommonFormTableView + ref="tableRef" :detailEnter="editCommonConfig.detailEnter" :show-summary="showSummary" :recalculateShow="false" @@ -754,6 +755,7 @@ }, // 閫夋嫨渚涘簲鍟� async handleSelectClient(value, item) { + this.$refs.tableRef.supplierId=item.id this.productTableList.supplierId = item.id if (value === "client") { this.supplierId = item.id @@ -766,6 +768,7 @@ }).then((res) => { if (res.code === 200) { this.productTableList.tableProductList = res.data.list + this.$refs.tableRef.productList=res.data.list console.log(this.productTableList.tableProductList, "pop") } }) @@ -774,12 +777,14 @@ this.editSelectSupplierConfig.editVisible = true }, async selClient(row) { + this.$refs.tableRef.supplierId=row.id await getProductList({ supplierId: row.id, page: 1, pageSize: 100 }).then((res) => { if (res.code === 200) { + this.$refs.tableRef.productList=res.data.list this.productTableList.tableProductList = res.data.list } }) @@ -789,11 +794,22 @@ this.editConfig.infomation.supplierId = row.id }, // 娓呴櫎宸查�夋嫨鐢ㄦ埛 - clearupClient(value) { + async clearupClient(value) { if (value == "client") { + this.$refs.tableRef.supplierId=null this.$set(this.editConfig.infomation, "supplierName", "") this.supplierId = null this.$forceUpdate() + await getProductList({ + page: 1, + pageSize: 100 + }).then((res) => { + if (res.code === 200) { + this.productTableList.tableProductList = res.data.list + this.$refs.tableRef.productList=res.data.list + console.log(this.productTableList.tableProductList, "pop") + } + }) } }, setTableForm() { diff --git a/src/views/purchaseManage/purchase/index.vue b/src/views/purchaseManage/purchase/index.vue index 775a993..ab410a7 100644 --- a/src/views/purchaseManage/purchase/index.vue +++ b/src/views/purchaseManage/purchase/index.vue @@ -9,7 +9,7 @@ :show-download="false" :amount-view="false" :show-action-btn="false" - :placeholder="'璇疯緭鍏ヤ緵搴斿晢鍚嶇О/鐗╂枡鍚嶇О/閲囪喘鍗曞悕绉�'" + :placeholder="'璇疯緭鍏ヤ緵搴斿晢鍚嶇О/鐗╂枡鍚嶇О/閲囪喘鍗曞悕绉�/閲囪喘鍗曞彿绛�..'" @searchClick="onFilterSearch" /> </div> @@ -246,6 +246,7 @@ tableColumn: [ { label: "鍗曟嵁绫诲瀷", prop: "orderType", min: 130 }, { label: "閲囪喘鍗曞彿", prop: "number", min: 150, isCommonClick: true, default: true }, + { label: "閿�鍞槑缁嗗崟", prop: "sourceOrder", min: 130 }, { label: "閲囪喘鍗曞悕绉�", prop: "name", min: 130, isCommonClick: true }, { label: "渚涘簲鍟嗗悕绉�", prop: "supplierName", min: 130 }, { label: "閲囪喘鏁伴噺", prop: "quantity", min: 130 }, @@ -253,7 +254,7 @@ { label: "缁忓姙浜�", prop: "handledBy", min: 130 }, { label: "鍒跺崟浜�", prop: "creator", min: 130 } ], - showCol: ["閲囪喘鍗曞彿", "閲囪喘鍗曞悕绉�", "鍗曟嵁绫诲瀷", "渚涘簲鍟嗗悕绉�", "閲囪喘鏁伴噺", "鏀惰揣浠撳簱", "缁忓姙浜�", "鍒跺崟浜�"], + showCol: ["閲囪喘鍗曞彿","閿�鍞槑缁嗗崟", "閲囪喘鍗曞悕绉�", "鍗曟嵁绫诲瀷", "渚涘簲鍟嗗悕绉�", "閲囪喘鏁伴噺", "鏀惰揣浠撳簱", "缁忓姙浜�", "鍒跺崟浜�"], tableBottomColumn: [], showBottomCol: [], TabsIndex: 0, -- Gitblit v1.8.0