From 7da8d51d212f96b2d419d4f22617827ea4df9e3d Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期六, 26 八月 2023 15:28:26 +0800
Subject: [PATCH] 服务商列表联调及无用api删除

---
 src/views/other/commonDialog/EditDropdownDialog.vue |   71 +++++++++++++++++++++--------------
 1 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/src/views/other/commonDialog/EditDropdownDialog.vue b/src/views/other/commonDialog/EditDropdownDialog.vue
index 142bf25..4691fa8 100644
--- a/src/views/other/commonDialog/EditDropdownDialog.vue
+++ b/src/views/other/commonDialog/EditDropdownDialog.vue
@@ -13,7 +13,7 @@
             <el-input v-model="scope.row.name" size="mini"></el-input>
           </template>
         </el-table-column>
-        <el-table-column label="璁句负榛樿" prop="setDefault">
+        <!-- <el-table-column label="璁句负榛樿" prop="setDefault">
           <template slot-scope="scope">
             <el-switch
               v-model="scope.row.setDefault"
@@ -24,7 +24,7 @@
             >
             </el-switch>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column label="鎿嶄綔" width="110px">
           <template slot-scope="scope">
             <i
@@ -47,7 +47,7 @@
         <el-button type="text" size="mini" @click="addDropdown">鏂板涓嬫媺妗�</el-button>
       </div>
       <div slot="footer">
-        <el-button type="primary" size="small" @click="editConfig.editVisible = false">淇濆瓨</el-button>
+        <el-button type="primary" size="small" @click="saveClick">淇濆瓨</el-button>
         <el-button size="small" @click="editConfig.editVisible = false">鍙栨秷</el-button>
       </div>
     </el-dialog>
@@ -55,6 +55,7 @@
 </template>
 
 <script>
+import { getSupplierTypeList, updateSupplierType } from "@/api/supplierManage/supplier"
 export default {
   name: "EditDropdownDialog",
   props: {
@@ -79,32 +80,31 @@
     return {
       dialogWidth: "20%",
       editConfig: this.editDropdownConfig,
-      tableData: [
-        {
-          name: "1",
-          color: "red",
-          setDefault: true
-        },
-        {
-          name: "2",
-          color: "blue",
-          setDefault: false
-        },
-        {
-          name: "3",
-          color: null,
-          setDefault: false
-        },
-        {
-          name: "4",
-          color: null,
-          setDefault: false
-        }
-      ]
+      tableData: []
     }
   },
-  created() {},
+  created() {
+    this.setList()
+  },
   methods: {
+    setList() {
+      if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") {
+        this.getSupplierTypeList()
+      }
+    },
+    // 渚涘簲鍟嗙被鍨�
+    async getSupplierTypeList() {
+      await getSupplierTypeList({
+        page: 1,
+        pageSize: 100
+      }).then((res) => {
+        console.log("dsss")
+        console.log(res.data)
+        this.tableData = res.data.data.list
+      })
+    },
+    // 鎵�灞炶涓�
+    async getIndustryList() {},
     handleClose() {
       this.editConfig.editVisible = false
     },
@@ -151,10 +151,23 @@
     // 鏂板涓嬫媺妗�
     addDropdown() {
       this.tableData.push({
-        name: "5",
-        color: null,
-        setDefault: false
+        name: "",
+        id: 0
       })
+    },
+    async saveClick() {
+      console.log(this.tableData)
+      if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") {
+        updateSupplierType({
+          supplierTypes: this.tableData
+        }).then((res) => {
+          console.log(res)
+          if (res.code === 200) {
+            this.$message.success("缂栬緫鎴愬姛")
+            this.$parent.getData()
+          }
+        })
+      }
     }
   }
 }

--
Gitblit v1.8.0