2 Commits

Author SHA1 Message Date
fyy
bf13cbfbb7 Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
/ Explore-Gitea-Actions (push) Failing after 6m52s
2025-08-19 10:53:50 +08:00
fyy
ca4f180e7e feat: 完成考勤管理下的区域管理和排班管理 2025-08-19 10:52:50 +08:00
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>