Sfoglia il codice sorgente

表单显示流程名称

cfort 3 anni fa
parent
commit
750b0835c5

+ 5 - 0
src/business/platform/bpmn/form/dialog.vue

@@ -16,6 +16,7 @@
       :def-id="defId"
       :pro-inst-id="proInstId"
       :flowName ="title"
+      :processName="processName"
       :task-id="taskId"
       :waiJian="waiJian"
       :instance-id="instanceId"
@@ -66,6 +67,10 @@ export default {
     waiJian: { // 新增参数
       type: String
     },
+    processName: { // 流程名称
+        type: String,
+        default: ''
+    }
   },
   data() {
     return {

+ 5 - 0
src/business/platform/bpmn/form/index.vue

@@ -226,6 +226,10 @@ export default {
     closeable: {
       type: Boolean,
       default: true
+    },
+    processName: { // 流程名称
+      type: String,
+      default: ''
     }
   },
   data() {
@@ -389,6 +393,7 @@ export default {
         // 表单定义
         this.formDef = this.$utils.parseData(formModel.formData) || {}
         this.formDef.flowName = this.flowName
+        this.formDef.processName = this.processName
 
         this.formData = {
           // 表单数据

+ 1 - 1
src/business/platform/form/formrender/dynamic-form/dynamic-form.vue

@@ -4,7 +4,7 @@
   <div class="dynamic-form" :class=" {'jbd-form-cont':!isDialog }">
     <!--表头-->
     <div v-if="hasHeader" class="form-header">
-      <div v-if="hasHeader" class="title" style="font-size:22px; font-family:SimHei;"  :class="titlePosition">{{ formDef.name}}
+      <div v-if="hasHeader" class="title" style="font-size:22px; font-family:SimHei;"  :class="titlePosition">{{ formDef.processName ? formDef.processName : formDef.name}}
       <span v-if="formDef && formDef.flowName">{{formDef.flowName}}</span>
       <relevance-table
          v-if="titleList.length>0"

+ 2 - 0
src/business/platform/form/utils/JForm.js

@@ -28,6 +28,7 @@ import {
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 import pinyin4js from 'pinyin4js';
 import store from '@/store'
+import router from '@/router'
 
 // 定义全局
 var JForm
@@ -63,6 +64,7 @@ _.extend(JForm, {
     this.$getSigPageUrl = getSigPageUrl // 对报表进行手动印章->预处理->签章页面
     this.$doManulSeal = doManulSeal // 手动签章弹框
     this.$generateUUID = generateUUID // 自定义规则自动生成uuid
+    this.$router = router //添加router对象
     
     this._ = _
     this.$store = store

+ 49 - 46
src/views/platform/bpmn/bpmTask/list.vue

@@ -56,6 +56,7 @@
       :visible="bpmnFormrenderDialogVisible"
       :task-id="editId"
       :title="flowName"
+      :processName="processName"
       @callback="search"
       @close="visible => bpmnFormrenderDialogVisible = visible"
     />
@@ -87,6 +88,7 @@ export default {
       action: 'agree', // 打开弹窗的动作
       pkKey: 'id', // 主键  如果主键不是pk需要传主键
       flowName:'',
+      processName:'',
       selectorVisible: false,
       ids: '',
       title: '',
@@ -297,59 +299,60 @@ export default {
      * 审批
      */
     handleApprove(id) {
-      let this_ = this
-// this_.editId = id
-//                             this_.bpmnFormrenderDialogVisible = true
-//                             return
-console.log("11111",request)
-        // getFormDataFlag(JSON.stringify({taskId:id})).then(response => {
-        //   console.log("111")
-        //   if( response.data.data=='Y'){
-        //     this_.editId = id
-        //     this_.bpmnFormrenderDialogVisible = true
-        //   }else{
-        //                    ActionUtils.success('任务生成中、请稍后重试...!')
-        //                    this_.search()
-        //   }
-        //  })
-
-        // 打开表单前给给flowName赋值,避免流程节点状态bug
-        this.flowName = this.listData.find(item => item.id === id).name
+        let this_ = this
+        // this_.editId = id
+        // this_.bpmnFormrenderDialogVisible = true
+        // return
 
-         request({
-                   url: BUSINESS_BASE_URL() + '/getFormData/flag',
-                    method: 'post',
-                    data: JSON.stringify({taskId:id})
-                    }).then(response => {
+        // getFormDataFlag(JSON.stringify({taskId:id})).then(response => {
+        //     console.log("111")
+        //     if( response.data.data=='Y'){
+        //         this_.editId = id
+        //         this_.bpmnFormrenderDialogVisible = true
+        //     }else{
+        //         ActionUtils.success('任务生成中、请稍后重试...!')
+        //         this_.search()
+        //     }
+        // })
 
-          if( response.data!='N'){
-            this_.editId = id
-            this_.bpmnFormrenderDialogVisible = true
-          }else{
-                           ActionUtils.success('任务生成中、请稍后重试...!')
-                           this_.search()
-          }
-         })
+        // 打开表单前获取flowName和processName,避免流程节点状态bug
+        let selected = this.listData.find(item => item.id === id)
+        this.flowName = selected.name
+        this.processName = selected.procDefName
 
-                   //       let sql = "select ID_,HOT_READ_ from ibps_bpm_tasks where TASK_ID_='"+id+"'"
-                   //  curdPost('sql',sql).then(response => {
-                   //      if( response.variables.data.length>0){
-                   //        if( response.variables.data[0].HOT_READ_=='1'){
-                   //         this_.editId = id
-                   //         this_.bpmnFormrenderDialogVisible = true
+        request({
+            url: BUSINESS_BASE_URL() + '/getFormData/flag',
+            method: 'post',
+            data: JSON.stringify({taskId:id})
+        }).then(response => {
+            if ( response.data!='N') {
+                this_.editId = id
+                this_.bpmnFormrenderDialogVisible = true
+            } else {
+                ActionUtils.success('任务生成中、请稍后重试...!')
+                this_.search()
+            }
+        })
 
-                   //        }else{
-                   //         ActionUtils.success('任务生成中、请稍后重试...!')
-                   //         this_.search()
-                   //        }
-                   //      }else{
-                   //         ActionUtils.success('任务状态已过期、请刷新页面...!')
-                   //         this_.search()
-                   //        }
-                   // })
+        // let sql = "select ID_,HOT_READ_ from ibps_bpm_tasks where TASK_ID_='"+id+"'"
+        // curdPost('sql',sql).then(response => {
+        //     if( response.variables.data.length>0){
+        //         if( response.variables.data[0].HOT_READ_=='1'){
+        //             this_.editId = id
+        //             this_.bpmnFormrenderDialogVisible = true
+        //         } else {
+        //             ActionUtils.success('任务生成中、请稍后重试...!')
+        //             this_.search()
+        //         }
+        //     } else {
+        //         ActionUtils.success('任务状态已过期、请刷新页面...!')
+        //         this_.search()
+        //     }
+        // })
     },
     handleLinkClick(data, columns) {
       this.flowName = data.name
+      this.processName = data.procDefName
       this.handleApprove(data[this.pkKey])
     }
   }

+ 2 - 0
src/views/system/dashboard/components/new-home.vue

@@ -93,6 +93,7 @@
             :task-id="taskId"
             :waiJian="waiJian"
             :title="FlowName"
+            :processName="processName"
             @callback="getWait()"
             @close="visible => dialogFormVisible = visible"/>
       </el-col>
@@ -620,6 +621,7 @@ import ActionUtils from '@/utils/action'
       this.taskId = cont.id || ''
       this.waiJian = cont.waiJian || ''
       this.FlowName =cont.name
+      this.processName = cont.procDefName
       this.dialogFormVisible = true
     },
     /**