From 6291de84d5f68f1f1cd90031c18183a2c1489555 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 11 八月 2023 18:20:04 +0800
Subject: [PATCH] 销售模块 删除和查询

---
 src/views/sales/salesOpportunity/index.vue |   94 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 70 insertions(+), 24 deletions(-)

diff --git a/src/views/sales/salesOpportunity/index.vue b/src/views/sales/salesOpportunity/index.vue
index 9518def..6a1ded9 100644
--- a/src/views/sales/salesOpportunity/index.vue
+++ b/src/views/sales/salesOpportunity/index.vue
@@ -9,6 +9,8 @@
         ref="searchCommonView"
         :query-class-options="queryClassOptions"
         :search-options="searchOptions"
+        @searchClick="searchClick"
+        @resetClick="resetClick"
       />
       <div class="btn-pager">
         <PublicFunctionBtnView
@@ -16,6 +18,7 @@
           :statistics="true"
           :custom-funnel="true"
           :operates-list="operatesList"
+          @batchDelete="delClick"
         />
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
       </div>
@@ -26,13 +29,14 @@
       @selClientClick="selClientClick"
       @selContactsClick="selContactsClick"
       @selCommonClick="selCommonClick"
+      @getSelectArray="getSelectArray"
     >
       <template slot="tableButton">
         <el-table-column label="鎿嶄綔" width="120">
           <template slot-scope="scope">
             <el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
             <el-button 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>
@@ -119,7 +123,9 @@
       clientDeail: {
         visible: false,
         infomation: {}
-      }
+      },
+      search_map: {},
+      selValueList: []
     }
   },
   created() {
@@ -135,25 +141,26 @@
           { label: "瀹㈡埛鍚嶇О", prop: "client_name", min: 90, isClientClick: true }, // 瀹㈡埛鍚嶇О
           { label: "閿�鍞満浼氱紪鍙�", prop: "number" }, // 閿�鍞満浼氱紪鍙�
           { label: "鑱旂郴浜哄鍚�", prop: "contact_name", min: 100, isContactClick: true }, // 鑱旂郴浜哄鍚�
-          { label: "閿�鍞樁娈�", prop: "sale_stage_id" }, // 閿�鍞樁娈�
-          { label: "鍙兘鎬�(%)", prop: "possibilities_id" }, // 鍙兘鎬�
+          { label: "閿�鍞樁娈�", prop: "sale_stage" }, // 閿�鍞樁娈�
+          { label: "鍙兘鎬�(%)", prop: "possibilities" }, // 鍙兘鎬�
           { label: "棰勮鎴愪氦鏃ユ湡", prop: "expected_time", isTime: true, min: 130 }, // 棰勮鎴愪氦鏃ユ湡
           { label: "棰勮鍚堝悓閲戦", prop: "projected_amount" }, // 棰勮鍚堝悓閲戦
           { label: "棰勭畻缁濆鍊�", prop: "capital_budget" }, // 棰勭畻缁濆鍊�
-          { label: "閿�鍞礋璐d汉", prop: "member_id" } // 閿�鍞礋璐d汉
+          { label: "閿�鍞礋璐d汉", prop: "member_name" } // 閿�鍞礋璐d汉
         ]
       }
       this.searchOptions = []
       for (let i = 0; i < this.tableList.tableColumn.length; i++) {
         const label = this.tableList.tableColumn[i].label
-        this.searchOptions.push({ value: (i + 1).toString(), label: label })
+        const value = this.tableList.tableColumn[i].prop
+        this.searchOptions.push({ value: value, label: label })
       }
     },
     // 璇锋眰鏁版嵁
     async getData() {
       this.loading = true
       await getSaleChanceList({
-        keyword: "",
+        search_map: this.search_map,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize
       })
@@ -184,6 +191,18 @@
           this.loading = false
         })
     },
+    // 鎼滅储
+    searchClick(val, content) {
+      console.log(val, content)
+      this.search_map = {
+        [val.value]: content
+      }
+      this.getData()
+    },
+    resetClick() {
+      this.search_map = {}
+      this.getData()
+    },
     // 鏂板缓
     addBtnClick() {
       this.editConfig.visible = true
@@ -198,27 +217,54 @@
       this.editConfig.infomation = { ...row }
     },
     // 鍒犻櫎
-    delClick(id) {
-      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      })
-        .then(function () {
-          return getDelSaleChance({ id: id })
+    delClick() {
+      // this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+      //   confirmButtonText: "纭畾",
+      //   cancelButtonText: "鍙栨秷",
+      //   type: "warning"
+      // })
+      //   .then(function () {
+      //     return getDelSaleChance({ id: id })
+      //   })
+      //   .then((response) => {
+      //     if (response.code === 200) {
+      //       this.$message.success("鍒犻櫎鎴愬姛")
+      //       this.getData()
+      //     } else {
+      //       this.$message.warning("鍒犻櫎澶辫触")
+      //     }
+      //   })
+      //   .catch(function () {})
+
+      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(() => {
+            console.log("dddd")
+            getDelSaleChance({ 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
     },
     // 瀹㈡埛鍚嶇О璇︽儏
     selClientClick(row) {

--
Gitblit v1.8.0