Kaynağa Gözat

审批意见组件显示审批人,已办事宜去除打印按钮和流程实例信息按钮

cfort 3 yıl önce
ebeveyn
işleme
e4e6330917

+ 619 - 635
src/business/platform/bpmn/form/action.js

@@ -4,654 +4,638 @@ import { startFlow, saveDraft } from '@/api/platform/bpmn/bpmInst'
 import Print from '@/utils/print'
 
 export default {
-  methods: {
-    // 内嵌url表单,外部url表单 【自定义】
-    emitButtonEventHandler(actionName, args) {
-       // 前置事件
-       this.beforeScript(actionName, (result) => {
-         if (result) {
-           return this.emitEventHandler(actionName, args)
-         }
-       })
-    },
-    /* 设置是否过审的状态*/
-    setData(title){
-       let data = title
-       console.log(this.getFormEL())
-       if(!title){
-         data = "已"+this.getFormEL().formDefData.flowName //获取当前流程步骤名
-       }
-       this.getFormEL().setData("shiFouGuoShen",data)
-    },
-
-    emitEventHandler(actionName, args) {
-      const this_ = this
-      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 'agree': // 同意
-          /* 判断是否最后一步流程 */
-            if(this.actionTitle =='同意并结束'){
-               this.setData("1")
-            }else{
-              this.setData()
+    methods: {
+        // 内嵌url表单,外部url表单 【自定义】
+        emitButtonEventHandler (actionName, args) {
+            // 前置事件
+            this.beforeScript(actionName, (result) => {
+                if (result) {
+                    return this.emitEventHandler(actionName, args)
+                }
+            })
+        },
+        // 设置是否过审的状态
+        setData (title) {
+            let data = title
+            console.log(this.getFormEL())
+            if (!title) {
+                //获取当前流程步骤名
+                data = "已" + this.getFormEL().formDefData.flowName
             }
-          /* if (this.isHide()) { */
-            this.handleDirectActionEvent(actionName)
-          /* } else {
-              this.agreeDialogVisible = true
-            } */
-             break
-        case 'oppose':// 反对
-        	this_.$confirm(
-        				  `确定进行 [ ${args.attributes.label} ] 操作 ?`,
-        				  "提示:",
-        				  {
-        					confirmButtonText: "确定",
-        					cancelButtonText: "取消",
-        					type: "warning"
-        				  }
-        				).then(() => {
-
-        				 /* if (this.isHide()) { */
+            this.getFormEL().setData("shiFouGuoShen", data)
+        },
+        emitEventHandler (actionName, args) {
+            const this_ = this
+            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 'agree':// 同意
+                    // 判断是否最后一步流程
+                    if (this.actionTitle == '同意并结束') {
+                        this.setData("1")
+                    } else {
+                        this.setData()
+                    }
+                    // if (this.isHide()) {
+                    this.handleDirectActionEvent(actionName)
+                    // } else {
+                    //     this.agreeDialogVisible = true
+                    // }
+                    break
+                case 'oppose':// 反对
+                    this_.$confirm(
+                        `确定进行 [ ${args.attributes.label} ] 操作 ?`,
+                        "提示:",
+                        {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }
+                    ).then(() => {
+                        // if (this.isHide()) {
                         this.setData("未同意")
-        					    	this.handleDirectActionEvent(actionName)
-        				 /* } else {
-                    this.agreeDialogVisible = true
-        				  } */
-        				  }).catch(() => {
-        				   });
-        				   break
-        case 'abandon':// 弃权
-          			this_.$confirm(
-          				  `确定进行 [ 弃权 ] 操作 ?`,
-          				  "提示:",
-          				  {
-          				    confirmButtonText: "确定",
-          				    cancelButtonText: "取消",
-          				    type: "warning"
-          				  }
-          				).then(() => {
-          				  if (this.isHide()) {
-          					    	this.handleDirectActionEvent(actionName)
-          					    } else {
-                        this.agreeDialogVisible = true
+                        this.handleDirectActionEvent(actionName)
+                        // } else {
+                        //     this.agreeDialogVisible = true
+                        // }
+                    }).catch(() => {})
+                    break
+                case 'abandon':// 弃权
+                    this_.$confirm(
+                        `确定进行 [ 弃权 ] 操作 ?`,
+                        "提示:",
+                        {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
                         }
-          				  }).catch(() => {
-          		           });
-              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': // 启动流程
-          this.setData("已编制")
-          this.handleStartFlow()
-          break
-        case 'saveDraft': // 保存草稿
-          this.setData("已暂存")
-          this.handleSaveDraft()
-          break
-        case 'rejectToPrevious':// 驳回上一步
-        case 'rejectToStart':// 驳回发起人
-        case 'reject':// 驳回
-        this.setData("已退回")
-          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("2")
-          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.setData("已暂存")
-          this.handleSave()
-          break
-        default:
-          break
-      }
-    },
-    /**
-     * 是否隐藏
-     */
-    isHide() {
-      return (this.isBpmOpinionHide && this.attributes.isHidePath) ||
-      (this.attributes.isCommonJumpType && this.attributes.isHideOpinion && this.attributes.isHidePath) ||
-      (this.attributes.isEnd && this.attributes.isHideOpinion)
-    },
-    /**
-     * 是否保存[节点-按钮设置-保存]
-     */
-    handleSave() {
-      const formData = this.getFormData()
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      if (!formData) return
-      bpmTaskSave({
-        taskId: this.taskId,
-        data: JSON.stringify(formData)
-      }).then(response => {
-		  loading.close()
-        this.$alert(`已保存表单内容!`, {
-          showClose: false
-        }).then(() => {
-        // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-           // this.callbackPage()
-          })
-        }).catch(() => {
-        })
-      })
-    },
-    /**
-     * 处理启动流程
-     */
-    handleStartFlow() {
-      const firstNodeUserAssign = this.attributes.firstNodeUserAssign || false
-      if (firstNodeUserAssign) {
-        const formData = this.getFormData()
-        if (!formData) return
-        this.submitFormData = formData
-        this.startFlowDialogVisible = true
-      } else {
-        this.saveStartFlow()
-      }
-    },
-    /**
-     * 保存启动流程
-     * @param {*}
-     */
-    saveStartFlow(params = {}) {
-      const formData = this.getFormData()
-      if (!formData) return
-      const jsonData = {
-        defId: this.defId,
-        version: this.version || '0',
-        data: JSON.stringify(formData)
-      }
-      if (this.$utils.isNotEmpty(params.nodeUsers)) {
-        jsonData.nodeUsers = JSON.stringify(params.nodeUsers) || ''
-      }
-      if (this.$utils.isNotEmpty(params.destination)) {
-        jsonData.destination = params.destination || ''
-      }
-
-      if (this.$utils.isNotEmpty(this.proInstId) && !this.copyFlow) {
-        jsonData.proInstId = this.proInstId || ''
-      }
-
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      // 1、直接启动
-      startFlow(jsonData).then(response => {
-        loading.close()
-        this.$alert(`启动成功!`, {
-          showClose: false
-        }).then(() => {
-          this.startFlowDialogVisible = false
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        }).catch(() => {})
-      }).catch(() => {
-        loading.close()
-      })
-    },
-    /**
-     * 保存草稿
-     */
-    handleSaveDraft() {
-      // 表单数据
-      const formData = this.getFormData()
-      if (!formData) return
+                    ).then(() => {
+                        if (this.isHide()) {
+                            this.handleDirectActionEvent(actionName)
+                        } else {
+                            this.agreeDialogVisible = true
+                        }
+                    }).catch(() => {})
+                    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': // 启动流程
+                    this.setData("已编制")
+                    this.handleStartFlow()
+                    break
+                case 'saveDraft': // 保存草稿
+                    this.setData("已暂存")
+                    this.handleSaveDraft()
+                    break
+                case 'rejectToPrevious':// 驳回上一步
+                case 'rejectToStart':// 驳回发起人
+                case 'reject':// 驳回
+                    this.setData("已退回")
+                    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("2")
+                    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.setData("已暂存")
+                    this.handleSave()
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 是否隐藏
+         */
+        isHide () {
+            return (this.isBpmOpinionHide && this.attributes.isHidePath) || (this.attributes.isCommonJumpType && this.attributes.isHideOpinion && this.attributes.isHidePath) || (this.attributes.isEnd && this.attributes.isHideOpinion)
+        },
+        // 是否保存[节点-按钮设置-保存]
+        handleSave () {
+            const formData = this.getFormData()
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
+            })
+            if (!formData) return
+            bpmTaskSave({
+                taskId: this.taskId,
+                data: JSON.stringify(formData)
+            }).then(response => {
+                loading.close()
+                this.$alert(`已保存表单内容!`, {
+                    showClose: false
+                }).then(() => {
+                    // 后置事件
+                    this.afterScript(this.actionName, {
+                        data: response.data,
+                        variables: response.variables
+                    }, () => {
+                        // 回调上个页面
+                        // this.callbackPage()
+                    })
+                }).catch(() => {})
+            })
+        },
+        /**
+         * 处理启动流程
+         */
+        handleStartFlow () {
+            const firstNodeUserAssign = this.attributes.firstNodeUserAssign || false
+            if (firstNodeUserAssign) {
+                const formData = this.getFormData()
+                if (!formData) return
+                this.submitFormData = formData
+                this.startFlowDialogVisible = true
+            } else {
+                this.saveStartFlow()
+            }
+        },
+        /**
+         * 保存启动流程
+         * @param {*}
+         */
+        saveStartFlow (params = {}) {
+            const formData = this.getFormData()
+            if (!formData) return
+            const jsonData = {
+                defId: this.defId,
+                version: this.version || '0',
+                data: JSON.stringify(formData)
+            }
+            if (this.$utils.isNotEmpty(params.nodeUsers)) {
+                jsonData.nodeUsers = JSON.stringify(params.nodeUsers) || ''
+            }
+            if (this.$utils.isNotEmpty(params.destination)) {
+                jsonData.destination = params.destination || ''
+            }
 
-      const jsonData = {
-        defId: this.defId,
-        version: this.version || '',
-        data: JSON.stringify(formData)
-      }
-      if (this.$utils.isNotEmpty(this.proInstId) && !this.copyFlow) {
-        jsonData.proInstId = this.proInstId || ''
-      }
+            if (this.$utils.isNotEmpty(this.proInstId) && !this.copyFlow) {
+                jsonData.proInstId = this.proInstId || ''
+            }
 
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      saveDraft(jsonData).then(response => {
-        loading.close()
-        this.$alert(`保存成功!`, {
-          showClose: false
-        }).then(() => {
-        // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        }).catch(() => {
-        })
-      }).catch(() => {
-        loading.close()
-      })
-    },
-    /**
-     * 直接同意流程
-     * @param {*} actionName
-     */
-    handleDirectActionEvent(actionName) {
-      const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
-      this.handleActionEvent(actionName, {
-        opinion: opinion
-      })
-    },
-    /**
-     * 处理按钮事件
-     * @param {*} actionName
-     * @param {*} 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') {
-        this.handleDoEndProcess(params)
-      } else if (actionName === 'addSign') {
-        this.handleAddSignTask(params)
-      }
-    },
-    handleComplete(actionName, params = {}) {
-      const formData = this.getFormData()
-      if (!formData) return
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      params.taskId = this.taskId
-      params.data = JSON.stringify(formData)
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
+            })
+            // 1、直接启动
+            startFlow(jsonData).then(response => {
+                loading.close()
+                this.$alert(`启动成功!`, {
+                    showClose: false
+                }).then(() => {
+                    this.startFlowDialogVisible = false
+                    // 后置事件
+                    this.afterScript(this.actionName, {
+                        data: response.data,
+                        variables: response.variables
+                    }, () => {
+                        // 回调上个页面
+                        this.callbackPage()
+                    })
+                }).catch(() => { })
+            }).catch(() => {
+                loading.close()
+            })
+        },
+        /**
+         * 保存草稿
+         */
+        handleSaveDraft () {
+            // 表单数据
+            const formData = this.getFormData()
+            if (!formData) return
 
-      if (actionName === 'agree') {
-        agree(params).then(response => {
-          this.handleResponse(actionName, loading, response)
-        }).catch(() => {
-          loading.close()
-        })
-      } else if (actionName === 'oppose') {
-        oppose(params).then(response => {
-          this.handleResponse(actionName, loading, response)
-        }).catch(() => {
-          loading.close()
-        })
-      } else if (actionName === 'abandon') {
-        abandon(params).then(response => {
-          this.handleResponse(actionName, loading, response)
-        }).catch(() => {
-          loading.close()
-        })
-      } else if (actionName === 'rejectToPrevious') {
-        rejectToPrevious(params).then(response => {
-          this.handleResponse(actionName, loading, response)
-        }).catch(() => {
-          loading.close()
-        })
-      } else if (actionName === 'rejectToStart') {
-        rejectToStarter(params).then(response => {
-          this.handleResponse(actionName, loading, response)
-        }).catch(() => {
-          loading.close()
-        })
-      } else if (actionName === 'reject') {
-        reject(params).then(response => {
-          this.handleResponse(actionName, loading, response)
-        }).catch(() => {
-          loading.close()
-        })
-      }
-    },
-    handleResponse(actionName, loading, response) {
-      loading.close()
-      this.$alert(response.message, {
-        showClose: false
-      }).then(() => {
-        // 关闭窗口
-        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()
-        })
-      }).catch(() => {})
-    },
-    handleEndProcess() {
-      if (this.isBpmOpinionHide) {
-        this.$confirm('确定终止流程!', '提示', {
-          type: 'warning'
-        }).then(() => {
-          const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
-          this.handleDoEndProcess({
-            opinion: opinion
-          })
-        }).catch(() => {})
-      } else {
-        this.approveDialogVisible = true
-      }
-    },
-    /**
-     * 处理终止任务
-     * @param {*} params
-     */
-    handleDoEndProcess(params) {
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      doEndProcess({
-        taskId: this.taskId ? this.taskId : this.endProcessTaskId,
-        endReason: params.opinion
-      }).then(response => {
-        loading.close()
-        this.$alert(response.message, {
-          showClose: false
-        }).then(() => {
-          this.approveDialogVisible = false
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        })
-      }).catch((err) => {
-        loading.close()
-        console.error(err)
-      })
-    },
-    /**
-     * 补签
-     * @param {*} params
-     */
-    handleAddSignTask(params) {
-      const loading = this.$loading({
-        lock: true,
-        text: this.$t('common.saving')
-      })
-      doAddSignTask({
-        taskId: this.taskId,
-        addSignTaskUserId: params.addSignTaskUserId,
-        messageType: params.messageType,
-        addReason: params.opinion
-      }).then(response => {
-        loading.close()
-        this.$alert(response.message, {
-          showClose: false
-        }).then(() => {
-          this.addSignTaskDialogVisible = false
-          // 后置事件
-          this.afterScript(this.actionName, {
-            data: response.data,
-            variables: response.variables
-          }, () => {
-            // 回调上个页面
-            this.callbackPage()
-          })
-        })
-      }).catch((err) => {
-        loading.close()
-        console.error(err)
-      })
-    },
-    /**
-     * 打印
-     */
-    handlePrint() {
-      if (this.$utils.isNotEmpty(this.printTemplateId)) {
-        this.submitFormData = this.getFormData()
-        // 打开打印模版页面
-        this.formPrintTemplateDialogVisible = true
-      } else {
-        const loading = this.$loading({
-          lock: true,
-          text: this.$t('common.loading')
-        })
-        setTimeout(() => {
-          Print(this.$refs.formrender.$el, {
-            title: '',
-            callback: () => {
-              loading.close()
+            const jsonData = {
+                defId: this.defId,
+                version: this.version || '',
+                data: JSON.stringify(formData)
+            }
+            if (this.$utils.isNotEmpty(this.proInstId) && !this.copyFlow) {
+                jsonData.proInstId = this.proInstId || ''
             }
-          })
-        }, 300)
-      }
-    },
-    /**
-     * 锁定任务
-     */
-    handleLock() {
-      this.$confirm('确定锁定任务!', '提示', {
-        type: 'warning'
-      }).then(() => {
-        const loading = this.$loading({
-          lock: true,
-          text: this.$t('common.saving')
-        })
-        lock({ taskId: this.taskId }).then(response => {
-          loading.close()
-          this.$alert(`锁定任务成功!`, {
-            showClose: false
-          }).then(() => {
-            // 后置事件
-            this.afterScript(this.actionName, {
-              data: response.data,
-              variables: response.variables
-            }, () => {
-              // 回调上个页面
-              this.callbackPage()
+
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
+            })
+            saveDraft(jsonData).then(response => {
+                loading.close()
+                this.$alert(`保存成功!`, {
+                    showClose: false
+                }).then(() => {
+                    // 后置事件
+                    this.afterScript(this.actionName, {
+                        data: response.data,
+                        variables: response.variables
+                    }, () => {
+                        // 回调上个页面
+                        this.callbackPage()
+                    })
+                }).catch(() => {})
+            }).catch(() => {
+                loading.close()
             })
-          }).catch(() => {})
-        }).catch(() => {
-          loading.close()
-        })
-      }).catch(() => {})
-    },
-    /**
-     * 解锁任务
-     */
-    handleUnlock() {
-      this.$confirm('确定解锁任务!', '提示', {
-        type: 'warning'
-      }).then(() => {
-        const loading = this.$loading({
-          lock: true,
-          text: this.$t('common.saving')
-        })
-        unlock({ taskId: this.taskId }).then(response => {
-          loading.close()
-          this.$alert(`解锁任务成功!`, {
-            showClose: false
-          }).then(() => {
-            // 后置事件
-            this.afterScript(this.actionName, {
-              data: response.data,
-              variables: response.variables
-            }, () => {
-              // 回调上个页面
-              this.callbackPage()
+        },
+        /**
+         * 直接同意流程
+         * @param {*} actionName
+         */
+        handleDirectActionEvent (actionName) {
+            const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
+            this.handleActionEvent(actionName, {
+                opinion: opinion
+            })
+        },
+        /**
+         * 处理按钮事件
+         * @param {*} actionName
+         * @param {*} 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') {
+                this.handleDoEndProcess(params)
+            } else if (actionName === 'addSign') {
+                this.handleAddSignTask(params)
+            }
+        },
+        handleComplete (actionName, params = {}) {
+            const formData = this.getFormData()
+            if (!formData) return
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
             })
-          }).catch(() => {})
-        }).catch(() => {
-          loading.close()
-        })
-      }).catch(() => {})
-    },
+            params.taskId = this.taskId
+            params.data = JSON.stringify(formData)
 
-    /**
-     * 强制解锁任务
-     */
-    handleForceUnlock() {
-      this.$confirm('确定强制解锁任务!', '提示', {
-        type: 'warning'
-      }).then(() => {
-        const loading = this.$loading({
-          lock: true,
-          text: this.$t('common.saving')
-        })
-        unlock({ taskId: this.taskId }).then(response => {
-          loading.close()
-          this.$alert(`强制解锁任务成功!`, {
-            showClose: false
-          }).then(() => {
-            // 后置事件
-            this.afterScript(this.actionName, {
-              data: response.data,
-              variables: response.variables
-            }, () => {
-              // 回调上个页面
-              this.callbackPage()
+            if (actionName === 'agree') {
+                agree(params).then(response => {
+                    this.handleResponse(actionName, loading, response)
+                }).catch(() => {
+                    loading.close()
+                })
+            } else if (actionName === 'oppose') {
+                oppose(params).then(response => {
+                    this.handleResponse(actionName, loading, response)
+                }).catch(() => {
+                    loading.close()
+                })
+            } else if (actionName === 'abandon') {
+                abandon(params).then(response => {
+                    this.handleResponse(actionName, loading, response)
+                }).catch(() => {
+                    loading.close()
+                })
+            } else if (actionName === 'rejectToPrevious') {
+                rejectToPrevious(params).then(response => {
+                    this.handleResponse(actionName, loading, response)
+                }).catch(() => {
+                    loading.close()
+                })
+            } else if (actionName === 'rejectToStart') {
+                rejectToStarter(params).then(response => {
+                    this.handleResponse(actionName, loading, response)
+                }).catch(() => {
+                    loading.close()
+                })
+            } else if (actionName === 'reject') {
+                reject(params).then(response => {
+                    this.handleResponse(actionName, loading, response)
+                }).catch(() => {
+                    loading.close()
+                })
+            }
+        },
+        handleResponse (actionName, loading, response) {
+            loading.close()
+            this.$alert(response.message, {
+                showClose: false
+            }).then(() => {
+                // 关闭窗口
+                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()
+                })
+            }).catch(() => { })
+        },
+        handleEndProcess () {
+            if (this.isBpmOpinionHide) {
+                this.$confirm('确定终止流程!', '提示', {
+                    type: 'warning'
+                }).then(() => {
+                    const opinion = this.hasFormOpinion() ? this.getFormOpinionData() : ''
+                    this.handleDoEndProcess({
+                        opinion: opinion
+                    })
+                }).catch(() => { })
+            } else {
+                this.approveDialogVisible = true
+            }
+        },
+        /**
+         * 处理终止任务
+         * @param {*} params
+         */
+        handleDoEndProcess (params) {
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
             })
-          }).catch(() => {})
-        }).catch(() => {
-          loading.close()
-        })
-      }).catch(() => {})
-    },
-    /**
-     * 挂起任务
-     */
-    handleSuspendProcess() {
-      this.$confirm('确定挂起任务', '提示', {
-        type: 'warning'
-      }).then(() => {
-        const loading = this.$loading({
-          lock: true,
-          text: this.$t('common.saving')
-        })
-        suspendProcess({ taskId: this.taskId }).then(response => {
-          loading.close()
-          this.$alert(`挂起任务成功!`, {
-            showClose: false
-          }).then(() => {
-            // 后置事件
-            this.afterScript(this.actionName, {
-              data: response.data,
-              variables: response.variables
-            }, () => {
-              // 回调上个页面
-              this.callbackPage()
+            doEndProcess({
+                taskId: this.taskId ? this.taskId : this.endProcessTaskId,
+                endReason: params.opinion
+            }).then(response => {
+                loading.close()
+                this.$alert(response.message, {
+                    showClose: false
+                }).then(() => {
+                    this.approveDialogVisible = false
+                    // 后置事件
+                    this.afterScript(this.actionName, {
+                        data: response.data,
+                        variables: response.variables
+                    }, () => {
+                        // 回调上个页面
+                        this.callbackPage()
+                    })
+                })
+            }).catch((err) => {
+                loading.close()
+                console.error(err)
             })
-          }).catch(() => {})
-        }).catch(() => {
-          loading.close()
-        })
-      }).catch(() => {})
-    },
-    /**
-     * 恢复任务
-     */
-    handleRecoverProcess() {
-      this.$confirm('确定恢复任务', '提示', {
-        type: 'warning'
-      }).then(() => {
-        const loading = this.$loading({
-          lock: true,
-          text: this.$t('common.saving')
-        })
-        recoverProcess({
-          taskId: this.taskId
-        }).then(response => {
-          loading.close()
-          this.$alert(`恢复任务成功!`, {
-            showClose: false
-          }).then(() => {
-            // 后置事件
-            this.afterScript(this.actionName, {
-              data: response.data,
-              variables: response.variables
-            }, () => {
-              // 回调上个页面
-              this.callbackPage()
+        },
+        /**
+         * 补签
+         * @param {*} params
+         */
+        handleAddSignTask (params) {
+            const loading = this.$loading({
+                lock: true,
+                text: this.$t('common.saving')
             })
-          })
-        }).catch(() => {
-          loading.close()
-        })
-      }).catch(() => {
+            doAddSignTask({
+                taskId: this.taskId,
+                addSignTaskUserId: params.addSignTaskUserId,
+                messageType: params.messageType,
+                addReason: params.opinion
+            }).then(response => {
+                loading.close()
+                this.$alert(response.message, {
+                    showClose: false
+                }).then(() => {
+                    this.addSignTaskDialogVisible = false
+                    // 后置事件
+                    this.afterScript(this.actionName, {
+                        data: response.data,
+                        variables: response.variables
+                    }, () => {
+                        // 回调上个页面
+                        this.callbackPage()
+                    })
+                })
+            }).catch((err) => {
+                loading.close()
+                console.error(err)
+            })
+        },
+        /**
+         * 打印
+         */
+        handlePrint () {
+            if (this.$utils.isNotEmpty(this.printTemplateId)) {
+                this.submitFormData = this.getFormData()
+                // 打开打印模版页面
+                this.formPrintTemplateDialogVisible = true
+            } else {
+                const loading = this.$loading({
+                    lock: true,
+                    text: this.$t('common.loading')
+                })
+                setTimeout(() => {
+                    Print(this.$refs.formrender.$el, {
+                        title: '',
+                        callback: () => {
+                            loading.close()
+                        }
+                    })
+                }, 300)
+            }
+        },
+        /**
+         * 锁定任务
+         */
+        handleLock () {
+            this.$confirm('确定锁定任务!', '提示', {
+                type: 'warning'
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: this.$t('common.saving')
+                })
+                lock({ taskId: this.taskId }).then(response => {
+                    loading.close()
+                    this.$alert(`锁定任务成功!`, {
+                        showClose: false
+                    }).then(() => {
+                        // 后置事件
+                        this.afterScript(this.actionName, {
+                            data: response.data,
+                            variables: response.variables
+                        }, () => {
+                            // 回调上个页面
+                            this.callbackPage()
+                        })
+                    }).catch(() => { })
+                }).catch(() => {
+                    loading.close()
+                })
+            }).catch(() => { })
+        },
+        /**
+         * 解锁任务
+         */
+        handleUnlock () {
+            this.$confirm('确定解锁任务!', '提示', {
+                type: 'warning'
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: this.$t('common.saving')
+                })
+                unlock({ taskId: this.taskId }).then(response => {
+                    loading.close()
+                    this.$alert(`解锁任务成功!`, {
+                        showClose: false
+                    }).then(() => {
+                        // 后置事件
+                        this.afterScript(this.actionName, {
+                            data: response.data,
+                            variables: response.variables
+                        }, () => {
+                            // 回调上个页面
+                            this.callbackPage()
+                        })
+                    }).catch(() => { })
+                }).catch(() => {
+                    loading.close()
+                })
+            }).catch(() => { })
+        },
+        /**
+         * 强制解锁任务
+         */
+        handleForceUnlock () {
+            this.$confirm('确定强制解锁任务!', '提示', {
+                type: 'warning'
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: this.$t('common.saving')
+                })
+                unlock({ taskId: this.taskId }).then(response => {
+                    loading.close()
+                    this.$alert(`强制解锁任务成功!`, {
+                        showClose: false
+                    }).then(() => {
+                        // 后置事件
+                        this.afterScript(this.actionName, {
+                            data: response.data,
+                            variables: response.variables
+                        }, () => {
+                            // 回调上个页面
+                            this.callbackPage()
+                        })
+                    }).catch(() => { })
+                }).catch(() => {
+                    loading.close()
+                })
+            }).catch(() => { })
+        },
+        /**
+         * 挂起任务
+         */
+        handleSuspendProcess () {
+            this.$confirm('确定挂起任务', '提示', {
+                type: 'warning'
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: this.$t('common.saving')
+                })
+                suspendProcess({ taskId: this.taskId }).then(response => {
+                    loading.close()
+                    this.$alert(`挂起任务成功!`, {
+                        showClose: false
+                    }).then(() => {
+                        // 后置事件
+                        this.afterScript(this.actionName, {
+                            data: response.data,
+                            variables: response.variables
+                        }, () => {
+                            // 回调上个页面
+                            this.callbackPage()
+                        })
+                    }).catch(() => { })
+                }).catch(() => {
+                    loading.close()
+                })
+            }).catch(() => { })
+        },
+        /**
+         * 恢复任务
+         */
+        handleRecoverProcess () {
+            this.$confirm('确定恢复任务', '提示', {
+                type: 'warning'
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: this.$t('common.saving')
+                })
+                recoverProcess({
+                    taskId: this.taskId
+                }).then(response => {
+                    loading.close()
+                    this.$alert(`恢复任务成功!`, {
+                        showClose: false
+                    }).then(() => {
+                        // 后置事件
+                        this.afterScript(this.actionName, {
+                            data: response.data,
+                            variables: response.variables
+                        }, () => {
+                            // 回调上个页面
+                            this.callbackPage()
+                        })
+                    })
+                }).catch(() => {
+                    loading.close()
+                })
+            }).catch(() => {
 
-      })
-    },
-    finishTask(actionName, params, callback) {
+            })
+        },
+        finishTask (actionName, params, callback) {
 
+        }
     }
