浏览代码

计划数据是否存在 已完成任务 改为点击单条数据时 再查询

zhulu 1 年之前
父节点
当前提交
8fcb5b38bf
共有 1 个文件被更改,包括 33 次插入32 次删除
  1. 33 32
      src/views/core/accessPlan/index.vue

+ 33 - 32
src/views/core/accessPlan/index.vue

@@ -994,41 +994,42 @@ export default {
         });
     },
     handWithdraw(row) {
-      if (row.isComplete) {
-
-        this.$modal
-        .confirm("因不存在已完成任务,撤回后将删除所有生成任务")
-        .then(function () {
-          return withdraw(row.id);
-        })
-        .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("撤回成功");
-        })
-        .catch(() => {});
-      }else{
-        if (row.planCycle==0) {
-           this.$modal
-         .confirm("存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击“删除”。")
-         .then(() => {
-          this.getList();
+      getPlan(row.id).then((response) => {
+        console.log("handWithdraw",response)
+          if (response.data.isComplete) {
+            if (row.planCycle==0) {
+            this.$modal
+          .confirm("存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击“删除”。")
+          .then(() => {
+            this.getList();
 
-        })
+          })
+          }else{
+            this.$modal
+          .confirm("因存在已完成任务,撤回后下周期起将不再生成任务")
+          .then(function () {
+            return withdraw(row.id);
+          })
+          .then(() => {
+            this.getList();
+            this.$modal.msgSuccess("撤回成功");
+          })
+          .catch(() => {});
+          }
+         
         }else{
-          this.$modal
-        .confirm("因存在已完成任务,撤回后下周期起将不再生成任务")
-        .then(function () {
-          return withdraw(row.id);
-        })
-        .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("撤回成功");
-        })
-        .catch(() => {});
+         
+          this.$modal.confirm("因不存在已完成任务,撤回后将删除所有生成任务")
+            .then(function () {
+              return withdraw(row.id);
+            })
+            .then(() => {
+              this.getList();
+              this.$modal.msgSuccess("撤回成功");
+            })
+            .catch(() => {});
         }
-
-      }
-
+      });
     },
     /** 导出按钮操作 */
     handleExport() {