Browse Source

fix: 结转建设项目复用

master
yxhc 2 weeks ago
parent
commit
67e085a13a
2 changed files with 56 additions and 3 deletions
  1. +2
    -2
      src/pages/declareManage/projectDeclare/declarePage/components/basicInfo.vue
  2. +54
    -1
      src/pages/declareManage/projectDeclare/declarePage/index.vue

+ 2
- 2
src/pages/declareManage/projectDeclare/declarePage/components/basicInfo.vue View File

@@ -589,7 +589,7 @@ watch(() => formData.value, val => {
:empty-temp="false" :empty-temp="false"
> >
<template #action="{scope}"> <template #action="{scope}">
<a class="text-primary" @click="delPro(scope.$index)">复用信息</a>
<a v-if="formData.projectType==='03'" class="text-primary" @click="emits('reuseItem', formData.baseHistorProjs[scope.$index])">复用信息</a>
<a class="text-danger" @click="delPro(scope.$index)">删除</a> <a class="text-danger" @click="delPro(scope.$index)">删除</a>
</template> </template>
</table-list> </table-list>
@@ -606,7 +606,7 @@ watch(() => formData.value, val => {
:empty-temp="false" :empty-temp="false"
> >
<template #action="{scope}"> <template #action="{scope}">
<a class="text-primary" @click="delPro(scope.$index)">复用信息</a>
<a v-if="formData.projectType==='03'" class="text-primary" @click="emits('reuseItem', formData.baseHistorProjs[scope.$index])">复用信息</a>
<a class="text-danger" @click="delPro(scope.$index)">删除</a> <a class="text-danger" @click="delPro(scope.$index)">删除</a>
</template> </template>
</table-list> </table-list>


+ 54
- 1
src/pages/declareManage/projectDeclare/declarePage/index.vue View File

@@ -276,7 +276,7 @@ const { proxy } = getCurrentInstance(),
// bizDomain: basicInfoRef.value.formData?.isDigitalReform === 1 ? basicInfoRef.value.formData.bizDomain.join(',') : undefined, // bizDomain: basicInfoRef.value.formData?.isDigitalReform === 1 ? basicInfoRef.value.formData.bizDomain.join(',') : undefined,
baseConstructionType: basicInfoRef.value.formData?.baseConstructionType?.join(';') || '', baseConstructionType: basicInfoRef.value.formData?.baseConstructionType?.join(';') || '',
baseProvManDeprtType: basicInfoRef.value.formData.baseProvManDeprtType * 1 || undefined, 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], beginTime: basicInfoRef.value.formData?.buildDuration?.length && basicInfoRef.value.formData.buildDuration[0],
endTime: basicInfoRef.value.formData?.buildDuration?.length && basicInfoRef.value.formData.buildDuration[1], endTime: basicInfoRef.value.formData?.buildDuration?.length && basicInfoRef.value.formData.buildDuration[1],
buildDuration: undefined, 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()
})
}

</script> </script>
<template> <template>
<div class="declarePage footerPage"> <div class="declarePage footerPage">
@@ -624,6 +676,7 @@ onMounted(async () => {
:detail-data="detailData" :detail-data="detailData"
:dictionary-list="dictionaryList" :dictionary-list="dictionaryList"
:declare-amount="fundsInfoRef?.formData.declareAmount" :declare-amount="fundsInfoRef?.formData.declareAmount"
@reuse-item="reuseItem"
@change-is-first="changeIsFirst" @change-is-first="changeIsFirst"
@get-basic-info-data="getBasicInfoData" @get-basic-info-data="getBasicInfoData"
/> />


Loading…
Cancel
Save