feat: 完成考勤管理下的区域管理和排班管理

This commit is contained in:
fyy 2025-08-19 10:52:50 +08:00
parent 7d15ff713c
commit ca4f180e7e
5 changed files with 42 additions and 14 deletions

View File

@ -43,6 +43,7 @@ export interface ArrangementVO {
userGroupList?: any[]; userGroupList?: any[];
attendanceGroup?: any; attendanceGroup?: any;
dateType?: number; dateType?: number;
areaList: any[]; //区域
} }
export interface ArrangementForm extends BaseEntity { export interface ArrangementForm extends BaseEntity {

View File

@ -19,9 +19,20 @@ export const columns: VxeGridProps['columns'] = [
width: 'auto', width: 'auto',
}, },
{ {
title: '摄像机id', title: '摄像机',
field: 'deviceManageId', field: 'areaDevice',
minWidth: 300, minWidth: 300,
slots: {
default: ({ row }: { row: any }) => {
if (!row.areaDevice || !Array.isArray(row.areaDevice)) {
return '';
}
return row.areaDevice
.map((device: any) => device.remoteSisDeviceManage?.deviceName || '')
.filter((deviceName: string) => deviceName)
.join(', ');
},
},
}, },
{ {

View File

@ -31,7 +31,7 @@ let formModal = reactive<{
dateType: number | undefined; dateType: number | undefined;
startDate: string; startDate: string;
endDate: string; endDate: string;
areaId: string; areaId: string[];
userGroupList: any[]; userGroupList: any[];
}>({ }>({
id: '', id: '',
@ -43,7 +43,7 @@ let formModal = reactive<{
// dateRange: [null, null], // dateRange: [null, null],
startDate: '', // startDate: '', //
endDate: '', // endDate: '', //
areaId: '', // areaId: [], //
userGroupList: [ userGroupList: [
// scheduleId:undefined,//ID // scheduleId:undefined,//ID
// employeeId:undefined,//ID // employeeId:undefined,//ID
@ -313,7 +313,7 @@ async function handleConfirm() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId: '', areaId: [],
userGroupList: [], userGroupList: [],
}); });
// //
@ -338,7 +338,7 @@ async function handleClosed() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId: '', areaId: [],
userGroupList: [], userGroupList: [],
}); });
@ -422,6 +422,7 @@ onMounted(() => {});
v-model:value="formModal.areaId" v-model:value="formModal.areaId"
:options="areaOptions" :options="areaOptions"
placeholder="请选择" placeholder="请选择"
mode="multiple"
@change="chooseGroup" @change="chooseGroup"
/> />
</FormItem> </FormItem>

View File

@ -59,7 +59,7 @@ export const querySchema: FormSchemaGetter = () => [
export const unitQuerySchema: FormSchemaGetter = () => [ export const unitQuerySchema: FormSchemaGetter = () => [
{ {
component: 'Input', component: 'Input',
fieldName: 'scheduleName', fieldName: 'userName',
label: '姓名', label: '姓名',
}, },
{ {
@ -339,6 +339,22 @@ export const workforceDayDetailColumns: VxeGridProps['columns'] = [
}, },
}, },
}, },
{
title: '区域',
field: 'areaList',
width: 'auto',
slots: {
default: ({ row }: { row: any }) => {
if (!row.areaList || !Array.isArray(row.areaList)) {
return '';
}
return row.areaList
.map((item: any) => item.area || '')
.filter((areaName: string) => areaName)
.join(', ');
},
},
},
{ {
title: '班组人数', title: '班组人数',
field: 'userCount', field: 'userCount',

View File

@ -22,14 +22,14 @@ let formModal = reactive<{
id: string | number; id: string | number;
groupId?: string | number; groupId?: string | number;
attendanceType: string; attendanceType: string;
areaId: string; areaId: string[];
userGroupList: any[]; userGroupList: any[];
dateType: number | undefined; dateType: number | undefined;
}>({ }>({
id: '', id: '',
groupId: '', groupId: '',
attendanceType: '', // attendanceType: '', //
areaId: '', // areaId: [], //
userGroupList: [ userGroupList: [
// scheduleId:undefined,//ID // scheduleId:undefined,//ID
// employeeId:undefined,//ID // employeeId:undefined,//ID
@ -179,6 +179,7 @@ const [BasicModal, modalApi] = useVbenModal({
formModal.id = record.id; formModal.id = record.id;
formModal.groupId = record.attendanceGroup.id; formModal.groupId = record.attendanceGroup.id;
formModal.dateType = record.dateType; formModal.dateType = record.dateType;
formModal.areaId = record.areaList?.map((area: any) => area.id) || [];
if (record.userGroupList) { if (record.userGroupList) {
// userGroupList // userGroupList
@ -203,8 +204,6 @@ const [BasicModal, modalApi] = useVbenModal({
tableData.splice(0, 0, ...Array.from(deptMap.values())); tableData.splice(0, 0, ...Array.from(deptMap.values()));
} }
} }
console.log(tableData);
// await markInitialized(); // await markInitialized();
modalApi.modalLoading(false); modalApi.modalLoading(false);
}, },
@ -251,7 +250,6 @@ async function handleConfirm() {
modalApi.lock(true); modalApi.lock(true);
await formRef.value.validate(); // await formRef.value.validate(); //
const data = formModal; const data = formModal;
console.log(tableData);
data.userGroupList = tableData.flatMap((item) => data.userGroupList = tableData.flatMap((item) =>
item.users.map((user) => ({ item.users.map((user) => ({
deptId: item.dept.unitId, deptId: item.dept.unitId,
@ -270,7 +268,7 @@ async function handleConfirm() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId: '', areaId: [],
userGroupList: [], userGroupList: [],
}); });
// //
@ -292,7 +290,7 @@ async function handleClosed() {
dateType: undefined, dateType: undefined,
startDate: '', startDate: '',
endDate: '', endDate: '',
areaId: '', areaId: [],
userGroupList: [], userGroupList: [],
}); });
@ -332,6 +330,7 @@ onMounted(() => {});
v-model:value="formModal.areaId" v-model:value="formModal.areaId"
:options="areaOptions" :options="areaOptions"
placeholder="请选择" placeholder="请选择"
mode="multiple"
@change="chooseGroup" @change="chooseGroup"
/> />
</FormItem> </FormItem>