Просмотр исходного кода

修改删除巡查任务提示状态

yangqishu 3 месяцев назад
Родитель
Сommit
9a503003fe
1 измененных файлов с 13 добавлено и 9 удалено
  1. 13 9
      src/views/safety-inspection/right.vue

+ 13 - 9
src/views/safety-inspection/right.vue

@@ -239,16 +239,20 @@ export default {
       this.getSecurityPatrolList()
     },
     handleDelete(row) {
-      confirm().then(() => {
-        deleteSecurityPatrol(row.id).then((res) => {
-          if (res.data) {
-            this.$message({ message: '删除成功', type: 'success' })
-            this.getSecurityPatrolList()
-          } else {
-            this.$message({ message: '删除失败', type: 'error' })
-          }
+      confirm()
+        .then(() => {
+          deleteSecurityPatrol(row.id).then((res) => {
+            if (res.code === 200) {
+              this.$message({ message: '删除成功', type: 'success' })
+              this.getSecurityPatrolList()
+            } else if (res.code === 500) {
+              this.$message({ message: '任务已执行!', type: 'warning' })
+            } else {
+              this.$message({ message: '删除失败', type: 'error' })
+            }
+          })
         })
-      }).catch(() => {})
+        .catch(() => {})
     }
   },
   destroyed() {