-  }
-}
+}

+ 687 - 673
src/business/platform/bpmn/form/index.vue

@@ -1,700 +1,714 @@
 <template>
-  <div
-    v-loading.fullscreen.lock="loading"
-    :element-loading-text="$t('common.loading')"
-  >
-    <template v-if="formModel.type === 'INNER'">
-      <formrender
-        v-if="formDef"
-        ref="formrender"
-        :form-def="formDef"
-        :buttons="buttons"
-        :data="formData"
-        :params="formParams"
-        :readonly="readonly"
-        @action-event="(actionKey,args)=>emitEventHandler(actionKey,args)"
-        @callback="callbackPage"
-        @close="closeDialog"
-      />
-    </template>
-    <!---内嵌url表单,外部url表单---->
-    <template
-      v-else-if="formModel.type === 'URL_LOAD'|| formModel.type === 'FRAME'"
-    >
-      <form-toolbar
-        v-if="formModel.type === 'URL_LOAD'"
-        :buttons="buttons"
-        @validate="validateForm"
-        @action-event="(actionKey,args)=>emitButtonEventHandler(actionKey,args)"
-        @callback="callbackPage"
-        @close="closeDialog"
-      />
-      <iframe
-        v-if="formUrlType === 'iframe'"
-        ref="formrender"
-        :class="formModel.type === 'URL_LOAD'?'ibps-container-url-frame':'ibps-container-frame'"
-        frameborder="0"
-      />
-      <component
-        :is="formUrlName"
-        v-else
-        ref="formrender"
-        :params="formParams"
-        :readonly="readonly"
-        @action-event="(actionKey,args)=>emitButtonEventHandler(actionKey,args)"
-        @callback="callbackPage"
-        @close="closeDialog"
-      />
-    </template>
-    <!--流程图-->
-    <flow-diagram-dialog
-      :visible="flowDiagramVisible"
-      :def-id="defId"
-      :task-id="taskId"
-      :inst-id="instanceId"
-      @close="visible => flowDiagramVisible= visible"
-    />
-    <!--流程历史-->
-    <approval-history-dialog
-      :visible="approvalHistoryVisible"
-      :task-id="taskId"
-      :inst-id="instanceId"
-      @close="visible => approvalHistoryVisible= visible"
-    />
-    <!--流程实例-->
-    <instance-detail
-      :visible="instanceDetailVisible"
-      :bpmn-inst-id="instanceId"
-      @close="visible => instanceDetailVisible= visible"
-    />
-
-    <!--启动流程-->
-    <start-flow-dialog
-      :visible="startFlowDialogVisible"
-      :def-id="defId"
-      :data="submitFormData"
-      :title="actionTitle"
-      @close="visible => startFlowDialogVisible= visible"
-      @action-event="saveStartFlow"
-    />
-
-    <!--同意-->
-    <agree-dialog
-      :visible="agreeDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :version="version"
-      :is-common="attributes.isCommonJumpType"
-      :hide-opinion="isBpmOpinionHide"
-      :hide-path="attributes.isHidePath"
-      :form-opinion="submitFormOpinion"
-      @close="visible => agreeDialogVisible= visible"
-      @action-event="handleActionEvent"
-    />
-
-    <!--驳回-->
-    <reject-dialog
-      :visible="rejectDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :hide-opinion="isBpmOpinionHide"
-      :form-opinion="submitFormOpinion"
-      @close="visible => rejectDialogVisible= visible"
-      @action-event="handleActionEvent"
-    />
-    <!--终止流程-->
-    <approve-dialog
-      :visible="approveDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :hide-opinion="isBpmOpinionHide"
-      :form-opinion="submitFormOpinion"
-      callback-event
-      @close="visible => approveDialogVisible= visible"
-      @action-event="handleActionEvent"
-    />
-    <!--转办-->
-    <delegate-dialog
-      :id="taskChangeId"
-      :visible="delegateDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :readonly="delegateReadonly"
-      @close="visible => delegateDialogVisible= visible"
-      @callback="callbackPage"
-    />
-    <!--任务补签-->
-    <add-sign-task-dialog
-      :visible="addSignTaskDialogVisible"
-      :action="actionName"
-      :title="actionTitle"
-      :task-id="taskId"
-      :hide-opinion="false"
-      :form-opinion="submitFormOpinion"
-      @close="visible => addSignTaskDialogVisible= visible"
-      @action-event="handleActionEvent"
-      @callback="callbackPage"
-    />
-
-    <form-print-template
-      :id="printTemplateId"
-      :data="submitFormData"
-      :pk="pkValue"
-      :visible="formPrintTemplateDialogVisible"
-      @close="visible => formPrintTemplateDialogVisible = visible"
-    />
-  </div>
+    <div v-loading.fullscreen.lock="loading" :element-loading-text="$t('common.loading')">
+        <template v-if="formModel.type === 'INNER'">
+            <formrender
+                v-if="formDef"
+                ref="formrender"
+                :form-def="formDef"
+                :buttons="buttons"
+                :data="formData"
+                :params="formParams"
+                :readonly="readonly"
+                @action-event="(actionKey, args) => emitEventHandler(actionKey, args)"
+                @callback="callbackPage"
+                @close="closeDialog"
+            />
+        </template>
+        <!-- 内嵌url表单,外部url表单 -->
+        <template v-else-if="formModel.type === 'URL_LOAD' || formModel.type === 'FRAME'">
+            <form-toolbar
+                v-if="formModel.type === 'URL_LOAD'"
+                :buttons="buttons"
+                @validate="validateForm"
+                @action-event="(actionKey, args) => emitButtonEventHandler(actionKey, args)"
+                @callback="callbackPage"
+                @close="closeDialog"
+            />
+            <iframe
+                v-if="formUrlType === 'iframe'"
+                ref="formrender"
+                :class="formModel.type === 'URL_LOAD' ? 'ibps-container-url-frame' : 'ibps-container-frame'"
+                frameborder="0"
+            />
+            <component
+                :is="formUrlName"
+                v-else
+                ref="formrender"
+                :params="formParams"
+                :readonly="readonly"
+                @action-event="(actionKey, args) => emitButtonEventHandler(actionKey, args)"
+                @callback="callbackPage"
+                @close="closeDialog"
+            />
+        </template>
+        <!-- 流程图 -->
+        <flow-diagram-dialog
+            :visible="flowDiagramVisible"
+            :def-id="defId"
+            :task-id="taskId"
+            :inst-id="instanceId"
+            @close="visible => (flowDiagramVisible = visible)"
+        />
+        <!-- 流程历史 -->
+        <approval-history-dialog
+            :visible="approvalHistoryVisible"
+            :task-id="taskId"
+            :inst-id="instanceId"
+            @close="visible => (approvalHistoryVisible = visible)"
+        />
+        <!-- 流程实例 -->
+        <instance-detail
+            :visible="instanceDetailVisible"
+            :bpmn-inst-id="instanceId"
+            @close="visible => (instanceDetailVisible = visible)"
+        />
+        <!-- 启动流程 -->
+        <start-flow-dialog
+            :visible="startFlowDialogVisible"
+            :def-id="defId"
+            :data="submitFormData"
+            :title="actionTitle"
+            @close="visible => (startFlowDialogVisible = visible)"
+            @action-event="saveStartFlow"
+        />
+        <!-- 同意 -->
+        <agree-dialog
+            :visible="agreeDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :version="version"
+            :is-common="attributes.isCommonJumpType"
+            :hide-opinion="isBpmOpinionHide"
+            :hide-path="attributes.isHidePath"
+            :form-opinion="submitFormOpinion"
+            @close="visible => (agreeDialogVisible = visible)"
+            @action-event="handleActionEvent"
+        />
+        <!-- 驳回 -->
+        <reject-dialog
+            :visible="rejectDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :hide-opinion="isBpmOpinionHide"
+            :form-opinion="submitFormOpinion"
+            @close="visible => (rejectDialogVisible = visible)"
+            @action-event="handleActionEvent"
+        />
+        <!-- 终止流程 -->
+        <approve-dialog
+            :visible="approveDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :hide-opinion="isBpmOpinionHide"
+            :form-opinion="submitFormOpinion"
+            callback-event
+            @close="visible => (approveDialogVisible = visible)"
+            @action-event="handleActionEvent"
+        />
+        <!-- 转办 -->
+        <delegate-dialog
+            :id="taskChangeId"
+            :visible="delegateDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :readonly="delegateReadonly"
+            @close="visible => (delegateDialogVisible = visible)"
+            @callback="callbackPage"
+        />
+        <!-- 任务补签 -->
+        <add-sign-task-dialog
+            :visible="addSignTaskDialogVisible"
+            :action="actionName"
+            :title="actionTitle"
+            :task-id="taskId"
+            :hide-opinion="false"
+            :form-opinion="submitFormOpinion"
+            @close="visible => (addSignTaskDialogVisible = visible)"
+            @action-event="handleActionEvent"
+            @callback="callbackPage"
+        />
+        <!-- 表单打印 -->
+        <form-print-template
+            :id="printTemplateId"
+            :data="submitFormData"
+            :pk="pkValue"
+            :visible="formPrintTemplateDialogVisible"
+            @close="visible => (formPrintTemplateDialogVisible = visible)"
+        />
+    </div>
 </template>
 <script>
