From 8e2ed696fcac962263ac7ea56bad9506728de8e0 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: Thu, 25 Aug 2022 09:53:38 +0800
Subject: [PATCH] 删除
---
src/views/specialWorkSystem/foundationSet/safetyAction/index.vue | 32 ++++++++++++++++++++++++++++++--
1 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/src/views/specialWorkSystem/foundationSet/safetyAction/index.vue b/src/views/specialWorkSystem/foundationSet/safetyAction/index.vue
index f51701b..2f51399 100644
--- a/src/views/specialWorkSystem/foundationSet/safetyAction/index.vue
+++ b/src/views/specialWorkSystem/foundationSet/safetyAction/index.vue
@@ -28,7 +28,7 @@
<el-row class="cardTop">
<el-col :span="12" class="mainCardBtn">
<el-button type="primary" :icon="Plus" size="default" @click="openSafetyActionDialog('新增', {})">新建</el-button>
- <!-- <el-button type="danger" :icon="Delete" size="default" plain>删除</el-button>-->
+ <el-button type="danger" :icon="Delete" size="default" @click="deleteMoreSafetyAction" plain>批量删除</el-button>
</el-col>
<el-button type="primary" :icon="Refresh" size="default" />
</el-row>
@@ -192,7 +192,7 @@
// };
// 删除
- const deleteSafetyAction = (row: any) => {
+ const deleteMoreSafetyAction = () => {
ElMessageBox.confirm(`此操作将永久删除该措施,是否继续?`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
@@ -201,6 +201,33 @@
.then(async () => {
let res = await safetyActionApi().deleteSafetyAction(state.deleteList);
if (res.data.code === '200') {
+ ElMessage({
+ type: 'success',
+ duration: 2000,
+ message: '删除成功'
+ });
+ await initSafetyAction();
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
+ })
+ .catch(() => {});
+ };
+
+ // 删除
+ const deleteSafetyAction = (row: any) => {
+ ElMessageBox.confirm(`此操作将永久删除该措施,是否继续?`, '提示', {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(async () => {
+ let res = await safetyActionApi().deleteSafetyAction({ ids: [row.id] });
+ if (res.data.code === '200') {
+ state.deleteList.ids = [];
ElMessage({
type: 'success',
duration: 2000,
@@ -275,6 +302,7 @@
parseNumber,
handleSelectionChange,
deleteSafetyAction,
+ deleteMoreSafetyAction,
initSafetyAction,
onHandleSizeChange,
onHandleCurrentChange,
--
Gitblit v1.9.2