|
|
|
|
@ -140,10 +140,32 @@
|
|
|
|
|
<el-input-number v-model="scope.row.delayDay" :min="0" :step="1" controls-position="right" style="width: 100%" :disabled="!canEditLimited" @change="recalcReceivableDate(scope.row)"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="应收款日期" width="160" align="center">
|
|
|
|
|
<!-- <el-table-column label="应收款日期" width="160" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-date-picker v-model="scope.row.receivableDate" type="date" value-format="YYYY-MM-DD" placeholder="自动计算" style="width: 100%" disabled/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>-->
|
|
|
|
|
<el-table-column label="实际开始" min-width="140">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="scope.row.realStartTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="实际结束" min-width="140">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="scope.row.realEndTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="进度备注" width="200" align="center">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
@ -174,6 +196,7 @@ import { getErpProjectPlan, addErpProjectPlan, updateErpProjectPlan, projectPlan
|
|
|
|
|
import { ErpProjectPlanForm } from '@/api/oa/erp/erpProjectPlan/types';
|
|
|
|
|
import { listUser } from '@/api/system/user';
|
|
|
|
|
import { getErpProjectInfoList } from '@/api/oa/erp/projectInfo';
|
|
|
|
|
import type { ProjectInfoVO } from '@/api/oa/erp/projectInfo/types';
|
|
|
|
|
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
|
|
|
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
|
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
@ -284,7 +307,7 @@ const buttonLoading = ref(false);
|
|
|
|
|
const draftLoading = ref(false);
|
|
|
|
|
const submitLoading = ref(false);
|
|
|
|
|
const currentAction = ref<'draft' | 'submit' | null>(null);
|
|
|
|
|
const projectInfoList = ref<any[]>([]);
|
|
|
|
|
const projectInfoList = ref<Partial<ProjectInfoVO>[]>([]);
|
|
|
|
|
const userList = ref<any[]>([]);
|
|
|
|
|
const selectedProjectCode = ref<string>(''); // 展示选中项目的编号
|
|
|
|
|
const baseDataLoaded = ref(false);
|
|
|
|
|
@ -321,7 +344,7 @@ const resetForm = () => {
|
|
|
|
|
/** 获取项目列表 */
|
|
|
|
|
const getProjectInfoList = async () => {
|
|
|
|
|
const res = await getErpProjectInfoList({});
|
|
|
|
|
projectInfoList.value = res.data;
|
|
|
|
|
projectInfoList.value = (res.data || []) as Partial<ProjectInfoVO>[];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 获取用户列表 */
|
|
|
|
|
@ -370,20 +393,44 @@ const handleDeleteStage = (index: number) => {
|
|
|
|
|
form.value.planStageList?.splice(index, 1);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 处理项目选择变化,自动填充项目经理、部门负责人和项目编号 */
|
|
|
|
|
const handleProjectChange = (projectId: number) => {
|
|
|
|
|
if (!projectId) {
|
|
|
|
|
interface ProjectSyncOptions {
|
|
|
|
|
syncManagerAndCharge?: boolean;
|
|
|
|
|
syncPaymentMethod?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 处理项目选择变化,自动填充项目经理、部门负责人、付款方式和项目编号 */
|
|
|
|
|
const handleProjectChange = (
|
|
|
|
|
projectId?: string | number,
|
|
|
|
|
{ syncManagerAndCharge = true, syncPaymentMethod = true }: ProjectSyncOptions = {}
|
|
|
|
|
) => {
|
|
|
|
|
const isEmptySelection = projectId === undefined || projectId === null || projectId === '';
|
|
|
|
|
if (isEmptySelection) {
|
|
|
|
|
if (syncManagerAndCharge) {
|
|
|
|
|
form.value.managerId = undefined;
|
|
|
|
|
form.value.chargeId = undefined;
|
|
|
|
|
}
|
|
|
|
|
if (syncPaymentMethod) {
|
|
|
|
|
form.value.paymentMethod = undefined;
|
|
|
|
|
}
|
|
|
|
|
selectedProjectCode.value = '';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const project = projectInfoList.value.find(p => p.projectId === projectId);
|
|
|
|
|
if (project) {
|
|
|
|
|
form.value.managerId = project.managerId;
|
|
|
|
|
form.value.chargeId = project.chargeId;
|
|
|
|
|
selectedProjectCode.value = project.projectCode || '';
|
|
|
|
|
|
|
|
|
|
const project = projectInfoList.value.find(item => String(item.projectId) === String(projectId));
|
|
|
|
|
if (!project) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (syncManagerAndCharge) {
|
|
|
|
|
form.value.managerId = project.managerId ?? undefined;
|
|
|
|
|
form.value.chargeId = project.chargeId ?? undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (syncPaymentMethod) {
|
|
|
|
|
form.value.paymentMethod = (project.paymentMethod as string) ?? undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
selectedProjectCode.value = (project.projectCode as string) || '';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -562,6 +609,12 @@ const loadFormData = async () => {
|
|
|
|
|
if (!form.value.planStageList) {
|
|
|
|
|
form.value.planStageList = [];
|
|
|
|
|
}
|
|
|
|
|
if (form.value.projectId) {
|
|
|
|
|
handleProjectChange(form.value.projectId, {
|
|
|
|
|
syncManagerAndCharge: false,
|
|
|
|
|
syncPaymentMethod: false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
resetForm();
|
|
|
|
|
form.value.flowStatus = 'draft';
|
|
|
|
|
|