diff --git a/src/views/modules/communityService/commonDemand/index.vue b/src/views/modules/communityService/commonDemand/index.vue index f6b983038..16dda5dc6 100644 --- a/src/views/modules/communityService/commonDemand/index.vue +++ b/src/views/modules/communityService/commonDemand/index.vue @@ -153,7 +153,15 @@ v-loading="tableLoading" class="m-table-item" style="width: 100%" - :height="maxTableHeight"> + :height="maxTableHeight" + @selection-change="onMultiSelection"> + +
+ + 批量删除 + { + this.cancelFuwu(this.multiSelection.map(e => e.serviceRecordId)); + }).catch((err) => { + console.error(err); + this.$message.error('删除失败'); + }); + }, }, props: { diff --git a/src/views/modules/communityService/fuwuzhaoren/index.vue b/src/views/modules/communityService/fuwuzhaoren/index.vue index 96adf1b4f..e3b379fc8 100644 --- a/src/views/modules/communityService/fuwuzhaoren/index.vue +++ b/src/views/modules/communityService/fuwuzhaoren/index.vue @@ -171,7 +171,16 @@ v-loading="tableLoading" class="m-table-item" style="width: 100%" - :height="maxTableHeight"> + :height="maxTableHeight" + @select-all="onMultiSelect" + @selection-change="onMultiSelect"> + + +
+ + 批量删除 + { + let serviceRecordIds = this.multiSelectedRows.map(item => item.serviceRecordId) + this.cancelFuwu(serviceRecordIds) + }) + .catch((err) => { + if (err == "cancel") { + } + }); + } }, props: { diff --git a/src/views/modules/communityService/policy/policyList.vue b/src/views/modules/communityService/policy/policyList.vue index a5158707a..f1a36a2dc 100644 --- a/src/views/modules/communityService/policy/policyList.vue +++ b/src/views/modules/communityService/policy/policyList.vue @@ -125,7 +125,7 @@ 批量删除
@@ -377,27 +377,21 @@ export default { this.getTableData(); }, methods: { - deleteBatch () { + onDeleteBatch () { if (this.selection.length > 0) { - this.$confirm("确认删除选择的楼栋?", "提示", { + this.$confirm("删除的数据无法恢复,确认删除?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }) - .then(() => { - this.delPolicy() - }) - .catch(err => { - if (err == "cancel") { - // this.$message({ - // type: "info", - // message: "已取消删除" - // }); - } - - }); + .then(() => { + this.delPolicyBatch(this.selection.map(i => i.id)); + }) + .catch(err => { + console.error(err) + }); } else { - this.$message.warning('请先选择要删除的楼栋') + this.$message.warning('请先选择要删除的政策') } }, @@ -564,6 +558,20 @@ export default { this.$message.error("操作失败!"); } }, + + // 批量删除政策 + async delPolicyBatch(policyIds) { + const url = `/governance/policy/deletePolicyBatch`; + + const { data, code, msg } = await requestPost(url, policyIds); + + if (code === 0) { + this.$message.success("删除成功!"); + this.getTableData(); + } else { + this.$message.error("操作失败!"); + } + }, //写好的批量删除直接用 // async delPolicy() { // if (this.selection.length === 0)