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/productManage/product/index.vue |   93 +++++++++++++++++-----------------------------
 1 files changed, 34 insertions(+), 59 deletions(-)

diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue
index 6485e3e..d797006 100644
--- a/src/views/productManage/product/index.vue
+++ b/src/views/productManage/product/index.vue
@@ -13,12 +13,7 @@
         </div>
       </div>
       <template>
-        <TableCommonView
-          ref="tableListRef"
-          :table-list="tableList"
-          @selCommonClick="selCommonClick"
-          @getSelectArray="getSelectArray"
-        >
+        <TableCommonView ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick">
           <template slot="tableButton">
             <el-table-column label="鎿嶄綔" width="120">
               <template slot-scope="scope">
@@ -42,7 +37,7 @@
 
 <script>
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
-import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead"
+import { getProductList, deleteProduct } from "@/api/productManage/product"
 import DetailProduct from "@/views/productManage/product/DetailProduct"
 import AddProduct from "@/views/productManage/product/AddProduct"
 
@@ -55,7 +50,6 @@
   data() {
     return {
       tableList: {},
-      selValueList: [],
       searchOptions: [],
       commonDetail: {
         visible: false,
@@ -66,8 +60,7 @@
         visible: false,
         title: "鏂板缓",
         infomation: {}
-      },
-      search_map: {}
+      }
     }
   },
   created() {
@@ -83,10 +76,10 @@
           { label: "浜у搧缂栫爜", prop: "number", min: 190, isCommonClick: true },
           { label: "浜у搧鍚嶇О", prop: "name", min: 130 },
           { label: "渚涘簲鍟�", prop: "id", min: 130 },
-          { label: "浜у搧绫诲埆", prop: "contact_phone", min: 130 },
+          { label: "浜у搧绫诲埆", prop: "productType", min: 130 },
           { label: "瑙勬牸", prop: "sales_resources", min: 130 },
           { label: "鍨嬪彿", prop: "province", min: 130 },
-          { label: "鍗曚綅", prop: "sales_sources_id", min: 60 },
+          { label: "鍗曚綅", prop: "unit", min: 60 },
           { label: "浠锋牸", prop: "contact_phone1", min: 130 },
           { label: "鏈�浣庡簱瀛�", prop: "desc", min: 80 },
           { label: "鏈�楂樺簱瀛�", prop: "member_name", min: 80 }
@@ -100,37 +93,30 @@
       }
     },
     // 璇锋眰鏁版嵁
-    async getData() {
-      await getSalesLeadsList({
-        search_map: this.search_map,
+    async getData(val, content) {
+      await getProductList({
+        val,
+        content,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize
-      })
-        .then((res) => {
-          const list = res.data.list.map((item) => {
+      }).then((res) => {
+        if (res.data.code === 200) {
+          const list = res.data.data.list.map((item) => {
             return {
-              ...item,
-              sales_resources: item.sales_sources.name,
-              member_name: item.member.username
+              ...item
             }
           })
           this.tableList.tableInfomation = list || []
-          this.pagerOptions.totalCount = res.data.count
-        })
-        .catch((err) => {
-          console.log(err)
-        })
+          this.pagerOptions.totalCount = res.data.data.total
+        }
+      })
     },
     // 鎼滅储
     searchClick(val, content) {
       console.log(val, content)
-      this.search_map = {
-        [val.value]: content
-      }
-      this.getData()
+      this.getData(val, content)
     },
     resetClick() {
-      this.search_map = {}
       this.getData()
     },
     // 鏂板缓
@@ -143,37 +129,26 @@
       console.log(row)
       this.editConfig.visible = true
       this.editConfig.title = "缂栬緫"
+      this.editConfig.infomation = { ...row }
     },
     // 鍒犻櫎
-    delClick() {
-      if (this.selValueList && this.selValueList.length > 0) {
-        this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
-          confirmButtonText: "纭畾",
-          cancelButtonText: "鍙栨秷",
-          type: "warning"
-        })
-          .then(() => {
-            console.log("dddd")
-            getDeleteSalesLeads({ ids: this.selValueList }).then((response) => {
-              if (response.code === 200) {
-                this.$message.success("鍒犻櫎鎴愬姛")
-                this.getData()
-              } else {
-                this.$message.warning("鍒犻櫎澶辫触")
-              }
-            })
-          })
-          .catch(() => {})
-      } else {
-        this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
-      }
-    },
-    getSelectArray(val) {
-      this.selValueList = []
-      const list = val.map((item) => {
-        return item.id
+    delClick(val) {
+      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
       })
-      this.selValueList = list
+        .then(() => {
+          deleteProduct({ id: val }).then((response) => {
+            if (response.code === 200) {
+              this.$message.success("鍒犻櫎鎴愬姛")
+              this.getData()
+            } else {
+              this.$message.warning("鍒犻櫎澶辫触")
+            }
+          })
+        })
+        .catch(() => {})
     },
     // 璇︽儏
     selCommonClick(row) {

--
Gitblit v1.8.0