加班管理新版
This commit is contained in:
parent
caff5b8313
commit
25d5d4ff86
@ -1,52 +1,54 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 加班管理 VO
|
||||
export interface JbglVO {
|
||||
id: number // id
|
||||
title: string // 申请标题
|
||||
userName: string // 申请人名字
|
||||
userId: number // 申请人id
|
||||
deptName: string // 申请部门名字
|
||||
deptId: number // 申请部门id
|
||||
usageDate: Date // 申请时间
|
||||
type: number // 加班类型
|
||||
startDate: Date // 加班开始时间
|
||||
endDate: Date // 加班结束时间
|
||||
duration: number // 加班总时长
|
||||
reason: string // 加班原因
|
||||
status: number // 审批状态
|
||||
processInstanceId: string // 流程实例的编号
|
||||
}
|
||||
|
||||
// 加班管理 API
|
||||
export const JbglApi = {
|
||||
// 查询加班管理分页
|
||||
getJbglPage: async (params: any) => {
|
||||
return await request.get({ url: `/home/jbgl/page`, params })
|
||||
},
|
||||
|
||||
// 查询加班管理详情
|
||||
getJbgl: async (id: number) => {
|
||||
return await request.get({ url: `/home/jbgl/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增加班管理
|
||||
createJbgl: async (data: JbglVO) => {
|
||||
return await request.post({ url: `/home/jbgl/create`, data })
|
||||
},
|
||||
|
||||
// 修改加班管理
|
||||
updateJbgl: async (data: JbglVO) => {
|
||||
return await request.put({ url: `/home/jbgl/update`, data })
|
||||
},
|
||||
|
||||
// 删除加班管理
|
||||
deleteJbgl: async (id: number) => {
|
||||
return await request.delete({ url: `/home/jbgl/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出加班管理 Excel
|
||||
exportJbgl: async (params) => {
|
||||
return await request.download({ url: `/home/jbgl/export-excel`, params })
|
||||
},
|
||||
}
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 加班管理 VO
|
||||
export interface JbglVO {
|
||||
id: number // id
|
||||
title: string // 申请标题
|
||||
curfullpath: string // 申请用户名称
|
||||
processDefinitionKey: string // 申请用户名称
|
||||
userName: string // 申请人名字
|
||||
userId: number // 申请人id
|
||||
deptName: string // 申请部门名字
|
||||
deptId: number // 申请部门id
|
||||
usageDate: Date // 申请时间
|
||||
type: number // 加班类型
|
||||
startDate: Date // 加班开始时间
|
||||
endDate: Date // 加班结束时间
|
||||
duration: number // 加班总时长
|
||||
reason: string // 加班原因
|
||||
status: number // 审批状态
|
||||
processInstanceId: string // 流程实例的编号
|
||||
}
|
||||
|
||||
// 加班管理 API
|
||||
export const JbglApi = {
|
||||
// 查询加班管理分页
|
||||
getJbglPage: async (params: any) => {
|
||||
return await request.get({ url: `/home/jbgl/page`, params })
|
||||
},
|
||||
|
||||
// 查询加班管理详情
|
||||
getJbgl: async (id: number) => {
|
||||
return await request.get({ url: `/home/jbgl/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增加班管理
|
||||
createJbgl: async (data: JbglVO) => {
|
||||
return await request.post({ url: `/home/jbgl/create`, data })
|
||||
},
|
||||
|
||||
// 修改加班管理
|
||||
updateJbgl: async (data: JbglVO) => {
|
||||
return await request.put({ url: `/home/jbgl/update`, data })
|
||||
},
|
||||
|
||||
// 删除加班管理
|
||||
deleteJbgl: async (id: number) => {
|
||||
return await request.delete({ url: `/home/jbgl/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出加班管理 Excel
|
||||
exportJbgl: async (params) => {
|
||||
return await request.download({ url: `/home/jbgl/export-excel`, params })
|
||||
},
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user