2025-07-22 19:11:52 +08:00
|
|
|
|
<script setup lang="ts">
|
2025-07-23 14:26:56 +08:00
|
|
|
|
import { ref, shallowRef } from 'vue';
|
|
|
|
|
import { useVbenModal } from '@vben/common-ui';
|
2025-07-22 19:11:52 +08:00
|
|
|
|
import {
|
|
|
|
|
Button,
|
|
|
|
|
Checkbox,
|
|
|
|
|
Descriptions,
|
|
|
|
|
DescriptionsItem,
|
|
|
|
|
Table,
|
|
|
|
|
} from 'ant-design-vue';
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
import duration from 'dayjs/plugin/duration';
|
|
|
|
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
2025-07-23 14:26:56 +08:00
|
|
|
|
import { renderDict } from '#/utils/render';
|
|
|
|
|
import { groupInfo } from '#/api/property/attendanceManagement/attendanceGroupSettings';
|
|
|
|
|
import type { GroupVO } from '#/api/property/attendanceManagement/attendanceGroupSettings/model';
|
2025-07-22 19:11:52 +08:00
|
|
|
|
import {
|
|
|
|
|
infoCycleColumns,
|
|
|
|
|
infoClockingColumns,
|
|
|
|
|
infoNoClockingColumns,
|
2025-07-23 14:26:56 +08:00
|
|
|
|
infoWeekdayColumns,
|
|
|
|
|
} from '#/views/property/attendanceManagement/attendanceGroupSettings/data';
|
|
|
|
|
import holidayCalendar from './holiday-calendar.vue';
|
2025-07-22 19:11:52 +08:00
|
|
|
|
|
|
|
|
|
dayjs.extend(duration);
|
|
|
|
|
dayjs.extend(relativeTime);
|
|
|
|
|
|
|
|
|
|
const [BasicModal, modalApi] = useVbenModal({
|
|
|
|
|
onOpenChange: handleOpenChange,
|
|
|
|
|
onClosed() {
|
|
|
|
|
groupDetail.value = null;
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const groupDetail = shallowRef<null | GroupVO>(null);
|
|
|
|
|
|
2025-07-23 14:26:56 +08:00
|
|
|
|
const weekdayData = ref<any[]>([]);
|
|
|
|
|
const cycleData = ref<any[]>([]);
|
|
|
|
|
const unCheckInData = ref<any[]>([]);
|
|
|
|
|
const checkInData = ref<any[]>([]);
|
2025-07-22 19:11:52 +08:00
|
|
|
|
|
|
|
|
|
async function handleOpenChange(open: boolean) {
|
|
|
|
|
if (!open) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
modalApi.modalLoading(true);
|
2025-07-27 17:42:14 +08:00
|
|
|
|
const {id,attendanceType} = modalApi.getData() as { id?: number | string,attendanceType?:string };
|
2025-07-28 17:16:27 +08:00
|
|
|
|
const res = await groupInfo(id,attendanceType);
|
|
|
|
|
groupDetail.value=res;
|
|
|
|
|
if(res.attendanceType==0){
|
|
|
|
|
unCheckInData.value=res.clockDateList.filter(item=>item.mustNoCheck==0)
|
|
|
|
|
checkInData.value=res.clockDateList.filter(item=>item.mustNoCheck==1)
|
|
|
|
|
weekdayData.value=res.weekList
|
|
|
|
|
weekdayData.value.forEach(item => {
|
|
|
|
|
if(item.shiftId){
|
|
|
|
|
const shift = res.attendanceList.find(i => item.shiftId == i.id);
|
|
|
|
|
let str = ''
|
|
|
|
|
if (shift.isRest) {
|
|
|
|
|
str = `${shift.name}:${shift.startTime}~${shift.restStartTime} ${shift.restEndTime}~${shift.endTime}`;
|
|
|
|
|
} else {
|
|
|
|
|
str = `${shift.name}:${shift.startTime}~${shift.endTime}`;
|
|
|
|
|
}
|
|
|
|
|
item.shiftValue=str
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
groupDetail.value.isAutomatic=true
|
|
|
|
|
}else {
|
|
|
|
|
cycleData.value=res;
|
|
|
|
|
}
|
2025-07-22 19:11:52 +08:00
|
|
|
|
modalApi.modalLoading(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const [HolidayCalendar, holidayApi] = useVbenModal({
|
|
|
|
|
connectedComponent: holidayCalendar,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查看法定节假日日历
|
|
|
|
|
*/
|
|
|
|
|
async function showHoliday() {
|
2025-07-23 14:26:56 +08:00
|
|
|
|
holidayApi.open();
|
2025-07-22 19:11:52 +08:00
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<BasicModal
|
|
|
|
|
:footer="false"
|
|
|
|
|
:fullscreen-button="false"
|
|
|
|
|
title="考勤组信息"
|
|
|
|
|
class="w-[70%]"
|
|
|
|
|
>
|
2025-07-22 19:11:52 +08:00
|
|
|
|
<div v-if="groupDetail" class="des-container">
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<Descriptions size="small" :column="1" :labelStyle="{ width: '100px' }">
|
2025-07-22 19:11:52 +08:00
|
|
|
|
<DescriptionsItem label="考勤组名称">
|
|
|
|
|
{{ groupDetail.groupName }}
|
|
|
|
|
</DescriptionsItem>
|
|
|
|
|
<DescriptionsItem label="考勤类型">
|
|
|
|
|
<component
|
2025-07-27 17:42:14 +08:00
|
|
|
|
:is="renderDict(groupDetail.attendanceType, 'wy_kqlx')"
|
2025-07-22 19:11:52 +08:00
|
|
|
|
/>
|
|
|
|
|
</DescriptionsItem>
|
|
|
|
|
<DescriptionsItem label="状态">
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<component :is="renderDict(groupDetail.status, 'wy_state')" />
|
2025-07-22 19:11:52 +08:00
|
|
|
|
</DescriptionsItem>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<DescriptionsItem
|
|
|
|
|
label="工作日设置"
|
|
|
|
|
v-if="groupDetail.attendanceType == 0"
|
|
|
|
|
>
|
|
|
|
|
<div class="item-font" style="width: 100%">
|
|
|
|
|
<Table
|
|
|
|
|
style="width: 90%"
|
|
|
|
|
bordered
|
|
|
|
|
:columns="infoWeekdayColumns"
|
|
|
|
|
:data-source="weekdayData"
|
|
|
|
|
size="small"
|
|
|
|
|
:pagination="false"
|
|
|
|
|
>
|
2025-07-28 17:16:27 +08:00
|
|
|
|
<template #bodyCell="{ column, record, index }">
|
|
|
|
|
<template v-if="column.dataIndex === 'dayOfWeek'">
|
|
|
|
|
<component :is="renderDict(record.dayOfWeek,'wy_kqgzr')"></component>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.dataIndex === 'shiftId'">
|
|
|
|
|
<span v-if="record.shiftId">{{record.shiftValue }}</span>
|
|
|
|
|
<span v-else>休息</span>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
2025-07-22 19:11:52 +08:00
|
|
|
|
</Table>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<Checkbox
|
|
|
|
|
class="item-padding-top"
|
|
|
|
|
v-model:checked="groupDetail.isAutomatic"
|
|
|
|
|
>
|
2025-07-22 19:11:52 +08:00
|
|
|
|
法定节假日自动排休
|
|
|
|
|
</Checkbox>
|
|
|
|
|
<Button type="link" @click="showHoliday">查看法定节假日日历</Button>
|
|
|
|
|
<p class="item-padding-top item-font-weight">特殊日期:</p>
|
|
|
|
|
<p class="item-padding">无需打卡日期:</p>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<Table
|
|
|
|
|
style="width: 75%"
|
|
|
|
|
bordered
|
|
|
|
|
:columns="infoNoClockingColumns"
|
|
|
|
|
:data-source="unCheckInData"
|
|
|
|
|
size="small"
|
|
|
|
|
:pagination="false"
|
|
|
|
|
>
|
2025-07-28 17:16:27 +08:00
|
|
|
|
<template #bodyCell="{ column, record }">
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<template v-if="column.dataIndex === 'dateTime'">
|
|
|
|
|
<span v-if="record.dateType == 0">{{
|
2025-07-28 17:16:27 +08:00
|
|
|
|
dayjs(record.startDate).format('YYYY-MM-DD')
|
|
|
|
|
}}</span>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<span v-else>{{
|
2025-07-28 17:16:27 +08:00
|
|
|
|
dayjs(record.startDate).format('YYYY-MM-DD')
|
|
|
|
|
+ '~' + dayjs(record.endDate).format('YYYY-MM-DD')
|
|
|
|
|
}}</span>
|
2025-07-22 19:11:52 +08:00
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</Table>
|
|
|
|
|
<p class="item-padding">必须打卡日期:</p>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<Table
|
|
|
|
|
style="width: 75%"
|
|
|
|
|
bordered
|
|
|
|
|
:columns="infoClockingColumns"
|
|
|
|
|
:data-source="checkInData"
|
|
|
|
|
size="small"
|
|
|
|
|
:pagination="false"
|
|
|
|
|
>
|
2025-07-28 17:16:27 +08:00
|
|
|
|
<template #bodyCell="{ column, record }">
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<template v-if="column.dataIndex === 'dateTime'">
|
|
|
|
|
<span v-if="record.dateType == 0">{{
|
2025-07-28 17:16:27 +08:00
|
|
|
|
dayjs(record.startDate).format('YYYY-MM-DD')
|
2025-07-23 14:26:56 +08:00
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
2025-07-28 17:16:27 +08:00
|
|
|
|
dayjs(record.startDate).format('YYYY-MM-DD')
|
|
|
|
|
+ '~' + dayjs(record.endDate).format('YYYY-MM-DD')
|
2025-07-23 14:26:56 +08:00
|
|
|
|
}}</span>
|
2025-07-22 19:11:52 +08:00
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</Table>
|
|
|
|
|
</div>
|
|
|
|
|
</DescriptionsItem>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<DescriptionsItem
|
|
|
|
|
label="排班周期"
|
|
|
|
|
v-if="groupDetail.attendanceType == 1"
|
|
|
|
|
>
|
|
|
|
|
<p class="item-font">
|
|
|
|
|
周期天数
|
|
|
|
|
<span class="item-font-weight item-font-color">{{
|
|
|
|
|
cycleData.length
|
|
|
|
|
}}</span>
|
|
|
|
|
天
|
|
|
|
|
</p>
|
|
|
|
|
<Table
|
|
|
|
|
style="width: 80%; margin-top: 5px"
|
|
|
|
|
bordered
|
|
|
|
|
:columns="infoCycleColumns"
|
|
|
|
|
:data-source="cycleData"
|
|
|
|
|
size="small"
|
|
|
|
|
:pagination="false"
|
|
|
|
|
>
|
|
|
|
|
<template #bodyCell="{ column, record, index }">
|
|
|
|
|
<template v-if="column.dataIndex === 'day'">
|
2025-07-22 19:11:52 +08:00
|
|
|
|
<span>{{ '第' + (index + 1) + '天' }}</span>
|
|
|
|
|
</template>
|
2025-07-23 14:26:56 +08:00
|
|
|
|
<template v-if="column.dataIndex === 'shiftId'">
|
2025-07-28 17:16:27 +08:00
|
|
|
|
{{record.shiftId}}
|
2025-07-22 19:11:52 +08:00
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</Table>
|
|
|
|
|
</DescriptionsItem>
|
|
|
|
|
</Descriptions>
|
|
|
|
|
<HolidayCalendar></HolidayCalendar>
|
|
|
|
|
</div>
|
|
|
|
|
</BasicModal>
|
|
|
|
|
</template>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.des-container {
|
|
|
|
|
.item-font {
|
|
|
|
|
font-size: 0.875rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-font-weight {
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-font-color {
|
|
|
|
|
color: red;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-padding-top {
|
|
|
|
|
padding-top: 1.1rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.item-padding {
|
|
|
|
|
padding: 1.1rem 0 0.5rem 0;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-23 14:26:56 +08:00
|
|
|
|
:deep(
|
|
|
|
|
.ant-descriptions
|
|
|
|
|
.ant-descriptions-item-container
|
|
|
|
|
.ant-descriptions-item-content
|
|
|
|
|
) {
|
2025-07-22 19:11:52 +08:00
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|