加班管理新版

This commit is contained in:
XaoLi717 2024-11-27 14:25:41 +08:00
parent caff5b8313
commit 25d5d4ff86
2 changed files with 77 additions and 53 deletions

View File

@ -4,6 +4,8 @@ import request from '@/config/axios'
export interface JbglVO {
id: number // id
title: string // 申请标题
curfullpath: string // 申请用户名称
processDefinitionKey: string // 申请用户名称
userName: string // 申请人名字
userId: number // 申请人id
deptName: string // 申请部门名字

View File

@ -103,6 +103,7 @@ import * as DefinitionApi from '@/api/bpm/definition'
import * as UserApi from '@/api/system/user'
import {useTagsViewStore} from "@/store/modules/tagsView";
import {getUserProfile} from "@/api/system/user/profile";
import {FormProcessMappingApi} from "@/api/bpm/formprocessmapping";
/** 加班管理 表单 */
defineOptions({ name: 'JbglCreate' })
@ -131,7 +132,7 @@ const formData = ref({
//
const { delView } = useTagsViewStore()//
const { push, currentRoute } = useRouter()
const processDefineKey = 'jbgl-001' // Key
/*const processDefineKey = 'jbgl-001'流程定义 Key*/
const startUserSelectTasks = ref([]) //
const startUserSelectAssignees = ref({}) //
const startUserSelectAssigneesFormRef = ref() // Ref
@ -191,6 +192,17 @@ const submitForm = async () => {
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 JbglApi.createJbgl(data)
message.success(t('common.createSuccess'))
delView(unref(currentRoute))
@ -202,6 +214,16 @@ const submitForm = async () => {
/** 初始化 */
onMounted(async () => {
await getUserInfo()
const curFullPath = currentRoute.value.fullPath
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
if ( !processKey ) {
message.error('流程对应表单模型未配置,请检查!')
return
}
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(
undefined,
processDefineKey