From 8380b537474be9b9aa24efcd65c730e2907b9b8b Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期六, 26 八月 2023 18:07:48 +0800
Subject: [PATCH] 服务商相关接口联调

---
 src/views/other/commonDialog/EditDropdownDialog.vue |   37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/src/views/other/commonDialog/EditDropdownDialog.vue b/src/views/other/commonDialog/EditDropdownDialog.vue
index 4691fa8..61713a6 100644
--- a/src/views/other/commonDialog/EditDropdownDialog.vue
+++ b/src/views/other/commonDialog/EditDropdownDialog.vue
@@ -55,7 +55,7 @@
 </template>
 
 <script>
-import { getSupplierTypeList, updateSupplierType } from "@/api/supplierManage/supplier"
+import { getSupplierTypeList, updateSupplierType, updateIndustry, getIndustryList } from "@/api/supplierManage/supplier"
 export default {
   name: "EditDropdownDialog",
   props: {
@@ -90,6 +90,8 @@
     setList() {
       if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") {
         this.getSupplierTypeList()
+      } else if (this.editConfig.title === "鎵�灞炶涓�") {
+        this.getIndustryList()
       }
     },
     // 渚涘簲鍟嗙被鍨�
@@ -98,13 +100,20 @@
         page: 1,
         pageSize: 100
       }).then((res) => {
-        console.log("dsss")
         console.log(res.data)
         this.tableData = res.data.data.list
       })
     },
     // 鎵�灞炶涓�
-    async getIndustryList() {},
+    async getIndustryList() {
+      await getIndustryList({
+        page: 1,
+        pageSize: 100
+      }).then((res) => {
+        console.log(res.data)
+        this.tableData = res.data.data.list
+      })
+    },
     handleClose() {
       this.editConfig.editVisible = false
     },
@@ -151,12 +160,16 @@
     // 鏂板涓嬫媺妗�
     addDropdown() {
       this.tableData.push({
-        name: "",
-        id: 0
+        ID: 0,
+        name: ""
       })
     },
     async saveClick() {
       console.log(this.tableData)
+      this.tableData.map((ite) => {
+        ite.ID = 0
+        return { ...ite }
+      })
       if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") {
         updateSupplierType({
           supplierTypes: this.tableData
@@ -164,7 +177,19 @@
           console.log(res)
           if (res.code === 200) {
             this.$message.success("缂栬緫鎴愬姛")
-            this.$parent.getData()
+            this.$parent.getSupplierTypeList()
+            this.handleClose()
+          }
+        })
+      } else if (this.editConfig.title === "鎵�灞炶涓�") {
+        updateIndustry({
+          industries: this.tableData
+        }).then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            this.$message.success("缂栬緫鎴愬姛")
+            this.$parent.getIndustryList()
+            this.handleClose()
           }
         })
       }

--
Gitblit v1.8.0