From 67e085a13a08871e68457ab2d8fb01335b6a5f82 Mon Sep 17 00:00:00 2001 From: yxhc <825210484@qq.com> Date: Tue, 3 Sep 2024 15:28:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=93=E8=BD=AC=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=8D=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../declarePage/components/basicInfo.vue | 4 +- .../projectDeclare/declarePage/index.vue | 55 +++++++++++++++++++++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/src/pages/declareManage/projectDeclare/declarePage/components/basicInfo.vue b/src/pages/declareManage/projectDeclare/declarePage/components/basicInfo.vue index 055bae6..12534ed 100644 --- a/src/pages/declareManage/projectDeclare/declarePage/components/basicInfo.vue +++ b/src/pages/declareManage/projectDeclare/declarePage/components/basicInfo.vue @@ -589,7 +589,7 @@ watch(() => formData.value, val => { :empty-temp="false" > @@ -606,7 +606,7 @@ watch(() => formData.value, val => { :empty-temp="false" > diff --git a/src/pages/declareManage/projectDeclare/declarePage/index.vue b/src/pages/declareManage/projectDeclare/declarePage/index.vue index a368db9..0d2b560 100644 --- a/src/pages/declareManage/projectDeclare/declarePage/index.vue +++ b/src/pages/declareManage/projectDeclare/declarePage/index.vue @@ -276,7 +276,7 @@ const { proxy } = getCurrentInstance(), // bizDomain: basicInfoRef.value.formData?.isDigitalReform === 1 ? basicInfoRef.value.formData.bizDomain.join(',') : undefined, baseConstructionType: basicInfoRef.value.formData?.baseConstructionType?.join(';') || '', baseProvManDeprtType: basicInfoRef.value.formData.baseProvManDeprtType * 1 || undefined, - projectYear: fundsInfoRef.value.formData?.projectYear * 1, + projectYear: basicInfoRef.value.formData?.projectYear * 1, beginTime: basicInfoRef.value.formData?.buildDuration?.length && basicInfoRef.value.formData.buildDuration[0], endTime: basicInfoRef.value.formData?.buildDuration?.length && basicInfoRef.value.formData.buildDuration[1], buildDuration: undefined, @@ -563,6 +563,58 @@ onMounted(async () => { }) } }) + +async function reuseItem (data) { + const projectId = data.baseProjId + const res = await projectDetail(projectId) + + // 取出不复用的字段 + const projectType = basicInfoRef.value.formData.projectType + const projectName = basicInfoRef.value.formData.projectName + const baseHistorProjId = basicInfoRef.value.formData?.baseHistorProjs?.map(i => i.baseProjId)?.join(';') || '' + const baseHistorProjName = basicInfoRef.value.formData?.baseHistorProjs?.map(i => i.baseProjName)?.join(';') || '' + const baseHistorProjYear = basicInfoRef.value.formData?.baseHistorProjs?.map(i => i.baseProjSetYear)?.join(';') || '' + const projectYear = basicInfoRef.value.formData.projectYear + + const annualPaymentFormData = { + annualPlanAmount: annualPaymentPlanRef.value.formData.annualPlanAmount, + annualPlanHaveAmount: annualPaymentPlanRef.value.formData.annualPlanHaveAmount, + annualPlanGovOwnFinanceAmount: annualPaymentPlanRef.value.formData.annualPlanGovOwnFinanceAmount, + annualPlanGovSuperiorFinanceAmount: annualPaymentPlanRef.value.formData.annualPlanGovSuperiorFinanceAmount, + annualPlanBankLendingAmount: annualPaymentPlanRef.value.formData.annualPlanBankLendingAmount, + annualPlanOtherAmount: annualPaymentPlanRef.value.formData.annualPlanOtherAmount + } + detailData.value = { + ...res.data, + projectType, baseHistorProjId, baseHistorProjName, baseHistorProjYear, projectYear, projectName, + ...annualPaymentFormData, + // 新项目不应该有状态 + status: undefined + } + + const safetyInputModular = res.data.safetyInputModular && JSON.parse(res.data.safetyInputModular).map(i => { + return { + ...i, + formList: i.formList.map(j => { + return { + ...j, + value: !j.value ? undefined : j.props.type === '文件上传' ? reviewFileParam(j.value) : j.value + } + }) + } + }) + formConfig.value = { + isCoreBusiness: res.data.isOpenCoreBusiness, + isProjectImageProgress: res.data.isEngineeringSpeed, + isRemark: res.data.isRemark, + isSafetyInput: res.data.isOpenSafetyInput, + safetyInputModular: safetyInputModular || [] + } + nextTick(() => { + setData() + }) +} +