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

update 启动添加判断,如果是同意并结束并且只有一个节点改为1

linweizeng 3 лет назад
Родитель
Сommit
cca37ce1ff
1 измененных файлов с 33 добавлено и 28 удалено
  1. 33 28
      src/business/platform/bpmn/form/action.js

+ 33 - 28
src/business/platform/bpmn/form/action.js

@@ -6,7 +6,7 @@ import Print from '@/utils/print'
 export default {
     methods: {
         // 内嵌url表单,外部url表单 【自定义】
-        emitButtonEventHandler (actionName, args) {
+        emitButtonEventHandler(actionName, args) {
             // 前置事件
             this.beforeScript(actionName, (result) => {
                 if (result) {
@@ -15,7 +15,7 @@ export default {
             })
         },
         // 设置是否过审的状态
-        setData (title) {
+        setData(title) {
             let data = title
             console.log(this.getFormEL())
             if (!title) {
@@ -24,7 +24,7 @@ export default {
             }
             this.getFormEL().setData("shiFouGuoShen", data)
         },
-        emitEventHandler (actionName, args) {
+        emitEventHandler(actionName, args) {
             const this_ = this
             this.actionName = actionName
             const buttonType = args && args.attributes ? args.attributes.button_type || actionName : actionName
@@ -60,7 +60,7 @@ export default {
                         // } else {
                         //     this.agreeDialogVisible = true
                         // }
-                    }).catch(() => {})
+                    }).catch(() => { })
                     break
                 case 'abandon':// 弃权
                     this_.$confirm(
@@ -77,7 +77,7 @@ export default {
                         } else {
                             this.agreeDialogVisible = true
                         }
-                    }).catch(() => {})
+                    }).catch(() => { })
                     break
                 case 'close': // 关闭窗口
                     this.closeDialog()
@@ -92,7 +92,12 @@ export default {
                     this.instanceDetailVisible = true
                     break
                 case 'startFlow': // 启动流程
-                    this.setData("已编制")
+                    if (this.actionTitle == '同意并结束') {
+                        this.setData("1")
+                    } else {
+                        this.setData("已编制")
+                    }
+                    // this.setData("已编制")
                     this.handleStartFlow()
                     break
                 case 'saveDraft': // 保存草稿
@@ -154,11 +159,11 @@ export default {
         /**
          * 是否隐藏
          */
-        isHide () {
+        isHide() {
             return (this.isBpmOpinionHide && this.attributes.isHidePath) || (this.attributes.isCommonJumpType && this.attributes.isHideOpinion && this.attributes.isHidePath) || (this.attributes.isEnd && this.attributes.isHideOpinion)
         },
         // 是否保存[节点-按钮设置-保存]
-        handleSave () {
+        handleSave() {
             const formData = this.getFormData()
             const loading = this.$loading({
                 lock: true,
@@ -181,13 +186,13 @@ export default {
                         // 回调上个页面
                         // this.callbackPage()
                     })
-                }).catch(() => {})
+                }).catch(() => { })
             })
         },
         /**
          * 处理启动流程
          */
-        handleStartFlow () {
+        handleStartFlow() {
             const firstNodeUserAssign = this.attributes.firstNodeUserAssign || false
             if (firstNodeUserAssign) {
                 const formData = this.getFormData()
@@ -202,7 +207,7 @@ export default {
          * 保存启动流程
          * @param {*}
          */
-        saveStartFlow (params = {}) {
+        saveStartFlow(params = {}) {
             const formData = this.getFormData()
             if (!formData) return
             const jsonData = {
@@ -248,7 +253,7 @@ export default {
         /**
          * 保存草稿
          */
-        handleSaveDraft () {
+        handleSaveDraft() {
             // 表单数据
             const formData = this.getFormData()
             if (!formData) return
@@ -279,7 +284,7 @@ export default {
                         // 回调上个页面
                         this.callbackPage()
                     })
-                }).catch(() => {})
+                }).catch(() => { })
             }).catch(() => {
                 loading.close()
             })
@@ -288,7 +293,7 @@ export default {
          * 直接同意流程
          * @param {*} actionName
          */
-        handleDirectActionEvent (actionName) {
+        handleDirectActionEvent(actionName) {
             const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
             this.handleActionEvent(actionName, {
                 opinion: opinion
@@ -299,7 +304,7 @@ export default {
          * @param {*} actionName
          * @param {*} params
          */
-        handleActionEvent (actionName, params) {
+        handleActionEvent(actionName, params) {
             if (actionName === 'agree' || actionName === 'oppose' || actionName === 'abandon' || actionName === 'rejectToPrevious' || actionName === 'rejectToStart' || actionName === 'reject') {
                 this.handleComplete(actionName, params)
             } else if (actionName === 'endProcess') {
@@ -308,7 +313,7 @@ export default {
                 this.handleAddSignTask(params)
             }
         },
-        handleComplete (actionName, params = {}) {
+        handleComplete(actionName, params = {}) {
             const formData = this.getFormData()
             if (!formData) return
             const loading = this.$loading({
@@ -356,7 +361,7 @@ export default {
                 })
             }
         },
-        handleResponse (actionName, loading, response) {
+        handleResponse(actionName, loading, response) {
             loading.close()
             this.$alert(response.message, {
                 showClose: false
@@ -377,7 +382,7 @@ export default {
                 })
             }).catch(() => { })
         },
-        handleEndProcess () {
+        handleEndProcess() {
             if (this.isBpmOpinionHide) {
                 this.$confirm('确定终止流程!', '提示', {
                     type: 'warning'
@@ -395,7 +400,7 @@ export default {
          * 处理终止任务
          * @param {*} params
          */
-        handleDoEndProcess (params) {
+        handleDoEndProcess(params) {
             const loading = this.$loading({
                 lock: true,
                 text: this.$t('common.saving')
@@ -427,7 +432,7 @@ export default {
          * 补签
          * @param {*} params
          */
-        handleAddSignTask (params) {
+        handleAddSignTask(params) {
             const loading = this.$loading({
                 lock: true,
                 text: this.$t('common.saving')
@@ -460,7 +465,7 @@ export default {
         /**
          * 打印
          */
-        handlePrint () {
+        handlePrint() {
             if (this.$utils.isNotEmpty(this.printTemplateId)) {
                 this.submitFormData = this.getFormData()
                 // 打开打印模版页面
@@ -483,7 +488,7 @@ export default {
         /**
          * 锁定任务
          */
-        handleLock () {
+        handleLock() {
             this.$confirm('确定锁定任务!', '提示', {
                 type: 'warning'
             }).then(() => {
@@ -513,7 +518,7 @@ export default {
         /**
          * 解锁任务
          */
-        handleUnlock () {
+        handleUnlock() {
             this.$confirm('确定解锁任务!', '提示', {
                 type: 'warning'
             }).then(() => {
@@ -543,7 +548,7 @@ export default {
         /**
          * 强制解锁任务
          */
-        handleForceUnlock () {
+        handleForceUnlock() {
             this.$confirm('确定强制解锁任务!', '提示', {
                 type: 'warning'
             }).then(() => {
@@ -573,7 +578,7 @@ export default {
         /**
          * 挂起任务
          */
-        handleSuspendProcess () {
+        handleSuspendProcess() {
             this.$confirm('确定挂起任务', '提示', {
                 type: 'warning'
             }).then(() => {
@@ -603,7 +608,7 @@ export default {
         /**
          * 恢复任务
          */
-        handleRecoverProcess () {
+        handleRecoverProcess() {
             this.$confirm('确定恢复任务', '提示', {
                 type: 'warning'
             }).then(() => {
@@ -634,8 +639,8 @@ export default {
 
             })
         },
-        finishTask (actionName, params, callback) {
+        finishTask(actionName, params, callback) {
 
         }
     }
-}
+}