1.1.54 开票编辑页面获取项目经理。

dev
yinq 7 days ago
parent 7836e62cc9
commit 4d3c8d4460

@ -378,6 +378,11 @@ export interface FinInvoiceInfoForm extends BaseEntity {
*/
contractFlag?: string;
/**
* ID
*/
managerId?: string | number;
/**
*
*/

@ -1,4 +1,4 @@
<template>
5<template>
<div class="p-3">
<el-card shadow="never" style="margin-top: 0; margin-bottom: 10px">
<!-- <template #header>-->
@ -373,7 +373,7 @@ import ContractSelectDialog from '@/views/oa/components/ContractSelectDialog.vue
import FileUpload from '@/components/FileUpload/index.vue';
import { checkPermi, checkRole } from '@/utils/permission';
import { getContractInfo } from '@/api/oa/erp/contractInfo';
import { listProjectInfoByContractId } from '@/api/oa/erp/projectInfo';
import { getProjectInfo, listProjectInfoByContractId } from '@/api/oa/erp/projectInfo';
const userOptions = ref<UserVO[]>([]);
const deptOptions = ref<DeptTreeVO[]>([]);
@ -464,6 +464,7 @@ const initFormData: FinInvoiceInfoForm = {
projectId: undefined,
projectCode: undefined,
projectName: undefined,
managerId: undefined,
acceptanceDate: undefined,
deliveryDate: undefined,
arrivalDate: undefined,
@ -653,6 +654,15 @@ const calculateReturnedRate = () => {
}
};
const syncManagerIdFromProject = async (projectId?: string | number) => {
if (!projectId) {
form.value.managerId = undefined;
return;
}
const res = await getProjectInfo(projectId);
form.value.managerId = res.data?.managerId;
};
// contractId
const initByContractId = async () => {
const contractId = routeParams.value.contractId as string | number | undefined;
@ -675,6 +685,7 @@ const initByContractId = async () => {
projectId: matchedProject?.projectId,
projectCode: matchedProject?.projectCode,
projectName: matchedProject?.projectName,
managerId: matchedProject?.managerId,
contractFlag: matchedProject?.contractFlag
});
@ -715,6 +726,9 @@ onMounted(async () => {
} else {
contractPaymentMethodVoList.value = [];
}
if (form.value.projectId) {
await syncManagerIdFromProject(form.value.projectId);
}
} else {
const res = await getBaseInfo();
Object.assign(form.value, res.data);
@ -756,6 +770,7 @@ const handleProjectSelected = (result: any) => {
projectId: project.projectId,
projectName: project.projectName,
projectCode: project.projectCode,
managerId: project.managerId,
contractCode: result.contract?.contractCode,
contractName: result.contract?.contractName,
customerName: result.contract?.oneCustomerName,
@ -1029,6 +1044,11 @@ const handleSave = async (status: string, mode: boolean) => {
return;
}
if (status !== 'draft' && !form.value.managerId) {
ElMessage.warning('项目项目经理不能为空,请重新选择项目');
return;
}
const invoiceForm = normalizeInvoiceForm();
try {
buttonLoading.value = true;

Loading…
Cancel
Save