From e54db551a68c08e6d4076554b5fd15613f5a8a7a Mon Sep 17 00:00:00 2001 From: dj <1042039504@qq.com> Date: Wed, 2 Apr 2025 23:01:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(project-demand):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=BE=81=E9=9B=86=E5=8F=98=E6=9B=B4=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailComponent/ProjectApply.vue | 70 ++++++++++++++++--- src/views/project-demand/summary/add.vue | 16 ++++- 2 files changed, 75 insertions(+), 11 deletions(-) diff --git a/src/components/DetailComponent/ProjectApply.vue b/src/components/DetailComponent/ProjectApply.vue index 12e2991..a1ef965 100644 --- a/src/components/DetailComponent/ProjectApply.vue +++ b/src/components/DetailComponent/ProjectApply.vue @@ -514,6 +514,65 @@ const getFileParam = (item) => { } } const handleSubmit = async (instance) => { + if(props.step==50){ + let files = [] + if (props.mode === 'resubmit') { + attachment.value.allFileList.forEach(item => { + files.push(getFileParam(item)) + }) + } else { + otherFileList.value.forEach(item => { + files.push(getFileParam(item)) + }) + } + // console.info("🚀 ~method:handleSubmit -----", files,attachment.value.isHaveOneFile) + if (!attachment.value.isHaveOneFile) { + attachment.value.validate() + ElNotification({ + title: '提示', + message: '请上传附件', + type: 'error' + }) + return; + } else { + attachment.value.clearValidate() + } + let projectPersonIds = [] + for (const item of projectPersonUserList.value) { + projectPersonIds.push(parseInt(item.id)) + } + let params = { + deploymentId: deploymentId.value, + requirementId: route.query.id, + fileList: files, + // singleFile: attachment.value.singleFile, + projectId: projectId.value, + actualEconomicEstimate: parseFloat(localFormData.value.actualEconomicEstimate), + specialFundAmount: parseFloat(localFormData.value.specialFundAmount), + preProcess: JSON.stringify(localFormData.value.preProcess) + } + if (sessionParams.value.preProcess && !localFormData.value.preProcess) { + params.preProcess = JSON.stringify(sessionParams.value.preProcess) + } + console.log('params',params) + let res + if (props.mode === 'resubmit') { + res = await resubmitConclusion(params) + } else { + res = await projectConclusion(params) + } + ElNotification({ + title: '提示', + message: res.msg, + type: res.code === 1000 ? 'success' : 'error' + }) + if (res.code === 1000) { + tagsViewStore.delVisitedViews(router.currentRoute.value.path) + await router.push({ + name: 'Filing' + }) + } + }else{ if (!instance) return instance.validate(async (valid) => { if (!valid) { @@ -597,12 +656,6 @@ const handleSubmit = async (instance) => { } else { res = await projectCheck(params) } - } else if (props.step === '50') { - if (props.mode === 'resubmit') { - res = await resubmitConclusion(params) - } else { - res = await projectConclusion(params) - } } ElNotification({ title: '提示', @@ -619,13 +672,10 @@ const handleSubmit = async (instance) => { await router.push({ name: 'Implementation' }) - } else if (props.step === '50') { - await router.push({ - name: 'Filing' - }) } } }) + } } const init = async () => { let id = projectId.value diff --git a/src/views/project-demand/summary/add.vue b/src/views/project-demand/summary/add.vue index bfaff07..0915da5 100644 --- a/src/views/project-demand/summary/add.vue +++ b/src/views/project-demand/summary/add.vue @@ -235,7 +235,7 @@ + @change="changeCollectData();changeRequirement()"> { + console.log('formData.requirementId',formData.requirementId) + // await getFormInfo(route.query.id).then(res => { + // if (res.code === 1000) { + // formData.value.requirementDefaultName = res.data.requirementName + // // loading.value = false + // formData.value.isSpecialFund = res.data.isSpecialFund + // if (res.data.isSpecialFund) { + // formData.value.specialFundId = res.data.specialFundId + // formData.value.specialFund = res.data.specialFund + // } + // } + // }) +} const changeCollectData = () => { if (name.value === 'Summary/edit') { // params.fileList= attachment.value.allFileList