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/salesReturn/index.vue |   72 +++++++++++++++++++++++++----------
 1 files changed, 51 insertions(+), 21 deletions(-)

diff --git a/src/views/sales/salesReturn/index.vue b/src/views/sales/salesReturn/index.vue
index 32c0634..9654087 100644
--- a/src/views/sales/salesReturn/index.vue
+++ b/src/views/sales/salesReturn/index.vue
@@ -9,9 +9,16 @@
         ref="searchCommonView"
         :query-class-options="queryClassOptions"
         :search-options="searchOptions"
+        @searchClick="searchClick"
+        @resetClick="resetClick"
       />
       <div class="btn-pager">
-        <PublicFunctionBtnView :receive="false" :import-button="false" receive:operates-list="operatesList" />
+        <PublicFunctionBtnView
+          :receive="false"
+          :import-button="false"
+          receive:operates-list="operatesList"
+          @batchDelete="delClick"
+        />
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
       </div>
     </div>
@@ -21,12 +28,13 @@
       :select-box="!isDetail"
       @selClientClick="selClientClick"
       @selCommonClick="selCommonClick"
+      @getSelectArray="getSelectArray"
     >
       <template slot="tableButton">
         <el-table-column label="鎿嶄綔" width="90">
           <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>
@@ -98,7 +106,9 @@
       clientDeail: {
         visible: false,
         infomation: {}
-      }
+      },
+      selValueList: [],
+      search_map: {}
     }
   },
   created() {
@@ -131,7 +141,7 @@
     async getData() {
       this.loading = true
       await getSalesReturnList({
-        keyword: "",
+        search_map: this.search_map,
         page: this.pagerOptions.currPage,
         pageSize: this.pagerOptions.pageSize
       })
@@ -160,6 +170,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
@@ -174,27 +196,35 @@
       this.editConfig.infomation = { ...row }
     },
     // 鍒犻櫎
-    delClick(id) {
-      this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        type: "warning"
-      })
-        .then(function () {
-          return getDelSalesReturn({ 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(() => {
+            getDelSalesReturn({ 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