feat(timesheetInfo): 工时填报页面新增人员和部门筛选功能

dev
Yangk 1 month ago
parent 9351bd701f
commit 6592131311

@ -4,8 +4,15 @@
<div v-show="showSearch" class="mb-[10px]"> <div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover"> <el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px"> <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
<el-form-item label="工时填报编号" prop="timesheetCode"> <el-form-item label="人员" prop="userId">
<el-input v-model="queryParams.timesheetCode" placeholder="请输入工时填报编号" clearable @keyup.enter="handleQuery" /> <el-select v-model="queryParams.userId" placeholder="请选择填报人" clearable filterable style="width: 200px">
<el-option v-for="user in userList" :key="user.userId" :label="user.nickName" :value="user.userId" />
</el-select>
</el-form-item>
<el-form-item label="部门" prop="deptId">
<el-select v-model="queryParams.deptId" placeholder="请选择部门" clearable filterable style="width: 200px">
<el-option v-for="dept in deptList" :key="dept.deptId" :label="dept.deptName" :value="dept.deptId" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="起始时间" prop="startTime"> <el-form-item label="起始时间" prop="startTime">
<el-date-picker clearable v-model="queryParams.startTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择起始时间" /> <el-date-picker clearable v-model="queryParams.startTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择起始时间" />
@ -102,6 +109,10 @@
<script setup name="TimesheetInfo" lang="ts"> <script setup name="TimesheetInfo" lang="ts">
import { listTimesheetInfo, getTimesheetInfo, delTimesheetInfo, addTimesheetInfo, updateTimesheetInfo } from '@/api/oa/erp/timesheetInfo'; import { listTimesheetInfo, getTimesheetInfo, delTimesheetInfo, addTimesheetInfo, updateTimesheetInfo } from '@/api/oa/erp/timesheetInfo';
import { TimesheetInfoVO, TimesheetInfoQuery, TimesheetInfoForm } from '@/api/oa/erp/timesheetInfo/types'; import { TimesheetInfoVO, TimesheetInfoQuery, TimesheetInfoForm } from '@/api/oa/erp/timesheetInfo/types';
import { listUser } from '@/api/system/user';
import { UserVO } from '@/api/system/user/types';
import { listDept } from '@/api/system/dept';
import { DeptVO } from '@/api/system/dept/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute(); const route = useRoute();
@ -116,6 +127,8 @@ const ids = ref<Array<string | number>>([]);
const single = ref(true); const single = ref(true);
const multiple = ref(true); const multiple = ref(true);
const total = ref(0); const total = ref(0);
const userList = ref<UserVO[]>([]);
const deptList = ref<DeptVO[]>([]);
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const timesheetInfoFormRef = ref<ElFormInstance>(); const timesheetInfoFormRef = ref<ElFormInstance>();
@ -298,13 +311,22 @@ const handleExport = () => {
proxy?.download( proxy?.download(
'oa/erp/timesheetInfo/export', 'oa/erp/timesheetInfo/export',
{ {
...queryParams.value ...queryParams.value,
//
timesheetIds: ids.value.length > 0 ? ids.value.join(',') : undefined
}, },
`timesheetInfo_${new Date().getTime()}.xlsx` `timesheetInfo_${new Date().getTime()}.xlsx`
); );
}; };
onMounted(() => { onMounted(async () => {
//
const userRes = await listUser({ pageNum: 1, pageSize: 1000 });
userList.value = userRes.rows;
//
const deptRes = await listDept();
deptList.value = deptRes.data;
//
getList(); getList();
}); });
</script> </script>

Loading…
Cancel
Save