|
|
|
|
@ -4,8 +4,15 @@
|
|
|
|
|
<div v-show="showSearch" class="mb-[10px]">
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
|
|
|
|
|
<el-form-item label="工时填报编号" prop="timesheetCode">
|
|
|
|
|
<el-input v-model="queryParams.timesheetCode" placeholder="请输入工时填报编号" clearable @keyup.enter="handleQuery" />
|
|
|
|
|
<el-form-item label="人员" prop="userId">
|
|
|
|
|
<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 label="起始时间" prop="startTime">
|
|
|
|
|
<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">
|
|
|
|
|
import { listTimesheetInfo, getTimesheetInfo, delTimesheetInfo, addTimesheetInfo, updateTimesheetInfo } from '@/api/oa/erp/timesheetInfo';
|
|
|
|
|
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 route = useRoute();
|
|
|
|
|
@ -116,6 +127,8 @@ const ids = ref<Array<string | number>>([]);
|
|
|
|
|
const single = ref(true);
|
|
|
|
|
const multiple = ref(true);
|
|
|
|
|
const total = ref(0);
|
|
|
|
|
const userList = ref<UserVO[]>([]);
|
|
|
|
|
const deptList = ref<DeptVO[]>([]);
|
|
|
|
|
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
|
|
const timesheetInfoFormRef = ref<ElFormInstance>();
|
|
|
|
|
@ -298,13 +311,22 @@ const handleExport = () => {
|
|
|
|
|
proxy?.download(
|
|
|
|
|
'oa/erp/timesheetInfo/export',
|
|
|
|
|
{
|
|
|
|
|
...queryParams.value
|
|
|
|
|
...queryParams.value,
|
|
|
|
|
// 如果选中了数据,则只导出选中的数据
|
|
|
|
|
timesheetIds: ids.value.length > 0 ? ids.value.join(',') : undefined
|
|
|
|
|
},
|
|
|
|
|
`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();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|