1.0.53 工时填报加部门逻辑优化

dev
yinq 1 day ago
parent ba4a11e49f
commit fa687b8148

@ -200,7 +200,7 @@ import { listBusinessTripApply, delBusinessTripApply, updateBusinessTripApply }
import { BusinessTripApplyVO, BusinessTripApplyQuery } from '@/api/oa/crm/businessTripApply/types';
import { getUserList, listUser } from '@/api/system/user';
import { UserQuery, UserVO } from '@/api/system/user/types';
import { listDept } from '@/api/system/dept';
import { allListDept, listDept } from '@/api/system/dept';
import { DeptVO } from '@/api/system/dept/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -357,7 +357,7 @@ onMounted(async () => {
const userRes = await getUserList(userQuery.value);
userList.value = userRes.data;
//
const deptRes = await listDept();
const deptRes = await allListDept({ deptCategory: '03' } as any);
deptList.value = deptRes.data;
//
getList();

@ -41,6 +41,14 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门" prop="deptId">
<el-select v-model="form.deptId" placeholder="请选择部门" style="width: 100%" :disabled="isReadOnly">
<el-option v-for="item in deptOptions" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="起始日期" prop="startTime">
<el-date-picker
@ -59,22 +67,21 @@
<el-date-picker v-model="form.endTime" type="date" value-format="YYYY-MM-DD" placeholder="本周日" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="12">
<el-form-item label="总工时" prop="totalHours">
<el-input-number v-model="form.totalHours" :min="0" :precision="1" disabled style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门工时" prop="deptHours">
<el-input-number v-model="form.deptHours" :min="0" :precision="1" disabled style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="12">
<el-form-item label="项目工时" prop="projectHours">
<el-input-number v-model="form.projectHours" :min="0" :precision="1" disabled style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总工时" prop="totalHours">
<el-input-number v-model="form.totalHours" :min="0" :precision="1" disabled style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
@ -240,7 +247,7 @@ import { ElMessage } from 'element-plus';
// API
import { getTimesheetInfo, addTimesheetInfo, updateTimesheetInfo, submitTimesheetAndFlowStart } from '@/api/oa/erp/timesheetInfo';
import { listProjectInfo } from '@/api/oa/erp/projectInfo';
import { getErpProjectInfoList, listProjectInfo } from '@/api/oa/erp/projectInfo';
import { getRuleGenerateCode } from '@/api/system/codeRule';
// Components & Store & Enums
@ -250,8 +257,8 @@ import ApprovalButton from '@/components/Process/approvalButton.vue';
import { useUserStore } from '@/store/modules/user';
import { CodeRuleEnum, FlowCodeEnum } from '@/enums/OAEnum';
import { getInfo } from '@/api/login';
import { listDept } from '@/api/system/dept';
import { listUser } from '@/api/system/user';
import { allListDept, listDept } from '@/api/system/dept';
import { getUserList, listUser } from '@/api/system/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
@ -296,7 +303,8 @@ const data = reactive({
rules: {
// timesheetCode: [{ required: true, message: '', trigger: 'blur' }],
startTime: [{ required: true, message: '请选择起始日期', trigger: 'change' }],
endTime: [{ required: true, message: '请选择结束日期', trigger: 'change' }]
endTime: [{ required: true, message: '请选择结束日期', trigger: 'change' }],
deptId: [{ required: true, message: '部门不能为空', trigger: 'change' }],
}
});
@ -367,13 +375,13 @@ const handleStartTimeChange = (val: any) => {
//
function loadBaseOptions() {
listProjectInfo({ pageNum: 1, pageSize: 1000 }).then((res: any) => {
projectOptions.value = res.rows;
getErpProjectInfoList({} as any).then((res: any) => {
projectOptions.value = res.data;
});
listUser({ pageNum: 1, pageSize: 1000 }).then((res: any) => {
userList.value = res.rows;
getUserList({} as any).then((res: any) => {
userList.value = res.data;
});
listDept({ pageNum: 1, pageSize: 1000 }).then((res: any) => {
allListDept({ deptCategory: '03' } as any).then((res: any) => {
deptOptions.value = res.data;
});
}

@ -14,12 +14,12 @@
<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="请选择起始时间" />
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择结束时间" />
</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="请选择起始时间" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="结束时间" prop="endTime">-->
<!-- <el-date-picker clearable v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择结束时间" />-->
<!-- </el-form-item>-->
<el-form-item label="工时填报状态" prop="timesheetStatus">
<el-select v-model="queryParams.timesheetStatus" placeholder="请选择工时填报状态" clearable>
<el-option v-for="dict in timesheet_status" :key="dict.value" :label="dict.label" :value="dict.value" />
@ -60,9 +60,9 @@
<el-table v-loading="loading" border :data="timesheetInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="工时填报ID" align="center" prop="timesheetId" v-if="columns[0].visible" />
<el-table-column label="工时填报编号" align="center" prop="timesheetCode" width="140" v-if="columns[2].visible" />
<el-table-column label="人员" align="center" prop="nickName" v-if="columns[11].visible" />
<el-table-column label="人员部门" align="center" prop="deptName" v-if="columns[12].visible" />
<el-table-column label="工时填报编号" align="center" prop="timesheetCode" v-if="columns[2].visible" />
<el-table-column label="人员ID" align="center" prop="userId" v-if="columns[3].visible" />
<el-table-column label="部门ID" align="center" prop="deptId" v-if="columns[4].visible" />
<el-table-column label="起始时间" align="center" prop="startTime" width="100" v-if="columns[5].visible">
@ -109,9 +109,9 @@
<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 { getUserList, listUser } from '@/api/system/user';
import { UserQuery, UserVO } from '@/api/system/user/types';
import { allListDept, listDept } from '@/api/system/dept';
import { DeptVO } from '@/api/system/dept/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -321,10 +321,10 @@ const handleExport = () => {
onMounted(async () => {
//
const userRes = await listUser({ pageNum: 1, pageSize: 1000 });
userList.value = userRes.rows;
const userRes = await getUserList({} as any);
userList.value = userRes.data;
//
const deptRes = await listDept();
const deptRes = await allListDept({ deptCategory: '03' } as any);
deptList.value = deptRes.data;
//
getList();

@ -83,7 +83,7 @@ import {
ProjectManHourReportQuery
} from '@/api/oa/erp/timesheetReport';
import { getErpProjectInfoList } from '@/api/oa/erp/projectInfo';
import { listDept } from '@/api/system/dept';
import { allListDept, listDept } from '@/api/system/dept';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { project_category } = toRefs<any>(proxy?.useDict('project_category'));
@ -211,7 +211,7 @@ const getProjectList = async () => {
const getDeptList = async () => {
//
const res = await listDept();
const res = await allListDept({ deptCategory: '03' } as any);
deptOptions.value = res.data || res.rows || [];
};

@ -74,7 +74,7 @@
</template>
<script setup name="ProjectPersonnelReport" lang="ts">
import { listDept } from '@/api/system/dept';
import { allListDept, listDept } from '@/api/system/dept';
import { getProjectPersonnelReport, ProjectPersonnelReportVO } from '@/api/oa/erp/timesheetReport';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -98,8 +98,8 @@ const queryParams = ref({
/** 获取部门 */
const getDeptList = async () => {
const res = await listDept();
deptOptions.value = res.data || res.rows || [];
const res = await allListDept({ deptCategory: '03' } as any);
deptOptions.value = res.data;
};
/** 查询报表 */

Loading…
Cancel
Save