-import { getFormData, getInstFormData } from '@/api/platform/bpmn/bpmInst'
-import { getTaskFormData } from '@/api/platform/bpmn/bpmTask'
-
-import FormUtil from '@/business/platform/form/utils/formUtil'
-import FormFieldUtil from '@/business/platform/form/utils/formFieldUtil'
-import ActionMixin from './action'
-import BpmnButton from './button'
-
-import Formrender from '@/business/platform/form/formrender/index.vue'
-import FormToolbar from '@/business/platform/form/formrender/toolbar.vue'
+    import { getFormData, getInstFormData } from '@/api/platform/bpmn/bpmInst'
+    import { getTaskFormData } from '@/api/platform/bpmn/bpmTask'
 
-import FlowDiagramDialog from '@/business/platform/bpmn/components/flow-diagram/dialog'
-import ApprovalHistoryDialog from '@/business/platform/bpmn/components/approval-history/dialog'
-import InstanceDetail from '@/views/platform/bpmn/bpmInst/detail'
+    import FormUtil from '@/business/platform/form/utils/formUtil'
+    import FormFieldUtil from '@/business/platform/form/utils/formFieldUtil'
+    import ActionMixin from './action'
+    import BpmnButton from './button'
 
-import StartFlowDialog from '@/business/platform/bpmn/form-ext/start-flow'
-import AgreeDialog from '@/business/platform/bpmn/form-ext/agree'
-import RejectDialog from '@/business/platform/bpmn/form-ext/reject'
-import ApproveDialog from '@/business/platform/bpmn/form-ext/approve'
-import DelegateDialog from '@/business/platform/bpmn/task-change/edit'
-import AddSignTaskDialog from '@/business/platform/bpmn/form-ext/add-sign-task'
+    import Formrender from '@/business/platform/form/formrender/index.vue'
+    import FormToolbar from '@/business/platform/form/formrender/toolbar.vue'
 
