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/salesDetails/index.vue | 67 +++++++++++++++++++++++---------- 1 files changed, 46 insertions(+), 21 deletions(-) diff --git a/src/views/sales/salesDetails/index.vue b/src/views/sales/salesDetails/index.vue index b318dad..61f25db 100644 --- a/src/views/sales/salesDetails/index.vue +++ b/src/views/sales/salesDetails/index.vue @@ -9,9 +9,11 @@ ref="searchCommonView" :query-class-options="queryClassOptions" :search-options="searchOptions" + @searchClick="searchClick" + @resetClick="resetClick" /> <div class="btn-pager"> - <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" /> + <PublicFunctionBtnView :submit-approval="true" :operates-list="operatesList" @batchDelete="delClick" /> <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> </div> </div> @@ -22,12 +24,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> @@ -113,7 +116,9 @@ clientDeail: { visible: false, infomation: {} - } + }, + selValueList: [], + search_map: {} } }, created() { @@ -152,7 +157,7 @@ async getData() { this.loading = true await getSalesDetailsList({ - keyword: "", + search_map: this.search_map, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize }) @@ -182,6 +187,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 @@ -196,27 +213,35 @@ this.editConfig.infomation = { ...row, sale_chance_name: "" } }, // 鍒犻櫎 - delClick(id) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(function () { - return getDelSalesDetails({ 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(() => { + getDelSalesDetails({ 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