From fe95d034e69c59d3e1a003615a65a0fb945ba55f Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 25 四月 2024 17:07:57 +0800
Subject: [PATCH] 获取供应商对应产品的列表接口修改和联调+获取产品相关供应商的接口修改和联调

---
 src/views/other/commonDialog/SelectCommonDialog.vue |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue
index 74d664a..afff0b0 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,
         }
       }
     },
@@ -102,11 +103,13 @@
       searchSel: {},
       keyword: "",
       keywordType: "",
-      showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "閿�鍞崟浠�", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"],
+      showPurchaseCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "渚涘簲鍟�", "閲囪喘鍗曚环", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"],
+      showProductCol: ["浜у搧鍚嶇О", "浜у搧缂栧彿", "閲囪喘鍗曚环", "鍗曚綅", "浜у搧瑙勬牸", "鍨嬪彿"],
       tableProductColumn: [
         { label: "浜у搧鍚嶇О", prop: "name", isClick: true },
         { label: "浜у搧缂栧彿", prop: "number" },
-        { label: "閿�鍞崟浠�", prop: "purchasePrice" },
+        { label: "渚涘簲鍟�", prop: "supplierName" },
+        { label: "閲囪喘鍗曚环", prop: "purchasePrice" },
         { label: "鍗曚綅", prop: "unit" },
         { label: "浜у搧瑙勬牸", prop: "specifications" },
         { label: "鍨嬪彿", prop: "modelNumber" }
@@ -115,7 +118,7 @@
       tableColumn: [],
       selectArray: []
     }
-  },
+  },  
   created() {
     this.setTable()
     this.getData()
@@ -131,7 +134,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 = {
@@ -175,15 +183,23 @@
     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) => {
-              return {
-                ...item
+              if (this.sign == "purchase") {
+                return {
+                  ...item,
+                  supplierName: item.supplier?.name
+                }
+              } else {
+                return {
+                  ...item
+                }
               }
             })
             this.tableList.tableInfomation = list

--
Gitblit v1.8.0