-import FormPrintTemplate from '@/business/platform/form/form-print/template'
+    import FlowDiagramDialog from '@/business/platform/bpmn/components/flow-diagram/dialog'
+    import ApprovalHistoryDialog from '@/business/platform/bpmn/components/approval-history/dialog'
+    import InstanceDetail from '@/views/platform/bpmn/bpmInst/detail'
 
-const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
+    import StartFlowDialog from '@/business/platform/bpmn/form-ext/start-flow'
+    import AgreeDialog from '@/business/platform/bpmn/form-ext/agree'
+    import RejectDialog from '@/business/platform/bpmn/form-ext/reject'
+    import ApproveDialog from '@/business/platform/bpmn/form-ext/approve'
+    import DelegateDialog from '@/business/platform/bpmn/task-change/edit'
+    import AddSignTaskDialog from '@/business/platform/bpmn/form-ext/add-sign-task'
 
-export default {
-  components: {
-    Formrender,
-    FormToolbar,
-    FlowDiagramDialog,
-    ApprovalHistoryDialog,
-    InstanceDetail,
-    StartFlowDialog,
-    AgreeDialog,
-    RejectDialog,
-    ApproveDialog,
-    DelegateDialog,
-    AddSignTaskDialog,
-    FormPrintTemplate
-  },
-  mixins: [
-    ActionMixin
-  ],
-  props: {
-    defId: { // 流程定义ID
-      type: String
-    },
-    proInstId: { // 草稿流程实例ID
-      type: String
-    },
-    instanceId: { // 流程实例ID
-      type: String
-    },
-    taskId: { // 流程任务ID
-      type: String
-    },
-    taskChangeId: { // 转办代理任务ID
-      type: String
-    },
-    waiJian: { // waiJianID
-      type: String
-    },
-    addDataCont: { // 新增参数
-      type: Object
-    },
-    copyFlow: { // 是否复制流程
-      type: Boolean,
-      default: false
-    },
-    flowName:{
-       type: String
-    },
-    closeable: {
-      type: Boolean,
-      default: true
-    },
-    processName: { // 流程名称
-      type: String,
-      default: ''
-    }
-  },
-  data() {
-    return {
-      flowDiagramVisible: false,
-      approvalHistoryVisible: false,
-      instanceDetailVisible: false,
-      startFlowDialogVisible: false,
-      agreeDialogVisible: false, // 同意
-      rejectDialogVisible: false,
-      delegateDialogVisible: false,
-      addSignTaskDialogVisible: false,
-      approveDialogVisible: false,
-
-      delegateReadonly: false,
-
-      endProcessTaskId: '',
+    import FormPrintTemplate from '@/business/platform/form/form-print/template'
 
-      actionName: '',
-      actionTitle: '',
-      version: '',
-      // ========表单的数据=======
-      loading: false,
-      formUrlName: '',
-      formUrlType: 'inner', // 内嵌url方式:inner: vue组件方式,iframe:iframe方式
+    const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 
-      formModel: {
-        type: 'INNER'
-      },
-      formDef: null,
-      buttons: [],
-      formData: {},
-      attributes: {}, // 新增扩展属性
-      formParams: {}, // 表单流程扩展参数
-      isBpmOpinionHide: false,
-      readonly: false,
+    export default {
+        components: {
+            Formrender,
+            FormToolbar,
+            FlowDiagramDialog,
+            ApprovalHistoryDialog,
+            InstanceDetail,
+            StartFlowDialog,
+            AgreeDialog,
+            RejectDialog,
+            ApproveDialog,
+            DelegateDialog,
+            AddSignTaskDialog,
+            FormPrintTemplate
+        },
+        mixins: [ActionMixin],
+        props: {
+            // 流程定义ID
+            defId: {
+                type: String
+            },
+            // 草稿流程实例ID
+            proInstId: {
+                type: String
+            },
+            // 流程实例ID
+            instanceId: {
+                type: String
+            },
+            // 流程任务ID
+            taskId: {
+                type: String
+            },
+            // 转办代理任务ID
+            taskChangeId: {
+                type: String
+            },
+            // waiJianID
+            waiJian: {
+                type: String
+            },
+            // 新增参数
+            addDataCont: {
+                type: Object
+            },
+            // 是否复制流程
+            copyFlow: {
+                type: Boolean,
+                default: false
+            },
+            flowName: {
+                type: String
+            },
+            closeable: {
+                type: Boolean,
+                default: true
+            },
+            // 流程名称
+            processName: {
+                type: String,
+                default: ''
+            }
+        },
+        data() {
+            return {
+                flowDiagramVisible: false,
+                approvalHistoryVisible: false,
+                instanceDetailVisible: false,
+                startFlowDialogVisible: false,
+                agreeDialogVisible: false, // 同意
+                rejectDialogVisible: false,
+                delegateDialogVisible: false,
+                addSignTaskDialogVisible: false,
+                approveDialogVisible: false,
+                delegateReadonly: false,
 
-      submitFormData: {},
-      submitFormOpinion: '',
-      printTemplateId: '',
-      formPrintTemplateDialogVisible: false,
-      pkValue: ''
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    // 获取数据
-    loadFormData() {
-      this.loading = true
-      this.formDef = null
-      this.buttons = null
-      this.formData = null
-      this.$nextTick(() => {
-        this.readonly = false
-        
-        if (this.$utils.isNotEmpty(this.taskId)) { // 处理流程任务
-          this.getTaskFormData()
-        } else if (this.$utils.isNotEmpty(this.defId)) { // 启动 或者草稿流程启动
-          this.getDefinitionFormData()
-        } else if (this.$utils.isNotEmpty(this.instanceId)) { // 流程实例
-          this.getInstanceFormData()
-        } else {
-          this.$alert('未获取正确的参数,请检查传入参数').then(() => {
-            this.closeDialog()
-          })
-          this.loading = false
-        }
-      })
-    },
+                endProcessTaskId: '',
+                actionName: '',
+                actionTitle: '',
+                version: '',
+                // 表单数据
+                loading: false,
+                formUrlName: '',
+                // 内嵌url方式:inner: vue组件方式,iframe:iframe方式
+                formUrlType: 'inner',
+                formModel: {
+                    type: 'INNER'
+                },
+                formDef: null,
+                buttons: [],
+                formData: {},
+                // 新增扩展属性
+                attributes: {},
+                // 表单流程扩展参数
+                formParams: {},
+                isBpmOpinionHide: false,
+                readonly: false,
+                submitFormData: {},
+                submitFormOpinion: '',
+                printTemplateId: '',
+                formPrintTemplateDialogVisible: false,
+                pkValue: ''
+            }
+        },
+        watch: {
+            visible: {
+                handler: function (val, oldVal) {
+                    this.dialogVisible = this.visible
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            // 获取数据
+            loadFormData() {
+                this.loading = true
+                this.formDef = null
+                this.buttons = null
+                this.formData = null
+                this.$nextTick(() => {
+                    this.readonly = false
+                    if (this.$utils.isNotEmpty(this.taskId)) {
+                        // 处理流程任务
+                        this.getTaskFormData()
+                    } else if (this.$utils.isNotEmpty(this.defId)) {
+                        // 启动 或者草稿流程启动
+                        this.getDefinitionFormData()
+                    } else if (this.$utils.isNotEmpty(this.instanceId)) {
+                        // 流程实例
+                        this.getInstanceFormData()
+                    } else {
+                        this.$alert('未获取正确的参数,请检查传入参数').then(() => {
+                            this.closeDialog()
+                        })
+                        this.loading = false
+                    }
+                })
+            },
 
-    /**
-     * 启动 或者草稿流程。
-     */
-    getDefinitionFormData() {
-      const proInstId = this.proInstId || null
-      const copyFlow = this.copyFlow || null
-      this.formParams.defId = this.defId
-      this.formParams.proInstId = proInstId
-      this.formParams.copyFlow = copyFlow
-      this.formParams.addDataCont = this.addDataCont
+            /**
+             * 启动 或者草稿流程。
+             */
+            getDefinitionFormData() {
+                const proInstId = this.proInstId || null
+                const copyFlow = this.copyFlow || null
+                this.formParams.defId = this.defId
+                this.formParams.proInstId = proInstId
+                this.formParams.copyFlow = copyFlow
+                this.formParams.addDataCont = this.addDataCont
 
-      getFormData({
-        defId: this.defId,
-        proInstId: proInstId,
-        copy: copyFlow
-      }).then(response => {
-        this.loading = false
-        this.buildFormData(response.data)
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取流程任务表单
-     */
-    getTaskFormData() {
-      this.loading = true
-      this.formParams.taskId = this.taskId || null
-      this.formParams.waiJian = this.waiJian || null
-      getTaskFormData({
-        taskId: this.taskId,
-        waiJian: this.waiJian
-      }).then(response => {
-        this.loading = false
-        this.buildFormData(response.data)
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 流程实例 的表单数据
-     */
-    getInstanceFormData() {
-      this.readonly = true
-      this.formParams.instanceId = this.instanceId || null
-      getInstFormData({
-        instId: this.instanceId
-      }).then(response => {
-        this.loading = false
-        this.buildFormData(response.data)
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 构建表单相关数据
-     */
-    buildFormData(data) {
-      if (this.$utils.isEmpty(data)) {
-        this.$alert(`未获取到数据`).then(() => {
-          this.closeDialog()
-        })
-        return
-      }
-      const formModel = data.formModel
-      this.formUrlType = 'inner'
+                getFormData({
+                    defId: this.defId,
+                    proInstId: proInstId,
+                    copy: copyFlow
+                }).then(response => {
+                    this.loading = false
+                    this.buildFormData(response.data)
+                }).catch(() => {
+                    this.loading = false
+                })
+            },
+            /**
+             * 获取流程任务表单
+             */
+            getTaskFormData() {
+                this.loading = true
+                this.formParams.taskId = this.taskId || null
+                this.formParams.waiJian = this.waiJian || null
+                getTaskFormData({
+                    taskId: this.taskId,
+                    waiJian: this.waiJian
+                }).then(response => {
+                    this.loading = false
+                    this.buildFormData(response.data)
+                }).catch(() => {
+                    this.loading = false
+                })
+            },
+            /**
+             * 流程实例 的表单数据
+             */
+            getInstanceFormData() {
+                this.readonly = true
+                this.formParams.instanceId = this.instanceId || null
+                getInstFormData({
+                    instId: this.instanceId
+                }).then(response => {
+                    this.loading = false
+                    this.buildFormData(response.data)
+                }).catch(() => {
+                    this.loading = false
+                })
+            },
+            /**
+             * 构建表单相关数据
+             */
+            buildFormData(data) {
+                if (this.$utils.isEmpty(data)) {
+                    this.$alert(`未获取到数据`).then(() => {
+                        this.closeDialog()
+                    })
+                    return
+                }
+                const formModel = data.formModel
+                this.formUrlType = 'inner'
 
-      // 判断是否设置表单
-      if (this.$utils.isEmpty(formModel)) {
-        this.$alert(`未设置表单,请流程定义中设置表单`).then(() => {
-          this.closeDialog()
-        })
-        return
-      }
-      this.formModel = formModel
-      // ============在线表单 ================
-      if (formModel.type === 'INNER') {
-        if (this.$utils.isEmpty(formModel.formData)) {
-          this.$alert(`未设置在线表单`).then(() => {
-            this.closeDialog()
-          })
-        }
+                // 判断是否设置表单
+                if (this.$utils.isEmpty(formModel)) {
+                    this.$alert(`未设置表单,请流程定义中设置表单`).then(() => {
+                        this.closeDialog()
+                    })
+                    return
+                }
+                this.formModel = formModel
+                // 数据预处理,审批意见数据添加审批人姓名
+                if (data.attributes && data.attributes.opinionList && data.attributes.opinionList.length) {
+                    let users = this.$store.getters.usersList || []
+                    data.attributes.opinionList.forEach(item => {
+                        let userInfo = users.find(i => i.userId === item.auditor)
+                        item.auditorName = userInfo ? userInfo.userName : null
+                    })
+                }
+                // ============在线表单 ================
+                if (formModel.type === 'INNER') {
+                    if (this.$utils.isEmpty(formModel.formData)) {
+                        this.$alert(`未设置在线表单`).then(() => {
+                            this.closeDialog()
+                        })
+                    }
 
-        // 表单定义
-        this.formDef = this.$utils.parseData(formModel.formData) || {}
-        this.formDef.flowName = this.flowName
-        this.formDef.processName = this.processName
+                    // 表单定义
+                    this.formDef = this.$utils.parseData(formModel.formData) || {}
+                    this.formDef.flowName = this.flowName
+                    this.formDef.processName = this.processName
 
-        this.formData = {
-          // 表单数据
-          responses: this.$utils.parseData(data.boData) || {},
-          // 表单权限
-          permissions: this.$utils.parseData(data.permissions) || {}
-        }
+                    this.formData = {
+                        // 表单数据
+                        responses: this.$utils.parseData(data.boData) || {},
+                        // 表单权限
+                        permissions: this.$utils.parseData(data.permissions) || {}
+                    }
 
-        // 一些参数
-        this.attributes = this.initAttributes(data)
-        this.formParams.nodeId = this.attributes.nodeId
-        // 操作按钮
-        this.buttons = this.buildButtons(data.buttons, this.attributes) || []
-        // 表单意见
-        this.formParams.formOpinionData = FormUtil.initFormOpinionData(data.attributes || {})
+                    // 一些参数
+                    this.attributes = this.initAttributes(data)
+                    this.formParams.nodeId = this.attributes.nodeId
+                    // 操作按钮
+                    this.buttons = this.buildButtons(data.buttons, this.attributes) || []
+                    // 表单意见
+                    this.formParams.formOpinionData = FormUtil.initFormOpinionData(data.attributes || {})
 
-        // 表单意见是否隐藏意见
-        this.$nextTick(() => {
-          this.isBpmOpinionHide = this.handleBpmOpinionHide(data.attributes || {}, this.formDef)
-        })
-        // 流程关联信息
-        this.formParams.bpmLinkData = FormUtil.getBpmLinkData(data.attributes || {})
-        // 打印模版
-        this.printTemplateId = this.attributes.templateId
+                    // 表单意见是否隐藏意见
+                    this.$nextTick(() => {
+                        this.isBpmOpinionHide = this.handleBpmOpinionHide(data.attributes || {}, this.formDef)
+                    })
+                    // 流程关联信息
+                    this.formParams.bpmLinkData = FormUtil.getBpmLinkData(data.attributes || {})
+                    // 打印模版
+                    this.printTemplateId = this.attributes.templateId
 
-        // 版本号
-        this.version = data.version
-        // 流程实例当前审批节点
-        this.endProcessTaskId = data.endProcessTaskId
-      //  ============内嵌表单[按钮这边提供] ================
-      } else if (formModel.type === 'URL_LOAD') {
-        const urlForm = formModel.formValue
-        if (this.$utils.isEmpty(urlForm)) {
-          this.$alert(`未设置内嵌表单`).then(() => {
-            this.closeDialog()
-          })
-        }
-        // 一些参数
-        this.attributes = this.initAttributes(data)
-        this.formParams.nodeId = this.attributes.nodeId
+                    // 版本号
+                    this.version = data.version
+                    // 流程实例当前审批节点
+                    this.endProcessTaskId = data.endProcessTaskId
+                    //  ============内嵌表单[按钮这边提供] ================
+                } else if (formModel.type === 'URL_LOAD') {
+                    const urlForm = formModel.formValue
+                    if (this.$utils.isEmpty(urlForm)) {
+                        this.$alert(`未设置内嵌表单`).then(() => {
+                            this.closeDialog()
+                        })
+                    }
+                    // 一些参数
+                    this.attributes = this.initAttributes(data)
+                    this.formParams.nodeId = this.attributes.nodeId
 
-        // 操作按钮
-        this.buttons = this.buildButtons(data.buttons, this.attributes) || []
-        // 初始化url表单
-        this.initUrlForm(urlForm)
-        console.log(urlForm, this.attributes,data,this.formParams)
-      //  ============外部表单【iframe】 ================
-      } else if (formModel.type === 'FRAME') {
-        const urlForm = formModel.formValue
-        if (this.$utils.isEmpty(urlForm)) {
-          this.$alert(`未设置外部表单`).then(() => {
-            this.closeDialog()
-          })
-        }
-        // 初始化url表单
-        this.initUrlForm(urlForm)
-         console.log(urlForm, this.attributes,data,this.formParams)
-      }
-    },
-    // 初始化url表单
-    initUrlForm(url) {
-      if (url.startsWith('http')) {
-        this.formUrlType = 'iframe'
-        this.$nextTick(() => {
-          this.$refs.formrender.src = url
-          // 传递消息
-          this.$refs.formrender.contentWindow.postMessage({ data: this.attributes }, '*')
-        })
-      } else {
-        const component = url.split('?')[0]
-        this.formParams.attrs = this.urlParse(url)
-        this.formUrlType = 'inner'
-        const formUrlName = 'IbpsBpmnFormUrl'
-        this.$options.components[formUrlName] = _import(component)
-        this.formUrlName = formUrlName
-      }
-    },
-    urlParse(str) {
-      const obj = {}
-      if (str.indexOf('?') !== -1) {
-        const str1 = str.split('?')[1].split('&')
-        for (let i = 0; i < str1.length; i++) {
-          const params = str1[i].split('=')
-          obj[params[0]] = params[1]
-        }
-      }
-      return obj
-    },
-    initAttributes(data) {
-      const attributes = data.attributes || {}
-      return {
-        title: this.title,
-        defId: this.defId,
-        proInstId: this.proInstId,
-        taskId: this.taskId,
-        nodeId: attributes.nodeId,
-        // 锁定用户
-        lockUser: attributes.lockUser,
-        // 当前用户
-        curUserId: attributes.curUserId,
-        // 挂起状态
-        suspendState: attributes.suspendState,
-        // 是否转办
-        isHiddenDelegate: this.$utils.toBoolean(attributes.isHiddenDelegate),
-        // 是否正常跳转
-        isCommonJumpType: this.$utils.toBoolean(attributes.isCommonJumpType),
-        // 是否隐藏意见
-        isHideOpinion: this.$utils.toBoolean(attributes.isHideOpinion),
-        // 是否隐藏路径
-        isHidePath: this.$utils.toBoolean(attributes.isHidePath),
-        // 是否结束
-        isEnd: this.$utils.toBoolean(attributes.isEnd),
-        // 第一个节点是否选择
-        firstNodeUserAssign: attributes.firstNodeUserAssign,
-        // 打印模版
-        printTemplateId: data.formModel.templateId,
-        // BO版本号
-        version: data.version
-      }
-    },
-    handleBpmOpinionHide(attributes = {}, formDef) {
-      const formOpinionSetting = attributes.formOpinionSetting
-      const formOpinion = attributes.formOpinion
-      const curNodeId = attributes.nodeId
-      // 处理删除审批意见的bug
-      if (this.$utils.isNotEmpty(formOpinionSetting) && this.$utils.isNotEmpty(formOpinion)) {
-        const formOpinionField = FormFieldUtil.getFormOpinionField(formDef.fields)
-        for (const key in formOpinion) {
-          const nodeList = formOpinion[key]
-          if (!formOpinionField[key]) {
-            const nodeKey = JSON.stringify(nodeList)
-            delete formOpinionSetting[nodeKey]
-          }
-        }
-      }
+                    // 操作按钮
+                    this.buttons = this.buildButtons(data.buttons, this.attributes) || []
+                    // 初始化url表单
+                    this.initUrlForm(urlForm)
+                    console.log(urlForm, this.attributes, data, this.formParams)
+                    //  ============外部表单【iframe】 ================
+                } else if (formModel.type === 'FRAME') {
+                    const urlForm = formModel.formValue
+                    if (this.$utils.isEmpty(urlForm)) {
+                        this.$alert(`未设置外部表单`).then(() => {
+                            this.closeDialog()
+                        })
+                    }
+                    // 初始化url表单
+                    this.initUrlForm(urlForm)
+                    console.log(urlForm, this.attributes, data, this.formParams)
+                }
+            },
+            // 初始化url表单
+            initUrlForm(url) {
+                if (url.startsWith('http')) {
+                    this.formUrlType = 'iframe'
+                    this.$nextTick(() => {
+                        this.$refs.formrender.src = url
+                        // 传递消息
+                        this.$refs.formrender.contentWindow.postMessage({ data: this.attributes }, '*')
+                    })
+                } else {
+                    const component = url.split('?')[0]
+                    this.formParams.attrs = this.urlParse(url)
+                    this.formUrlType = 'inner'
+                    const formUrlName = 'IbpsBpmnFormUrl'
+                    this.$options.components[formUrlName] = _import(component)
+                    this.formUrlName = formUrlName
+                }
+            },
+            urlParse(str) {
+                const obj = {}
+                if (str.indexOf('?') !== -1) {
+                    const str1 = str.split('?')[1].split('&')
+                    for (let i = 0; i < str1.length; i++) {
+                        const params = str1[i].split('=')
+                        obj[params[0]] = params[1]
+                    }
+                }
+                return obj
+            },
+            initAttributes(data) {
+                const attributes = data.attributes || {}
+                return {
+                    title: this.title,
+                    defId: this.defId,
+                    proInstId: this.proInstId,
+                    taskId: this.taskId,
+                    nodeId: attributes.nodeId,
+                    // 锁定用户
+                    lockUser: attributes.lockUser,
+                    // 当前用户
+                    curUserId: attributes.curUserId,
+                    // 挂起状态
+                    suspendState: attributes.suspendState,
+                    // 是否转办
+                    isHiddenDelegate: this.$utils.toBoolean(attributes.isHiddenDelegate),
+                    // 是否正常跳转
+                    isCommonJumpType: this.$utils.toBoolean(attributes.isCommonJumpType),
+                    // 是否隐藏意见
+                    isHideOpinion: this.$utils.toBoolean(attributes.isHideOpinion),
+                    // 是否隐藏路径
+                    isHidePath: this.$utils.toBoolean(attributes.isHidePath),
+                    // 是否结束
+                    isEnd: this.$utils.toBoolean(attributes.isEnd),
+                    // 第一个节点是否选择
+                    firstNodeUserAssign: attributes.firstNodeUserAssign,
+                    // 打印模版
+                    printTemplateId: data.formModel.templateId,
+                    // BO版本号
+                    version: data.version
+                }
+            },
+            handleBpmOpinionHide(attributes = {}, formDef) {
+                const formOpinionSetting = attributes.formOpinionSetting
+                const formOpinion = attributes.formOpinion
+                const curNodeId = attributes.nodeId
+                // 处理删除审批意见的bug
+                if (this.$utils.isNotEmpty(formOpinionSetting) && this.$utils.isNotEmpty(formOpinion)) {
+                    const formOpinionField = FormFieldUtil.getFormOpinionField(formDef.fields)
+                    for (const key in formOpinion) {
+                        const nodeList = formOpinion[key]
+                        if (!formOpinionField[key]) {
+                            const nodeKey = JSON.stringify(nodeList)
+                            delete formOpinionSetting[nodeKey]
+                        }
+                    }
+                }
 
-      if (this.$utils.isNotEmpty(formOpinionSetting)) {
-        let flag = false
-        for (const o in formOpinionSetting) {
-          const formOpinionHidden = formOpinionSetting[o]
-          try {
-            const nodeIds = this.$utils.parseJSON(o)
-            if (nodeIds.includes(curNodeId)) {
-              flag = this.$utils.toBoolean(formOpinionHidden)
-              break
+                if (this.$utils.isNotEmpty(formOpinionSetting)) {
+                    let flag = false
+                    for (const o in formOpinionSetting) {
+                        const formOpinionHidden = formOpinionSetting[o]
+                        try {
+                            const nodeIds = this.$utils.parseJSON(o)
+                            if (nodeIds.includes(curNodeId)) {
+                                flag = this.$utils.toBoolean(formOpinionHidden)
+                                break
+                            }
+                        } catch (err) {
+                            console.error(err)
+                        }
+                    }
+                    return this.hasFormOpinion() && !flag ? flag : true
+                }
+                // 是否有表单意见
+                return this.hasFormOpinion() ? true : (this.attributes.isHideOpinion || false)
+            },
+            /**
+             * 构建操作按钮
+             */
+            buildButtons(toolbars, params) {
+                if (this.$utils.isEmpty(toolbars)) {
+                    toolbars = []
+                }
+                // 如果转办,代理不为空
+                if (this.$utils.isNotEmpty(this.taskChangeId)) {
+                    toolbars.unshift({
+                        alias: 'delegateDetail',
+                        name: '转办/代理明细'
+                    })
+                }
+                if (this.closeable) {
+                    toolbars.unshift({
+                        alias: 'close'
+                    })
+                }
+                const buttons = []
+                // 已办事宜去除打印按钮和流程实例信息按钮(区分标准,this.instanceId有值则为已办)
+                const filterType = ['print', 'instanceDetail']
+                for (let i = 0; i < toolbars.length; i++) {
+                    const button = toolbars[i]
+                    const alias = button.alias
+                    const code = button.code
+                    button.key = alias === 'custom' ? (code || (alias + i)) : alias
+                    if (!this.instanceId) {
+                        buttons.push(button)
+                    } else if (!filterType.includes(button.key)) {
+                        buttons.push(button)
+                    }
+                }
+                const bpmnButton = new BpmnButton({
+                    buttons: buttons,
+                    params: params
+                })
+                return bpmnButton.response_buttons
+            },
+            getFormEL() {
+                if (this.formUrlType === 'inner') {
+                    return this.$refs.formrender
+                } else {
+                    try {
+                        // 跨域获取表单数据
+                        return this.$refs.formrender.contentWindow.ibpsFormUrl
+                    } catch (err) {
+                        console.error(err)
+                    }
+                }
+            },
+            // 获取表单数据
+            getFormData() {
+                if (!(this.getFormEL() && this.getFormEL().getFormData)) {
+                    this.$message({
+                        message: 'URL表单必须包含获取表单数据的方法【getFormData】',
+                        type: 'warning'
+                    })
+                    return
+                }
+                return this.getFormEL().getFormData()
+            },
+            // 是否有审批意见字段
+            hasFormOpinion() {
+                if (!(this.getFormEL() && this.getFormEL().hasFormOpinion)) {
+                    return false
+                }
+                return this.getFormEL().hasFormOpinion() || false
+            },
+            // 获取表单意见数据
+            getFormOpinionData() {
+                if (!(this.getFormEL() && this.getFormEL().getFormOpinionData)) {
+                    return ''
+                }
+                const formOpinionData = this.getFormEL().getFormOpinionData()
+                let data = ''
+                if (this.$utils.isEmpty(formOpinionData)) {
+                    return data
+                }
+                // 如果只有一个,多个,取最后一个
+                for (const key in formOpinionData) {
+                    data = formOpinionData[key]
+                }
+                return data
+            },
+            /**
+             * 获取审批意见验证
+             */
+            formOpinionValidate(calback, flag) {
+                if (!(this.getFormEL() && this.getFormEL().formOpinionValidate)) {
+                    calback(false)
+                    return false
+                }
+                this.getFormEL().formOpinionValidate(calback, flag)
+            },
+            // 前置事件
+            beforeScript(key, callback) {
+                if (!(this.getFormEL() && this.getFormEL().beforeScript)) {
+                    const flag = true
+                    callback(flag)
+                    return
+                }
+                return this.getFormEL().beforeScript(key, callback)
+            },
+            // 后置事件
+            afterScript(key, params, callback) {
+                if (!(this.getFormEL() && this.getFormEL().afterScript)) {
+                    const flag = true
+                    callback(flag)
+                    return
+                }
+                return this.getFormEL().afterScript(key, params, callback)
+            },
+            // 回调上一个页面
+            callbackPage() {
+                this.closeDialog()
+                this.$emit('callback', this)
+            },
+            // 关闭当前窗口
+            closeDialog() {
+                if (this.closeable) {
+                    this.$emit('close', false)
+                }
+            },
+            // 验证表单
+            validateForm(callback) {
+                if (!(this.getFormEL() && this.getFormEL().validate)) {
+                    const flag = true
+                    callback(flag)
+                    return
+                }
+                this.getFormEL().validate((valid, invalidFields) => {
+                    callback(valid, invalidFields)
+                })
             }
-          } catch (err) {
-            console.error(err)
-          }
         }
-        return this.hasFormOpinion() && !flag ? flag : true
-      }
-      // 是否有表单意见
-      return this.hasFormOpinion() ? true : (this.attributes.isHideOpinion || false)
-    },
-    /**
-     * 构建操作按钮
-     */
-    buildButtons(toolbars, params) {
-      if (this.$utils.isEmpty(toolbars)) {
-        toolbars = []
-      }
-      // 如果转办,代理不为空
-      if (this.$utils.isNotEmpty(this.taskChangeId)) {
-        toolbars.unshift({
-          alias: 'delegateDetail',
-          name: '转办/代理明细'
-        })
-      }
-      if (this.closeable) {
-        toolbars.unshift({
-          alias: 'close'
-        })
-      }
-      const buttons = []
-      for (let i = 0; i < toolbars.length; i++) {
-        const button = toolbars[i]
-        const alias = button.alias
-        const code = button.code
-        button.key = alias === 'custom' ? (code || (alias + i)) : alias
-        buttons.push(button)
-      }
-      const bpmnButton = new BpmnButton({
-        buttons: buttons,
-        params: params
-      })
-      return bpmnButton.response_buttons
-    },
-    getFormEL() {
-      if (this.formUrlType === 'inner') {
-        return this.$refs.formrender
-      } else {
-        try {
-          // 跨域获取表单数据
-          return this.$refs.formrender.contentWindow.ibpsFormUrl
-        } catch (err) {
-          console.error(err)
-        }
-      }
-    },
-    // 获取表单数据
-    getFormData() {
-      if (!(this.getFormEL() && this.getFormEL().getFormData)) {
-        this.$message({
-          message: 'URL表单必须包含获取表单数据的方法【getFormData】',
-          type: 'warning'
-        })
-        return
-      }
-      return this.getFormEL().getFormData()
-    },
-    // 是否有审批意见字段
-    hasFormOpinion() {
-      if (!(this.getFormEL() && this.getFormEL().hasFormOpinion)) {
-        return false
-      }
-      return this.getFormEL().hasFormOpinion() || false
-    },
-    // 获取表单意见数据
-    getFormOpinionData() {
-      if (!(this.getFormEL() && this.getFormEL().getFormOpinionData)) {
-        return ''
-      }
-      const formOpinionData = this.getFormEL().getFormOpinionData()
-      let data = ''
-      if (this.$utils.isEmpty(formOpinionData)) {
-        return data
-      }
-      // 如果只有一个,多个,取最后一个
-      for (const key in formOpinionData) {
-        data = formOpinionData[key]
-      }
-      return data
-    },
-    /**
-     * 获取审批意见验证
-     */
-    formOpinionValidate(calback, flag) {
-      if (!(this.getFormEL() && this.getFormEL().formOpinionValidate)) {
-        calback(false)
-        return false
-      }
-      this.getFormEL().formOpinionValidate(calback, flag)
-    },
-    // 前置事件
-    beforeScript(key, callback) {
-      if (!(this.getFormEL() && this.getFormEL().beforeScript)) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      return this.getFormEL().beforeScript(key, callback)
-    },
-    // 后置事件
-    afterScript(key, params, callback) {
-      if (!(this.getFormEL() && this.getFormEL().afterScript)) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      return this.getFormEL().afterScript(key, params, callback)
-    },
-    // 回调上一个页面
-    callbackPage() {
-      this.closeDialog()
-      this.$emit('callback', this)
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      if (this.closeable) {
-        this.$emit('close', false)
-      }
-    },
-    // 验证表单
-    validateForm(callback) {
-      if (!(this.getFormEL() && this.getFormEL().validate)) {
-        const flag = true
-        callback(flag)
-        return
-      }
-      this.getFormEL().validate((valid, invalidFields) => {
-        callback(valid, invalidFields)
-      })
     }
-  }
-}
 </script>
 <style lang="scss" scoped>
-  .ibps-container-frame {
-      position: absolute;
-      top: 0px;
-      left: 0px;
-      height: 100%;
-      width: 100%;
-  }
-  .ibps-container-url-frame{
-    position: absolute;
-    top: 0px;
-    left: 0px;
-    width: 100%;
-    height: calc(100vh - 50px) !important;
-    margin-top: 50px;
-  }
+    .ibps-container-frame {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        height: 100%;
+        width: 100%;
+    }
+    .ibps-container-url-frame {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 100%;
+        height: calc(100vh - 50px) !important;
+        margin-top: 50px;
+    }
 </style>

+ 273 - 225
src/business/platform/form/formrender/dynamic-form/components/approval-opinion/index.vue

@@ -1,236 +1,284 @@
 <template>
-  <div>
-    <template v-if="opinionData && opinionData.length >0">
-      <!--审批历史记录-- 横向-->
-      <el-table v-if="layout === 'horizontal'" size="mini"  :header-cell-style="{'font-size':'10px',height:'20px',padding:'0px'}" :data="opinionData" border stripe>
-          <el-table-column
-             :label="options[2].label"
-             width="135">
+    <div>
+        <template v-if="opinionData && opinionData.length">
+            <!--审批历史记录 横向-->
+            <el-table
+                v-if="layout === 'horizontal'"
+                size="mini"
+                :header-cell-style="{ 'font-size': '10px', height: '20px', padding: '0px' }"
+                :data="opinionData"
+                border
+                stripe
+            >
+                <!-- 审批人 -->
+                <el-table-column :label="options[0].label" width="135">
+                    <template slot-scope="{row, $index}">
+                        {{ row[options[0].value] }}
+                    </template>
+                </el-table-column>
+                <!-- 审批状态 -->
+                <el-table-column :label="options[2].label" width="135">
+                    <template slot-scope="{row, $index}">
+                        <template v-if="options[2].value === 'statusName'">
+                            <el-tag
+                                style="border: 0;background-color:unset;"
+                                :style="{ 'color': row.nodeColor }"
+                                effect="plain"
+                            >
+                                <span v-if="row[options[2].value] === '同意'">
+                                    提交/通过
+                                </span>
+                                <span v-else-if="row[options[2].value] == '驳回'">
+                                    退回修改
+                                </span>
+                                <span v-else-if="row[options[2].value] == '驳回到发起人'">
+                                    <span style="color: red;">退回、重新编辑</span>
+                                </span>
+                                <span v-else-if="row[options[2].value] !== '反对'">
+                                    {{ row[options[2].value]}}
+                                </span>
+                            </el-tag>
+                        </template>
+                        <template v-else-if="options[2].value === 'opinion'">
+                            <ibps-text-ellipsis
+                                :text="row[options[2].value] | filterData(options[2], row)"
+                                :height="80"
+                                :is-limit-height="limitHeight[$index]"
+                            >
+                                <small slot="more">
+                                    <span>...</span>
+                                    <span class="el-dropdown-link" @click="onShowMore($index, false)">查看更多</span>
+                                </small>
+                                <small
+                                    v-if="!limitHeight[$index]"
+                                    slot="after"
+                                    class="el-dropdown-link"
+                                    @click="onShowMore($index, true)"
+                                >收起</small>
+                            </ibps-text-ellipsis>
+                        </template>
+                        <template v-else>
+                            <div style="height: 20px;">{{ row[options[2].value]| filterData(options[2], row) }}</div>
+                        </template>
+                    </template>
+                </el-table-column>
+                <!-- 审批时间 -->
+                <el-table-column :label="options[1].label" width="135">
+                    <template slot-scope="{row, $index}">
+                        {{ row[options[1].value]}}
+                    </template>
+                </el-table-column>
+                <!-- 审批意见 -->
+                <el-table-column :label="options[3].label">
+                    <template slot-scope="{row,$index }">
+                        <ibps-text-ellipsis
+                            :text="row[options[3].value] | filterData(options[3], row)"
+                            :height="80"
+                            :is-limit-height="limitHeight[$index]"
+                        >
+                            <small slot="more">
+                                <span>...</span>
+                                <span class="el-dropdown-link" @click="onShowMore($index, false)">查看更多</span>
+                            </small>
+                            <small
+                                v-if="!limitHeight[$index]"
+                                slot="after" class="el-dropdown-link"
+                                @click="onShowMore($index, true)"
+                            >收起</small>
+                        </ibps-text-ellipsis>
+                    </template>
+                </el-table-column>
+            </el-table>
 
-             <template slot-scope="{row,$index }">
-               <template v-if="options[2].value==='statusName'">
-                 <el-tag style="border: 0;background-color:unset;" :style="{'color':row.nodeColor}" effect="plain">
-                  	<span v-if="row[options[2].value] ==='同意'">
-                  				提交/通过
-                  					</span>
-                  					<span v-else-if="row[options[2].value] =='驳回'">
-                  						退回修改
-                  					</span>
-									<span v-else-if="row[options[2].value] =='驳回到发起人'">
-										<span style="color: red;">退回、重新编辑</span>
-									</span>
-                  					<span v-else-if="row[options[2].value] !=='反对'">
-                  						{{row[options[2].value]}}
-                  					</span>
-                 </el-tag>
-               </template>
-               <template v-else-if="options[2].value==='opinion'">
-                 <ibps-text-ellipsis
-                   :text="row[options[2].value]|filterData(options[2],row)"
-                   :height="80"
-                   :is-limit-height="limitHeight[$index ]"
-                 >
-                   <small slot="more"><span>...</span><span class="el-dropdown-link" @click="onShowMore($index ,false)">查看更多</span></small>
-                   <small v-if="!limitHeight[$index ]" slot="after" class="el-dropdown-link" @click="onShowMore($index ,true)">收起</small>
-                 </ibps-text-ellipsis>
-               </template>
-               
-               
-               
-               
-               <template v-else>
-                 <div style="height: 20px;">{{ row[options[2].value]|filterData(options[2],row) }}</div>
-               </template>
-             </template>
-           </el-table-column>
-           
-          <el-table-column
-             :label="options[1].label"
-             width="135">
-              <template slot-scope="{row,$index }">
-                {{row[options[1].value]}}
-               </template>
-           </el-table-column>
-          <el-table-column
-             :label="options[3].label"
-             >
-              <template slot-scope="{row,$index }">
-                <ibps-text-ellipsis
-                  :text="row[options[3].value]|filterData(options[3],row)"
-                  :height="80"
-                  :is-limit-height="limitHeight[$index]"
+            <!--审批历史记录 纵向-->
+            <template v-else>
+                <el-card
+                    v-for="(row, i) in opinionData"
+                    :key="i" shadow="hover"
+                    class="ibps-mb-10"
                 >
-                  <small slot="more"><span>...</span><span class="el-dropdown-link" @click="onShowMore($index,false)">查看更多</span></small>
-                  <small v-if="!limitHeight[$index]" slot="after" class="el-dropdown-link" @click="onShowMore($index,true)">收起</small>
-                </ibps-text-ellipsis>
-               </template>
-           </el-table-column>
-          </el-table>
-
-      <template v-else>
-        <!--审批历史记录, 纵向-->
-        <template v-for="(row,i) in opinionData">
-          <el-card :key="i" shadow="hover" class="ibps-mb-10">
-            <el-row v-for="(item,j) in options" :key="i+j" :gutter="20">
-              <template v-if="item.checked">
-                <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="1" class="ibps-tr">{{ item.label }}:</el-col>
-                <el-col :xs="16" :sm="18" :md="20" :lg="21" :xl="23">
-                  <el-tag v-if="item.value==='statusName'" style="border: 0;background-color:unset;" :style="{'color':row.nodeColor}" effect="plain">
-                    {{ row[item.value]|filterData(item,row) }}
-                  </el-tag>
-                  <template v-else-if="item.value==='opinion'">
-                    <ibps-text-ellipsis
-                      :text="row[item.value]|filterData(item,row)"
-                      :height="80"
-                      :is-limit-height="limitHeight[i]"
+                    <el-row
+                        v-for="(item, j) in options"
+                        :key="i + j"
+                        :gutter="20"
                     >
-                      <small slot="more"><span>...</span><span class="el-dropdown-link" @click="onShowMore(i,false)">查看更多</span></small>
-                      <small v-if="!limitHeight[i]" slot="after" class="el-dropdown-link" @click="onShowMore(i,true)">收起</small>
-                    </ibps-text-ellipsis>
-                  </template>
-                  <template v-else>
-                    {{ row[item.value]|filterData(item,row) }}
-                  </template>
-                </el-col>
-              </template>
-            </el-row>
-          </el-card>
+                        <template v-if="item.checked">
+                            <el-col :xs="8" :sm="6" :md="4" :lg="3" :xl="1" class="ibps-tr">
+                                {{ item.label }}:
+                            </el-col>
+                            <el-col :xs="16" :sm="18" :md="20" :lg="21" :xl="23">
+                                <el-tag
+                                    v-if="item.value === 'statusName'"
+                                    style="border: 0;background-color:unset;"
+                                    :style="{ 'color': row.nodeColor }"
+                                    effect="plain"
+                                >
+                                    {{ row[item.value]| filterData(item, row) }}
+                                </el-tag>
+                                <template v-else-if="item.value === 'opinion'">
+                                    <ibps-text-ellipsis
+                                        :text="row[item.value] | filterData(item, row)"
+                                        :height="80"
+                                        :is-limit-height="limitHeight[i]"
+                                    >
+                                        <small slot="more">
+                                            <span>...</span>
+                                            <span class="el-dropdown-link" @click="onShowMore(i, false)">查看更多</span>
+                                        </small>
+                                        <small
+                                            v-if="!limitHeight[i]"
+                                            slot="after"
+                                            class="el-dropdown-link"
+                                            @click="onShowMore(i, true)"
+                                        >收起</small>
+                                    </ibps-text-ellipsis>
+                                </template>
+                                <template v-else>
+                                    {{ row[item.value]| filterData(item, row) }}
+                                </template>
+                            </el-col>
+                        </template>
+                    </el-row>
+                </el-card>
+            </template>
         </template>
-      </template>
-    </template>
-    <ibps-approval-opinion
-      v-if="!readonly"
-      v-model="data"
-      :enable-common="commonCtatment"
-      :placeholder="placeholder"
-    />
-  </div>
+        <ibps-approval-opinion
+            v-if="!readonly"
+            v-model="data"
+            :enable-common="commonCtatment"
+            :placeholder="placeholder"
+        />
+    </div>
 </template>
 <script>
-import Utils from '@/utils/util'
-import { format, dateDealFmt } from '@/utils/fecha'
-import IbpsApprovalOpinion from '@/business/platform/bpmn/components/approval-opinion'
-import IbpsTextEllipsis from '@/components/ibps-text-ellipsis'
-export default {
-  components: {
-    IbpsApprovalOpinion,
-    IbpsTextEllipsis
-  },
-  filters: {
-    filterData(val, config, data) {
-      if (config.value === 'auditorName') {
-        if (Utils.isEmpty(data.auditor) &&
-          Utils.isNotEmpty(data.qualifiedExecutor)) {
-          // 会签  审批人处理
-          const name = []
-          for (var i = 0; i < data.qualifiedExecutor.length; i++) {
-            name.push(data.qualifiedExecutor[i].executor)
-          }
-          val = name.join(' ')
-        }
-      } else if (config.value === 'completeTime') { // 审批时间
-        if (Utils.isNotEmpty(val)) {
-          let dateObj = val
-          const dateFormat = 'yyyy-MM-dd HH:mm:ss'
-          try {
-            if (typeof dateObj === 'number') {
-              dateObj = new Date(dateObj)
+    import Utils from '@/utils/util'
+    import { format, dateDealFmt } from '@/utils/fecha'
+    import IbpsApprovalOpinion from '@/business/platform/bpmn/components/approval-opinion'
+    import IbpsTextEllipsis from '@/components/ibps-text-ellipsis'
+    export default {
+        components: {
+            IbpsApprovalOpinion,
+            IbpsTextEllipsis
+        },
+        filters: {
+            filterData (val, config, data) {
+                // 审批人
+                if (config.value === 'auditorName') {
+                    if (Utils.isEmpty(data.auditor) && Utils.isNotEmpty(data.qualifiedExecutor)) {
+                        // 会签  审批人处理
+                        const name = []
+                        for (var i = 0; i < data.qualifiedExecutor.length; i++) {
+                            name.push(data.qualifiedExecutor[i].executor)
+                        }
+                        val = name.join(' ')
+                    }
+                } else if (config.value === 'completeTime') {
+                    // 审批时间
+                    if (Utils.isNotEmpty(val)) {
+                        let dateObj = val
+                        const dateFormat = 'yyyy-MM-dd HH:mm:ss'
+                        try {
+                            if (typeof dateObj === 'number') {
+                                dateObj = new Date(dateObj)
+                            }
+                            if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
+                                // 需要把字符串转换日期格式
+                                dateObj = dateDealFmt.dealFmt(dateObj, dateFormat)
+                            }
+                            val = format(dateObj, dateFormat)
+                        } catch (error) {
+                            console.error('转换日期格式错误:', error)
+                            val = ''
+                        }
+                    }
+                }
+                return val
             }
-            if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
-              // 需要把字符串转换日期格式
-              dateObj = dateDealFmt.dealFmt(dateObj, dateFormat)
+        },
+        inject: {
+            elForm: {
+                default: ''
+            }
+        },
+        props: {
+            value: String,
+            // 字段
+            field: Object,
+            // 只读
+            readonly: {
+                type: Boolean,
+                default: false
+            },
+            // 只读样式
+            readonlyStyle: String,
+            // 审批意见
+            opinionData: {
+                type: Array
+            },
+            params: Object
+        },
+        data () {
+            return {
+                data: '',
+                isLimitHeight: {}
+            }
+        },
+        computed: {
+            commonCtatment () {
+                return this.field ? this.field.field_options.common_statment : true
+            },
+            layout () {
+                return this.field ? this.field.field_options.arrangement : 'horizontal'
+            },
+            options () {
+                return this.field ? this.field.field_options.options : []
+            },
+            optionsCheckedLength () {
+                let k = 0
+                for (let i = 0; i < this.options.length; i++) {
+                    const option = this.options[i]
+                    if (option.checked) {
+                        k = i
+                    }
+                }
+                return k
+            },
+            placeholder () {
+                return this.field ? this.field.field_options.placeholder : ''
+            },
+            limitHeight () {
+                console.info('xxxx', this.isLimitHeight)
+                return this.isLimitHeight
+            }
+        },
+        watch: {
+            value (val) {
+                this.data = val
+            },
+            data: {
+                handler (val) {
+                    this.$emit('update:value', val)
+                },
+                deep: true
+            },
+            opinionData: {
+                handler (val) {
+                    if (this.$utils.isNotEmpty(val)) {
+                        for (let i = 0; i < this.opinionData.length; i++) {
+                            this.isLimitHeight[i] = true
+                        }
+                    }
+                },
+                immediate: true
+            }
+        },
+        methods: {
+            onShowMore (i, isLimitHeight) {
+                const limitHeight = JSON.parse(JSON.stringify(this.isLimitHeight))
+                limitHeight[i] = isLimitHeight
+                this.isLimitHeight = {}
+                this.isLimitHeight = limitHeight
             }
-            val = format(dateObj, dateFormat)
-          } catch (error) {
-            console.error('转换日期格式错误:', error)
-            val = ''
-          }
-        }
-      }
-      return val
-    }
-  },
-  inject: {
-    elForm: {
-      default: ''
-    }
-  },
-  props: {
-    value: String,
-    field: Object, // 字段
-    readonly: { // 只读
-      type: Boolean,
-      default: false
-    },
-    readonlyStyle: String, // 只读样式
-    opinionData: { // 审批意见
-      type: Array
-    },
-    params: Object
-  },
-  data() {
-    return {
-      data: '',
-      isLimitHeight: {}
-    }
-  },
-  computed: {
-    commonCtatment() {
-      return this.field ? this.field.field_options.common_statment : true
-    },
-    layout() {
-      return this.field ? this.field.field_options.arrangement : 'horizontal'
-    },
-    options() {
-      return this.field ? this.field.field_options.options : []
-    },
-    optionsCheckedLength() {
-      let k = 0
-      for (let i = 0; i < this.options.length; i++) {
-        const option = this.options[i]
-        if (option.checked) {
-          k = i
-        }
-      }
-      return k
-    },
-    placeholder() {
-      return this.field ? this.field.field_options.placeholder : ''
-    },
-    limitHeight() {
-      console.info('xxxx', this.isLimitHeight)
-      return this.isLimitHeight
-    }
-  },
-  watch: {
-    value(val) {
-      this.data = val
-    },
-    data: {
-      handler(val) {
-        this.$emit('update:value', val)
-      },
-      deep: true
-    },
-    opinionData: {
-      handler(val) {
-        if (this.$utils.isNotEmpty(val)) {
-          for (let i = 0; i < this.opinionData.length; i++) {
-            this.isLimitHeight[ i] = true
-          }
         }
-      },
-      immediate: true
-    }
-
-  },
-  methods: {
-    onShowMore(i, isLimitHeight) {
-      const limitHeight = JSON.parse(JSON.stringify(this.isLimitHeight))
-      limitHeight[i] = isLimitHeight
-      this.isLimitHeight = {}
-      this.isLimitHeight = limitHeight
     }
-  }
-}
-</script>
+</script>

+ 3 - 1
src/store/getters.js

@@ -34,5 +34,7 @@ export default {
   myform: state => state.ibps.myform ? state.ibps.myform : '',
   jianCeCanShuId: state => state.ibps.jianCeCanShuId ? state.ibps.jianCeCanShuId : '',
   // 所有检测项目名称及流程key数组
-  testingList: state => state.ibps.param && state.ibps.param.testingList ? state.ibps.param.testingList : []
+  testingList: state => state.ibps.param && state.ibps.param.testingList ? state.ibps.param.testingList : [],
+  // 获取所有用户信息
+  usersList: state => state.ibps.param && state.ibps.param.usersList ? state.ibps.param.usersList : []
 }

+ 9 - 1
src/store/modules/ibps/modules/param.js

@@ -6,7 +6,9 @@ export default {
         jianCeCanShuId: '',
         myform: '',
         // 所有检测项目名称及流程key数组
-        testingList: []
+        testingList: [],
+        // 所有用户信息
+        usersList: []
     },
     mutations: {
         jianCeDuiXiangIdSet(state, jianCeDuiXiang) {
@@ -20,11 +22,17 @@ export default {
         },
         testingList(state, data) {
             state.testingList = data.length ? data : []
+        },
+        usersList(state, data) {
+            state.usersList = data.length ? data : []
         }
     },
     actions: {
         setTestingList({ commit }, data){
             commit('testingList', data)
+        },
+        setUsersList({ commit }, data){
+            commit('usersList', data)
         }
     }
 }

+ 17 - 0
src/views/system/dashboard/page.vue

@@ -248,6 +248,7 @@
         },
         created() {
             this.getTestingData()
+            this.getUsersList()
             StatisticsData().then(data => {
                 //将参数替换成对应参数
                 if (data.state === 200 && data.variables.data.length > 0) {
@@ -519,6 +520,22 @@
                         console.log(error)
                     })
                 }
+            },
+            // 获取所有用户id及姓名存储到store中
+            getUsersList() {
+                let usersList = this.$store.getters.usersList
+                if (usersList.length) {
+                    return
+                } else {
+                    let sql = 'select id_ as userId, name_ as userName from ibps_party_employee'
+                    curdPost('sql', sql).then(res => {
+                        const { data } = res.variables
+                        this.$store.dispatch('ibps/param/setUsersList', data)
+                    }).catch(error => {
+                        this.$message.error('获取所有用户信息失败!')
+                        console.log(error)
+                    })
+                }
             }
         }
     }