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 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

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() {

--
Gitblit v1.8.0