This commit is contained in:
@@ -7,9 +7,9 @@ export interface AttendanceAreaVO {
|
|||||||
id: string | number;
|
id: string | number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 摄像机id
|
* 摄像机列表
|
||||||
*/
|
*/
|
||||||
deviceManageId: string | number;
|
deviceManageId: any[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区域
|
* 区域
|
||||||
|
@@ -20,6 +20,10 @@ import dayjs from 'dayjs';
|
|||||||
import type { PersonVO } from './type';
|
import type { PersonVO } from './type';
|
||||||
import { ref, h } from 'vue';
|
import { ref, h } from 'vue';
|
||||||
import { Tag, Table } from 'ant-design-vue';
|
import { Tag, Table } from 'ant-design-vue';
|
||||||
|
import {
|
||||||
|
attendanceAreaList,
|
||||||
|
} from '#/api/property/attendanceManagement/attendanceArea';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
//表单项
|
//表单项
|
||||||
let formModal = reactive<{
|
let formModal = reactive<{
|
||||||
@@ -29,6 +33,7 @@ let formModal = reactive<{
|
|||||||
dateType: number | undefined;
|
dateType: number | undefined;
|
||||||
startDate: string;
|
startDate: string;
|
||||||
endDate: string;
|
endDate: string;
|
||||||
|
areaId:string;
|
||||||
userGroupList: any[];
|
userGroupList: any[];
|
||||||
}>({
|
}>({
|
||||||
id: '',
|
id: '',
|
||||||
@@ -40,6 +45,7 @@ let formModal = reactive<{
|
|||||||
// dateRange: [null, null],
|
// dateRange: [null, null],
|
||||||
startDate: '', //开始日期
|
startDate: '', //开始日期
|
||||||
endDate: '', //结束日期
|
endDate: '', //结束日期
|
||||||
|
areaId:'',//区域
|
||||||
userGroupList: [
|
userGroupList: [
|
||||||
// scheduleId:undefined,//排班ID
|
// scheduleId:undefined,//排班ID
|
||||||
// employeeId:undefined,//员工ID
|
// employeeId:undefined,//员工ID
|
||||||
@@ -57,7 +63,8 @@ const rules = {
|
|||||||
attendanceType: [{ required: true }],
|
attendanceType: [{ required: true }],
|
||||||
dateType: [{ required: true, message: '请选择排班日期' }],
|
dateType: [{ required: true, message: '请选择排班日期' }],
|
||||||
};
|
};
|
||||||
const groupOptions = ref<any[]>([]);
|
const groupOptions = ref<any[]>([]);//考勤组
|
||||||
|
const areaOptions = ref<any[]>([]);//区域
|
||||||
const groupMap = ref<Record<string, any>>({}); // 用于快速查找
|
const groupMap = ref<Record<string, any>>({}); // 用于快速查找
|
||||||
let tableData = reactive<
|
let tableData = reactive<
|
||||||
{ dept: { deptId: string | number; deptName: string }; users: PersonVO[] }[]
|
{ dept: { deptId: string | number; deptName: string }; users: PersonVO[] }[]
|
||||||
@@ -209,6 +216,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
await getGroupList();
|
await getGroupList();
|
||||||
|
await getAreaList();
|
||||||
// await markInitialized();
|
// await markInitialized();
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
@@ -238,6 +246,14 @@ async function getGroupList() {
|
|||||||
groupMap.value[item.id] = item;
|
groupMap.value[item.id] = item;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async function getAreaList(){
|
||||||
|
const res = await attendanceAreaList({ pageSize: 1000000000,
|
||||||
|
pageNum: 1,})
|
||||||
|
areaOptions.value = (res.rows || []).map((item)=>({
|
||||||
|
label:item.area,
|
||||||
|
value:item.id
|
||||||
|
}));
|
||||||
|
}
|
||||||
function chooseGroup(value: any) {
|
function chooseGroup(value: any) {
|
||||||
const group = groupMap.value[value];
|
const group = groupMap.value[value];
|
||||||
if (group) {
|
if (group) {
|
||||||
@@ -300,6 +316,7 @@ async function handleConfirm() {
|
|||||||
dateType: undefined,
|
dateType: undefined,
|
||||||
startDate: '',
|
startDate: '',
|
||||||
endDate: '',
|
endDate: '',
|
||||||
|
areaId:'',
|
||||||
userGroupList: [],
|
userGroupList: [],
|
||||||
});
|
});
|
||||||
// 重置其他数据
|
// 重置其他数据
|
||||||
@@ -324,6 +341,7 @@ async function handleClosed() {
|
|||||||
dateType: undefined,
|
dateType: undefined,
|
||||||
startDate: '',
|
startDate: '',
|
||||||
endDate: '',
|
endDate: '',
|
||||||
|
areaId:'',
|
||||||
userGroupList: [],
|
userGroupList: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -402,6 +420,14 @@ onMounted(() => {});
|
|||||||
</Radio>
|
</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<FormItem name="areaId" label="请选择区域" class="mb-0">
|
||||||
|
<Select
|
||||||
|
v-model:value="formModal.areaId"
|
||||||
|
:options="areaOptions"
|
||||||
|
placeholder="请选择"
|
||||||
|
@change="chooseGroup"
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
<!-- 考勤组人员表格区 -->
|
<!-- 考勤组人员表格区 -->
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
|
import {
|
||||||
|
attendanceAreaList
|
||||||
|
} from '#/api/property/attendanceManagement/attendanceArea';
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@@ -261,6 +264,20 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label:'选择区域',
|
||||||
|
fieldName:'areaId',
|
||||||
|
component:'ApiSelect',
|
||||||
|
componentProps:{
|
||||||
|
api: async ()=>{
|
||||||
|
const res = await attendanceAreaList({pageNum:1,pageSize:10000});
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
resultField:'rows',
|
||||||
|
labelField:'',
|
||||||
|
valueField:''
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '状态:0-未生效,1-已生效',
|
label: '状态:0-未生效,1-已生效',
|
||||||
fieldName: 'status',
|
fieldName: 'status',
|
||||||
|
@@ -14,18 +14,24 @@ import dayjs from 'dayjs';
|
|||||||
import type { PersonVO } from './type';
|
import type { PersonVO } from './type';
|
||||||
import { ref, h } from 'vue';
|
import { ref, h } from 'vue';
|
||||||
import { Tag, Table } from 'ant-design-vue';
|
import { Tag, Table } from 'ant-design-vue';
|
||||||
|
import {
|
||||||
|
attendanceAreaList,
|
||||||
|
} from '#/api/property/attendanceManagement/attendanceArea';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
//表单项
|
//表单项
|
||||||
let formModal = reactive<{
|
let formModal = reactive<{
|
||||||
id: string | number;
|
id: string | number;
|
||||||
groupId?: string | number;
|
groupId?: string | number;
|
||||||
attendanceType: string;
|
attendanceType: string;
|
||||||
|
areaId:string;
|
||||||
userGroupList: any[];
|
userGroupList: any[];
|
||||||
dateType: number | undefined;
|
dateType: number | undefined;
|
||||||
}>({
|
}>({
|
||||||
id: '',
|
id: '',
|
||||||
groupId: '',
|
groupId: '',
|
||||||
attendanceType: '', //考勤组类型
|
attendanceType: '', //考勤组类型
|
||||||
|
areaId:'',//区域
|
||||||
userGroupList: [
|
userGroupList: [
|
||||||
// scheduleId:undefined,//排班ID
|
// scheduleId:undefined,//排班ID
|
||||||
// employeeId:undefined,//员工ID
|
// employeeId:undefined,//员工ID
|
||||||
@@ -36,7 +42,8 @@ let formModal = reactive<{
|
|||||||
dateType: undefined, //排班日期类型
|
dateType: undefined, //排班日期类型
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const groupOptions = ref<any[]>([]);
|
const groupOptions = ref<any[]>([]);//考勤组
|
||||||
|
const areaOptions = ref<any[]>([]);//区域
|
||||||
const groupMap = ref<Record<string, any>>({}); // 用于快速查找
|
const groupMap = ref<Record<string, any>>({}); // 用于快速查找
|
||||||
let tableData = reactive<
|
let tableData = reactive<
|
||||||
{ dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[]
|
{ dept: { unitId: string | number; unitName: string }; users: PersonVO[] }[]
|
||||||
@@ -161,6 +168,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
await getGroupList();
|
await getGroupList();
|
||||||
|
await getAreaList();
|
||||||
|
|
||||||
const { id, date } = modalApi.getData() as {
|
const { id, date } = modalApi.getData() as {
|
||||||
id?: number | string;
|
id?: number | string;
|
||||||
date?: string;
|
date?: string;
|
||||||
@@ -173,6 +182,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
formModal.groupId = record.attendanceGroup.id;
|
formModal.groupId = record.attendanceGroup.id;
|
||||||
formModal.dateType = record.dateType;
|
formModal.dateType = record.dateType;
|
||||||
|
|
||||||
|
|
||||||
if (record.userGroupList) {
|
if (record.userGroupList) {
|
||||||
// 按部门分组处理 userGroupList
|
// 按部门分组处理 userGroupList
|
||||||
const deptMap = new Map();
|
const deptMap = new Map();
|
||||||
@@ -221,6 +231,14 @@ async function getGroupList() {
|
|||||||
groupMap.value[item.id] = item;
|
groupMap.value[item.id] = item;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async function getAreaList(){
|
||||||
|
const res = await attendanceAreaList({ pageSize: 1000000000,
|
||||||
|
pageNum: 1,})
|
||||||
|
areaOptions.value = (res.rows || []).map((item)=>({
|
||||||
|
label:item.area,
|
||||||
|
value:item.id
|
||||||
|
}));
|
||||||
|
}
|
||||||
function chooseGroup(value: any) {
|
function chooseGroup(value: any) {
|
||||||
const group = groupMap.value[value];
|
const group = groupMap.value[value];
|
||||||
if (group) {
|
if (group) {
|
||||||
@@ -256,6 +274,7 @@ async function handleConfirm() {
|
|||||||
dateType: undefined,
|
dateType: undefined,
|
||||||
startDate: '',
|
startDate: '',
|
||||||
endDate: '',
|
endDate: '',
|
||||||
|
areaId:'',
|
||||||
userGroupList: [],
|
userGroupList: [],
|
||||||
});
|
});
|
||||||
// 重置其他数据
|
// 重置其他数据
|
||||||
@@ -277,6 +296,7 @@ async function handleClosed() {
|
|||||||
dateType: undefined,
|
dateType: undefined,
|
||||||
startDate: '',
|
startDate: '',
|
||||||
endDate: '',
|
endDate: '',
|
||||||
|
areaId:'',
|
||||||
userGroupList: [],
|
userGroupList: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -311,6 +331,14 @@ onMounted(() => {});
|
|||||||
placeholder="请选择考勤组"
|
placeholder="请选择考勤组"
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<FormItem name="areaId" label="请选择区域" class="mb-0">
|
||||||
|
<Select
|
||||||
|
v-model:value="formModal.areaId"
|
||||||
|
:options="areaOptions"
|
||||||
|
placeholder="请选择"
|
||||||
|
@change="chooseGroup"
|
||||||
|
/>
|
||||||
|
</FormItem>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
<!-- 考勤组人员表格区 -->
|
<!-- 考勤组人员表格区 -->
|
||||||
|
Reference in New Issue
Block a user