From 09db75ae58e7f361b8e21cbe7bab5011bdc35369 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Thu, 7 Aug 2025 11:16:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=E4=BF=9D=E6=B4=81=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=BE=E5=88=B0=E6=96=B9=E5=BC=8F=E3=80=81?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/property/visitorManagement/model.d.ts | 4 +++ .../clean/cleanOrders/clean-modal.vue | 26 ++++++++++++++++++- .../visitorTodo/visitorTodo-detail.vue | 8 +++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/api/property/visitorManagement/model.d.ts b/apps/web-antd/src/api/property/visitorManagement/model.d.ts index eec10054..c687f880 100644 --- a/apps/web-antd/src/api/property/visitorManagement/model.d.ts +++ b/apps/web-antd/src/api/property/visitorManagement/model.d.ts @@ -70,6 +70,10 @@ export interface VisitorManagementVO { * 预约状态(0:待确认,1:已确认,2:已取消,3:已完成) */ serveStatus: number; + /** + * 身份证号 + */ + idCard: string; } export interface VisitorManagementForm extends BaseEntity { diff --git a/apps/web-antd/src/views/property/clean/cleanOrders/clean-modal.vue b/apps/web-antd/src/views/property/clean/cleanOrders/clean-modal.vue index 34527570..d534c4d0 100644 --- a/apps/web-antd/src/views/property/clean/cleanOrders/clean-modal.vue +++ b/apps/web-antd/src/views/property/clean/cleanOrders/clean-modal.vue @@ -188,7 +188,7 @@ const modalSchema = [ }, }, { - label: '联系电话', + label: '评价图片', fieldName: 'imgUrl', component: 'Input', dependencies: { @@ -196,6 +196,30 @@ const modalSchema = [ triggerFields: [''], }, }, + { + label: '签到方式', + fieldName: 'signType', + component: 'Select', + componentProps: { + options:getDictOptions('wy_bjqdfs') + }, + dependencies: { + show: () => (isReadonly.value ? true : false), + triggerFields: [''], + }, + }, + { + label: '签到图片', + fieldName: 'signImgUrl', + component: 'ImageUpload', + componentProps: { + helpMessage:false + }, + dependencies: { + show: (formValue) => (isReadonly.value&&formValue.signImgUrl ? true : false), + triggerFields: [''], + }, + }, ]; const [BasicForm, formApi] = useVbenForm({ commonConfig: { diff --git a/apps/web-antd/src/views/property/visitorManagement/visitorTodo/visitorTodo-detail.vue b/apps/web-antd/src/views/property/visitorManagement/visitorTodo/visitorTodo-detail.vue index 828a3df9..16c92028 100644 --- a/apps/web-antd/src/views/property/visitorManagement/visitorTodo/visitorTodo-detail.vue +++ b/apps/web-antd/src/views/property/visitorManagement/visitorTodo/visitorTodo-detail.vue @@ -34,13 +34,19 @@ async function handleOpenChange(open: boolean) { - + {{ visitorTodoDetail.visitorName }} {{ visitorTodoDetail.visitorPhone }} + + {{ visitorTodoDetail.idCard }} + + + {{ visitorTodoDetail.facePictures }} + {{ visitorTodoDetail.visitorUnit}} From ed8fa0f5b4b4ff3e1b627e4cca7b33c94acdd7a0 Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Thu, 7 Aug 2025 16:49:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=B7=AF=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shiftSetting/shift-modal.vue | 1 - .../customerService/centerConsole/index.vue | 9 +++- .../inspectionRoute/index.vue | 2 +- .../inspectionRoute/inspectionRoute-modal.vue | 32 ++++++++++----- .../inspectionRoute/point-modal.vue | 41 ++++++++++++++----- 5 files changed, 60 insertions(+), 25 deletions(-) diff --git a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue index dc2ff70d..838d5b3e 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue @@ -63,7 +63,6 @@ const [BasicModal, modalApi] = useVbenModal({ ]; } record.status = record.status?.toString(); - console.log(record); await formApi.setValues(record); } await markInitialized(); diff --git a/apps/web-antd/src/views/property/customerService/centerConsole/index.vue b/apps/web-antd/src/views/property/customerService/centerConsole/index.vue index 95c4f82f..13a5bd7c 100644 --- a/apps/web-antd/src/views/property/customerService/centerConsole/index.vue +++ b/apps/web-antd/src/views/property/customerService/centerConsole/index.vue @@ -115,7 +115,6 @@ async function fetchOrderTyper() { const totalQuantity = board.value.satisfactionChartList.reduce((sum, item) => { return sum + Number(item.quantity || 0); }, 0); - console.log(seriesData.value) renderOrderTyper({ title: {text: '工单类型分类占比',left: '18px',top: '18px'}, tooltip: { @@ -127,7 +126,13 @@ async function fetchOrderTyper() { orient: 'vertical', icon: 'circle', itemWidth: 8, - itemHeight: 8 + itemHeight: 8, + formatter: (name) => { + const dataItem = seriesData.value.find(item => item.name === name); + const value = dataItem?.value || 0; + const percentage = totalQuantity ? ((value / totalQuantity) * 100).toFixed(1) : 0; + return `${name} ${percentage}% ${value}个`; + }, }, series: [ { diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue index a5a30d0e..1bc29de5 100644 --- a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue @@ -154,6 +154,6 @@ const handleUpdate = (dataSet) => { - + diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue index 18f22086..284f9a52 100644 --- a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue @@ -7,7 +7,6 @@ import { useVbenForm } from '#/adapter/form'; import { inspectionRouteAdd, inspectionRouteInfo, - inspectionRouteList, inspectionRouteUpdate } from '#/api/property/inspectionManagement/inspectionRoute'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; @@ -62,11 +61,14 @@ const [BasicModal, modalApi] = useVbenModal({ if (isUpdate.value && id) { const record = await inspectionRouteInfo(id); pointList.value = (record.inspectionRoutePointVoList || []).map(item => ({ + id: item.id, pointId: item.pointId ?? '', pointName: item.pointName ?? '', + startTime: item.startTime ?? '', + endTime: item.endTime ?? '', + sort: item.sort ?? '', })); await tableApi.reload(); - console.log(pointList.value,111) await formApi.setValues(record); } await markInitialized(); @@ -83,10 +85,10 @@ async function handleConfirm() { } let data = { ...cloneDeep(await formApi.getValues()), - inspectionRoutePointBoList:[pointData.value] + inspectionRoutePointBoList:[...pointList.value] } - console.log(data,333) await (isUpdate.value ? inspectionRouteUpdate(data) : inspectionRouteAdd(data)); + pointList.value = [] resetInitialized(); emit('reload'); modalApi.close(); @@ -99,9 +101,11 @@ async function handleConfirm() { async function handleClosed() { await formApi.resetForm(); + pointList.value = [] resetInitialized(); } +const pointItem = ref([]) async function queryWorkOrdersType() { let params = { pageSize: 1000, @@ -112,6 +116,10 @@ async function queryWorkOrdersType() { label: item.pointName, value: item.id, })); + pointItem.value = res.rows.map((item) => ({ + pointId: item.id, + pointName: item.pointName, + })); tableApi.formApi.updateSchema([{ componentProps: () => ({ options: options, @@ -166,7 +174,6 @@ const gridOptions: VxeGridProps = { }; const [BasicTable, tableApi] = useVbenVxeGrid({ - formOptions, gridOptions, }); @@ -180,15 +187,20 @@ function handleAdd() { } async function handleEdit(row: Required) { - pointModalApi.setData({ id: row.id }); + pointModalApi.setData({ row }); pointModalApi.open(); } -const pointData = ref({}) const handlePoint = (data) => { data.startTime = dayjs(data.startTime).format('YYYY-MM-DD HH:mm:ss') data.endTime = dayjs(data.endTime).format('YYYY-MM-DD HH:mm:ss') - pointData.value = data; + data.pointName = pointItem.value.find(item => item.pointId === data.pointId)?.pointName; + const existingIndex = pointList.value.findIndex(item => item.pointId === data.pointId); + if (existingIndex !== -1) { + pointList.value[existingIndex] = data; + } else { + pointList.value.push(data); + } }; @@ -196,7 +208,7 @@ const handlePoint = (data) => { - + { - + diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue index c21b83c9..34623aed 100644 --- a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue @@ -2,7 +2,7 @@ import { useVbenModal } from '@vben/common-ui'; import { cloneDeep } from '@vben/utils'; import { useVbenForm } from '#/adapter/form'; -import { inspectionRouteInfo } from '#/api/property/inspectionManagement/inspectionRoute'; +import dayjs from 'dayjs'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { inspectionPointList, @@ -34,6 +34,13 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff( }, ); +const props = defineProps({ + pointList: { + type: Array, + default: () => [], + }, +}); + const [BasicModal, modalApi] = useVbenModal({ class: 'w-[550px]', fullscreenButton: false, @@ -45,13 +52,14 @@ const [BasicModal, modalApi] = useVbenModal({ return null; } modalApi.modalLoading(true); + const { row } = modalApi.getData() as { row?: number | string }; + isUpdate.value = !!row; await queryWorkOrdersType() - const { id } = modalApi.getData() as { id?: number | string }; - isUpdate.value = !!id; - - if (isUpdate.value && id) { - const record = await inspectionRouteInfo(id); - await formApi.setValues(record); + if (isUpdate.value && row ){ + row.startTime = dayjs(row.startTime) + row.endTime = dayjs(row.endTime) + console.log(row,456) + await formApi.setValues(row); } await markInitialized(); @@ -89,15 +97,26 @@ async function queryWorkOrdersType() { pageNum: 1 } const res = await inspectionPointList(params) - const options = res.rows.map((item) => ({ - label: item.pointName, - value: item.id, - })); + let options = [] + if(isUpdate.value){ + options = res.rows.map((item) => ({ + label: item.pointName, + value: item.id, + })); + }else{ + const existingIds = props.pointList.map(item => item.pointId); + const filteredRows = res.rows.filter(item => !existingIds.includes(item.id)); + options = filteredRows.map((item) => ({ + label: item.pointName, + value: item.id, + })); + } formApi.updateSchema([{ componentProps: () => ({ options: options, showSearch: true, filterOption: filterOption, + disabled: isUpdate.value, }), fieldName: 'pointId', }]) From 1e4c74230f6a6b642e5ed6bbb891759369836f54 Mon Sep 17 00:00:00 2001 From: fyy <2717885210@qq.com> Date: Thu, 7 Aug 2025 17:44:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E6=8E=92=E7=8F=AD=E6=97=A5?= =?UTF-8?q?=E5=8E=86=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attendanceManagement/arrangement/index.ts | 34 +- .../arrangement/model.d.ts | 20 +- .../workforceManagement/arrangement-modal.vue | 78 +--- .../workforceManagement/calendarView.vue | 161 ++++---- .../workforceManagement/data.ts | 66 ++++ .../workforce-day-detail.vue | 107 ++++++ .../workforceManagement/workforce-detail.vue | 346 ++++++++++++++++++ 7 files changed, 647 insertions(+), 165 deletions(-) create mode 100644 apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-day-detail.vue create mode 100644 apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue 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 0ffab03b..fdd93873 100644 --- a/apps/web-antd/src/api/property/attendanceManagement/arrangement/index.ts +++ b/apps/web-antd/src/api/property/attendanceManagement/arrangement/index.ts @@ -1,18 +1,25 @@ -import type { ArrangementVO, ArrangementForm, ArrangementQuery } from './model'; +import type { + ArrangementVO, + ArrangementForm, + ArrangementQuery, + arrangmentListQuery, +} from './model'; import type { ID, IDS } from '#/api/common'; import type { PageResult } from '#/api/common'; -import { commonExport } from '#/api/helper'; import { requestClient } from '#/api/request'; /** -* 分页查询排班列表 -* @param params -* @returns 排班列表 -*/ + * 分页查询排班列表 + * @param params + * @returns 排班列表 + */ export function arrangementList(params?: ArrangementQuery) { - return requestClient.get>('/property/arrangement/list', { params }); + return requestClient.get>( + '/property/arrangement/list', + { params }, + ); } /** * 根据月份查询排班列表 @@ -58,3 +65,16 @@ export function arrangementUpdate(data: ArrangementForm) { export function arrangementRemove(id: ID | IDS) { return requestClient.deleteWithMsg(`/property/arrangement/${id}`); } + +/** + * 查询某天排班详情列表 + * @param params + * @returns 排班列表 + */ + +export function arrangmentList(params?: arrangmentListQuery) { + return requestClient.get>( + '/property/arrangement/list', + { 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 83f93190..e0ecbb4a 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 @@ -9,37 +9,40 @@ export interface ArrangementVO { /** * 排班名称 */ - scheduleName: string; + scheduleName?: string; /** * 考勤组ID */ - groupId: string | number; + groupId?: string | number; /** * 排班类型:1-固定班制,2-排班制 */ - scheduleType: number; + scheduleType?: number; /** * 日期类型:1-单个日期,2-长期有效,3-期间有效 */ - dateType: number; + dateType?: number; /** * 开始日期 */ - startDate: string; + startDate?: string; /** * 结束日期(仅date_type=3时有效) */ - endDate: string; + endDate?: string; /** * 状态:0-未生效,1-已生效 */ - status: number; + status?: number; + userGroupList?:any[]; + attendanceGroup?:any; + dateType?:number } export interface ArrangementForm extends BaseEntity { @@ -134,3 +137,6 @@ export interface ArrangementQuery extends PageQuery { */ month?: string; } +export interface arrangmentListQuery extends PageQuery { + currentDate:string//某天的日期 +} 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 d4e5ccd3..1a941699 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 @@ -1,18 +1,9 @@ - + {}); {}); - + 单个日期 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 b60874bf..3898bd20 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/calendarView.vue @@ -5,8 +5,13 @@ import { ref, onMounted, reactive } from 'vue'; import { Dayjs } from 'dayjs'; import dayjs from 'dayjs'; import arrangementModal from './arrangement-modal.vue'; +import workforceDetailModal from './workforce-detail.vue'; +import workforceDayDetailModal from './workforce-day-detail.vue'; import { useVbenModal } from '@vben/common-ui'; -import { arrangementCalender } from '#/api/property/attendanceManagement/arrangement'; // 导入接口 +import { + arrangementCalender, + arrangementRemove, +} from '#/api/property/attendanceManagement/arrangement'; // 导入接口 import { Modal } from 'ant-design-vue'; const emit = defineEmits<{ @@ -20,8 +25,6 @@ const calendarData = reactive([]); const loading = ref(false); // 查询日历数据 const fetchCalendarData = async (month?: string) => { - console.log(123); - try { loading.value = true; const params = { @@ -35,10 +38,10 @@ const fetchCalendarData = async (month?: string) => { month || selectedDate.value?.format('YYYY-MM') || dayjs().format('YYYY-MM'); //当前月份的开始日期 - + // 清空之前的数据 calendarData.length = 0; - + // 生成日历渲染数据结构 for (const row of res.rows) { if (row.endDate) { @@ -46,26 +49,27 @@ const fetchCalendarData = async (month?: string) => { const endDate = dayjs(row.endDate); const currentMonthStart = dayjs(currentMonth).startOf('month'); const currentMonthEnd = dayjs(currentMonth).endOf('month'); - + //当开始时间小于当前月份的开始日期 - if (startDate.isBefore(currentMonthStart) || startDate.isSame(currentMonthStart, 'day')) { - console.log(row, '小 - 开始时间小于等于当前月份开始时间'); - console.log('开始时间:', row.startDate); - console.log('结束时间:', row.endDate); - console.log('当前月份开始:', currentMonthStart.format('YYYY-MM-DD')); - console.log('当前月份结束:', currentMonthEnd.format('YYYY-MM-DD')); - + if ( + startDate.isBefore(currentMonthStart) || + startDate.isSame(currentMonthStart, 'day') + ) { + // 分析: //如果结束时间小于当前月份的结束时间,则生成当前月份开始时间到row.endDate结束时间的n条数据 //如果结束时间大于等于当前月份的结束时间,则生成当前月份开始时间到当前月份结束时间(即当前月份天数)的n条数据 - + // 实现: // 确定结束日期:取row.endDate和当前月份结束日期的较小值 - const actualEndDate = endDate.isBefore(currentMonthEnd) ? endDate : currentMonthEnd; - console.log('实际结束日期:', actualEndDate.format('YYYY-MM-DD')); - - // 生成从当前月份开始到实际结束日期的数据 + // 先判断当前日期与结束日期的大小,如果小则取实际结束时间endDate,否则取月份实际结束时间currentMonthEnd + const actualEndDate = endDate.isBefore(currentMonthEnd) + ? endDate + : currentMonthEnd; + // 生成数据 let currentDate = currentMonthStart; - let generatedCount = 0; - while (currentDate.isSame(actualEndDate, 'day') || currentDate.isBefore(actualEndDate, 'day')) { + while ( + currentDate.isSame(actualEndDate, 'day') || + currentDate.isBefore(actualEndDate, 'day') + ) { calendarData.push({ date: currentDate.format('YYYY-MM-DD'), item: { @@ -76,27 +80,21 @@ const fetchCalendarData = async (month?: string) => { endDate: row.endDate, }, }); - generatedCount++; currentDate = currentDate.add(1, 'day'); } - console.log(`生成了 ${generatedCount} 条数据`); } else { //当开始时间大于当前月份的开始日期 //如果结束时间小于当前月份的结束时间,则生成开始时间到结束时间的n条数据 - console.log(row, '大 - 开始时间大于当前月份开始时间'); - console.log('开始时间:', row.startDate); - console.log('结束时间:', row.endDate); - console.log('当前月份开始:', currentMonthStart.format('YYYY-MM-DD')); - console.log('当前月份结束:', currentMonthEnd.format('YYYY-MM-DD')); - // 确定结束日期:取row.endDate和当前月份结束日期的较小值 - const actualEndDate = endDate.isBefore(currentMonthEnd) ? endDate : currentMonthEnd; - console.log('实际结束日期:', actualEndDate.format('YYYY-MM-DD')); - + const actualEndDate = endDate.isBefore(currentMonthEnd) + ? endDate + : currentMonthEnd; // 生成从开始日期到实际结束日期的数据 let currentDate = startDate; - let generatedCount = 0; - while (currentDate.isSame(actualEndDate, 'day') || currentDate.isBefore(actualEndDate, 'day')) { + while ( + currentDate.isSame(actualEndDate, 'day') || + currentDate.isBefore(actualEndDate, 'day') + ) { calendarData.push({ date: currentDate.format('YYYY-MM-DD'), item: { @@ -107,13 +105,11 @@ const fetchCalendarData = async (month?: string) => { endDate: row.endDate, }, }); - generatedCount++; currentDate = currentDate.add(1, 'day'); } - console.log(`生成了 ${generatedCount} 条数据`); } } else { - // 没有结束日期的情况,只在开始日期添加一条数据 + // 单个日期排班类型 calendarData.push({ date: row.startDate, item: { @@ -126,52 +122,38 @@ const fetchCalendarData = async (month?: string) => { }); } } - console.log('日历数据:', calendarData); //变量calendarData,日期相同的数据放到一个对象中,数据结构为scheduleData - + // 将calendarData按日期分组,形成scheduleData结构 const groupedData = new Map(); - + // 遍历calendarData,按日期分组 - calendarData.forEach(item => { + calendarData.forEach((item) => { const date = item.date; if (!groupedData.has(date)) { groupedData.set(date, []); } groupedData.get(date)!.push(item.item); }); - + // 转换为scheduleData格式 scheduleData.length = 0; // 清空原有数据 groupedData.forEach((items, date) => { scheduleData.push({ date: date, - list: items.map(item => ({ + list: items.map((item) => ({ type: 'success' as BadgeProps['status'], content: item.groupName || '排班安排', - item: item - })) + item: item, + })), }); }); - - console.log('处理后的scheduleData:', scheduleData); - - // 测试:验证生成的日历数据 - console.log('=== 日历数据验证 ==='); - console.log('当前月份:', currentMonth); - console.log('原始数据条数:', res.rows.length); - console.log('生成的日历数据条数:', calendarData.length); - console.log('分组后的数据条数:', scheduleData.length); - // 验证是否有重复日期 const dateCounts = new Map(); - calendarData.forEach(item => { + calendarData.forEach((item) => { const count = dateCounts.get(item.date) || 0; dateCounts.set(item.date, count + 1); }); - - console.log('日期分布:', Object.fromEntries(dateCounts)); - console.log('=== 验证完成 ==='); } catch (error) { console.error('获取日历数据失败:', error); message.error('获取日历数据失败'); @@ -197,7 +179,7 @@ const getListData2 = ( current: Dayjs, ): { type: BadgeProps['status']; content: string; item?: any }[] => { const dateStr = current.format('YYYY-MM-DD'); - + // 使用scheduleData结构 if (scheduleData.length > 0) { const found = scheduleData.find((item) => item.date === dateStr); @@ -205,7 +187,7 @@ const getListData2 = ( return found.list; } } - + // 如果没有找到数据,返回空数组 return []; }; @@ -247,25 +229,34 @@ function customHeader() { // 返回想要的VNode或null return null; // 什么都不显示 } -const [ArrangementModal, modalApi] = useVbenModal({ +const [ArrangementModal, arrangementModalApi] = useVbenModal({ connectedComponent: arrangementModal, }); +const [WorkforceDetailModal, workforceDetailModalApi] = useVbenModal({ + connectedComponent: workforceDetailModal, +}); +const [WorkforceDayDetailModal, workforceDayDetailModalApi] = useVbenModal({ + connectedComponent: workforceDayDetailModal, +}); function handleAdd() { - modalApi.setData({}); - modalApi.open(); + arrangementModalApi.setData({}); + arrangementModalApi.open(); } // 编辑排班 -function handleEdit(item: any) { -console.log(815328); - - // modalApi.setData({ +function handleEdit(item: any, date: string) { + workforceDetailModalApi.setData({ + id: item.id as number | string, + date: dayjs(date).format('YYYY-MM-DD'), + }); + workforceDetailModalApi.open(); + // arrangementModalApi.setData({ // id: item.id, // groupId: item.groupId, // startDate: item.startDate, // endDate: item.endDate, // }); - // modalApi.open(); + // arrangementModalApi.open(); } // 删除排班 @@ -276,7 +267,7 @@ function handleDelete(item: any) { onOk: async () => { try { // 这里需要调用删除接口 - // await deleteArrangement(item.id); + await arrangementRemove(item.id); message.success('删除成功'); fetchCalendarData(); } catch (error) { @@ -287,23 +278,12 @@ function handleDelete(item: any) { }); } -// 查看详情 -function handleViewDetails(item: any) { - // 这里可以打开详情弹窗或跳转到详情页面 - console.log('查看详情:', item); -} - -// 获取指定日期的所有排班项目 -function getScheduleItemsByDate(date: string) { - const found = scheduleData.find((item) => item.date === date); - return found ? found.list : []; -} - // 查看某日期的所有排班详情 function handleViewDateDetails(date: string) { - const items = getScheduleItemsByDate(date); - console.log(`${date} 的所有排班安排:`, items); - // 这里可以打开详情弹窗显示该日期的所有排班 + workforceDayDetailModalApi.setData({ + date: dayjs(date).format('YYYY-MM-DD'), + }); + workforceDayDetailModalApi.open(); } // 页面初始化时加载数据 @@ -349,13 +329,13 @@ onMounted(() => { {{ item.content }} - 编辑 - @@ -367,7 +347,7 @@ onMounted(() => { 详情 @@ -375,7 +355,12 @@ onMounted(() => { + + + + + diff --git a/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue new file mode 100644 index 00000000..900d0d29 --- /dev/null +++ b/apps/web-antd/src/views/property/attendanceManagement/workforceManagement/workforce-detail.vue @@ -0,0 +1,346 @@ + + + + + + 排班日期:{{ editDate }}({{ dayjs(editDate).format('dddd') }}) + + + + + + + + + + + + + + + + 考勤组人员(已选 + {{ totalSelected }} 人) + + 添加人员 + + + + + + + +