From 3f19c3852f000c3e340870b127370c1b9b5d82e1 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Mon, 21 Jul 2025 20:57:31 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=80=83=E5=8B=A4=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../change-shift-schedule.vue | 143 ++++++++++++ .../attendanceGroupSettings/check-in-date.vue | 82 +++++++ .../attendanceGroupSettings/data.ts | 207 ++++++++++++------ .../attendanceGroupSettings/group-modal.vue | 179 ++++++++++++--- .../holiday-calendar.vue | 80 ++++--- 5 files changed, 569 insertions(+), 122 deletions(-) create mode 100644 apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue create mode 100644 apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/check-in-date.vue diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue new file mode 100644 index 00000000..81d6ebe6 --- /dev/null +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue @@ -0,0 +1,143 @@ + + + + + diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/check-in-date.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/check-in-date.vue new file mode 100644 index 00000000..3e6e41eb --- /dev/null +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/check-in-date.vue @@ -0,0 +1,82 @@ + + + + diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/data.ts b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/data.ts index 14d851ab..4c89c72d 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/data.ts +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/data.ts @@ -1,8 +1,8 @@ -import type { FormSchemaGetter } from '#/adapter/form'; -import type { VxeGridProps } from '#/adapter/vxe-table'; +import type {FormSchemaGetter} from '#/adapter/form'; +import type {VxeGridProps} from '#/adapter/vxe-table'; import {getDictOptions} from "#/utils/dict"; import {renderDict} from "#/utils/render"; -import type { TableColumnsType } from 'ant-design-vue'; +import type {TableColumnsType} from 'ant-design-vue'; export const querySchema: FormSchemaGetter = () => [ { @@ -13,7 +13,7 @@ export const querySchema: FormSchemaGetter = () => [ { component: 'Select', componentProps: { - options:getDictOptions('wy_kqlx') + options: getDictOptions('wy_kqlx') }, fieldName: 'attendanceType', label: '考勤类型', @@ -23,35 +23,35 @@ export const querySchema: FormSchemaGetter = () => [ // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ - { type: 'checkbox', width: 60 }, + {type: 'checkbox', width: 60}, { title: '考勤组名称', field: 'groupName', - minWidth:180, + minWidth: 180, }, { title: '考勤类型', field: 'attendanceType', - slots:{ - default: ({row})=>{ - return renderDict(row.attendanceType,'wy_kqlx') + slots: { + default: ({row}) => { + return renderDict(row.attendanceType, 'wy_kqlx') } }, - width:150 + width: 150 }, { title: '状态', field: 'status', - slots:{ + slots: { default: 'status' }, - width:180 + width: 180 }, { field: 'action', fixed: 'right', - slots: { default: 'action' }, + slots: {default: 'action'}, title: '操作', width: 180, }, @@ -82,32 +82,32 @@ export const modalSchema: FormSchemaGetter = () => [ options: getDictOptions('wy_kqlx'), }, rules: 'selectRequired', - defaultValue:'0' + defaultValue: '0' }, { label: '工作日设置', fieldName: 'weekdaySetting', component: 'Input', dependencies: { - show: (formValue) => formValue.attendanceType=='0', + show: (formValue) => formValue.attendanceType == '0', triggerFields: ['attendanceType'], }, - slots:{ - default:'weekdaySetting' + slots: { + default: 'weekdaySetting' }, - rules:'required', - defaultValue:'1', + rules: 'required', + defaultValue: '1', }, { label: '', fieldName: 'settingItem', component: 'Input', dependencies: { - show: (formValue) => formValue.attendanceType=='0', + show: (formValue) => formValue.attendanceType == '0', triggerFields: ['attendanceType'], }, - slots:{ - default:'settingItem' + slots: { + default: 'settingItem' }, }, { @@ -115,25 +115,25 @@ export const modalSchema: FormSchemaGetter = () => [ fieldName: 'attendanceShift', component: 'Input', dependencies: { - show: (formValue) => formValue.attendanceType=='1', + show: (formValue) => formValue.attendanceType == '1', triggerFields: ['attendanceType'], }, - slots:{ - default:'attendanceShift' + slots: { + default: 'attendanceShift' }, - rules:'required', - defaultValue:'1', + rules: 'required', + defaultValue: '1', }, { label: '', fieldName: 'shiftData', component: 'Input', dependencies: { - show: (formValue) => formValue.attendanceType=='1', + show: (formValue) => formValue.attendanceType == '1', triggerFields: ['attendanceType'], }, - slots:{ - default:'shiftData' + slots: { + default: 'shiftData' }, }, { @@ -141,25 +141,25 @@ export const modalSchema: FormSchemaGetter = () => [ fieldName: 'schedulingCycle', component: 'Input', dependencies: { - show: (formValue) => formValue.attendanceType=='1', + show: (formValue) => formValue.attendanceType == '1', triggerFields: ['attendanceType'], }, - slots:{ - default:'schedulingCycle' + slots: { + default: 'schedulingCycle' }, - defaultValue:'1', - rules:'required' + defaultValue: '1', + rules: 'required' }, { label: '', fieldName: 'cycleData', component: 'Input', dependencies: { - show: (formValue) => formValue.attendanceType=='1', + show: (formValue) => formValue.attendanceType == '1', triggerFields: ['attendanceType'], }, - slots:{ - default:'cycleData' + slots: { + default: 'cycleData' }, }, ]; @@ -168,23 +168,23 @@ export const weekdayColumns: TableColumnsType = [ { title: '工作日', key: 'label', - width:180, - align:'center', - dataIndex:'label' + width: 120, + align: 'center', + dataIndex: 'label' }, { title: '班次', key: 'shift', - minWidth:180, - align:'center', - dataIndex:'shift' + minWidth: 180, + align: 'center', + dataIndex: 'shift' }, { title: '操作', key: 'action', - dataIndex:'action', - width:180, - align:'center', + dataIndex: 'action', + width: 180, + align: 'center', }, ] @@ -192,16 +192,16 @@ export const noClockingColumns: TableColumnsType = [ { title: '无需打卡日期', key: 'label', - width:180, - align:'center', - dataIndex:'label' + minWidth: 180, + align: 'center', + dataIndex: 'label' }, { title: '操作', key: 'action', - dataIndex:'action', - width:180, - align:'center', + dataIndex: 'action', + width: 150, + align: 'center', }, ] @@ -209,16 +209,16 @@ export const clockingColumns: TableColumnsType = [ { title: '必须打卡日期', key: 'label', - width:180, - align:'center', - dataIndex:'label' + minWidth: 180, + align: 'center', + dataIndex: 'label' }, { title: '操作', key: 'action', - dataIndex:'action', - width:180, - align:'center', + dataIndex: 'action', + width: 150, + align: 'center', }, ] @@ -226,23 +226,94 @@ export const cycleColumns: TableColumnsType = [ { title: '天数', key: 'label', - width:180, - align:'center', - dataIndex:'label' + width: 150, + align: 'center', + dataIndex: 'label' }, { title: '班次', key: 'label', - width:180, - align:'center', - dataIndex:'label' + minWidth: 180, + align: 'center', + dataIndex: 'label' }, { title: '操作', key: 'action', - dataIndex:'action', - width:180, - align:'center', + dataIndex: 'action', + width: 150, + align: 'center', }, ] +export const shiftColumns = [ + { + title: '序号', + dataIndex: 'id', + key: 'id', + width: 100, + align: 'center', + }, + { + title: '班次名称', + dataIndex: 'name', + key: 'name', + width: 180, + align: 'center', + }, + { + title: '考勤时间', + dataIndex: 'attendanceTime', + key: 'attendanceTime', + minWidth: 180, + align: 'center', + }, +]; + +const typeOptions = [ + {label: '单个日期', value: 1}, + {label: '时间段', value: 2}, +]; +export const clockInModalSchema: FormSchemaGetter = () => [ + { + label: '添加方式', + fieldName: 'type', + component: 'RadioGroup', + componentProps: { + options: typeOptions, + buttonStyle: 'solid', + }, + defaultValue:1, + rules: 'required', + }, + { + label: '日期', + fieldName: 'singleTime', + component: 'DatePicker', + rules: 'required', + componentProps: { + format: 'YYYY-MM-DD', + valueFormat: 'YYYY-MM-DD', + }, + dependencies: { + show: (formValue) => formValue.type==1, + triggerFields: ['type'], + }, + }, + { + label: '日期', + fieldName: 'timeSlot', + component: 'RangePicker', + componentProps: { + format: 'YYYY-MM-DD', + valueFormat: 'YYYY-MM-DD', + }, + rules: 'required', + dependencies: { + show: (formValue) => formValue.type==2, + triggerFields: ['type'], + }, + }, +] + + diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue index 4445dbbc..4c2b5c43 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/group-modal.vue @@ -23,6 +23,11 @@ import { import {Tag, Button, Table, Checkbox} from 'ant-design-vue' import {getDictOptions} from "#/utils/dict"; import holidayCalendar from './holiday-calendar.vue' +import changeShiftSchedule from './change-shift-schedule.vue' +import checkInDate from './check-in-date.vue' +import {h} from 'vue'; +import {PlusOutlined, MinusOutlined} from '@ant-design/icons-vue'; +import type {ShiftVO} from "#/api/property/attendanceManagement/shiftSetting/model"; const emit = defineEmits<{ reload: [] }>(); @@ -58,10 +63,9 @@ const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff( ); const [BasicModal, modalApi] = useVbenModal({ - // 在这里更改宽度 - class: 'w-[80%]', fullscreenButton: false, - maskClosable:false, + fullscreen: true, + // class:'w-[80%]', onBeforeClose, onClosed: handleClosed, onConfirm: handleConfirm, @@ -119,6 +123,13 @@ async function handleClosed() { const [HolidayCalendar, holidayApi] = useVbenModal({ connectedComponent: holidayCalendar, }); +const [ChangeShiftSchedule, shiftApi] = useVbenModal({ + connectedComponent: changeShiftSchedule, +}); + +const [CheckInDate, checkInDateApi] = useVbenModal({ + connectedComponent: checkInDate, +}); /** * 查看法定节假日日历 @@ -127,66 +138,184 @@ async function showHoliday() { holidayApi.open() } +/** + * 更改班次 + * @param type 1.设置班次 2.选择班次 + */ +async function shiftScheduleHandle(type) { + await shiftApi.open() + await shiftApi.setData({type}) +} + +async function changeShiftHandle(type, index) { + await shiftApi.open() + await shiftApi.setData({type})//3.更改班次 +} + +async function selectDateHandle(type) { + checkInDateApi.open() + checkInDateApi.setData({type}) +} + +const shiftInfo = ref() +const shiftList = ref([]) +const handleShiftInfo = (info) => { + shiftInfo.value = info; +}; + +const handleShiftList = (list) => { + shiftList.value = list; +}; + +const handleAfterValue = (val) => { + console.log(val, '===val') +}; + +const cycleData = ref([]) +const unCheckInData = ref([]) +const checkInData = ref([]) + +async function addCycleHandle() { + cycleData.value.push({ + shiftId: '', + }) +} + +async function deleteCycleHandle(index) { + cycleData.value.splice(index, 1) +} + +async function deleteUnCheckInHandle(index) { + unCheckInData.value.splice(index, 1) +} + +async function deleteCheckInHandle(index) { + checkInData.value.splice(index, 1) +} + +async function restHandle(index){ + +} +