diff --git a/apps/web-antd/src/api/property/attendanceManagement/arrangement/index.ts b/apps/web-antd/src/api/property/attendanceManagement/arrangement/index.ts index 9a0df5c3..0ffab03b 100644 --- a/apps/web-antd/src/api/property/attendanceManagement/arrangement/index.ts +++ b/apps/web-antd/src/api/property/attendanceManagement/arrangement/index.ts @@ -7,21 +7,20 @@ import { commonExport } from '#/api/helper'; import { requestClient } from '#/api/request'; /** -* 查询排班列表 +* 分页查询排班列表 * @param params * @returns 排班列表 */ export function arrangementList(params?: ArrangementQuery) { return requestClient.get>('/property/arrangement/list', { params }); } - /** - * 导出排班列表 + * 根据月份查询排班列表 * @param params * @returns 排班列表 */ -export function arrangementExport(params?: ArrangementQuery) { - return commonExport('/property/arrangement/export', params ?? {}); +export function arrangementCalender(params?: ArrangementQuery) { + return requestClient.get('/property/arrangement/explore', { params }); } /** diff --git a/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts b/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts index ac3c65a8..83f93190 100644 --- a/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts +++ b/apps/web-antd/src/api/property/attendanceManagement/arrangement/model.d.ts @@ -40,7 +40,6 @@ export interface ArrangementVO { * 状态:0-未生效,1-已生效 */ status: number; - } export interface ArrangementForm extends BaseEntity { @@ -83,7 +82,10 @@ export interface ArrangementForm extends BaseEntity { * 状态:0-未生效,1-已生效 */ status?: number; - + /** + * 排班人员详情 + */ + userGroupList: any[]; } export interface ArrangementQuery extends PageQuery { @@ -123,7 +125,12 @@ export interface ArrangementQuery extends PageQuery { status?: number; /** - * 日期范围参数 - */ + * 日期范围参数 + */ params?: any; + + /** + * 月份 + */ + month?: string; } diff --git a/apps/web-antd/src/assets/digitalIntelligence/bg.png b/apps/web-antd/src/assets/digitalIntelligence/bg.png index c0c998d5..13301915 100644 Binary files a/apps/web-antd/src/assets/digitalIntelligence/bg.png and b/apps/web-antd/src/assets/digitalIntelligence/bg.png differ diff --git a/apps/web-antd/src/assets/energyConsumptionAnalysis/bg.png b/apps/web-antd/src/assets/energyConsumptionAnalysis/bg.png index 40c8a453..d05d513a 100644 Binary files a/apps/web-antd/src/assets/energyConsumptionAnalysis/bg.png and b/apps/web-antd/src/assets/energyConsumptionAnalysis/bg.png differ diff --git a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue index f1a0dd84..d4e5ccd3 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/arrangement-modal.vue @@ -34,12 +34,47 @@ const isUpdate = ref(false); const title = computed(() => { return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add'); }); +//表单项 +let formModel = reactive<{ + id: string; + groupId: string; + attendanceType: string; + dateType: number | undefined; + startDate: string; + endDate: string; + userGroupList: any[]; +}>({ + id: '', + groupId: '', + attendanceType: '', //考勤组类型 + dateType: undefined, //日期类型:1-单个日期,2-长期有效,3-期间有效 + // dateSingle: null, + // dateLong: null, + // dateRange: [null, null], + startDate: '', //开始日期 + endDate: '', //结束日期 + userGroupList: [ + // scheduleId:undefined,//排班ID + // employeeId:undefined,//员工ID + // employeeName:undefined,//员工姓名 + // deptId:undefined,//部门ID + // deptName:undefined,//部门名称 + ], //考勤组人员列表 +}); +const formRef = ref(); +let singleDate = ref(''); //排班日期单个日期 +let longDate = ref(''); //排班日期从此日起长期有效 +let rangeDate = ref(['', '']); //排班日期在此期间有效 +const rules = { + groupId: [{ required: true, message: '请选择考勤组' }], + attendanceType: [{ required: true }], + dateType: [{ required: true, message: '请选择排班日期' }], +}; const groupOptions = ref([]); const groupMap = ref>({}); // 用于快速查找 -const tableData = reactive< +let tableData = reactive< { dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[] ->([]); - +>([]); //存放考勤组人员列表数据 const columns = [ { title: '序号', @@ -108,44 +143,44 @@ function handleRemoveRow(index: number) { } function handleTableData(newTableData: any) { - tableData.splice(0, tableData.length, ...newTableData); + // 如果现有数据为空,直接替换 + if (tableData.length === 0) { + tableData.splice(0, 0, ...newTableData); + return; + } + + // 如果新数据为空,不做处理 + if (newTableData.length === 0) { + return; + } + + // 处理有数据的情况 + for (const newItem of newTableData) { + // 查找是否已存在相同部门 + const existingDeptIndex = tableData.findIndex( + (item) => item.dept.unitId === newItem.dept.unitId, + ); + + if (existingDeptIndex !== -1) { + // 找到相同部门,检查人员是否有重复 + const existingDept = tableData[existingDeptIndex]; + for (const newUser of newItem.users) { + // 检查该用户是否已存在 + const userExists = existingDept?.users.some( + (existingUser) => existingUser.id === newUser.id, + ); + if (!userExists) { + // 用户不存在,添加到现有部门 + existingDept?.users.push(newUser); + } + } + } else { + // 部门不存在,直接添加新部门 + tableData.push(newItem); + } + } } -//表单项 -const formModel = reactive<{ - id: string; - groupId: string; - attendanceType: string; - dateType: number | undefined; - startDate: string; - endDate: string; - userGroupList: any[]; -}>({ - id: '', - groupId: '', - attendanceType: '', //考勤组类型 - dateType: undefined, //日期类型:1-单个日期,2-长期有效,3-期间有效 - // dateSingle: null, - // dateLong: null, - // dateRange: [null, null], - startDate: '', //开始日期 - endDate: '', //结束日期 - userGroupList: [ - // scheduleId:undefined,//排班ID - // employeeId:undefined,//员工ID - // employeeName:undefined,//员工姓名 - // deptId:undefined,//部门ID - // deptName:undefined,//部门名称 - ], //考勤组人员列表 -}); -const singleDate = ref(''); -const longDate = ref(''); -const rangeDate = ref(['', '']); -const formRef = ref(); -const rules = { - groupId: [{ required: true, message: '请选择考勤组' }], - attendanceType: [{ required: true }], - dateType: [{ required: true, message: '请选择排班日期' }], -}; + const [BasicForm, formApi] = useVbenForm({ commonConfig: { // 默认占满两列 @@ -173,7 +208,7 @@ const [UnitPersonModal, unitPersonmodalApi] = useVbenModal({ }); const [BasicModal, modalApi] = useVbenModal({ // 在这里更改宽度 - class: 'w-[70%]', + class: 'w-[85%]', fullscreenButton: false, onBeforeClose, onClosed: handleClosed, @@ -183,7 +218,6 @@ const [BasicModal, modalApi] = useVbenModal({ return null; } await getGroupList(); - console.log(getDictOptions('wy_kqlx')); modalApi.modalLoading(true); const { id } = modalApi.getData() as { id?: number | string }; isUpdate.value = !!id; @@ -220,7 +254,6 @@ async function getGroupList() { }); } function chooseGroup(value: any) { - console.log(value); const group = groupMap.value[value]; if (group) { formModel.attendanceType = String(group.attendanceType); @@ -232,12 +265,10 @@ async function handleDateTypeChange(value: any) { async function handleConfirm() { try { modalApi.lock(true); - // await formRef.value.validate(); // 先校验 + await formRef.value.validate(); // 先校验 const data = formModel; const { id } = modalApi.getData() as { id?: string }; data.id = id ? id : ''; - console.log(data); - if (data.dateType == 1) { if (singleDate.value) { data.startDate = dayjs(singleDate.value).format('YYYY-MM-DD'); @@ -264,10 +295,36 @@ async function handleConfirm() { data.endDate = dayjs(rangeDate.value[1]).format('YYYY-MM-DD'); } } - // await (isUpdate.value ? arrangementUpdate(data) : arrangementAdd(data)); + for (const item of tableData) { + for (const user of item.users) { + data.userGroupList.push({ + deptId: item.dept.unitId, //部门ID + deptName: item.dept.unitName, //部门名称 + employeeId: user.id, //员工ID + employeeName: user.userName, //员工姓名 + }); + } + } + await (isUpdate.value ? arrangementUpdate(data) : arrangementAdd(data)); resetInitialized(); emit('reload'); + // 重置表单数据 + Object.assign(formModel, { + id: '', + groupId: '', + attendanceType: '', + dateType: undefined, + startDate: '', + endDate: '', + userGroupList: [], + }); + // 重置其他数据 + tableData.length = 0; + singleDate.value = ''; + longDate.value = ''; + rangeDate.value = ['', '']; modalApi.close(); + await formApi.resetForm(); } catch (error) { console.error(error); } finally { @@ -276,8 +333,27 @@ async function handleConfirm() { } async function handleClosed() { + // 重置表单数据 + Object.assign(formModel, { + id: '', + groupId: '', + attendanceType: '', + dateType: undefined, + startDate: '', + endDate: '', + userGroupList: [], + }); + + // 重置其他数据 + tableData.length = 0; + singleDate.value = ''; + longDate.value = ''; + rangeDate.value = ['', '']; + + // 重置表单状态 await formApi.resetForm(); resetInitialized(); + modalApi.close(); } onMounted(() => {}); diff --git a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue index ea4b843d..774f9aa0 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue @@ -1,11 +1,13 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/property/costManagement/costMeterWater/costMeterWater-modal.vue b/apps/web-antd/src/views/property/costManagement/costMeterWater/costMeterWater-modal.vue index f64606a6..7da7dabe 100644 --- a/apps/web-antd/src/views/property/costManagement/costMeterWater/costMeterWater-modal.vue +++ b/apps/web-antd/src/views/property/costManagement/costMeterWater/costMeterWater-modal.vue @@ -111,7 +111,6 @@ const schema = [ itemId: '', meterTypeId: '', }); - console.log(await formApi.getValues()); }, }, }, @@ -216,8 +215,6 @@ const [BasicModal, modalApi] = useVbenModal({ isUpdate.value = !!id; if (isUpdate.value && id) { const record = await costMeterWaterInfo(id); - console.log(1, record); - const costItemsRes = await costItemSettingList({ pageSize: 1000000000, pageNum: 1, @@ -253,7 +250,6 @@ const [BasicModal, modalApi] = useVbenModal({ }, ]); await formApi.setValues(record); - console.log(2, await formApi.getValues()); } await markInitialized(); @@ -270,8 +266,6 @@ async function handleConfirm() { } // getValues获取为一个readonly的对象 需要修改必须先深拷贝一次 const data = cloneDeep(await formApi.getValues()); - console.log(data); - await (isUpdate.value ? costMeterWaterUpdate(data) : costMeterWaterAdd(data)); diff --git a/apps/web-antd/src/views/property/personalCenter/leaveApplication/data.ts b/apps/web-antd/src/views/property/personalCenter/leaveApplication/data.ts index 5c6286bf..b75bac23 100644 --- a/apps/web-antd/src/views/property/personalCenter/leaveApplication/data.ts +++ b/apps/web-antd/src/views/property/personalCenter/leaveApplication/data.ts @@ -4,146 +4,6 @@ import type { VxeGridProps } from '#/adapter/vxe-table'; import { getDictOptions } from '#/utils/dict'; import { renderDict } from '#/utils/render'; -export const querySchema: FormSchemaGetter = () => [ - { - component: 'Input', - fieldName: 'userId', - label: '用户ID,关联用户表', - }, - { - component: 'Input', - fieldName: 'username', - label: '申请人姓名', - }, - { - component: 'Input', - fieldName: 'departmentId', - label: '部门ID,关联部门表', - }, - { - component: 'Input', - fieldName: 'departmentName', - label: '部门名称', - }, - { - component: 'Select', - componentProps: { - }, - fieldName: 'leaveType', - label: '请假类型', - }, - { - component: 'DatePicker', - componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - }, - fieldName: 'startTime', - label: '开始时间', - }, - { - component: 'DatePicker', - componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - }, - fieldName: 'endTime', - label: '结束时间', - }, - { - component: 'Input', - fieldName: 'totalDuration', - label: '合计时间,如3天5个小时', - }, - { - component: 'Textarea', - fieldName: 'reason', - label: '请假事由', - }, - { - component: 'Select', - componentProps: { - // 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护 - options: getDictOptions('wy_sqzt'), - }, - fieldName: 'status', - label: '申请状态', - }, - { - component: 'Input', - fieldName: 'searchValue', - label: '搜索值', - }, -]; - -// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 -// export const columns: () => VxeGridProps['columns'] = () => [ -export const columns: VxeGridProps['columns'] = [ - { type: 'checkbox', width: 60 }, - { - title: '', - field: 'id', - }, - { - title: '用户ID,关联用户表', - field: 'userId', - }, - { - title: '申请人姓名', - field: 'username', - }, - { - title: '部门ID,关联部门表', - field: 'departmentId', - }, - { - title: '部门名称', - field: 'departmentName', - }, - { - title: '请假类型', - field: 'leaveType', - }, - { - title: '开始时间', - field: 'startTime', - }, - { - title: '结束时间', - field: 'endTime', - }, - { - title: '合计时间,如3天5个小时', - field: 'totalDuration', - }, - { - title: '请假事由', - field: 'reason', - }, - { - title: '申请状态', - field: 'status', - slots: { - default: ({ row }) => { - // 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护 - return renderDict(row.status, 'wy_sqzt'); - }, - }, - }, - { - title: '搜索值', - field: 'searchValue', - }, - { - field: 'action', - fixed: 'right', - slots: { default: 'action' }, - title: '操作', - width: 180, - }, -]; export const modalSchema: FormSchemaGetter = () => [ { @@ -156,24 +16,16 @@ export const modalSchema: FormSchemaGetter = () => [ }, }, { - label: '用户ID,关联用户表', - fieldName: 'userId', - component: 'Input', - }, - { - label: '申请人姓名', + label: '姓名', fieldName: 'username', component: 'Input', + rules:'required' }, { - label: '部门ID,关联部门表', + label: '部门', fieldName: 'departmentId', - component: 'Input', - }, - { - label: '部门名称', - fieldName: 'departmentName', - component: 'Input', + component: 'ApiSelect', + rules:'required' }, { label: '请假类型', @@ -181,6 +33,7 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'Select', componentProps: { }, + rules:'required' }, { label: '开始时间', @@ -191,6 +44,8 @@ export const modalSchema: FormSchemaGetter = () => [ format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, + rules:'required' + }, { label: '结束时间', @@ -201,29 +56,19 @@ export const modalSchema: FormSchemaGetter = () => [ format: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD HH:mm:ss', }, + rules:'required' }, { - label: '合计时间,如3天5个小时', + label: '合计时间', fieldName: 'totalDuration', component: 'Input', + disabled:true, + rules:'required' }, { label: '请假事由', fieldName: 'reason', component: 'Textarea', - }, - { - label: '申请状态', - fieldName: 'status', - component: 'Select', - componentProps: { - // 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护 - options: getDictOptions('wy_sqzt'), - }, - }, - { - label: '搜索值', - fieldName: 'searchValue', - component: 'Input', - }, + rules:'required' + } ]; diff --git a/apps/web-antd/src/views/property/personalCenter/leaveApplication/index.vue b/apps/web-antd/src/views/property/personalCenter/leaveApplication/index.vue index 3c24b6a0..8bba1c88 100644 --- a/apps/web-antd/src/views/property/personalCenter/leaveApplication/index.vue +++ b/apps/web-antd/src/views/property/personalCenter/leaveApplication/index.vue @@ -1,188 +1,39 @@ diff --git a/apps/web-antd/src/views/property/personalCenter/leaveApplication/leaveApplication-modal.vue b/apps/web-antd/src/views/property/personalCenter/leaveApplication/leaveApplication-modal.vue deleted file mode 100644 index c052f188..00000000 --- a/apps/web-antd/src/views/property/personalCenter/leaveApplication/leaveApplication-modal.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - diff --git a/apps/web-antd/src/views/property/resident/unit/data.ts b/apps/web-antd/src/views/property/resident/unit/data.ts index f78ea30f..a7ac0cae 100644 --- a/apps/web-antd/src/views/property/resident/unit/data.ts +++ b/apps/web-antd/src/views/property/resident/unit/data.ts @@ -130,7 +130,6 @@ export const modalSchema: FormSchemaGetter = () => [ fieldName: 'name', component: 'Input', rules: 'required', - }, { label: '单位类型', diff --git a/apps/web-antd/src/views/screen/digitalIntelligence/index.vue b/apps/web-antd/src/views/screen/digitalIntelligence/index.vue index 7f971bfc..4e3d5213 100644 --- a/apps/web-antd/src/views/screen/digitalIntelligence/index.vue +++ b/apps/web-antd/src/views/screen/digitalIntelligence/index.vue @@ -1,394 +1,548 @@