Ver Fonte

feat: 审核人 无法选择 人员/角色的 类型做 自定义描述

lanceJiang há 1 ano atrás
pai
commit
b082d30e41

+ 7 - 3
src/components/scWorkflow/nodes/approver.vue

@@ -172,7 +172,8 @@ import {
 	selectModeOptions,
 	approveSelfOptions,
 	directorModeOptions,
-	examineModeOptions
+	examineModeOptions,
+	setTypeOptions_config
 } from './config'
 export default {
 	components: {
@@ -284,13 +285,16 @@ export default {
 				} else {
 					return false
 				}
-			} else if (type === 4) {
+			} else {
+				const label = setTypeOptions_config[type] || '-'
+				return label
+			} /*else if (type === 4) {
 				return '发起人自选'
 			} else if (type === 5) {
 				return '发起人自己'
 			} else if (type === 6) {
 				return '连续多级主管'
-			}
+			}*/
 		}
 	}
 }

+ 11 - 0
src/views/approve/launch/ItemDrawer.vue

@@ -43,6 +43,10 @@
 								</FlowNodeAvatar>
 							</template>
 						</div>
+						<div v-else-if="assigneeDesc[v.name]">
+							<!-- 没有assigneeMap 的情况下 尝试获取描述 -->
+							<el-tag>{{ assigneeDesc[v.name] }}</el-tag>
+						</div>
 					</template>
 				</el-timeline-item>
 				<el-timeline-item>
@@ -67,6 +71,7 @@ import { ref, shallowRef, computed, reactive, watchEffect } from 'vue'
 import { ElMessage } from 'element-plus'
 import UseSelect from '@/components/scWorkflow/select.vue'
 import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
+import { approveTypeOptions_config, selectModeOptions_config, setTypeOptions_config } from '@/components/scWorkflow/nodes/config'
 type Props = {
 	modelValue: boolean
 	record: { processId: string; processName: string; [key: string]: any }
@@ -89,6 +94,9 @@ const useSelectRef = ref()
 const assigneeMap = ref<{
 	[key: string]: Assignee
 }>({})
+const assigneeDesc = ref<{
+	[key: string]: string
+}>({})
 const active_assigneeKey = ref<string>()
 const active_selectOpts = ref({})
 // const userMap = ref(new Map())
@@ -199,6 +207,7 @@ const packageProcess = (data, list = []) => {
 								break
 							case 2:
 								// 主管 (不需要选择)
+								assigneeDesc.value[config.name] = config.examineLevel === 1 ? '直接主管' : `发起人的第${config.examineLevel}级主管`
 								break
 							case 3:
 								// 角色 选择角色 (允许重新选择)
@@ -213,9 +222,11 @@ const packageProcess = (data, list = []) => {
 								user_fn()
 								break
 							case 5: // 发起人自己 (不能选择)
+								assigneeDesc.value[config.name] = setTypeOptions_config[5]
 								break
 							case 6:
 								// 连续多级主管 (不能选择)
+								assigneeDesc.value[config.name] = config.examineLevel === 1 ? '直接主管' : `发起人的第${config.examineLevel}级主管`
 								break
 						}
 					}