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