This commit is contained in:
@@ -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<ShiftVO>()
|
||||
const shiftList = ref<ShiftVO[]>([])
|
||||
const handleShiftInfo = (info) => {
|
||||
shiftInfo.value = info;
|
||||
};
|
||||
|
||||
const handleShiftList = (list) => {
|
||||
shiftList.value = list;
|
||||
};
|
||||
|
||||
const handleAfterValue = (val) => {
|
||||
console.log(val, '===val')
|
||||
};
|
||||
|
||||
const cycleData = ref<any[]>([])
|
||||
const unCheckInData = ref<any[]>([])
|
||||
const checkInData = ref<any[]>([])
|
||||
|
||||
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){
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicModal :title="title+'考勤组'">
|
||||
<BasicForm>
|
||||
<template #weekdaySetting>
|
||||
<div class="item-font">
|
||||
<span>快捷设置班次:</span>
|
||||
<Tag color="processing">常规班次:08:00:00~12:00:00 14:00:00~17:00:00</Tag>
|
||||
<Button type="link">更改班次</Button>
|
||||
<Tag color="processing" v-if="shiftInfo">
|
||||
<span>{{ shiftInfo.name }}</span>
|
||||
<span v-if="shiftInfo.isRest">
|
||||
{{ shiftInfo.startTime + '~' + shiftInfo.restStartTime }}
|
||||
{{ shiftInfo.restEndTime + '~' + shiftInfo.endTime }}
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ shiftInfo.startTime + '~' + shiftInfo.endTime }}
|
||||
</span>
|
||||
</Tag>
|
||||
<Button type="link" @click="shiftScheduleHandle(1)">设置班次</Button>
|
||||
</div>
|
||||
</template>
|
||||
<template #settingItem>
|
||||
<div class="item-font" style="width: 100%;">
|
||||
<Table style="width: 100%" bordered :columns="weekdayColumns" :data-source="weekdayData"
|
||||
<Table style="width: 90%" bordered :columns="weekdayColumns" :data-source="weekdayData"
|
||||
size="small" :pagination="false">
|
||||
<!-- <template #headerCell="{ column }">-->
|
||||
<!-- </template>-->
|
||||
<!-- <template #bodyCell="{ column, record }">-->
|
||||
<!-- <template>-->
|
||||
<!-- {{ record[column.field] }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template #action="{row}">-->
|
||||
<!-- <Button type="link">更改班次</Button>-->
|
||||
<!-- <Button type="link">休息</Button>-->
|
||||
<!-- </template>-->
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<template v-if="column.dataIndex==='action'">
|
||||
<Button type="link" size="small" @click="changeShiftHandle(3)">更改班次</Button>
|
||||
<Button type="link" size="small" @click="restHandle(index)">休息</Button>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
<Checkbox class="item-padding-top" v-model:checked="settingData.isAutomatic">
|
||||
法定节假日自动排休
|
||||
</Checkbox>
|
||||
<!-- https://timor.tech/api/holiday/year/2024 国务院节假日安排API-->
|
||||
<Button type="link" @click="showHoliday">查看法定节假日日历</Button>
|
||||
<p class="item-padding-top item-font-weight">特殊日期:</p>
|
||||
<p class="item-padding">无需打卡日期:</p>
|
||||
<Table style="width: 80%" bordered :columns="noClockingColumns" :data-source="[]"
|
||||
<Table style="width: 75%" bordered :columns="noClockingColumns"
|
||||
:data-source="unCheckInData"
|
||||
size="small" :pagination="false">
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
@click="selectDateHandle"
|
||||
:icon="h(PlusOutlined)">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<template v-if="column.dataIndex==='action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
danger :icon="h(MinusOutlined)" @click="deleteUnCheckInHandle(index)">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
<p class="item-padding">必须打卡日期:</p>
|
||||
<Table style="width: 80%" bordered :columns="clockingColumns" :data-source="[]"
|
||||
<Table style="width: 75%" bordered :columns="clockingColumns" :data-source="checkInData"
|
||||
size="small" :pagination="false">
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
@click="selectDateHandle"
|
||||
:icon="h(PlusOutlined)">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<template v-if="column.dataIndex==='action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
danger :icon="h(MinusOutlined)" @click="deleteCheckInHandle(index)">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</template>
|
||||
<template #attendanceShift>
|
||||
<Button size="small">选择班次</Button>
|
||||
<Button size="small" @click="shiftScheduleHandle(2)" type="primary">选择班次</Button>
|
||||
</template>
|
||||
<template #shiftData>
|
||||
<Tag closable color="processing">早班</Tag>
|
||||
<div v-if="shiftList">
|
||||
<Tag closable color="processing" v-for="(item,index) in shiftList">
|
||||
{{ item.name }}
|
||||
</Tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #schedulingCycle>
|
||||
<span class="item-font">周期天数4天</span>
|
||||
<span class="item-font">周期天数
|
||||
<span style="font-weight: 500;color: red">{{ cycleData.length }}</span>
|
||||
天</span>
|
||||
</template>
|
||||
<template #cycleData>
|
||||
<Table style="width: 100%" bordered :columns="cycleColumns" :data-source="[]"
|
||||
<Table style="width: 80%" bordered :columns="cycleColumns" :data-source="cycleData"
|
||||
size="small" :pagination="false">
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
:icon="h(PlusOutlined)" @click="addCycleHandle">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<template v-if="column.dataIndex==='action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
danger :icon="h(MinusOutlined)" @click="deleteCycleHandle(index)">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<HolidayCalendar></HolidayCalendar>
|
||||
<ChangeShiftSchedule @shiftInfo="handleShiftInfo"
|
||||
@shiftList="handleShiftList"
|
||||
@afterValue="handleAfterValue"
|
||||
></ChangeShiftSchedule>
|
||||
<CheckInDate></CheckInDate>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
|
Reference in New Issue
Block a user