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

添加流程审批中多级部门负责人支持,优化审批记录展示逻辑

yusheng пре 9 месеци
родитељ
комит
2994a90390

+ 13 - 3
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -166,7 +166,11 @@
             >
               <template v-slot="scope">
                 <div
-                  v-if="scope.row.type !== 60 &&scope.row.type !== 70 && scope.row.options.length > 0"
+                  v-if="
+                    scope.row.type !== 60 &&
+                    scope.row.type !== 70 &&
+                    scope.row.options.length > 0
+                  "
                 >
                   <el-tag
                     size="medium"
@@ -177,7 +181,10 @@
                   </el-tag>
                 </div>
 
-                <el-tag size="medium" v-if="scope.row.type === 60||scope.row.type === 70">
+                <el-tag
+                  size="medium"
+                  v-if="scope.row.type === 60 || scope.row.type === 70|| scope.row.type === 80"
+                >
                   {{ getAssignRuleOptionName(scope.row) }}
                 </el-tag>
               </template>
@@ -286,7 +293,7 @@
   import { getToken } from '@/utils/token-util';
   import { mapGetters } from 'vuex';
   import staffSelection from '@/components/staffSelection/staffSelection.vue';
-  import { topLevel1, topLevel2 } from '@/enum/dict';
+  import { topLevel1, topLevel2, topLevel3 } from '@/enum/dict';
   import dayjs from 'dayjs';
   import { number } from 'echarts';
   import { del } from 'vue';
@@ -566,6 +573,9 @@ this.postOptions.push(...response.data);
           } else {
             return topLevel1.find((item) => item.value == data.topLevel)?.label;
           }
+        } else if (row.type === 80) {
+          let data = JSON.parse(row.variableName);
+          return topLevel3.find((item) => item.value == data.topLevel)?.label;
         }
         return '未知(' + option + ')';
       },

+ 40 - 0
src/enum/dict.js

@@ -196,6 +196,46 @@ export const saleOrderProgressStatusEnum = [
   { value: 800, label: '全部发货' },
   { value: 1000, label: '完成' }
 ];
+
+export const topLevel3 = [
+  {
+    label: '上级部门负责人',
+    value: '1'
+  },
+  {
+    label: '上二级部门负责人',
+    value: '2'
+  },
+  {
+    label: '上三级部门负责人',
+    value: '3'
+  },
+  {
+    label: '上四级部门负责人',
+    value: '4'
+  },
+  {
+    label: '上五级部门负责人',
+    value: '5'
+  },
+  {
+    label: '上六级部门负责人',
+    value: '6'
+  },
+  {
+    label: '上七级部门负责人',
+    value: '7'
+  },
+  {
+    label: '上八级部门负责人',
+    value: '8'
+  },
+  {
+    label: '上九级部门负责人',
+    value: '9'
+  }
+];
+
 export const topLevel1 = [
   {
     label: '直接部门负责人',

+ 30 - 12
src/views/bpm/processInstance/detail.vue

@@ -12,7 +12,6 @@
     :maxable="true"
     :resizable="true"
   >
-
     <div class="app-container" style="padding: 15px">
       <!-- 审批记录 -->
       <el-card class="box-card" v-loading="tasksLoad">
@@ -32,32 +31,41 @@
                 <el-card :body-style="{ padding: '10px' }">
                   <label
                     v-if="item.assigneeUser"
-                    style="font-weight: normal; margin-right: 30px">
-                    {{index==0?' 审批人':'发起人' }}:{{ item.assigneeUser.nickname }}
+                    style="font-weight: normal; margin-right: 30px"
+                  >
+                    {{ index == 0 ? ' 审批人' : '发起人' }}:{{
+                      item.assigneeUser.nickname
+                    }}
                     <el-tag type="info" size="mini">{{
                       item.assigneeUser.deptName
                     }}</el-tag>
                   </label>
                   <label style="font-weight: normal" v-if="item.createTime"
-                    >创建时间:</label>
+                    >创建时间:</label
+                  >
                   <label style="color: #8a909c; font-weight: normal">{{
                     item.createTime
                   }}</label>
                   <label
                     v-if="item.endTime"
                     style="margin-left: 30px; font-weight: normal"
-                    >审批时间:</label>
+                    >审批时间:</label
+                  >
                   <label
                     v-if="item.endTime"
-                    style="color: #8a909c; font-weight: normal">
-                    {{ item.endTime }}</label>
+                    style="color: #8a909c; font-weight: normal"
+                  >
+                    {{ item.endTime }}</label
+                  >
                   <label
                     v-if="item.durationInMillis"
                     style="margin-left: 30px; font-weight: normal"
-                    >耗时:</label>
+                    >耗时:</label
+                  >
                   <label
                     v-if="item.durationInMillis"
-                    style="color: #8a909c; font-weight: normal">
+                    style="color: #8a909c; font-weight: normal"
+                  >
                     {{ getDateStar(item.durationInMillis) }}
                   </label>
                   <p v-if="item.reason">
@@ -78,7 +86,6 @@
         </div>
 
         <my-process-viewer
-        
           key="designer"
           v-model="bpmnXML"
           v-bind="bpmnControlForm"
@@ -143,6 +150,15 @@
         this.dialogVisible = true;
         this.getDetail();
       },
+      getChildren(data) {
+        let arr = [];
+        console.log(data, 'data');
+        arr.push(...data);
+        if (data.children) {
+          this.getChildren(data.children);
+        }
+        return arr;
+      },
       /** 获得流程实例 */
       getDetail() {
         // 获得流程实例相关
@@ -185,8 +201,10 @@
           this.tasks = [];
           // 移除已取消的审批
           response.forEach((task) => {
-            // if (task.result !== 4) {
-              this.tasks.push(task);
+            if (task.children.length > 0) {
+              this.tasks.push(...this.getChildren(task.children));
+            }
+            this.tasks.push(task);
             // }
           });
           // 排序,将未完成的排在前面,已完成的排在后面;

+ 14 - 0
src/views/bpm/processInstance/detailNew.vue

@@ -154,6 +154,15 @@
       this.getDetail();
     },
     methods: {
+      getChildren(data) {
+        let arr = [];
+        arr.push(...data);
+        if (data.children) {
+          this.getChildren(data.children);
+        }
+        return arr;
+      },
+
       /** 获得流程实例 */
       getDetail() {
         // 获得流程实例相关
@@ -182,6 +191,7 @@
           getActivityList({
             processInstanceId: this.processInstance.id
           }).then((response) => {
+            
             this.activityList = response;
           });
 
@@ -194,8 +204,12 @@
         getTaskListByProcessInstanceId(this.id).then((response) => {
           // 审批记录
           this.tasks = [];
+          // console.log(response,'response')
           // 移除已取消的审批
           response.forEach((task) => {
+            if (task.children.length > 0) {
+              this.tasks.push(...this.getChildren(task.children));
+            }
             // if (task.result !== 4) {
             this.tasks.push(task);
             // }