Преглед изворни кода

流程按钮更改是否过审状态

cyy пре 1 година
родитељ
комит
952d51bd40
1 измењених фајлова са 498 додато и 345 уклоњено
  1. 498 345
      src/business/platform/bpmn/form/action.js

+ 498 - 345
src/business/platform/bpmn/form/action.js

@@ -1,118 +1,190 @@
-import { doEndProcess, doAddSignTask, lock, unlock, suspendProcess, recoverProcess } from '@/api/platform/bpmn/bpmTask'
-import { agree, oppose, abandon, reject, rejectToStarter, rejectToPrevious, bpmTaskSave } from '@/api/platform/bpmn/bpmTask'
-import { startFlow, saveDraft } from '@/api/platform/bpmn/bpmInst'
+import {
+  doEndProcess,
+  doAddSignTask,
+  lock,
+  unlock,
+  suspendProcess,
+  recoverProcess
+} from "@/api/platform/bpmn/bpmTask";
+import {
+  agree,
+  oppose,
+  abandon,
+  reject,
+  rejectToStarter,
+  rejectToPrevious,
+  bpmTaskSave
+} from "@/api/platform/bpmn/bpmTask";
+import { startFlow, saveDraft } from "@/api/platform/bpmn/bpmInst";
 export default {
   methods: {
     // 内嵌url表单,外部url表单 【自定义】
     emitButtonEventHandler(actionName, args) {
       // 前置事件
-      this.beforeScript(actionName, (result) => {
+      this.beforeScript(actionName, result => {
         if (result) {
-          return this.emitEventHandler(actionName, args)
+          return this.emitEventHandler(actionName, args);
         }
-      })
+      });
+    },
+    // 设置是否过审的状态
+    setData(title) {
+      let data = title;
+      if (!title) {
+        // 获取当前流程步骤名
+        data = "已" + this.getFormEL().formDefData.flowName;
+      }
+      this.getFormEL().setData("shiFouGuoShen", data);
     },
     emitEventHandler(actionName, args) {
-      this.actionName = actionName
-      const buttonType = args && args.attributes ? args.attributes.button_type || actionName : actionName
-      this.actionTitle = args && args.attributes ? args.attributes.label : null
-      this.submitFormOpinion = this.getFormOpinionData()
+      this.actionName = actionName;
+      const buttonType =
+        args && args.attributes
+          ? args.attributes.button_type || actionName
+          : actionName;
+      this.actionTitle = args && args.attributes ? args.attributes.label : null;
+      this.submitFormOpinion = this.getFormOpinionData();
       switch (buttonType) {
-        case 'close': // 关闭窗口
-          this.closeDialog()
-          break
-        case 'flowImage':// 流程图
-          this.flowDiagramVisible = true
-          break
-        case 'approvalHistory': // 审批历史
-          this.approvalHistoryVisible = true
-          break
-        case 'instanceDetail': // 流程实例明细
-          this.instanceDetailVisible = true
-          break
-        case 'startFlow': // 启动流程
-          this.handleStartFlow()
-          break
-        case 'saveDraft': // 保存草稿
-          this.handleSaveDraft()
-          break
-        case 'agree': // 同意
-        case 'oppose':// 反对
-        case 'abandon':// 弃权
-          if (this.isHide()) {
-            this.handleDirectActionEvent(actionName)
-          } else {
-            this.agreeDialogVisible = true
-          }
-          break
-        case 'rejectToPrevious':// 驳回上一步
-        case 'rejectToStart':// 驳回发起人
-        case 'reject':// 驳回
-          if (this.isBpmOpinionHide && actionName === 'rejectToPrevious') {
-            this.handleDirectActionEvent(actionName)
+        case "agree": // 同意
+          this.setData();
+          this.handleDirectActionEvent(actionName);
+          break;
+        case "oppose": // 反对
+          this.$dialog
+            .alert({
+              message: `确定进行 [ ${args.attributes.label} ] 操作 ?`,
+              title: "提示"
+            })
+            .then(() => {
+              this.setData("未同意");
+              this.handleDirectActionEvent(actionName);
+            })
+            .catch(() => {
+              // on cancel
+            });
+          break;
+        case "abandon": // 弃权
+          this.$dialog
+            .alert({
+              message: `确定进行 [ 弃权 ] 操作 ?`,
+              title: "提示"
+            })
+            .then(() => {
+              if (this.isHide()) {
+                this.handleDirectActionEvent(actionName);
+              } else {
+                this.agreeDialogVisible = true;
+              }
+            })
+            .catch(() => {
+              // on cancel
+            });
+
+          break;
+        case "close": // 关闭窗口
+          this.closeDialog();
+          break;
+        case "flowImage": // 流程图
+          this.flowDiagramVisible = true;
+          break;
+        case "approvalHistory": // 审批历史
+          this.approvalHistoryVisible = true;
+          break;
+        case "instanceDetail": // 流程实例明细
+          this.instanceDetailVisible = true;
+          break;
+        case "startFlow": // 启动流程
+          if (
+            this.actionTitle === "同意并结束" ||
+            this.actionTitle === "提交并结束"
+          ) {
+            this.setData("已完成");
           } else {
-            this.rejectDialogVisible = true
+            this.setData("已编制");
           }
-          break
-        case 'delegate':// 转办
-          this.delegateReadonly = false
-          this.delegateDialogVisible = true
-          break
-        case 'delegateDetail':// 转办/代理明细
-          this.delegateReadonly = true
-          this.delegateDialogVisible = true
-          break
-        case 'addSign':// 加签
-          this.addSignTaskDialogVisible = true
-          break
-        case 'endProcess':// 终止流程
-          this.handleEndProcess()
-          break
-        case 'print':// 打印
-          this.handlePrint()
-          break
-        case 'lock':// 锁定
-          this.handleLock()
-          break
-        case 'unlock':// 解锁
-          this.handleUnlock()
-          break
-        case 'forceUnlock':// 强制解锁
-          this.handleForceUnlock()
-          break
-        case 'suspendProcess':// 挂起流程
-          this.handleSuspendProcess()
-          break
-        case 'recoverProcess':// 撤回流程
-          this.handleRecoverProcess()
-          break
-        case 'save':// 节点按钮设置-保存
-          this.handleSave()
-          break
+          this.handleStartFlow();
+          break;
+        case "saveDraft": // 保存草稿
+          this.setData("已暂存");
+          this.handleSaveDraft();
+          break;
+
+        case "rejectToPrevious": // 驳回上一步
+        case "rejectToStart": // 驳回发起人
+        case "reject": // 驳回
+          this.setData("已退回");
+          this.rejectDialogVisible = true;
+          // if (this.isBpmOpinionHide && actionName === "rejectToPrevious") {
+          //   this.handleDirectActionEvent(actionName);
+          // } else {
+          //   this.rejectDialogVisible = true;
+          // }
+          break;
+        case "delegate": // 转办
+          this.delegateReadonly = false;
+          this.delegateDialogVisible = true;
+          break;
+        case "delegateDetail": // 转办/代理明细
+          this.setData();
+          this.delegateReadonly = true;
+          this.delegateDialogVisible = true;
+          break;
+        case "addSign": // 加签
+          this.addSignTaskDialogVisible = true;
+          break;
+        case "endProcess": // 终止流程
+          this.setData("已终止");
+          this.handleEndProcess();
+          break;
+        case "print": // 打印
+          this.handlePrint();
+          break;
+        case "lock": // 锁定
+          this.handleLock();
+          break;
+        case "unlock": // 解锁
+          this.handleUnlock();
+          break;
+        case "forceUnlock": // 强制解锁
+          this.handleForceUnlock();
+          break;
+        case "suspendProcess": // 挂起流程
+          this.handleSuspendProcess();
+          break;
+        case "recoverProcess": // 撤回流程
+          this.handleRecoverProcess();
+          break;
+        case "save": // 节点按钮设置-保存
+          this.handleSave();
+          break;
         default:
-          break
+          break;
       }
     },
     /**
      * 是否隐藏
      */
     isHide() {
-      return (this.isBpmOpinionHide && this.attributes.isHidePath) ||
-      (this.attributes.isCommonJumpType && this.attributes.isHideOpinion && this.attributes.isHidePath) ||
-      (this.attributes.isEnd && this.attributes.isHideOpinion)
+      return (
+        (this.isBpmOpinionHide && this.attributes.isHidePath) ||
+        (this.attributes.isCommonJumpType &&
+          this.attributes.isHideOpinion &&
+          this.attributes.isHidePath) ||
+        (this.attributes.isEnd && this.attributes.isHideOpinion)
+      );
     },
     /**
      * 处理启动流程
      */
     handleStartFlow() {
-      const firstNodeUserAssign = this.attributes.firstNodeUserAssign || false
+      const firstNodeUserAssign = this.attributes.firstNodeUserAssign || false;
       if (firstNodeUserAssign) {
-        const formData = this.getFormData()
-        if (!formData) return
-        this.submitFormData = formData
-        this.startFlowDialogVisible = true
+        const formData = this.getFormData();
+        if (!formData) return;
+        this.submitFormData = formData;
+        this.startFlowDialogVisible = true;
       } else {
-        this.saveStartFlow()
+        this.saveStartFlow();
       }
     },
     /**
@@ -120,87 +192,96 @@ export default {
      * @param {*}
      */
     saveStartFlow(params = {}) {
-      const formData = this.getFormData()
-      if (!formData) return
+      const formData = this.getFormData();
+      if (!formData) return;
       const jsonData = {
         defId: this.defId,
-        version: this.version || '0',
+        version: this.version || "0",
         data: JSON.stringify(formData)
-      }
+      };
       if (this.$utils.isNotEmpty(params.nodeUsers)) {
-        jsonData.nodeUsers = params.nodeUsers || ''
+        jsonData.nodeUsers = params.nodeUsers || "";
       }
       if (this.$utils.isNotEmpty(params.destination)) {
-        jsonData.destination = params.destination || ''
+        jsonData.destination = params.destination || "";
       }
       if (this.$utils.isNotEmpty(this.proInstId) && !this.copyFlow) {
-        jsonData.proInstId = this.proInstId || ''
+        jsonData.proInstId = this.proInstId || "";
       }
 
       // 1、直接启动
-      startFlow(jsonData).then(response => {
-        this.$notify({
-          type: 'success',
-          message: '启动流程成功!'
-        })
-        this.$store.dispatch('ibps/app/setDataChange', false)
+      startFlow(jsonData)
+        .then(response => {
+          this.$notify({
+            type: "success",
+            message: "启动流程成功!"
+          });
+          this.$store.dispatch("ibps/app/setDataChange", false);
 
-        // 后置事件
-        this.afterScript(this.actionName, {
-          data: response.data,
-          variables: response.variables
-        }, () => {
-          // 回调上个页面
-          this.callbackPage()
+          // 后置事件
+          this.afterScript(
+            this.actionName,
+            {
+              data: response.data,
+              variables: response.variables
+            },
+            () => {
+              // 回调上个页面
+              this.callbackPage();
+            }
+          );
         })
-      }).catch(() => {
-
-      })
+        .catch(() => {});
     },
     /**
      * 保存草稿
      */
     handleSaveDraft() {
       // 表单数据
-      const formData = this.getFormData()
-      if (!formData) return
+      const formData = this.getFormData();
+      if (!formData) return;
       const jsonData = {
         defId: this.defId,
-        version: this.version || '',
+        version: this.version || "",
         data: JSON.stringify(formData)
-      }
+      };
 
       if (this.$utils.isNotEmpty(this.proInstId) && !this.copyFlow) {
-        jsonData.proInstId = this.proInstId || ''
+        jsonData.proInstId = this.proInstId || "";
       }
 
-      saveDraft(jsonData).then(response => {
-        this.$store.dispatch('ibps/app/setDataChange', false)
-        this.$notify({
-          type: 'success',
-          message: '保存成功!'
-        })
+      saveDraft(jsonData)
+        .then(response => {
+          this.$store.dispatch("ibps/app/setDataChange", false);
+          this.$notify({
+            type: "success",
+            message: "保存成功!"
+          });
 
-        // 后置事件
-        this.afterScript(this.actionName, {
-          data: response.data,
-          variables: response.variables
-        }, () => {
-          // 回调上个页面
-          this.callbackPage()
+          // 后置事件
+          this.afterScript(
+            this.actionName,
+            {
+              data: response.data,
+              variables: response.variables
+            },
+            () => {
+              // 回调上个页面
+              this.callbackPage();
+            }
+          );
         })
-      }).catch(() => {
-      })
+        .catch(() => {});
     },
     /**
      * 直接同意流程
      * @param {*} actionName
      */
     handleDirectActionEvent(actionName) {
-      const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
+      const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : "";
       this.handleActionEvent(actionName, {
         opinion: opinion
-      })
+      });
     },
     /**
      * 处理按钮事件
@@ -208,93 +289,107 @@ export default {
      * @param {*} params
      */
     handleActionEvent(actionName, params) {
-      if (actionName === 'agree' ||
-       actionName === 'oppose' ||
-       actionName === 'abandon' ||
-       actionName === 'rejectToPrevious' ||
-       actionName === 'rejectToStart' ||
-       actionName === 'reject'
+      if (
+        actionName === "agree" ||
+        actionName === "oppose" ||
+        actionName === "abandon" ||
+        actionName === "rejectToPrevious" ||
+        actionName === "rejectToStart" ||
+        actionName === "reject"
       ) {
-        this.handleComplete(actionName, params)
-      } else if (actionName === 'endProcess') {
-        this.handleDoEndProcess(params)
-      } else if (actionName === 'addSign') {
-        this.handleAddSignTask(params)
+        this.handleComplete(actionName, params);
+      } else if (actionName === "endProcess") {
+        this.handleDoEndProcess(params);
+      } else if (actionName === "addSign") {
+        this.handleAddSignTask(params);
       }
     },
     handleComplete(actionName, params = {}) {
-      const formData = this.getFormData()
-      if (!formData) return
+      const formData = this.getFormData();
+      if (!formData) return;
       // params.actionName = actionName
-      params.taskId = this.taskId
-      params.data = JSON.stringify(formData)
+      params.taskId = this.taskId;
+      params.data = JSON.stringify(formData);
 
-      if (actionName === 'agree') {
-        agree(params).then(response => {
-          this.handleResponse(actionName, response)
-        }).catch(() => {
-        })
-      } else if (actionName === 'oppose') {
-        oppose(params).then(response => {
-          this.handleResponse(actionName, response)
-        }).catch(() => {
-
-        })
-      } else if (actionName === 'abandon') {
-        abandon(params).then(response => {
-          this.handleResponse(actionName, response)
-        }).catch(() => {
-
-        })
-      } else if (actionName === 'rejectToPrevious') {
-        rejectToPrevious(params).then(response => {
-          this.handleResponse(actionName, response)
-        }).catch(() => {
-
-        })
-      } else if (actionName === 'rejectToStart') {
-        rejectToStarter(params).then(response => {
-          this.handleResponse(actionName, response)
-        }).catch(() => {
-
-        })
-      } else if (actionName === 'reject') {
-        reject(params).then(response => {
-          this.handleResponse(actionName, response)
-        }).catch(() => {
-
-        })
+      if (actionName === "agree") {
+        agree(params)
+          .then(response => {
+            this.handleResponse(actionName, response);
+          })
+          .catch(() => {});
+      } else if (actionName === "oppose") {
+        oppose(params)
+          .then(response => {
+            this.handleResponse(actionName, response);
+          })
+          .catch(() => {});
+      } else if (actionName === "abandon") {
+        abandon(params)
+          .then(response => {
+            this.handleResponse(actionName, response);
+          })
+          .catch(() => {});
+      } else if (actionName === "rejectToPrevious") {
+        rejectToPrevious(params)
+          .then(response => {
+            this.handleResponse(actionName, response);
+          })
+          .catch(() => {});
+      } else if (actionName === "rejectToStart") {
+        rejectToStarter(params)
+          .then(response => {
+            this.handleResponse(actionName, response);
+          })
+          .catch(() => {});
+      } else if (actionName === "reject") {
+        reject(params)
+          .then(response => {
+            this.handleResponse(actionName, response);
+          })
+          .catch(() => {});
       }
     },
     handleResponse(actionName, response) {
-      this.$store.dispatch('ibps/app/setDataChange', false)
+      this.$store.dispatch("ibps/app/setDataChange", false);
       this.$notify({
-        type: 'success',
+        type: "success",
         message: response.message
-      })
+      });
       // 关闭窗口
-      if (actionName === 'agree' || actionName === 'oppose' || actionName === 'abandon') {
-        this.agreeDialogVisible = false
-      } else if (actionName === 'rejectToPrevious' || actionName === 'rejectToStart' || actionName === 'reject') {
-        this.rejectDialogVisible = false
+      if (
+        actionName === "agree" ||
+        actionName === "oppose" ||
+        actionName === "abandon"
+      ) {
+        this.agreeDialogVisible = false;
+      } else if (
+        actionName === "rejectToPrevious" ||
+        actionName === "rejectToStart" ||
+        actionName === "reject"
+      ) {
+        this.rejectDialogVisible = false;
       }
       // 后置事件
-      this.afterScript(this.actionName, {
-        data: response.data,
-        variables: response.variables
-      }, () => {
-        // 回调上个页面
-        this.callbackPage()
-      })
+      this.afterScript(
+        this.actionName,
+        {
+          data: response.data,
+          variables: response.variables
+        },
+        () => {
+          // 回调上个页面
+          this.callbackPage();
+        }
+      );
     },
     handleEndProcess() {
       if (this.isBpmOpinionHide) {
-        const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
+        const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : "";
         this.handleDoEndProcess({
           opinion: opinion
-        })
+        });
       } else {
-        this.approveDialogVisible = true
+        this.approveDialogVisible = true;
       }
     },
     /**
@@ -305,22 +400,28 @@ export default {
       doEndProcess({
         taskId: this.taskId ? this.taskId : this.endProcessTaskId,
         endReason: params.opinion
-      }).then(response => {
-        this.$store.dispatch('ibps/app/setDataChange', false)
-        this.$notify({
-          type: 'success',
-          message: '终止流程成功!'
-        })
-        this.afterScript(this.actionName, {
-          data: response.data,
-          variables: response.variables
-        }, () => {
-          // 回调上个页面
-          this.callbackPage()
-        })
-      }).catch((err) => {
-        console.error(err)
       })
+        .then(response => {
+          this.$store.dispatch("ibps/app/setDataChange", false);
+          this.$notify({
+            type: "success",
+            message: "终止流程成功!"
+          });
+          this.afterScript(
+            this.actionName,
+            {
+              data: response.data,
+              variables: response.variables
+            },
+            () => {
+              // 回调上个页面
+              this.callbackPage();
+            }
+          );
+        })
+        .catch(err => {
+          console.error(err);
+        });
     },
     /**
      * 补签
@@ -332,22 +433,28 @@ export default {
         addSignTaskUserId: params.addSignTaskUserId,
         messageType: params.messageType,
         addReason: params.opinion
-      }).then(response => {
-        this.$notify({
-          type: 'success',
-          message: '补签成功!'
-        })
-        // 后置事件
-        this.afterScript(this.actionName, {
-          data: response.data,
-          variables: response.variables
-        }, () => {
-          // 回调上个页面
-          this.callbackPage()
-        })
-      }).catch((err) => {
-        console.error(err)
       })
+        .then(response => {
+          this.$notify({
+            type: "success",
+            message: "补签成功!"
+          });
+          // 后置事件
+          this.afterScript(
+            this.actionName,
+            {
+              data: response.data,
+              variables: response.variables
+            },
+            () => {
+              // 回调上个页面
+              this.callbackPage();
+            }
+          );
+        })
+        .catch(err => {
+          console.error(err);
+        });
     },
     /**
      * 打印
@@ -370,152 +477,198 @@ export default {
      * 锁定任务
      */
     handleLock() {
-      this.$dialog.confirm({
-        message: '确定锁定任务!'
-      }).then(() => {
-        lock({ taskId: this.taskId }).then(response => {
-          this.$notify({
-            type: 'success',
-            message: '锁定任务成功!'
-          })
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        }).catch(() => {
+      this.$dialog
+        .confirm({
+          message: "确定锁定任务!"
         })
-      }).catch(() => {})
+        .then(() => {
+          lock({ taskId: this.taskId })
+            .then(response => {
+              this.$notify({
+                type: "success",
+                message: "锁定任务成功!"
+              });
+              // 后置事件
+              this.afterScript(
+                this.actionName,
+                {
+                  data: response.data,
+                  variables: response.variables
+                },
+                () => {
+                  // 回调上个页面
+                  this.callbackPage();
+                }
+              );
+            })
+            .catch(() => {});
+        })
+        .catch(() => {});
     },
     /**
      * 解锁任务
      */
     handleUnlock() {
-      this.$dialog.confirm({
-        message: '确定解锁任务'
-      }).then(() => {
-        unlock({ taskId: this.taskId }).then(response => {
-          this.$notify({
-            type: 'success',
-            message: '解锁任务成功!'
-          })
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        }).catch(() => {
+      this.$dialog
+        .confirm({
+          message: "确定解锁任务"
+        })
+        .then(() => {
+          unlock({ taskId: this.taskId })
+            .then(response => {
+              this.$notify({
+                type: "success",
+                message: "解锁任务成功!"
+              });
+              // 后置事件
+              this.afterScript(
+                this.actionName,
+                {
+                  data: response.data,
+                  variables: response.variables
+                },
+                () => {
+                  // 回调上个页面
+                  this.callbackPage();
+                }
+              );
+            })
+            .catch(() => {});
         })
-      }).catch(() => {})
+        .catch(() => {});
     },
 
     /**
      * 强制解锁任务
      */
     handleForceUnlock() {
-      this.$dialog.confirm({
-        message: '确定强制解锁任务!'
-      }).then(() => {
-        unlock({ taskId: this.taskId }).then(response => {
-          this.$notify({
-            type: 'success',
-            message: '强制解锁任务成功!'
-          })
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        }).catch(() => {
+      this.$dialog
+        .confirm({
+          message: "确定强制解锁任务!"
+        })
+        .then(() => {
+          unlock({ taskId: this.taskId })
+            .then(response => {
+              this.$notify({
+                type: "success",
+                message: "强制解锁任务成功!"
+              });
+              // 后置事件
+              this.afterScript(
+                this.actionName,
+                {
+                  data: response.data,
+                  variables: response.variables
+                },
+                () => {
+                  // 回调上个页面
+                  this.callbackPage();
+                }
+              );
+            })
+            .catch(() => {});
         })
-      }).catch(() => {})
+        .catch(() => {});
     },
     /**
      * 挂起任务
      */
     handleSuspendProcess() {
-      this.$dialog.confirm({
-        message: '确定挂起任务'
-      }).then(() => {
-        suspendProcess({ taskId: this.taskId }).then(response => {
-          this.$notify({
-            type: 'success',
-            message: '挂起任务成功!'
-          })
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        }).catch(() => {
+      this.$dialog
+        .confirm({
+          message: "确定挂起任务"
         })
-      }).catch(() => {})
+        .then(() => {
+          suspendProcess({ taskId: this.taskId })
+            .then(response => {
+              this.$notify({
+                type: "success",
+                message: "挂起任务成功!"
+              });
+              // 后置事件
+              this.afterScript(
+                this.actionName,
+                {
+                  data: response.data,
+                  variables: response.variables
+                },
+                () => {
+                  // 回调上个页面
+                  this.callbackPage();
+                }
+              );
+            })
+            .catch(() => {});
+        })
+        .catch(() => {});
     },
     /**
      * 恢复任务
      */
     handleRecoverProcess() {
-      this.$dialog.confirm({
-        message: '确定恢复任务'
-      }).then(() => {
-        recoverProcess({
-          taskId: this.taskId
-        }).then(response => {
-          this.$notify({
-            type: 'success',
-            message: '恢复任务成功!'
-          })
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
+      this.$dialog
+        .confirm({
+          message: "确定恢复任务"
+        })
+        .then(() => {
+          recoverProcess({
+            taskId: this.taskId
           })
-        }).catch(() => {
+            .then(response => {
+              this.$notify({
+                type: "success",
+                message: "恢复任务成功!"
+              });
+              // 后置事件
+              this.afterScript(
+                this.actionName,
+                {
+                  data: response.data,
+                  variables: response.variables
+                },
+                () => {
+                  // 回调上个页面
+                  this.callbackPage();
+                }
+              );
+            })
+            .catch(() => {});
         })
-      }).catch(() => {
-
-      })
+        .catch(() => {});
     },
     /**
      * 是否保存[节点-按钮设置-保存]
      */
     handleSave() {
-      const formData = this.getFormData()
-      if (!formData) return
-      this.$dialog.confirm({
-        message: '确定保存任务'
-      }).then(() => {
-        bpmTaskSave({ taskId: this.taskId, data: JSON.stringify(formData) }).then(response => {
-          this.$notify({
-            type: 'success',
-            message: '保存任务成功!'
-          })
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        }).catch(() => {
+      const formData = this.getFormData();
+      if (!formData) return;
+      this.$dialog
+        .confirm({
+          message: "确定保存任务"
+        })
+        .then(() => {
+          bpmTaskSave({ taskId: this.taskId, data: JSON.stringify(formData) })
+            .then(response => {
+              this.$notify({
+                type: "success",
+                message: "保存任务成功!"
+              });
+              // 后置事件
+              this.afterScript(
+                this.actionName,
+                {
+                  data: response.data,
+                  variables: response.variables
+                },
+                () => {
+                  // 回调上个页面
+                  this.callbackPage();
+                }
+              );
+            })
+            .catch(() => {});
         })
-      }).catch(() => {})
+        .catch(() => {});
     }
   }
-}
+};