From f90ee55e6d63cd02c2b883bd5bd942c487fce56a Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期六, 20 八月 2022 16:51:33 +0800
Subject: [PATCH] 修改bug

---
 src/views/specialWorkSystem/workFlow/approveRule/index.vue |   49 ++++++++++++++++++++++++++++++++++---------------
 1 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/src/views/specialWorkSystem/workFlow/approveRule/index.vue b/src/views/specialWorkSystem/workFlow/approveRule/index.vue
index 0893fd7..76ee2de 100644
--- a/src/views/specialWorkSystem/workFlow/approveRule/index.vue
+++ b/src/views/specialWorkSystem/workFlow/approveRule/index.vue
@@ -4,9 +4,7 @@
             <el-row class="homeCard">
                 <div class="basic-line">
                     <span>规则名称:</span>
-                    <el-select v-model="tableData.params.searchParams.ruleName" clearable filterable class="input-box" placeholder="任务类型">
-                        <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
-                    </el-select>
+                    <el-input v-model="tableData.params.searchParams.ruleName" class="input-box" placeholder="规则名称"> </el-input>
                 </div>
                 <div class="basic-line">
                     <span>部门:</span>
@@ -34,7 +32,7 @@
                     <el-row class="cardTop">
                         <el-col :span="12" class="mainCardBtn">
                             <el-button type="primary" :icon="Plus" size="default" @click="openApproveRuleDialog('新增', {})">新建</el-button>
-                            <!--                            <el-button type="danger" :icon="Delete" size="default" plain>删除</el-button>-->
+                            <el-button type="danger" :icon="Delete" size="default" @click="deleteMoreApproveRule" plain>批量删除</el-button>
                         </el-col>
                         <el-button type="primary" :icon="Refresh" size="default" />
                     </el-row>
@@ -63,7 +61,7 @@
                             <template #default="scope">
                                 <el-button link type="primary" size="small" :icon="View" @click="openApproveRuleDialog('查看', scope.row)">查看</el-button>
                                 <el-button link type="primary" size="small" :icon="Edit" @click="openApproveRuleDialog('修改', scope.row)">修改</el-button>
-                                <el-button link type="danger" size="small" :icon="Delete" @click="deleteApproveRule(scope.row)">删除</el-button>
+                                <el-button link type="primary" style="color: red" size="small" :icon="Delete" @click="deleteApproveRule(scope.row)">删除</el-button>
                             </template>
                         </el-table-column>
                     </el-table>
@@ -217,12 +215,40 @@
 
         // 删除
         const deleteApproveRule = (row: any) => {
-            ElMessageBox.confirm(`此操作将永久删除该任务:“${row.unitName}”,是否继续?`, '提示', {
+            ElMessageBox.confirm(`此操作将永久删除该审批规则,是否继续?`, '提示', {
                 confirmButtonText: '确认',
                 cancelButtonText: '取消',
                 type: 'warning'
             })
                 .then(async () => {
+                    let res = await approveRuleApi().deleteApproveRule({ ids: [row.id] });
+                    state.deleteList.ids = [];
+                    if (res.data.code === '200') {
+                        ElMessage({
+                            type: 'success',
+                            duration: 2000,
+                            message: '删除成功'
+                        });
+                        await getApproveRule();
+                    } else {
+                        ElMessage({
+                            type: 'warning',
+                            message: res.data.msg
+                        });
+                    }
+                })
+                .catch(() => {});
+        };
+
+        // 批量删除
+        const deleteMoreApproveRule = (row: any) => {
+            ElMessageBox.confirm(`此操作将永久删除这些审批规则,是否继续?`, '提示', {
+                confirmButtonText: '确认',
+                cancelButtonText: '取消',
+                type: 'warning'
+            })
+                .then(async () => {
+                    debugger;
                     let res = await approveRuleApi().deleteApproveRule(state.deleteList);
                     if (res.data.code === '200') {
                         ElMessage({
@@ -255,6 +281,7 @@
         };
 
         const handleSelectionChange = (val: Array<deleteType>) => {
+            debugger;
             state.deleteList.ids = val.map((item) => {
                 return item.ruleId;
             }) as [];
@@ -301,6 +328,7 @@
             parseNumber,
             deleteApproveRule,
             getApproveRule,
+            deleteMoreApproveRule,
             handleSelectionChange,
             onHandleSizeChange,
             onHandleCurrentChange,
@@ -437,15 +465,6 @@
         border: 2px solid #0098f5;
         color: #0098f5;
     }
-}
-.el-input {
-    width: 100% !important;
-}
-:deep(.el-date-editor) {
-    width: 100%;
-}
-.el-select {
-    width: 100%;
 }
 :deep(.el-textarea.is-disabled .el-textarea__inner) {
     background-color: var(--el-card-bg-color);

--
Gitblit v1.9.2