feat: 新增投资项目退出反馈、进度报告、计划申请及退出计划等管理功能模块及相关组件

This commit is contained in:
2025-12-27 01:11:47 +08:00
parent b29d128e41
commit 915cb66b40
11 changed files with 968 additions and 684 deletions

View File

@@ -27,15 +27,19 @@
<!-- 标题描述上传附件 -->
<el-row class="mb10">
<el-form :model="headerForm" label-width="80px" class="w-full">
<el-form-item :label="t('progressReport.headerForm.title')">
<el-input v-model="headerForm.title" :placeholder="t('progressReport.headerForm.titlePlaceholder')" />
<el-form :model="headerForm" :rules="headerFormRules" ref="headerFormRef" label-width="80px"
class="w-full">
<el-form-item :label="t('progressReport.headerForm.title')" prop="title" required>
<el-input v-model="headerForm.title"
:placeholder="t('progressReport.headerForm.titlePlaceholder')" />
</el-form-item>
<el-form-item :label="t('progressReport.headerForm.description')">
<el-input v-model="headerForm.description" :placeholder="t('progressReport.headerForm.descriptionPlaceholder')" />
<el-input v-model="headerForm.description"
:placeholder="t('progressReport.headerForm.descriptionPlaceholder')" />
</el-form-item>
<el-form-item :label="t('progressReport.headerForm.attachments')">
<UploadFile :modelValue="headerForm.attachments" @change="uploadChange" :fileSize="20" type="simple" :limit="10" />
<UploadFile :modelValue="headerForm.attachments" @change="uploadChange" :fileSize="20"
type="simple" :limit="10" />
</el-form-item>
</el-form>
</el-row>
@@ -46,7 +50,7 @@
</template>
<script setup lang="ts">
import { reactive } from 'vue';
import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useMessage } from '/@/hooks/message';
import ProjectProgressReportForm from '/@/components/investment/common/ProjectProgressReportForm.vue';
@@ -57,14 +61,18 @@ import {
getInvestmentProjectsProgressUserDeptBelongAPI
} from '/@/api/investment/progressOfInvestmentProjects';
import UploadFile from "/@/components/Upload/index.vue";
import {flowFn} from "/@/utils/flowFn";
import {addFlowForm} from "/@/api/flow/flow";
import {flowNameOptions} from "/@/hooks/enums";
import { flowFn } from "/@/utils/flowFn";
import { addFlowForm } from "/@/api/flow/flow";
import { flowNameOptions } from "/@/hooks/enums";
const { t } = useI18n();
const message = useMessage();
const headerForm = reactive<{ title: string; description: string; attachments: any[] | string}>({
const headerFormRef = ref<any>();
const headerFormRules = {
title: [{ required: true, message: '标题必填', trigger: ['blur', 'change'] }]
};
const headerForm = reactive<{ title: string; description: string; attachments: any[] | string }>({
title: '',
description: '',
attachments: [],
@@ -103,6 +111,7 @@ const formData = reactive<InvestmentProjectProgress>({
delFlag: '',
processInstanceId: '',
status: '',
deptId: '',
});
// 必填规则
const requiredRule = [{ required: true, message: `${t('该字段必填')}` }];
@@ -118,6 +127,10 @@ const formDataRef = ref<FormRules<InvestmentProjectProgress>>({
const handleInitiateApproval = async () => {
// message.info(t('progressReport.messages.initiateApproval'));
try {
const headerValid = await headerFormRef.value?.validate().catch(() => false);
if (!headerValid) {
return;
}
const valid = await formRef.value?.validate();
submitLoading.value = true;
let flowIdKey = '';
@@ -139,10 +152,14 @@ const handleInitiateApproval = async () => {
flowIdKey = 'VITE_FLOWID_31';
}
headerForm.attachments = JSON.stringify(headerForm.attachments);
const {processInstanceId} = await flowFn(flowIdKey,{
paramMap:{
const flowResult = await flowFn(flowIdKey, {
paramMap: {
}
})
if (flowResult instanceof Error) {
throw flowResult;
}
const { processInstanceId } = flowResult;
const flowNameObj = flowNameOptions.filter(item => item.label === 'projectProgressDeclaration')[0]
await addFlowForm({
title: headerForm.title,
@@ -154,9 +171,9 @@ const handleInitiateApproval = async () => {
valid.processInstanceId = processInstanceId;
valid.supportingDocuments = JSON.stringify(valid.supportingDocuments);
valid.status = 1;
await addInvestmentProjectsProgressAPI(valid).then(()=>{
await addInvestmentProjectsProgressAPI(valid).then(() => {
message.success(t('common.success'));
}).finally(()=>{
}).finally(() => {
submitLoading.value = false;
}).catch((err: any) => {
submitLoading.value = false;
@@ -182,12 +199,12 @@ const handleSaveTemplate = () => {
const handleViewWorkflow = () => {
message.info(t('progressReport.messages.viewWorkflow'));
};
const uploadChange = (_:any,data:any[]) =>{
if (!data || Object.prototype.toString.call(data) !== '[object Array]' || data.length === 0){
const uploadChange = (_: any, data: any[]) => {
if (!data || Object.prototype.toString.call(data) !== '[object Array]' || data.length === 0) {
headerForm.attachments = [];
return;
}
headerForm.attachments = data.map((item:any) => {
headerForm.attachments = data.map((item: any) => {
return {
name: item.name,
url: item.url