考勤管理新版本
This commit is contained in:
parent
58af80edd2
commit
140a7bf570
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
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',
|
||||
};
|
||||
|
@ -209,6 +209,7 @@ const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
id: undefined,
|
||||
title: undefined,
|
||||
userId: undefined,
|
||||
userName: undefined,
|
||||
deptId: undefined,
|
||||
|
Loading…
Reference in New Issue
Block a user