diff --git a/src/api/home/hygl/index.ts b/src/api/home/hygl/index.ts index bb32574..8ca28b5 100644 --- a/src/api/home/hygl/index.ts +++ b/src/api/home/hygl/index.ts @@ -4,6 +4,8 @@ import request from '@/config/axios' export interface HyglVO { id: number // id title: string // 会议标题 + curfullpath: string // 申请用户名称 + processDefinitionKey: string // 申请用户名称 userName: string // 申请人名字 userId: number // 申请人id deptName: string // 申请部门名字 diff --git a/src/views/Home/hygl/HyglCreate.vue b/src/views/Home/hygl/HyglCreate.vue index f512d61..dfd0d59 100644 --- a/src/views/Home/hygl/HyglCreate.vue +++ b/src/views/Home/hygl/HyglCreate.vue @@ -164,6 +164,7 @@ import * as UserApi from '@/api/system/user' import {useTagsViewStore} from "@/store/modules/tagsView"; import {HysglApi, HysglVO} from "@/api/home/hysgl"; + import {FormProcessMappingApi} from "@/api/bpm/formprocessmapping"; /** 会议管理 表单 */ defineOptions({ name: 'HyglCreate' }) @@ -228,7 +229,7 @@ // 指定审批人 const { delView } = useTagsViewStore()//视图操作 const { push, currentRoute } = useRouter() - const processDefineKey = 'hygl-001' // 流程定义 Key +/* const processDefineKey = 'hygl-001' 流程定义 Key*/ const startUserSelectTasks = ref([]) // 发起人需要选择审批人的用户任务列表 const startUserSelectAssignees = ref({}) // 发起人选择审批人的数据 const startUserSelectAssigneesFormRef = ref() // 发起人选择审批人的表单 Ref @@ -277,6 +278,17 @@ if(startUserSelectTasks.value?.length > 0){ data.startUserSelectAssignees = startUserSelectAssignees.value } + + const curFullPath = currentRoute.value.fullPath + + if( curFullPath ) { + data.curfullpath = curFullPath + } + const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) + if ( processKey) { + data.processDefinitionKey = processKey + } + await HyglApi.createHygl(data) message.success(t('common.createSuccess')) delView(unref(currentRoute)) @@ -316,6 +328,16 @@ onMounted(async () => { await getUserInfo() await getList() + + const curFullPath = currentRoute.value.fullPath + + const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath ) + + if ( !processKey ) { + message.error('流程对应表单模型未配置,请检查!') + return + } + const processDefinitionDetail = await DefinitionApi.getProcessDefinition( undefined, processDefineKey