|
|
|
|
@ -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;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|