From b136c0a80500d929897a8e24f920efad47e2e307 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 01 十一月 2023 19:03:01 +0800
Subject: [PATCH] 变更公海 的接口传参修改
---
src/views/sales/generatePlan/index.vue | 73 +++++++++++++++++++++++++-----------
1 files changed, 51 insertions(+), 22 deletions(-)
diff --git a/src/views/sales/generatePlan/index.vue b/src/views/sales/generatePlan/index.vue
index bf56574..f6ae8f7 100644
--- a/src/views/sales/generatePlan/index.vue
+++ b/src/views/sales/generatePlan/index.vue
@@ -5,18 +5,25 @@
ref="searchCommonView"
:query-class-options="queryClassOptions"
:search-options="searchOptions"
+ @searchClick="searchClick"
+ @resetClick="resetClick"
/>
<div class="btn-pager">
- <PublicFunctionBtnView :operates-list="operatesList" />
+ <PublicFunctionBtnView :operates-list="operatesList" @batchDelete="delClick" />
<PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
</div>
</div>
- <TableCommonView ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick">
+ <TableCommonView
+ ref="tableListRef"
+ :table-list="tableList"
+ @selCommonClick="selCommonClick"
+ @getSelectArray="getSelectArray"
+ >
<template slot="tableButton">
<el-table-column label="鎿嶄綔" width="100">
<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>
@@ -77,7 +84,9 @@
planDetail: {
visible: false,
infomation: {}
- }
+ },
+ selValueList: [],
+ search_map: {}
}
},
created() {
@@ -106,7 +115,7 @@
async getData() {
this.loading = true
await getPlanList({
- keyword: "",
+ search_map: this.search_map,
page: this.pagerOptions.currPage,
pageSize: this.pagerOptions.pageSize
})
@@ -135,6 +144,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
@@ -149,27 +170,35 @@
this.editConfig.infomation = { ...row }
},
// 鍒犻櫎
- delClick(id) {
- this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- })
- .then(function () {
- return getDelPlan({ 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(() => {
+ getDelPlan({ 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
},
// 鍚堝悓绠$悊璇︽儏
selCommonClick(row) {
--
Gitblit v1.8.0