考勤管理新版本

This commit is contained in:
XaoLi717 2024-11-27 15:29:01 +08:00
parent 58af80edd2
commit 140a7bf570
4 changed files with 39 additions and 4 deletions

View File

@ -3,6 +3,9 @@ import request from '@/config/axios'
// 考勤管理 VO
export interface KqglVO {
id: number // id
title: string // 申请用户名称
curfullpath: string // 申请用户名称
processDefinitionKey: string // 申请用户名称
userId: number // 用户id
userName: string // 用户名字
deptId: number // 部门id

View File

@ -10,6 +10,9 @@
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="标题" prop="title">
<el-input autosize v-model="formData.title" type="text" placeholder="请输入标题" />
</el-form-item>
<eL-row>
<el-col :span="12">
<el-form-item label="用户名字" prop="userName">
@ -57,7 +60,7 @@
<el-button-group>
<el-button @click="changeDay($index,day,1)" color="green">上班</el-button>
<el-button @click="changeDay($index,day,2)" color="orange">缺勤</el-button>
<el-button @click="changeDay($index,day,3)" color="yellow">休息</el-button>
<el-button @click="changeDay($index,day,3)" color="white">休息</el-button>
<el-button @click="changeDay($index,day,4)" color="red" >加班</el-button>
<el-button @click="changeDay($index,day,5)" color="violet" >年班</el-button>
</el-button-group>
@ -84,6 +87,7 @@ import {getUserPageKQ} from "@/api/system/user";
import * as DefinitionApi from '@/api/bpm/definition'
import * as UserApi from '@/api/system/user'
import {useTagsViewStore} from "@/store/modules/tagsView";
import {FormProcessMappingApi} from "@/api/bpm/formprocessmapping";
/** 考勤管理 表单 */
defineOptions({ name: 'KqglCreate' })
@ -97,6 +101,7 @@ const formLoading = ref(false) // 表单的加载中1修改时的数据加
// const formType = ref('') // create - update -
const formData = ref({
id: undefined,
title: undefined,
userId: undefined,
userName: undefined,
deptId: undefined,
@ -105,6 +110,7 @@ const formData = ref({
})
const formRules = reactive({
userId: [{ required: true, message: '用户id不能为空', trigger: 'blur' }],
title: [{ required: true, message: '标题不能为空', trigger: 'blur' }],
deptId: [{ required: true, message: '部门id不能为空', trigger: 'blur' }],
date: [{ required: true, message: '考勤日期不能为空', trigger: 'blur' }],
})
@ -146,7 +152,7 @@ const dayStatus = [
const colorMap: Record<number, string> = {
1: 'green',
2: 'orange',
3: 'yellow',
3: 'black',
4: 'red',
5: 'violet',
};
@ -171,7 +177,7 @@ const computedDate = computed(() => {
//
const { delView } = useTagsViewStore()//
const { push, currentRoute } = useRouter()
const processDefineKey = 'kqgl-001' // Key
/*const processDefineKey = 'kqgl-001' // 流程定义 Key*/
const startUserSelectTasks = ref([]) //
const startUserSelectAssignees = ref({}) //
const startUserSelectAssigneesFormRef = ref() // Ref
@ -330,6 +336,16 @@ const submitForm = async () => {
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
}
data.date = dateKey.value //
await KqglApi.createKqgl(data)
await updateUser() //
@ -345,6 +361,16 @@ const submitForm = async () => {
/** 初始化 */
onMounted(async () => {
await open()
const curFullPath = currentRoute.value.fullPath
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
if ( !processKey ) {
message.error('流程对应表单模型未配置,请检查!')
return
}
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(
undefined,
processDefineKey
@ -372,6 +398,7 @@ onMounted(async () => {
const resetForm = () => {
formData.value = {
id: undefined,
title: undefined,
userId: undefined,
userName: undefined,
deptId: undefined,

View File

@ -10,6 +10,9 @@
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="标题" prop="title">
<el-input autosize v-model="formData.title" type="text" placeholder="请输入标题" disabled />
</el-form-item>
<eL-row>
<el-col :span="12">
<el-form-item label="用户名字" prop="userName">
@ -93,6 +96,7 @@ defineOptions({ name: 'KqglDetail' })
const formLoading = ref(false) // 12
const formData = ref({
id: undefined,
title: undefined,
userId: undefined,
userName: undefined,
deptId: undefined,
@ -127,7 +131,7 @@ const queryParamsData = reactive({
const colorMap: Record<number, string> = {
1: 'green',
2: 'orange',
3: 'yellow',
3: 'black',
4: 'red',
5: 'violet',
};

View File

@ -209,6 +209,7 @@ const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: undefined,
title: undefined,
userId: undefined,
userName: undefined,
deptId: undefined,