Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -5,7 +5,7 @@ export interface ShiftVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* 班次名称
|
||||
|
@@ -0,0 +1,166 @@
|
||||
<script setup lang="ts">
|
||||
import {ref, shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
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';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {groupInfo} from "#/api/property/attendanceManagement/attendanceGroupSettings";
|
||||
import type {GroupVO} from "#/api/property/attendanceManagement/attendanceGroupSettings/model";
|
||||
import {
|
||||
infoCycleColumns,
|
||||
infoClockingColumns,
|
||||
infoNoClockingColumns,
|
||||
infoWeekdayColumns
|
||||
} from "#/views/property/attendanceManagement/attendanceGroupSettings/data";
|
||||
import holidayCalendar from './holiday-calendar.vue'
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
groupDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const groupDetail = shallowRef<null | GroupVO>(null);
|
||||
|
||||
const weekdayData = ref<any[]>([])
|
||||
const cycleData = ref<any[]>([])
|
||||
const unCheckInData = ref<any[]>([])
|
||||
const checkInData = ref<any[]>([])
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
groupDetail.value = await groupInfo(id);
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
const [HolidayCalendar, holidayApi] = useVbenModal({
|
||||
connectedComponent: holidayCalendar,
|
||||
});
|
||||
|
||||
/**
|
||||
* 查看法定节假日日历
|
||||
*/
|
||||
async function showHoliday() {
|
||||
holidayApi.open()
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="考勤组信息" class="w-[70%]">
|
||||
<div v-if="groupDetail" class="des-container">
|
||||
<Descriptions size="small" :column="1" :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="考勤组名称">
|
||||
{{ groupDetail.groupName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="考勤类型">
|
||||
<component
|
||||
:is="groupDetail.attendanceType ? renderDict(groupDetail.attendanceType,'wy_kqlx') : ''"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态">
|
||||
<component
|
||||
:is="renderDict(groupDetail.status,'wy_state')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<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">
|
||||
</Table>
|
||||
<Checkbox class="item-padding-top" v-model:checked="groupDetail.isAutomatic">
|
||||
法定节假日自动排休
|
||||
</Checkbox>
|
||||
<Button type="link" @click="showHoliday">查看法定节假日日历</Button>
|
||||
<p class="item-padding-top item-font-weight">特殊日期:</p>
|
||||
<p class="item-padding">无需打卡日期:</p>
|
||||
<Table style="width: 75%" bordered :columns="infoNoClockingColumns"
|
||||
:data-source="unCheckInData"
|
||||
size="small" :pagination="false">
|
||||
<template #bodyCell="{ column,record,index }">
|
||||
<template v-if="column.dataIndex==='dateTime'">
|
||||
<span v-if="record.dateType==0">{{ record.startDate }}</span>
|
||||
<span v-else>{{ record.startDate + '~' + record.endDate }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
<p class="item-padding">必须打卡日期:</p>
|
||||
<Table style="width: 75%" bordered :columns="infoClockingColumns"
|
||||
:data-source="checkInData"
|
||||
size="small" :pagination="false">
|
||||
<template #bodyCell="{ column,record,index }">
|
||||
<template v-if="column.dataIndex==='dateTime'">
|
||||
<span v-if="record.dateType==0">{{ record.startDate }}</span>
|
||||
<span v-else>{{ record.startDate + '~' + record.endDate }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</DescriptionsItem>
|
||||
<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'">
|
||||
<span>{{ '第' + (index + 1) + '天' }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex==='shiftId'">
|
||||
<!-- {{item.name+'\xa0'}}-->
|
||||
<!-- <span v-if="item.isRest">{{item.startTime+'~'+item.restStartTime+'\xa0'+item.restEndTime+'~'+item.endTime}}</span>-->
|
||||
<!-- <span v-else>{{item.startTime+'~'+item.endTime}}</span>-->
|
||||
</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;
|
||||
}
|
||||
|
||||
:deep(.ant-descriptions .ant-descriptions-item-container .ant-descriptions-item-content) {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -14,19 +14,21 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
onConfirm: handleConfirm,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{ shiftInfo: [info: ShiftVO], shiftList: [list: ShiftVO[]] }>();
|
||||
const emit = defineEmits(['shiftInfo', 'shiftList', 'afterValue']);
|
||||
|
||||
const handleType = ref<number>(1);
|
||||
const tableLoading = ref<boolean>(true);
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
if (state.selectedRowKeys.length) {
|
||||
let arr = shiftData.value.filter(item => state.selectedRowKeys.includes(item.id))
|
||||
if (handleType.value == 1 && arr.length) {
|
||||
await emit('shiftInfo', arr[0]);
|
||||
} else if (handleType.value == 2 && arr.length) {
|
||||
await emit('shiftList', arr);
|
||||
let arr = shiftData.value.filter((item: ShiftVO) => state.selectedRowKeys.includes(item.id));
|
||||
if (handleType.value === 1 && arr.length) {
|
||||
emit('shiftInfo', arr[0]);
|
||||
} else if (handleType.value === 2 && arr.length) {
|
||||
emit('shiftList', arr);
|
||||
} else if (handleType.value === 3 && arr.length) {
|
||||
emit('afterValue', arr[0]);
|
||||
}
|
||||
}
|
||||
modalApi.close();
|
||||
@@ -41,10 +43,11 @@ async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
state.selectedRowKeys = []
|
||||
handleType.value = modalApi.getData()?.type;
|
||||
await queryShiftData()
|
||||
modalApi.modalLoading(true);
|
||||
state.selectedRowKeys = []
|
||||
const {type} = await modalApi.getData() as {type:number};
|
||||
handleType.value = type;
|
||||
await queryShiftData()
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
@@ -52,7 +55,6 @@ const shiftData = ref<ShiftVO[]>([])
|
||||
const shiftName = ref<string>('')
|
||||
|
||||
async function queryShiftData() {
|
||||
tableLoading.value = true
|
||||
let params = {
|
||||
name: shiftName.value,
|
||||
pageNum: 1,
|
||||
@@ -60,17 +62,16 @@ async function queryShiftData() {
|
||||
}
|
||||
const res = await shiftList(params)
|
||||
shiftData.value = res.rows
|
||||
tableLoading.value = false
|
||||
}
|
||||
|
||||
// 行勾选状态
|
||||
const state = reactive({
|
||||
selectedRowKeys: [],
|
||||
selectedRowKeys: [] as string[],
|
||||
});
|
||||
|
||||
// 勾选变化时的回调
|
||||
const onSelectChange = (selectedRowKeys: string[]) => {
|
||||
if (selectedRowKeys.length > 1 && handleType.value == 1) {
|
||||
if (selectedRowKeys.length > 1 && (handleType.value == 1||handleType.value == 3)) {
|
||||
state.selectedRowKeys = selectedRowKeys.slice(-1);
|
||||
} else {
|
||||
state.selectedRowKeys = selectedRowKeys;
|
||||
@@ -110,7 +111,6 @@ const resetHandle = () => {
|
||||
:pagination="false"
|
||||
rowKey="id"
|
||||
:scroll="{ y: 350 }"
|
||||
:loading="tableLoading"
|
||||
>
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<template v-if="column.dataIndex==='id'">
|
||||
|
@@ -1,16 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import {computed, ref} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
import {clockInModalSchema} from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const isClockIn = ref(false);
|
||||
const emit = defineEmits(['checkIn', 'unCheckIn']);
|
||||
const isClockIn = ref(false);
|
||||
|
||||
const title = computed(() => {
|
||||
return isClockIn.value ? '必须打卡日期' : '无需打卡日期';
|
||||
return isClockIn.value ? '必须打卡日期' : '无需打卡日期';
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
@@ -26,7 +26,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
@@ -44,8 +44,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const { type } = modalApi.getData() as { type?: number };
|
||||
isClockIn.value = !!type;
|
||||
const {check} = modalApi.getData() as { check?: boolean };
|
||||
isClockIn.value = check;
|
||||
await markInitialized();
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
@@ -54,11 +54,20 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (data.dateType == 1) {
|
||||
data.startDate = data.timeSlot[0]
|
||||
data.endDate = data.timeSlot[1]
|
||||
}
|
||||
if (isClockIn.value) {
|
||||
emit('checkIn', data)
|
||||
} else {
|
||||
emit('unCheckIn', data)
|
||||
}
|
||||
resetInitialized();
|
||||
await modalApi.close();
|
||||
} catch (error) {
|
||||
|
@@ -72,6 +72,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
fieldName: 'groupName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
formItemClass:'col-span-1'
|
||||
},
|
||||
{
|
||||
label: '考勤类型',//(0:固定班制,1:排班制)
|
||||
@@ -82,7 +83,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
options: getDictOptions('wy_kqlx'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
defaultValue: '0'
|
||||
defaultValue: '0',
|
||||
},
|
||||
{
|
||||
label: '工作日设置',
|
||||
@@ -174,10 +175,10 @@ export const weekdayColumns: TableColumnsType = [
|
||||
},
|
||||
{
|
||||
title: '班次',
|
||||
key: 'shift',
|
||||
key: 'shiftValue',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'shift'
|
||||
dataIndex: 'shiftValue'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -191,10 +192,10 @@ export const weekdayColumns: TableColumnsType = [
|
||||
export const noClockingColumns: TableColumnsType = [
|
||||
{
|
||||
title: '无需打卡日期',
|
||||
key: 'label',
|
||||
key: 'dateTime',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'label'
|
||||
dataIndex: 'dateTime'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -208,10 +209,10 @@ export const noClockingColumns: TableColumnsType = [
|
||||
export const clockingColumns: TableColumnsType = [
|
||||
{
|
||||
title: '必须打卡日期',
|
||||
key: 'label',
|
||||
key: 'dateTime',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'label'
|
||||
dataIndex: 'dateTime'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -225,17 +226,17 @@ export const clockingColumns: TableColumnsType = [
|
||||
export const cycleColumns: TableColumnsType = [
|
||||
{
|
||||
title: '天数',
|
||||
key: 'label',
|
||||
key: 'day',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
dataIndex: 'label'
|
||||
dataIndex: 'day'
|
||||
},
|
||||
{
|
||||
title: '班次',
|
||||
key: 'label',
|
||||
key: 'shiftId',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'label'
|
||||
dataIndex: 'shiftId'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -271,24 +272,24 @@ export const shiftColumns = [
|
||||
];
|
||||
|
||||
const typeOptions = [
|
||||
{label: '单个日期', value: 1},
|
||||
{label: '时间段', value: 2},
|
||||
{label: '单个日期', value: 0},
|
||||
{label: '时间段', value: 1},
|
||||
];
|
||||
export const clockInModalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '添加方式',
|
||||
fieldName: 'type',
|
||||
fieldName: 'dateType',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: typeOptions,
|
||||
buttonStyle: 'solid',
|
||||
},
|
||||
defaultValue:1,
|
||||
defaultValue:0,
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '日期',
|
||||
fieldName: 'singleTime',
|
||||
fieldName: 'startDate',
|
||||
component: 'DatePicker',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
@@ -296,8 +297,8 @@ export const clockInModalSchema: FormSchemaGetter = () => [
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
dependencies: {
|
||||
show: (formValue) => formValue.type==1,
|
||||
triggerFields: ['type'],
|
||||
show: (formValue) => formValue.dateType==0,
|
||||
triggerFields: ['dateType'],
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -310,10 +311,64 @@ export const clockInModalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules: 'required',
|
||||
dependencies: {
|
||||
show: (formValue) => formValue.type==2,
|
||||
triggerFields: ['type'],
|
||||
show: (formValue) => formValue.dateType==1,
|
||||
triggerFields: ['dateType'],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export const infoWeekdayColumns: TableColumnsType = [
|
||||
{
|
||||
title: '工作日',
|
||||
key: 'label',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
dataIndex: 'label'
|
||||
},
|
||||
{
|
||||
title: '班次',
|
||||
key: 'shiftValue',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'shiftValue'
|
||||
},
|
||||
]
|
||||
|
||||
export const infoNoClockingColumns: TableColumnsType = [
|
||||
{
|
||||
title: '无需打卡日期',
|
||||
key: 'dateTime',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'dateTime'
|
||||
},
|
||||
]
|
||||
|
||||
export const infoClockingColumns: TableColumnsType = [
|
||||
{
|
||||
title: '必须打卡日期',
|
||||
key: 'dateTime',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'dateTime'
|
||||
},
|
||||
]
|
||||
|
||||
export const infoCycleColumns: TableColumnsType = [
|
||||
{
|
||||
title: '天数',
|
||||
key: 'day',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
dataIndex: 'day'
|
||||
},
|
||||
{
|
||||
title: '班次',
|
||||
key: 'shiftId',
|
||||
minWidth: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'shiftId'
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
@@ -20,7 +20,7 @@ import {
|
||||
noClockingColumns,
|
||||
weekdayColumns
|
||||
} from './data';
|
||||
import {Tag, Button, Table, Checkbox} from 'ant-design-vue'
|
||||
import {Tag, Button, Table, Checkbox, Select, SelectOption,message} from 'ant-design-vue'
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import holidayCalendar from './holiday-calendar.vue'
|
||||
import changeShiftSchedule from './change-shift-schedule.vue'
|
||||
@@ -86,7 +86,9 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
weekdayData.value.push({
|
||||
dayOfWeek: item.value,
|
||||
label: item.label,
|
||||
shift: item.value == '6' || item.value == '7' ? '休息' : '常规班次:08:00:00~12:00:00 14:00:00~17:00:00'
|
||||
shiftValue: '休息',
|
||||
isRest: true,
|
||||
shiftId: null,
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -118,6 +120,9 @@ async function handleConfirm() {
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
cycleData.value = []
|
||||
unCheckInData.value = []
|
||||
checkInData.value = []
|
||||
}
|
||||
|
||||
const [HolidayCalendar, holidayApi] = useVbenModal({
|
||||
@@ -142,59 +147,122 @@ async function showHoliday() {
|
||||
* 更改班次
|
||||
* @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})
|
||||
async function shiftScheduleHandle(type: number) {
|
||||
shiftApi.setData({type})
|
||||
shiftApi.open()
|
||||
}
|
||||
|
||||
const shiftInfo = ref<ShiftVO>()
|
||||
const shiftList = ref<ShiftVO[]>([])
|
||||
const handleShiftInfo = (info) => {
|
||||
shiftInfo.value = info;
|
||||
const handleShiftInfo = (info: ShiftVO) => {
|
||||
if (info) {
|
||||
shiftInfo.value = info;
|
||||
weekdayData.value.forEach(item => {
|
||||
item.shiftId = info.id
|
||||
let str = ''
|
||||
if (info.isRest) {
|
||||
str = `${info.name}:${info.startTime}~${info.restStartTime} ${info.restEndTime}~${info.endTime}`;
|
||||
} else {
|
||||
str = `${info.name}:${info.startTime}~${info.endTime}`;
|
||||
}
|
||||
item.shiftValue = str
|
||||
item.isRest = false
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
const handleShiftList = (list) => {
|
||||
const handleShiftList = (list: any[]) => {
|
||||
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: '',
|
||||
})
|
||||
if(cycleData.value.length<31){
|
||||
cycleData.value.push({
|
||||
shiftId: '',
|
||||
})
|
||||
}else {
|
||||
message.warning('周期天数最多31天。');
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteCycleHandle(index) {
|
||||
cycleData.value.splice(index, 1)
|
||||
async function deleteCycleHandle(index: number) {
|
||||
if(cycleData.value.length>2){
|
||||
cycleData.value.splice(index, 1)
|
||||
}else {
|
||||
message.warning('周期天数最少2天。');
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteUnCheckInHandle(index) {
|
||||
async function deleteUnCheckInHandle(index: number) {
|
||||
unCheckInData.value.splice(index, 1)
|
||||
}
|
||||
|
||||
async function deleteCheckInHandle(index) {
|
||||
async function deleteCheckInHandle(index: number) {
|
||||
checkInData.value.splice(index, 1)
|
||||
}
|
||||
|
||||
async function restHandle(index){
|
||||
const tableIndex = ref(-1)
|
||||
|
||||
async function changeShiftHandle(type: number, index: number) {
|
||||
tableIndex.value = index
|
||||
shiftApi.setData({type})//3.更改班次
|
||||
shiftApi.open()
|
||||
|
||||
}
|
||||
|
||||
async function restHandle(index: number) {
|
||||
weekdayData.value[index].isRest = true
|
||||
weekdayData.value[index].shiftValue = '休息'
|
||||
}
|
||||
|
||||
const handleAfterValue = (val: ShiftVO) => {
|
||||
if (tableIndex.value > -1 && val) {
|
||||
weekdayData.value[tableIndex.value].shiftId = val.id
|
||||
let str = ''
|
||||
if (val.isRest) {
|
||||
str = `${val.name}:${val.startTime}~${val.restStartTime} ${val.restEndTime}~${val.endTime}`;
|
||||
} else {
|
||||
str = `${val.name}:${val.startTime}~${val.endTime}`;
|
||||
}
|
||||
weekdayData.value[tableIndex.value].shiftValue = str
|
||||
weekdayData.value[tableIndex.value].isRest = false
|
||||
}
|
||||
};
|
||||
|
||||
const closeHandle = (i: number) => {
|
||||
shiftList.value.splice(i, 1)
|
||||
};
|
||||
|
||||
const checkInIndex = ref(-1)
|
||||
|
||||
async function addCheckInHandle(index: number) {
|
||||
checkInIndex.value = index
|
||||
checkInDateApi.setData({check: true})
|
||||
checkInDateApi.open()
|
||||
}
|
||||
|
||||
const getCheckInData = (val: any) => {
|
||||
if (val) {
|
||||
checkInData.value.push(val)
|
||||
}
|
||||
}
|
||||
const unCheckInIndex = ref(-1)
|
||||
|
||||
async function addUnCheckInHandle(index: number) {
|
||||
unCheckInIndex.value = index
|
||||
checkInDateApi.setData({check: false})
|
||||
checkInDateApi.open()
|
||||
}
|
||||
|
||||
const getUnCheckInData = (val: any) => {
|
||||
if (val) {
|
||||
unCheckInData.value.push(val)
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -224,8 +292,11 @@ async function restHandle(index){
|
||||
size="small" :pagination="false">
|
||||
<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>
|
||||
<Button type="link" size="small" @click="changeShiftHandle(3,index)">更改班次
|
||||
</Button>
|
||||
<Button type="link" size="small" @click="restHandle(index)" v-if="!record.isRest">
|
||||
休息
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
@@ -241,17 +312,21 @@ async function restHandle(index){
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
@click="selectDateHandle"
|
||||
@click="addUnCheckInHandle"
|
||||
:icon="h(PlusOutlined)">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<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 v-if="column.dataIndex==='dateTime'">
|
||||
<span v-if="record.dateType==0">{{ record.startDate }}</span>
|
||||
<span v-else>{{ record.startDate + '~' + record.endDate }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
<p class="item-padding">必须打卡日期:</p>
|
||||
@@ -260,12 +335,16 @@ async function restHandle(index){
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
@click="selectDateHandle"
|
||||
@click="addCheckInHandle"
|
||||
:icon="h(PlusOutlined)">
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<template #bodyCell="{ column,record,index }">
|
||||
<template v-if="column.dataIndex==='dateTime'">
|
||||
<span v-if="record.dateType==0">{{ record.startDate }}</span>
|
||||
<span v-else>{{ record.startDate + '~' + record.endDate }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex==='action'">
|
||||
<Button size="small" type="primary" shape="circle"
|
||||
danger :icon="h(MinusOutlined)" @click="deleteCheckInHandle(index)">
|
||||
@@ -280,15 +359,17 @@ async function restHandle(index){
|
||||
</template>
|
||||
<template #shiftData>
|
||||
<div v-if="shiftList">
|
||||
<Tag closable color="processing" v-for="(item,index) in shiftList">
|
||||
<Tag closable color="processing" v-for="(item,i) in shiftList" @close="closeHandle(i)">
|
||||
{{ item.name }}
|
||||
</Tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #schedulingCycle>
|
||||
<span class="item-font">周期天数
|
||||
<span style="font-weight: 500;color: red">{{ cycleData.length }}</span>
|
||||
天</span>
|
||||
<span class="item-font-weight item-font-color">{{ cycleData.length }}</span>
|
||||
天
|
||||
<span style="color:#b2b0b0;">(周期最少2天,最多31天)</span>
|
||||
</span>
|
||||
</template>
|
||||
<template #cycleData>
|
||||
<Table style="width: 80%" bordered :columns="cycleColumns" :data-source="cycleData"
|
||||
@@ -300,12 +381,30 @@ async function restHandle(index){
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<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 v-if="column.dataIndex==='day'">
|
||||
<span>{{ '第' + (index + 1) + '天' }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex==='shiftId'">
|
||||
<Select
|
||||
ref="select"
|
||||
style="width: 100%"
|
||||
v-model:value="record.shiftId"
|
||||
placeholder="请选择班次"
|
||||
>
|
||||
<SelectOption v-for="item in shiftList" :value="item.id">
|
||||
{{ item.name + '\xa0' }}
|
||||
<span
|
||||
v-if="item.isRest">{{ item.startTime + '~' + item.restStartTime + '\xa0' + item.restEndTime + '~' + item.endTime }}</span>
|
||||
<span v-else>{{ item.startTime + '~' + item.endTime }}</span>
|
||||
</SelectOption>
|
||||
</Select>
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
</template>
|
||||
@@ -315,7 +414,9 @@ async function restHandle(index){
|
||||
@shiftList="handleShiftList"
|
||||
@afterValue="handleAfterValue"
|
||||
></ChangeShiftSchedule>
|
||||
<CheckInDate></CheckInDate>
|
||||
<CheckInDate @checkIn="getCheckInData"
|
||||
@unCheckIn="getUnCheckInData"
|
||||
></CheckInDate>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
@@ -327,6 +428,10 @@ async function restHandle(index){
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.item-font-color {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.item-padding-top {
|
||||
padding-top: 1.1rem;
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ import type { GroupForm } from '#/api/property/attendanceManagement/attendanceGr
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import groupModal from './group-modal.vue';
|
||||
import attendanceGroupDetail from './attendance-group-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {TableSwitch} from "#/components/table";
|
||||
import {useAccess} from "@vben/access";
|
||||
@@ -77,6 +78,10 @@ const [GroupModal, modalApi] = useVbenModal({
|
||||
connectedComponent: groupModal,
|
||||
});
|
||||
|
||||
const [AttendanceGroupDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: attendanceGroupDetail,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
@@ -87,6 +92,11 @@ async function handleEdit(row: Required<GroupForm>) {
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleInfo(row: Required<GroupForm>) {
|
||||
detailApi.setData({ id: row.id });
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<GroupForm>) {
|
||||
await groupRemove(row.id);
|
||||
await tableApi.query();
|
||||
@@ -143,6 +153,12 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['Property:group:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['Property:group:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
@@ -177,5 +193,6 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
</BasicTable>
|
||||
<GroupModal @reload="tableApi.query()" />
|
||||
<AttendanceGroupDetail></AttendanceGroupDetail>
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -147,7 +147,10 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '联系电话',
|
||||
fieldName: 'phone',
|
||||
component: 'Input',
|
||||
rules: z.string().regex(/^1[3-9]\d{9}$/, { message: '格式错误' }),
|
||||
rules:z.union([
|
||||
z.string().regex(/^1[3-9]\d{9}$/, { message: '手机号格式错误' }),
|
||||
z.number().int().min(1000000000).max(19999999999, { message: '手机号格式错误' })
|
||||
]).transform(val => val.toString()),
|
||||
},
|
||||
{
|
||||
label: '入驻位置',
|
||||
|
Reference in New Issue
Block a user