【功能新增】审批节点的审批人与发起人相同时,对应的处理类型的配置

pull/452/head
YunaiV 2024-08-17 10:18:50 +08:00
parent fd13eb7f8f
commit 2dae231afc
3 changed files with 44 additions and 2 deletions

View File

@ -77,6 +77,8 @@ export interface SimpleFlowNode {
timeoutHandler?: TimeoutHandler timeoutHandler?: TimeoutHandler
// 审批任务拒绝处理 // 审批任务拒绝处理
rejectHandler?: RejectHandler rejectHandler?: RejectHandler
// 审批节点的审批人与发起人相同时,对应的处理类型
assignStartUserHandlerType?: number
} }
// 候选人策略枚举 用于审批节点。抄送节点 ) // 候选人策略枚举 用于审批节点。抄送节点 )
export enum CandidateStrategy { export enum CandidateStrategy {
@ -174,6 +176,21 @@ export enum RejectHandlerType {
*/ */
RETURN_USER_TASK = 2 RETURN_USER_TASK = 2
} }
// 用户任务的审批人与发起人相同时,处理类型枚举
export enum AssignStartUserHandlerType {
/**
*
*/
START_USER_AUDIT = 1,
/**
* 12
*/
SKIP = 2,
/**
*
*/
ASSIGN_DEPT_LEADER
}
// 时间单位枚举 // 时间单位枚举
export enum TimeUnitType { export enum TimeUnitType {
@ -309,6 +326,11 @@ export const REJECT_HANDLER_TYPES: DictDataVO[] = [
{ label: '驳回到指定节点', value: RejectHandlerType.RETURN_USER_TASK } { label: '驳回到指定节点', value: RejectHandlerType.RETURN_USER_TASK }
// { label: '结束任务', value: RejectHandlerType.FINISH_TASK } // { label: '结束任务', value: RejectHandlerType.FINISH_TASK }
] ]
export const ASSIGN_START_USER_HANDLER_TYPES: DictDataVO[] = [
{ label: '由发起人对自己审批', value: 1 },
{ label: '自动跳过', value: 2 },
{ label: '转交给部门负责人审批', value: 3 }
]
// 比较运算符 // 比较运算符
export const COMPARISON_OPERATORS: DictDataVO = [ export const COMPARISON_OPERATORS: DictDataVO = [

View File

@ -10,7 +10,9 @@ import {
NodeType, NodeType,
ApproveMethodType, ApproveMethodType,
RejectHandlerType, RejectHandlerType,
NODE_DEFAULT_NAME NODE_DEFAULT_NAME,
AssignStartUserHandlerType,
ASSIGN_START_USER_HANDLER_TYPES
} from './consts' } from './consts'
export function useWatchNode(props: { flowNode: SimpleFlowNode }): Ref<SimpleFlowNode> { export function useWatchNode(props: { flowNode: SimpleFlowNode }): Ref<SimpleFlowNode> {
const node = ref<SimpleFlowNode>(props.flowNode) const node = ref<SimpleFlowNode>(props.flowNode)
@ -97,6 +99,7 @@ export type UserTaskFormType = {
returnNodeId?: string returnNodeId?: string
timeoutHandlerEnable?: boolean timeoutHandlerEnable?: boolean
timeoutHandlerAction?: number timeoutHandlerAction?: number
assignStartUserHandlerType?: AssignStartUserHandlerType
timeDuration?: number timeDuration?: number
maxRemindCount?: number maxRemindCount?: number
buttonsSetting: any[] buttonsSetting: any[]
@ -125,6 +128,7 @@ export function useNodeForm(nodeType: NodeType) {
approveMethod: ApproveMethodType.RRANDOM_SELECT_ONE_APPROVE, approveMethod: ApproveMethodType.RRANDOM_SELECT_ONE_APPROVE,
approveRatio: 100, approveRatio: 100,
rejectHandlerType: RejectHandlerType.FINISH_PROCESS, rejectHandlerType: RejectHandlerType.FINISH_PROCESS,
assignStartUserHandlerType: AssignStartUserHandlerType.START_USER_AUDIT,
returnNodeId: '', returnNodeId: '',
timeoutHandlerEnable: false, timeoutHandlerEnable: false,
timeoutHandlerAction: 1, timeoutHandlerAction: 1,

View File

@ -275,6 +275,17 @@
> >
<el-input-number v-model="configForm.maxRemindCount" :min="1" :max="10" /> <el-input-number v-model="configForm.maxRemindCount" :min="1" :max="10" />
</el-form-item> </el-form-item>
<el-divider content-position="left">审批人与提交人为同一人时</el-divider>
<el-form-item prop="assignStartUserHandlerType">
<el-radio-group v-model="configForm.assignStartUserHandlerType">
<div class="flex-col">
<div v-for="(item, index) in ASSIGN_START_USER_HANDLER_TYPES" :key="index">
<el-radio :key="item.value" :value="item.value" :label="item.label" />
</div>
</div>
</el-radio-group>
</el-form-item>
</el-form> </el-form>
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -364,7 +375,8 @@ import {
REJECT_HANDLER_TYPES, REJECT_HANDLER_TYPES,
DEFAULT_BUTTON_SETTING, DEFAULT_BUTTON_SETTING,
OPERATION_BUTTON_NAME, OPERATION_BUTTON_NAME,
ButtonSetting ButtonSetting,
ASSIGN_START_USER_HANDLER_TYPES
} from '../consts' } from '../consts'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { import {
@ -506,6 +518,8 @@ const saveConfig = async () => {
timeDuration: isoTimeDuration.value, timeDuration: isoTimeDuration.value,
maxRemindCount: cTimeoutMaxRemindCount.value maxRemindCount: cTimeoutMaxRemindCount.value
} }
//
currentNode.value.assignStartUserHandlerType = configForm.value.assignStartUserHandlerType
// //
currentNode.value.fieldsPermission = fieldsPermissionConfig.value currentNode.value.fieldsPermission = fieldsPermissionConfig.value
// //
@ -560,6 +574,8 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
} }
configForm.value.timeoutHandlerAction = node.timeoutHandler?.action configForm.value.timeoutHandlerAction = node.timeoutHandler?.action
configForm.value.maxRemindCount = node.timeoutHandler?.maxRemindCount configForm.value.maxRemindCount = node.timeoutHandler?.maxRemindCount
// 1.5
configForm.value.assignStartUserHandlerType = node.assignStartUserHandlerType
// 2. // 2.
buttonsSetting.value = cloneDeep(node.buttonsSetting) || DEFAULT_BUTTON_SETTING buttonsSetting.value = cloneDeep(node.buttonsSetting) || DEFAULT_BUTTON_SETTING
// 3. // 3.