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

@@ -19,9 +19,20 @@ export const columns: VxeGridProps['columns'] = [
width: 'auto',
},
{
title: '摄像机id',
field: 'deviceManageId',
title: '摄像机',
field: 'areaDevice',
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;
startDate: string;
endDate: string;
areaId: string;
areaId: string[];
userGroupList: any[];
}>({
id: '',
@@ -43,7 +43,7 @@ let formModal = reactive<{
// dateRange: [null, null],
startDate: '', //开始日期
endDate: '', //结束日期
areaId: '', //区域
areaId: [], //区域
userGroupList: [
// scheduleId:undefined,//排班ID
// employeeId:undefined,//员工ID
@@ -313,7 +313,7 @@ async function handleConfirm() {
dateType: undefined,
startDate: '',
endDate: '',
areaId: '',
areaId: [],
userGroupList: [],
});
// 重置其他数据
@@ -338,7 +338,7 @@ async function handleClosed() {
dateType: undefined,
startDate: '',
endDate: '',
areaId: '',
areaId: [],
userGroupList: [],
});
@@ -422,6 +422,7 @@ onMounted(() => {});
v-model:value="formModal.areaId"
:options="areaOptions"
placeholder="请选择"
mode="multiple"
@change="chooseGroup"
/>
</FormItem>

View File

@@ -59,7 +59,7 @@ export const querySchema: FormSchemaGetter = () => [
export const unitQuerySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'scheduleName',
fieldName: 'userName',
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: '班组人数',
field: 'userCount',

View File

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