From acdff03246ce648082192dfb069c3a006a7fbee6 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 09 八月 2023 18:46:06 +0800
Subject: [PATCH] 客户管理模块 批量删除、推进、跟进接口联调

---
 src/views/client/followupRecords/index.vue |   61 +++++++++++++++++++-----------
 1 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/src/views/client/followupRecords/index.vue b/src/views/client/followupRecords/index.vue
index 24a3a97..a9486b0 100644
--- a/src/views/client/followupRecords/index.vue
+++ b/src/views/client/followupRecords/index.vue
@@ -11,7 +11,7 @@
         :search-options="searchOptions"
       />
       <div class="btn-pager">
-        <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" />
+        <PublicFunctionBtnView :statistics="true" :operates-list="operatesList" @batchDelete="delClick" />
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
       </div>
     </div>
@@ -22,12 +22,13 @@
       :select-box="!isDetail"
       @selContactsClick="selContactsClick"
       @selClientClick="selClientClick"
+      @getSelectArray="getSelectArray"
     >
       <template slot="tableButton">
-        <el-table-column label="鎿嶄綔" width="120" fixed="right">
+        <el-table-column label="鎿嶄綔" width="60" fixed="right">
           <template slot-scope="scope">
             <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
-            <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
+            <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
           </template>
         </el-table-column>
       </template>
@@ -101,7 +102,8 @@
       clientDeail: {
         visible: false,
         infomation: {}
-      }
+      },
+      selValueList: []
     }
   },
   created() {
@@ -181,39 +183,52 @@
       this.editConfig.infomation = { ...row, sale_chance_name: "", sales_leads_name: "" }
     },
     // 鍒犻櫎
-    delClick(id) {
-      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      })
-        .then(function () {
-          return getDeleteFollowRecord({ id: id })
+    delClick() {
+      if (this.selValueList && this.selValueList.length > 0) {
+        this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "warning"
         })
-        .then((response) => {
-          if (response.code === 200) {
-            this.$message.success("鍒犻櫎鎴愬姛")
-            this.getData()
-          } else {
-            this.$message.warning("鍒犻櫎澶辫触")
-          }
-        })
-        .catch(function () {})
+          .then(() => {
+            getDeleteFollowRecord({ 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) {
       console.log(val)
+      this.selValueList = []
+      const list = val.map((item) => {
+        return item.id
+      })
+      this.selValueList = list
     },
     // 鑱旂郴浜鸿鎯�
     selContactsClick(row) {
       console.log(row)
       this.contactsDeail.visible = true
-      this.contactsDeail.infomation = { ...row }
+      this.contactsDeail.infomation = { ...row.contact, Client: { name: row.client_name } }
     },
     // 瀹㈡埛鍚嶇О璇︽儏
     selClientClick(row) {
       console.log(row)
       this.clientDeail.visible = true
-      this.clientDeail.infomation = { ...row }
+      this.clientDeail.infomation = {
+        ...row.client,
+        client_name: row.client.name,
+        client_level: row.client.client_level.name,
+        client_status: row.client.client_status.name
+      }
     }
   }
 }

--
Gitblit v1.8.0