Przeglądaj źródła

修复完结流程审批意见处理异常问题,生成快照增加延时

cfort 2 lat temu
rodzic
commit
7505f236f6

+ 1 - 1
src/business/platform/bpmn/components/approval-opinion/index.vue

@@ -213,7 +213,7 @@ export default {
     },
     created () {
         setTimeout(() => {
-            this.data = this.unCompleteOpinion || this.value
+            this.data = this.unCompleteOpinion || this.value || '同意'
         }, 500)
     },
     methods: {

+ 18 - 16
src/business/platform/bpmn/form/action.js

@@ -674,22 +674,24 @@ export default {
                 const now = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 16).replace(/[-:T]/g, '')
                 const fileName = name + now
                 console.log(url, fileName)
-                snapshoot({
-                    url,
-                    name: fileName,
-                    type: 'pdf'
-                }).then(res => {
-                    if (!res.data || !res.data.id) {
-                        this.$message.error('生成快照失败!')
-                    }
-                    const fileId = res.data && res.data.id ? res.data.id : ''
-                    const fileParams = fileId ? { kuai_zhao_: fileId } : {}
-                    this.updateState(id, code, '', fileParams)
-                }).catch(() => {
-                    // 生成快照接口调用失败时,也需要更新状态为已完成
-                    this.$message.error('提交快照生成失败!')
-                    // this.updateState(id, code, '1')
-                })
+                setTimeout(() => {
+                    snapshoot({
+                        url,
+                        name: fileName,
+                        type: 'pdf'
+                    }).then(res => {
+                        if (!res.data || !res.data.id) {
+                            this.$message.error('生成快照失败!')
+                        }
+                        const fileId = res.data && res.data.id ? res.data.id : ''
+                        const fileParams = fileId ? { kuai_zhao_: fileId } : {}
+                        this.updateState(id, code, '', fileParams)
+                    }).catch(() => {
+                        // 生成快照接口调用失败时,也需要更新状态为已完成
+                        this.$message.error('提交快照生成失败!')
+                        // this.updateState(id, code, '1')
+                    })
+                }, 300)
             })
         },
         // 判断流程是否结束

+ 3 - 2
src/business/platform/form/utils/formUtil.js

@@ -837,8 +837,9 @@ const FormUtil = {
             if (Utils.isEmpty(opinion.completeTime)) { continue }
             formOpinionList.push(opinion)
         }
-        // 筛选出已保存未提交的审批意见
-        const unComplateOpinion = opinionList.find(i => i.completeTime === null).opinion
+        // 筛选出已保存未提交的审批意见(已结束流程无此数据,需判空)
+        const unComplate = opinionList.find(i => i.completeTime === null)
+        const unComplateOpinion = unComplate ? unComplate.opinion : ''
         opinionData.unComplateOpinion = unComplateOpinion
 
         if (Utils.isEmpty(formOpinionConfig)) { // 没有绑定节点的