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

fix: 工作环节设置预置流转操作默认显示所有,审核端办结任务只有在出具报告的时候显示

shiyanyu 1 месяц назад
Родитель
Сommit
768cd33e01

+ 7 - 1
src/views/costAudit/auditInfo/auditManage/mainDetails.vue

@@ -15,7 +15,13 @@
           <el-button type="primary" @click="handlePrevStep">
             退回上一步
           </el-button>
-          <el-button type="primary" @click="handleAddTask">办结任务</el-button>
+          <el-button
+            v-if="currentNode === 'cjbg'"
+            type="primary"
+            @click="handleAddTask"
+          >
+            办结任务
+          </el-button>
           <el-button type="primary" @click="handleAssign">返回</el-button>
           <el-tooltip
             v-if="currentNode !== 'clcs' && currentNode !== 'sdsh'"

+ 38 - 13
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/workflowTab.vue

@@ -402,6 +402,30 @@
     },
 
     methods: {
+      // 获取“归档”的key
+      getArchiveKey() {
+        const list = (this.dictData && this.dictData['processStatus']) || []
+        if (!Array.isArray(list)) return ''
+        const item = list.find((it) => it && it.name === '归档')
+        return item ? item.key : ''
+      },
+      // 获取除“归档”外的全部预置流转操作key数组
+      getNonArchiveKeys() {
+        const list = (this.dictData && this.dictData['processStatus']) || []
+        if (!Array.isArray(list)) return []
+        return list
+          .filter((it) => it && it.name !== '归档')
+          .map((it) => it.key)
+          .filter((k) => k != null && k !== '')
+      },
+      // 获取所有预置流转操作的key数组(全选)
+      getAllStatusKeys() {
+        const list = (this.dictData && this.dictData['processStatus']) || []
+        if (!Array.isArray(list)) return []
+        return list
+          .map((it) => (it ? it.key : undefined))
+          .filter((k) => k != null && k !== '')
+      },
       formatterUserList(userId) {
         // 筛选出除主办人员之外的人员
         return this.formatterMainUserList().filter(
@@ -486,12 +510,13 @@
               userId: item.userId ? item.userId.split(',') : [],
               status: item.status ? item.status.split(',') : [],
             }
-            // 默认预置流转操作:归档环节默认“归档”,其他默认“通过
+            // 默认预置流转操作:归档环节默认“全部选中”,其他环节默认“除归档外全部选中
             if (!mapped.status || mapped.status.length === 0) {
-              const defaultKey = this.isArchiveNode(mapped)
-                ? this.getProcessStatusKeyByName('归档')
-                : this.getProcessStatusKeyByName('通过')
-              mapped.status = defaultKey ? [defaultKey] : []
+              if (this.isArchiveNode(mapped)) {
+                mapped.status = this.getAllStatusKeys()
+              } else {
+                mapped.status = this.getNonArchiveKeys()
+              }
             }
             return mapped
           })
@@ -508,10 +533,11 @@
                 status: item.status ? item.status.split(',') : [],
               }
               if (!mapped.status || mapped.status.length === 0) {
-                const defaultKey = this.isArchiveNode(mapped)
-                  ? this.getProcessStatusKeyByName('归档')
-                  : this.getProcessStatusKeyByName('通过')
-                mapped.status = defaultKey ? [defaultKey] : []
+                if (this.isArchiveNode(mapped)) {
+                  mapped.status = this.getAllStatusKeys()
+                } else {
+                  mapped.status = this.getNonArchiveKeys()
+                }
               }
               return mapped
             })
@@ -525,10 +551,9 @@
         const statusArr = row.status ? row.status.split(',') : []
         let finalStatus = statusArr
         if (!finalStatus || finalStatus.length === 0) {
-          const defaultKey = this.isArchiveNode(row)
-            ? this.getProcessStatusKeyByName('归档')
-            : this.getProcessStatusKeyByName('通过')
-          finalStatus = defaultKey ? [defaultKey] : []
+          finalStatus = this.isArchiveNode(row)
+            ? this.getAllStatusKeys()
+            : this.getNonArchiveKeys()
         }
         this.formData.currentStep = {
           ...row,