From afbe755d605fdc3a78bbd577d12c7b65951ea0da Mon Sep 17 00:00:00 2001 From: yinq Date: Fri, 3 Apr 2026 17:54:38 +0800 Subject: [PATCH] =?UTF-8?q?1.1.16=20=E6=8A=8A=E9=A1=B9=E7=9B=AE=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E9=98=B6=E6=AE=B5=E7=9A=84=E5=9B=9E=E6=AC=BE=E5=85=B3?= =?UTF-8?q?=E8=81=94=E4=BB=8E=E5=AD=97=E5=85=B8=E5=AD=97=E6=AE=B5=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=9B=9E=E6=AC=BE=E9=98=B6=E6=AE=B5=E4=B8=BB=E9=94=AE?= =?UTF-8?q?=EF=BC=88=E5=90=8E=E7=AB=AF=20SQL=E8=81=94=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E5=A4=9A=E9=A1=B5=E9=9D=A2=E5=89=8D=E7=AB=AF=E4=B8=8E=E5=90=88?= =?UTF-8?q?=E5=90=8C=E5=9B=9E=E6=AC=BE=E9=80=BB=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/oa/erp/erpProjectPlan/types.ts | 6 ++- src/api/oa/erp/erpProjectPlanStage/types.ts | 32 +++++++++++++--- .../oa/erp/contractInfo/orderActivate.vue | 16 +++----- src/views/oa/erp/erpProjectPlan/edit.vue | 37 ++++++++++++++++--- src/views/oa/erp/erpProjectPlan/index.vue | 4 +- .../oa/erp/erpProjectPlanStage/index.vue | 36 +++++++++++++----- src/views/oa/erp/orderLedger/index.vue | 11 +++--- 7 files changed, 103 insertions(+), 39 deletions(-) diff --git a/src/api/oa/erp/erpProjectPlan/types.ts b/src/api/oa/erp/erpProjectPlan/types.ts index b267ef3..c876830 100644 --- a/src/api/oa/erp/erpProjectPlan/types.ts +++ b/src/api/oa/erp/erpProjectPlan/types.ts @@ -323,14 +323,18 @@ export interface ContractCollectionStageDetailVO { contractId: string | number; paymentStageId: string | number; stageName: string; - collectionStage: string; + /** base_payment_stage.collection_stage,可选 */ + collectionStage?: string; + repaymentRate: number; paymentPercentage: number; paymentAmount: number; paymentDeadline: number; paymentDescription: string; planStageId: string | number; + repaymentAmount?: number; receivableDate: string; actualRepaymentAmount: number; + actualRepaymentRate?: number; collectionConfirmUserId: string | number; collectionConfirmTime: string; collectionConfirmStatus: string; diff --git a/src/api/oa/erp/erpProjectPlanStage/types.ts b/src/api/oa/erp/erpProjectPlanStage/types.ts index 00cfb3a..97dcf01 100644 --- a/src/api/oa/erp/erpProjectPlanStage/types.ts +++ b/src/api/oa/erp/erpProjectPlanStage/types.ts @@ -30,9 +30,13 @@ export interface ErpProjectPlanStageVO { planEndTime: string; /** - * 回款阶段 + * 付款节点ID,关联 base_payment_stage */ - collectionStage: string; + paymentStageId?: string | number; + /** + * 付款节点名称(关联查询,展示用) + */ + paymentStageName?: string; /** * 预计回款比例(%) @@ -99,6 +103,11 @@ export interface ErpProjectPlanStageVO { */ actualRepaymentAmount: number; + /** + * 实际回款比例(%) + */ + actualRepaymentRate: number; + /** * 回款确认人 */ @@ -153,9 +162,10 @@ export interface ErpProjectPlanStageForm extends BaseEntity { planEndTime?: string; /** - * 回款阶段 + * 付款节点ID */ - collectionStage?: string; + paymentStageId?: string | number; + paymentStageName?: string; /** * 预计回款比例(%) @@ -222,6 +232,11 @@ export interface ErpProjectPlanStageForm extends BaseEntity { */ actualRepaymentAmount?: number; + /** + * 实际回款比例(%) + */ + actualRepaymentRate?: number; + /** * 回款确认人 */ @@ -272,9 +287,9 @@ export interface ErpProjectPlanStageQuery extends PageQuery { planEndTime?: string; /** - * 回款阶段 + * 付款节点ID */ - collectionStage?: string; + paymentStageId?: string | number; /** * 预计回款比例(%) @@ -336,6 +351,11 @@ export interface ErpProjectPlanStageQuery extends PageQuery { */ actualRepaymentAmount?: number; + /** + * 实际回款比例(%) + */ + actualRepaymentRate?: number; + /** * 回款确认人 */ diff --git a/src/views/oa/erp/contractInfo/orderActivate.vue b/src/views/oa/erp/contractInfo/orderActivate.vue index 7e0eea4..bb09113 100644 --- a/src/views/oa/erp/contractInfo/orderActivate.vue +++ b/src/views/oa/erp/contractInfo/orderActivate.vue @@ -250,8 +250,8 @@ @@ -775,10 +775,7 @@ const paymentStageList = ref([]); const getPaymentStageList = async () => { try { const res = await getBasePaymentStageList({ pageNum: 1, pageSize: 9999 }); - paymentStageList.value = (res.data || []).map((item: any) => ({ - ...item, - paymentStageId: item.paymentStageId != null ? String(item.paymentStageId) : item.paymentStageId - })); + paymentStageList.value = res.data || []; } catch (error) { console.error('查询回款阶段列表失败:', error); paymentStageList.value = []; @@ -1055,7 +1052,6 @@ const loadContractInfo = async () => { const list = (contractData as any).contractPaymentMethodList; if (list && Array.isArray(list) && list.length > 0) { planStageList.value = list.map((pm: any, index: number) => { - const stage = paymentStageList.value.find((s: PaymentStageVO) => String(s.paymentStageId) === String(pm.paymentStageId)); return { planStageId: undefined, projectId: form.value.projectId, @@ -1063,7 +1059,7 @@ const loadContractInfo = async () => { projectPhases: '', planStartTime: undefined, planEndTime: undefined, - collectionStage: stage.paymentStageId, + paymentStageId: pm.paymentStageId != null && pm.paymentStageId !== '' ? String(pm.paymentStageId) : undefined, repaymentRate: pm.paymentPercentage ?? undefined, repaymentAmount: undefined, repaymentTime: getDefaultRepaymentDate(pm), @@ -1205,7 +1201,7 @@ const getPlanStageList = async () => { projectPhases: item.projectPhases || '', planStartTime: item.planStartTime || undefined, planEndTime: item.planEndTime || undefined, - collectionStage: item.collectionStage || '', + paymentStageId: item.paymentStageId != null && item.paymentStageId !== '' ? String(item.paymentStageId) : undefined, repaymentRate: item.repaymentRate || undefined, repaymentAmount: item.repaymentAmount || undefined, repaymentTime: item.repaymentTime || undefined, @@ -1233,7 +1229,7 @@ const handleAddPlanStage = () => { projectPhases: '', planStartTime: undefined, planEndTime: undefined, - collectionStage: '', + paymentStageId: undefined, repaymentRate: undefined, repaymentAmount: undefined, repaymentTime: undefined, diff --git a/src/views/oa/erp/erpProjectPlan/edit.vue b/src/views/oa/erp/erpProjectPlan/edit.vue index 3f32e63..67f2354 100644 --- a/src/views/oa/erp/erpProjectPlan/edit.vue +++ b/src/views/oa/erp/erpProjectPlan/edit.vue @@ -137,10 +137,22 @@ /> - + @@ -290,6 +302,8 @@ import { useRoute, useRouter } from 'vue-router'; import { addErpProjectPlan, getErpProjectPlan, projectPlanSubmitAndFlowStart, updateErpProjectPlan } from '@/api/oa/erp/erpProjectPlan'; import { ErpProjectPlanForm } from '@/api/oa/erp/erpProjectPlan/types'; import { queryProjectChangeByProjectPlanId } from '@/api/oa/erp/erpProjectChange'; +import { getBasePaymentStageList } from '@/api/oa/base/paymentStage'; +import type { PaymentStageVO } from '@/api/oa/base/paymentStage/types'; import { getErpProjectInfoList } from '@/api/oa/erp/projectInfo'; import type { ProjectInfoVO } from '@/api/oa/erp/projectInfo/types'; import SubmitVerify from '@/components/Process/submitVerify.vue'; @@ -300,8 +314,8 @@ import { useUserStore } from '@/store/modules/user'; import { FlowCodeEnum } from '@/enums/OAEnum'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { project_plan_status, project_phases, collection_stage, project_change_status } = toRefs( - proxy?.useDict('project_plan_status', 'project_phases', 'collection_stage', 'project_change_status') +const { project_plan_status, project_phases, project_change_status } = toRefs( + proxy?.useDict('project_plan_status', 'project_phases', 'project_change_status') ); const route = useRoute(); const router = useRouter(); @@ -352,6 +366,7 @@ const selectedProjectCode = ref(''); // 展示选中项目的编号 const selectedProjectName = ref(''); // 展示选中项目的名称 const baseDataLoaded = ref(false); const projectSelectRef = ref>(); +const paymentStageOptions = ref([]); // 项目计划变更记录相关 const projectChangeList = ref([]); // 变更记录列表 @@ -398,11 +413,21 @@ const getProjectInfoList = async () => { projectInfoList.value = (res.data || []) as Partial[]; }; +const loadPaymentStageOptions = async () => { + try { + const res = await getBasePaymentStageList({ pageNum: 1, pageSize: 9999 }); + paymentStageOptions.value = res.data || []; + } catch { + paymentStageOptions.value = []; + } +}; + const initBaseData = async () => { if (baseDataLoaded.value) { return; } await getProjectInfoList(); + await loadPaymentStageOptions(); baseDataLoaded.value = true; }; @@ -441,7 +466,7 @@ const handleAddStage = () => { projectPhases: undefined, planStartTime: undefined, planEndTime: undefined, - collectionStage: undefined, + paymentStageId: undefined, repaymentRate: undefined, repaymentAmount: undefined, repaymentTime: undefined, diff --git a/src/views/oa/erp/erpProjectPlan/index.vue b/src/views/oa/erp/erpProjectPlan/index.vue index 25722dd..0263e7d 100644 --- a/src/views/oa/erp/erpProjectPlan/index.vue +++ b/src/views/oa/erp/erpProjectPlan/index.vue @@ -222,8 +222,8 @@ import ApprovalRecord from '@/components/Process/approvalRecord.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const route = useRoute(); const router = useRouter(); -const { active_flag, project_plan_status, project_phases, collection_stage, wf_business_status } = toRefs( - proxy?.useDict('active_flag', 'project_plan_status', 'project_phases', 'collection_stage', 'wf_business_status') +const { active_flag, project_plan_status, project_phases, wf_business_status } = toRefs( + proxy?.useDict('active_flag', 'project_plan_status', 'project_phases', 'wf_business_status') ); const approvalRecordRef = ref>(); diff --git a/src/views/oa/erp/erpProjectPlanStage/index.vue b/src/views/oa/erp/erpProjectPlanStage/index.vue index 7ead168..619a99d 100644 --- a/src/views/oa/erp/erpProjectPlanStage/index.vue +++ b/src/views/oa/erp/erpProjectPlanStage/index.vue @@ -29,8 +29,8 @@ placeholder="请选择计划结束时间" /> - - + + @@ -131,7 +131,11 @@ {{ parseTime(scope.row.planEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }} - + + + @@ -208,9 +212,9 @@ placeholder="请选择计划结束时间"> - - - + + + @@ -290,9 +294,13 @@ diff --git a/src/views/oa/erp/orderLedger/index.vue b/src/views/oa/erp/orderLedger/index.vue index 3856e39..000067d 100644 --- a/src/views/oa/erp/orderLedger/index.vue +++ b/src/views/oa/erp/orderLedger/index.vue @@ -253,7 +253,7 @@ @@ -642,7 +642,8 @@ const loadPlanStageList = async () => { const res = await getErpProjectPlanStageList({ projectId: projectId.value }); planStageList.value = (res.data || []).map((item: any) => ({ ...item, - collectionStage: item.collectionStage || '', + paymentStageId: item.paymentStageId, + paymentStageName: item.paymentStageName, repaymentRate: item.repaymentRate || undefined, repaymentTime: item.repaymentTime || undefined, remark: item.remark || '' @@ -656,10 +657,10 @@ const loadPlanStageList = async () => { }; /** 获取回款阶段名称 */ -const getPaymentStageName = (stageId: string | number) => { - if (!stageId) return '-'; +const getPaymentStageName = (stageId: string | number | undefined) => { + if (stageId === undefined || stageId === null || stageId === '') return '-'; const stage = paymentStageList.value.find((s) => String(s.paymentStageId) === String(stageId)); - return stage?.paymentMethod || '-'; + return stage?.stageName || '-'; }; /** Tab 切换 */