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

@@ -5,11 +5,12 @@
<div class="form-meta">
<div class="meta-item">
<span>{{ t('projectExitPlan.form.applyDepartmentLabel') }}</span>
<el-input v-model="formData.applicationDept" size="small" :placeholder="t('projectExitPlan.placeholder.input')" />
<el-input v-model="formData.applicationDept" size="small"
:placeholder="t('projectExitPlan.placeholder.input')" />
</div>
<div class="meta-item">
<span>{{ t('projectExitPlan.form.applyDateLabel') }}</span>
<span>{{new Date().toLocaleDateString('zh-CN')}}</span>
<span>{{ new Date().toLocaleDateString('zh-CN') }}</span>
</div>
</div>
</div>
@@ -20,7 +21,8 @@
<div class="table-cell label">{{ t('projectExitPlan.form.projectName') }}</div>
</template>
<div class="table-cell value project-name-cell">
<el-input v-model="formData.projectName" :placeholder="t('projectExitPlan.form.projectNamePlaceholder')" readonly>
<el-input v-model="formData.projectName"
:placeholder="t('projectExitPlan.form.projectNamePlaceholder')" readonly>
<template #suffix>
<el-icon class="cursor-pointer interactive-icon" @click="handleSelectProject">
<FolderOpened />
@@ -38,7 +40,8 @@
<div class="table-cell label">{{ t('projectExitPlan.form.exitSuggestion') }}</div>
</template>
<div class="table-cell value">
<el-input v-model="formData.exitRecommendation" :placeholder="t('projectExitPlan.placeholder.input')" />
<el-input v-model="formData.exitRecommendation"
:placeholder="t('projectExitPlan.placeholder.input')" />
</div>
</el-form-item>
@@ -65,7 +68,8 @@
<div class="table-cell label">{{ t('projectExitPlan.form.taskDescription') }}</div>
</template>
<div class="table-cell value">
<el-input v-model="formData.taskDescription" type="textarea" :rows="1" :placeholder="t('projectExitPlan.placeholder.input')" />
<el-input v-model="formData.taskDescription" type="textarea" :rows="1"
:placeholder="t('projectExitPlan.placeholder.input')" />
</div>
</el-form-item>
@@ -74,8 +78,10 @@
<div class="table-cell label">{{ t('projectExitPlan.form.executor') }}</div>
</template>
<div class="table-cell value">
<el-select v-model="formData.executor" clearable :placeholder="t('projectExitPlan.form.executorPlaceholder')">
<el-option :label="t('projectExitPlan.form.executorPlaceholder')" value="executor-placeholder" />
<el-select v-model="formData.executor" clearable
:placeholder="t('projectExitPlan.form.executorPlaceholder')">
<el-option :label="t('projectExitPlan.form.executorPlaceholder')"
value="executor-placeholder" />
</el-select>
</div>
</el-form-item>
@@ -85,23 +91,13 @@
<div class="table-cell label">{{ t('projectExitPlan.form.taskStartTime') }}</div>
</template>
<div class="table-cell value">
<el-date-picker
v-model="formData.taskStartDate"
type="date"
value-format="YYYY-MM-DD"
:placeholder="t('projectExitPlan.placeholder.select')"
style="width: 100%"
/>
<el-date-picker v-model="formData.taskStartDate" type="date" value-format="YYYY-MM-DD"
:placeholder="t('projectExitPlan.placeholder.select')" style="width: 100%" />
</div>
<div class="table-cell label">{{ t('projectExitPlan.form.taskEndTime') }}</div>
<div class="table-cell value">
<el-date-picker
v-model="formData.taskEndDate"
type="date"
value-format="YYYY-MM-DD"
:placeholder="t('projectExitPlan.placeholder.select')"
style="width: 100%"
/>
<el-date-picker v-model="formData.taskEndDate" type="date" value-format="YYYY-MM-DD"
:placeholder="t('projectExitPlan.placeholder.select')" style="width: 100%" />
</div>
</el-form-item>
</el-form>
@@ -117,31 +113,39 @@
</el-form-item>
</el-form>
</template>
<el-table :data="tableData" style="width: 100%" height="50vh" highlight-current-row border @current-change="handleSelectionChange">
<el-table :data="tableData" style="width: 100%" height="50vh" highlight-current-row border
@current-change="handleSelectionChange">
<el-table-column label="选择" width="80">
<template #default="scope">
<div class="options" :class="active === scope.$index ? 'active' : ''"></div>
</template>
</el-table-column>
<el-table-column prop="projectName" :label="t('projectLibrary.table.projectName')" min-width="200" />
<el-table-column prop="projectStartTime" :label="t('projectLibrary.table.projectImplementationStart')" min-width="160" />
<el-table-column prop="projectStartTime" :label="t('projectLibrary.table.projectImplementationStart')"
min-width="160" />
<el-table-column prop="projectNature" :label="t('projectLibrary.table.projectNature')" min-width="140">
<template #default="{ row }">
{{ projectNatureOptions.find((item: Enums) => item.value === row.projectNature)?.label }}
{{projectNatureOptions.find((item: Enums) => item.value === row.projectNature)?.label}}
</template>
</el-table-column>
<el-table-column prop="projectOwnerUnit" :label="t('projectLibrary.table.projectOwnerUnit')" min-width="200" />
<el-table-column prop="projectOwnerUnit" :label="t('projectLibrary.table.projectOwnerUnit')"
min-width="200" />
<el-table-column prop="" label="项目实施单位" />
<el-table-column prop="projectInvestmentDirection" :label="t('projectLibrary.table.projectDirection')" min-width="160" />
<el-table-column prop="mainBusinessTypes" :label="t('planApply.applySection.mainBusinessType')" min-width="160">
<el-table-column prop="projectInvestmentDirection" :label="t('projectLibrary.table.projectDirection')"
min-width="160" />
<el-table-column prop="mainBusinessTypes" :label="t('planApply.applySection.mainBusinessType')"
min-width="160">
<template #default="{ row }">
{{ mainBusinessOptions.find((item: Enums) => item.value === row.mainBusinessTypes)?.label }}
{{mainBusinessOptions.find((item: Enums) => item.value === row.mainBusinessTypes)?.label}}
</template>
</el-table-column>
<el-table-column prop="constructionStage" :label="t('projectLibrary.table.constructionStage')" min-width="120" />
<el-table-column prop="investmentCategory" :label="t('projectLibrary.table.investmentCategory')" min-width="140">
<el-table-column prop="constructionStage" :label="t('projectLibrary.table.constructionStage')"
min-width="120" />
<el-table-column prop="investmentCategory" :label="t('projectLibrary.table.investmentCategory')"
min-width="140">
<template #default="{ row }">
{{ investmentCategoryOptions.find((item: Enums) => item.value === row.investmentCategory)?.label }}
{{investmentCategoryOptions.find((item: Enums) => item.value === row.investmentCategory)?.label
}}
</template>
</el-table-column>
<el-table-column prop="" label="操作" fixed="right" width="100">
@@ -151,16 +155,10 @@
</el-table-column>
</el-table>
<div class="mt15 flex justify-end pagination-wrapper">
<el-pagination
background
layout="sizes, prev, pager, next, jumper, total"
:total="total"
:page-sizes="[10, 20, 50, 100]"
v-model:page-size="queryForm.size"
v-model:current-page="queryForm.page"
@size-change="handlePageSizeChange"
@current-change="handlePageChange"
/>
<el-pagination background layout="sizes, prev, pager, next, jumper, total" :total="total"
:page-sizes="[10, 20, 50, 100]" v-model:page-size="queryForm.size"
v-model:current-page="queryForm.page" @size-change="handlePageSizeChange"
@current-change="handlePageChange" />
</div>
<template #footer>
<el-button type="primary" @click="tableSubmit">确定</el-button>
@@ -190,7 +188,7 @@ const visible = ref<boolean>(false);
const visible2 = ref<boolean>(false);
const props = defineProps<{
modelValue?: ProjectTask;
rules:FormRules;
rules: FormRules;
}>();
const useForm = ref<FormInstance | undefined>();
const emit = defineEmits<{
@@ -202,11 +200,11 @@ const defaultForm: ProjectTask = {
projectName: '',
projectId: undefined,
exitRecommendation: '',
executionTask:'',
taskDescription:'',
executor:'',
taskStartDate:new Date().toISOString().substring(0,10),
taskEndDate:new Date().toISOString().substring(0,10),
executionTask: '',
taskDescription: '',
executor: '',
taskStartDate: new Date().toISOString().substring(0, 10),
taskEndDate: new Date().toISOString().substring(0, 10),
};
const formData = reactive<ProjectTask>({ ...defaultForm, ...props.modelValue });
@@ -238,17 +236,17 @@ const handlePageChange = (page: number) => {
getListOfProjects();
};
getListOfProjects();
const getListSearch = () =>{
const getListSearch = () => {
queryForm.value.page = 1;
getListOfProjects();
}
const handleReset = () =>{
const handleReset = () => {
queryForm.value.projectName = '';
}
watch(
formData,
(newVal) => {
console.log(newVal,'formData');
console.log(newVal, 'formData');
emit('update:modelValue', { ...newVal });
},
{ deep: true }
@@ -258,7 +256,7 @@ watch(
() => props.modelValue,
(newVal) => {
if (newVal) {
console.log(newVal,'asdas');
console.log(newVal, 'asdas');
Object.assign(formData, newVal);
}
},
@@ -371,9 +369,11 @@ defineExpose({
.table-cell.value {
flex: 1;
}
.table-row {
margin: 0;
}
.table-row.two-columns .table-cell.label {
width: 160px;
}
@@ -405,6 +405,7 @@ defineExpose({
.exit-plan-table :deep(.el-date-editor) {
width: 100%;
}
.options {
width: 20px;
height: 20px;
@@ -412,6 +413,7 @@ defineExpose({
border: 1px solid var(--el-border-color);
border-radius: 50%;
}
.active {
background-color: var(--el-color-primary);
color: white;
@@ -421,6 +423,7 @@ defineExpose({
height: 100%;
position: relative;
}
:deep(.el-form-item__label:before) {
left: 4px;
position: absolute;

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
<template>
<el-row class="page-title-row mb10">
<div class="page-title">{{ title ? title : t('progressReport.form.title') }}</div>
<div class="page-report-time">{{ t('progressReport.form.reportTime') }}: {{formData.createTime || reportTime }}</div>
<div class="page-report-time">{{ t('progressReport.form.reportTime') }}: {{ formData.createTime || reportTime }}
</div>
<div class="page-unit">{{ t('progressReport.form.unit') }}</div>
</el-row>
<div class="project-progress-report-form">
@@ -10,55 +11,60 @@
<el-row :gutter="20" class="form-row">
<el-col :span="24">
<el-form-item :label="t('progressReport.form.projectName')" required prop="projectName">
<span>{{formData.projectName }}</span>
<span>{{ formData.projectName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="form-row">
<el-col :span="12">
<el-form-item :label="t('progressReport.form.projectStatus')" required prop="projectStatus">
<span v-for="item in projectStatusOptions" :key="item.value">{{formData.projectStatus == item.value ? item.label : ''}}</span>
<span v-for="item in projectStatusOptions" :key="item.value">{{ formData.projectStatus ==
item.value ? item.label : '' }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="t('progressReport.form.constructionStage')">
<span v-for="item in constructionStageOptions" :key="item.value">{{formData.constructionStage == item.value ? item.label : ''}}</span>
<span v-for="item in constructionStageOptions" :key="item.value">{{ formData.constructionStage
==
item.value ? item.label : '' }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="form-row">
<el-col :span="12">
<el-form-item :label="t('progressReport.form.projectImplementationUnit')">
<span>{{formData.implementingBody}}</span>
<span>{{ formData.implementingBody }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="t('progressReport.form.totalInvestmentAmount')" required prop="projectTotalAmount">
<span>{{formData.projectTotalAmount }}</span>
<el-form-item :label="t('progressReport.form.totalInvestmentAmount')" required
prop="projectTotalAmount">
<span>{{ formData.projectTotalAmount }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="form-row">
<el-col :span="12">
<el-form-item :label="t('progressReport.form.cumulativeInvestmentToMonthEnd')" required prop="cumulativeInvestmentToDate">
<span>{{formData.cumulativeInvestmentToDate}}</span>
<el-form-item :label="t('progressReport.form.cumulativeInvestmentToMonthEnd')" required
prop="cumulativeInvestmentToDate">
<span>{{ formData.cumulativeInvestmentToDate }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="t('progressReport.form.completionRate')" required prop="completionRate">
<span>{{formData.completionRate}}</span>
<span>{{ formData.completionRate }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" class="form-row">
<el-col :span="12">
<el-form-item :label="t('progressReport.form.cumulativePaymentToMonthEnd')">
<span>{{formData.cumulativePaymentToDate}}</span>
<span>{{ formData.cumulativePaymentToDate }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="t('progressReport.form.paymentCompletionRate')">
<span>{{formData.paymentCompletionRate}}</span>
<span>{{ formData.paymentCompletionRate }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -69,19 +75,23 @@
<div class="panel-title">{{ t('progressReport.form.currentYearImageAmount') }}</div>
<div style="flex: 1;">
<el-form-item style="height: 82px;" :label="t('progressReport.form.reportYear')">
<span>{{formData.annualReport}}</span>
<span>{{ formData.annualReport }}</span>
</el-form-item>
<el-form-item style="height: 82px;"
:label="t('progressReport.form.currentYearPlannedInvestment')" required prop="annualPlannedInvestment">
<span>{{formData.investmentTotalAmount ?? 0 + ' ' + t('progressReport.form.unitSuffix')}}</span>
:label="t('progressReport.form.currentYearPlannedInvestment')" required
prop="annualPlannedInvestment">
<span>{{ formData.investmentTotalAmount ?? 0 + ' ' +
t('progressReport.form.unitSuffix') }}</span>
</el-form-item>
<el-form-item style="height: 82px;"
:label="t('progressReport.form.enterpriseCumulativeInvestmentToMonthEnd')" required prop="ytdRemainingInvestment">
<span>{{ formData.ytdRemainingInvestment + ' ' + t('progressReport.form.unitSuffix')}}</span>
:label="t('progressReport.form.enterpriseCumulativeInvestmentToMonthEnd')" required
prop="ytdRemainingInvestment">
<span>{{ formData.ytdRemainingInvestment + ' ' +
t('progressReport.form.unitSuffix') }}</span>
</el-form-item>
<el-form-item style="height: 82px;"
:label="t('progressReport.form.investmentCompletionRate')">
<span>{{formData.investmentCompletionRate}}%</span>
<span>{{ formData.investmentCompletionRate }}%</span>
</el-form-item>
</div>
</div>
@@ -91,15 +101,15 @@
<div class="panel-title">{{ t('progressReport.form.currentYearPlannedAmount') }}</div>
<div style="flex: 1;">
<el-form-item style="height: 82px;" :label="t('progressReport.form.plannedPaymentAmount')">
<span>{{formData.plannedPayment + ' ' + t('progressReport.form.unitSuffix')}}</span>
<span>{{ formData.plannedPayment + ' ' + t('progressReport.form.unitSuffix') }}</span>
</el-form-item>
<el-form-item style="height: 82px;"
:label="t('progressReport.form.completedPaymentAmount')">
<span>{{formData.actualPayment + ' ' + t('progressReport.form.unitSuffix')}}</span>
<span>{{ formData.actualPayment + ' ' + t('progressReport.form.unitSuffix') }}</span>
</el-form-item>
<el-form-item style="height: 82px;"
:label="t('progressReport.form.plannedAmountPaymentCompletionRate')">
<span>{{formData.investmentPlanCompletionRate}} %</span>
<span>{{ formData.investmentPlanCompletionRate }} %</span>
</el-form-item>
</div>
</div>
@@ -109,7 +119,7 @@
<el-row :gutter="20" class="form-row">
<el-col :span="24">
<el-form-item :label="t('progressReport.form.effectiveness')">
<span>{{formData.achievements}}</span>
<span>{{ formData.achievements }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -117,7 +127,7 @@
<el-row :gutter="20" class="form-row">
<el-col :span="24">
<el-form-item :label="t('progressReport.form.coordinationMatters')">
<span>{{formData.coordinationIssues}}</span>
<span>{{ formData.coordinationIssues }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -125,7 +135,7 @@
<el-row :gutter="20" class="form-row">
<el-col :span="24">
<el-form-item :label="t('progressReport.form.nextWorkArrangements')">
<span>{{formData.nextWorkPlan}}</span>
<span>{{ formData.nextWorkPlan }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -133,8 +143,9 @@
<el-row :gutter="20" class="form-row">
<el-col :span="24">
<el-form-item :label="t('progressReport.form.currentStageEvidenceMaterials')">
<uploadFile :modelValue="JSON.parse(formData.supportingDocuments || '[]') || []" @change="uploadChange" :fileSize="20" type="simple" :limit="10"
:isShowTip="false" disabled></uploadFile>
<uploadFile :modelValue="JSON.parse(formData.supportingDocuments || '[]') || []"
@change="uploadChange" :fileSize="20" type="simple" :limit="10" :isShowTip="false" disabled>
</uploadFile>
</el-form-item>
</el-col>
</el-row>
@@ -142,7 +153,7 @@
<el-row :gutter="20" class="form-row">
<el-col :span="24">
<el-form-item :label="t('progressReport.form.remark')">
<span>{{formData.remarks}}</span>
<span>{{ formData.remarks }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -150,7 +161,8 @@
<el-row :gutter="20" class="form-row">
<el-col :span="24">
<el-form-item :label="t('progressReport.form.isLastDeclaration')">
<span>{{formData.isFinalApplication == '1' ? t('progressReport.form.yes') : t('progressReport.form.no')}}</span>
<span>{{ formData.isFinalApplication == '1' ? t('progressReport.form.yes') :
t('progressReport.form.no') }}</span>
</el-form-item>
</el-col>
</el-row>
@@ -200,8 +212,8 @@ export interface ProjectProgressReportFormData {
const props = defineProps<{
modelValue?: InvestmentProjectProgress;
rules?:FormRules;
title?: string;
rules?: FormRules;
title?: string;
}>();
const emit = defineEmits<{
@@ -209,37 +221,37 @@ const emit = defineEmits<{
}>();
const useForm = ref<FormInstance | undefined>()
const defaultForm = reactive<InvestmentProjectProgress>({
id: undefined,
projectName: '',
projectId: undefined,
projectStatus: '',
constructionStage: '',
implementingBody: '',
projectTotalAmount: undefined,
cumulativeInvestmentToDate: undefined,
completionRate: undefined,
cumulativePaymentToDate: undefined,
paymentCompletionRate: undefined,
annualReport: undefined,
annualPlannedInvestment: undefined,
ytdRemainingInvestment: undefined,
investmentCompletionRate: undefined,
plannedPayment: undefined,
actualPayment: undefined,
investmentPlanCompletionRate: undefined,
achievements: '',
coordinationIssues: '',
nextWorkPlan: '',
supportingDocuments: '',
remarks: '',
isFinalApplication: undefined,
createBy: '',
createTime: '',
updateBy: '',
updateTime: '',
delFlag: '',
processInstanceId: '',
status: '',
id: undefined,
projectName: '',
projectId: undefined,
projectStatus: '',
constructionStage: '',
implementingBody: '',
projectTotalAmount: undefined,
cumulativeInvestmentToDate: undefined,
completionRate: undefined,
cumulativePaymentToDate: undefined,
paymentCompletionRate: undefined,
annualReport: undefined,
annualPlannedInvestment: undefined,
ytdRemainingInvestment: undefined,
investmentCompletionRate: undefined,
plannedPayment: undefined,
actualPayment: undefined,
investmentPlanCompletionRate: undefined,
achievements: '',
coordinationIssues: '',
nextWorkPlan: '',
supportingDocuments: '',
remarks: '',
isFinalApplication: undefined,
createBy: '',
createTime: '',
updateBy: '',
updateTime: '',
delFlag: '',
processInstanceId: '',
status: '',
})
const formData = reactive<InvestmentProjectProgress>({ ...defaultForm, ...props.modelValue });
const projectNameData = ref<ProjectPlanApplyFormItem[]>([]);
@@ -257,30 +269,30 @@ const queryForm = reactive<investmentProjectsPlanList>({
size: 10,
});
const getProjectNameList = async () => {
try {
const res = await investmentProjectsPlanPage(queryForm);
projectNameData.value = res.data?.records || [];
total.value = res.data?.total || 0;
} catch (error) {
console.error(error);
projectNameData.value = []; // 出错时设置为空数组
}
try {
const res = await investmentProjectsPlanPage(queryForm);
projectNameData.value = res.data?.records || [];
total.value = res.data?.total || 0;
} catch (error) {
console.error(error);
projectNameData.value = []; // 出错时设置为空数组
}
}
getProjectNameList();
/**
* 初始化图片
* */
const uploadChange = (_:any,data:any[]) =>{
if (!data || Object.prototype.toString.call(data) !== '[object Array]' || data.length === 0){
formData.supportingDocuments = [];
return;
}
formData.supportingDocuments = data.map((item:any) => {
return {
name: item.name,
url: item.url
}
})
const uploadChange = (_: any, data: any[]) => {
if (!data || Object.prototype.toString.call(data) !== '[object Array]' || data.length === 0) {
formData.supportingDocuments = [];
return;
}
formData.supportingDocuments = data.map((item: any) => {
return {
name: item.name,
url: item.url
}
})
}
// 监听 formData 变化,同步到父组件
watch(
@@ -296,18 +308,18 @@ watch(
() => props.modelValue,
(newVal) => {
if (newVal) {
if (typeof newVal.annualReport === 'number') newVal.annualReport = newVal.annualReport.toString()
Object.assign(formData, defaultForm, newVal);
if (typeof newVal.annualReport === 'number') newVal.annualReport = newVal.annualReport.toString()
Object.assign(formData, newVal);
}
},
{ immediate: true, deep: true }
);
defineExpose({
validate: async () => {
const isValid = await useForm.value?.validate();
if (!isValid) return false
return formData
},
validate: async () => {
const isValid = await useForm.value?.validate();
if (!isValid) return false
return formData
},
})
</script>

View File

@@ -1,12 +1,12 @@
export interface InvestmentProjects {
id?: number;
plannedInvestmentYear: string;
plannedImageAmount: string;
plannedPaymentAmount: string;
selfFunding: string;
externalFunding: string;
fiscalFunding: string;
otherFunding: string;
plannedImageAmount: string | number | null;
plannedPaymentAmount: string | number | null;
selfFunding: string | number | null;
externalFunding: string | number | null;
fiscalFunding: string | number | null;
otherFunding: string | number | null;
fiscalFundingSource: string;
otherFundingSource: string;
}
@@ -25,7 +25,7 @@ export interface EvaluationRecordEntitiesT {
createBy: string;
createTime: string
}
export interface ProjectPlanApplyFormItem{
export interface ProjectPlanApplyFormItem {
id?: any;
projectName: string;
projectNature: string;
@@ -75,7 +75,7 @@ export interface ProjectPlanApplyFormItem{
projectDesc: string;
promotionPlan: string;
projectPreliminaryPlan: string;
projectPreliminaryPlanAttachment:any[] | string;
projectPreliminaryPlanAttachment: any[] | string;
attachments: any[] | string;
remark: string;
decisionType: string;
@@ -89,16 +89,16 @@ export interface ProjectPlanApplyFormItem{
groupInvestmentDeptOpinion: string;
submitUnitLeadershipOpinion: string;
submitUnitMainLeadershipOpinion: string;
planImageQuota:string;
projectInvestmentEntities?:InvestmentProjects[];
evaluationRecordEntities?:EvaluationRecordEntitiesT[];
planImageQuota: string;
projectInvestmentEntities?: InvestmentProjects[];
evaluationRecordEntities?: EvaluationRecordEntitiesT[];
delFlag?: number;
projectId?: number;
processInstanceId:string;
status:number;
deptId:number
processInstanceId: string;
status: number;
deptId: number
}
export interface ProjectPlanApplyFormData {
entity:ProjectPlanApplyFormItem;
entity: ProjectPlanApplyFormItem;
investmentProjects: InvestmentProjects[];
}

View File

@@ -15,7 +15,8 @@
</el-button>
</div>
<div class="opinion-input">
<el-input v-model="opinionText" type="textarea" :rows="4" :placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
<el-input v-model="opinionText" type="textarea" :rows="4"
:placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
</div>
<!-- <div class="opinion-attachment">
<el-icon class="attachment-icon">
@@ -30,7 +31,8 @@
<!-- 撤回区域可撤回状态显示 -->
<div v-if="status === 'withdrawable'" class="withdraw-section">
<div class="withdraw-input">
<el-input v-model="opinionText" type="textarea" :rows="4" :placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
<el-input v-model="opinionText" type="textarea" :rows="4"
:placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
</div>
<div class="withdraw-action">
<el-button type="primary" @click="handleWithdraw">
@@ -58,10 +60,11 @@
</div>
<div class="record-time">{{ item.showTime || '待审核' }}</div>
</div>
<!-- <div v-if="record.action" class="record-action">{{ record.action }}</div> -->
<template v-if="record.id !== 'root' && item.status === 2">
<div class="record-status" :class="getStatusClass(item.approveDesc?.startsWith('拒绝原因:') ? 'rejected' : 'approved')">
<div class="record-status"
:class="getStatusClass(item.approveDesc?.startsWith('拒绝原因:') ? 'rejected' : 'approved')">
{{ getStatusLabel(item.approveDesc?.startsWith('拒绝原因:') ? 'rejected' : 'approved') }}
</div>
<div class="record-opinion">
@@ -79,7 +82,8 @@
</div>
</div>
<template v-if="selectUser">
<EmployeesDialog :visible="selectUserDialog" :data="[]" type="user" @change="changeUser" @update:visible="(e:boolean) => selectUserDialog = e"/>
<EmployeesDialog :visible="selectUserDialog" :data="[]" type="user" @change="changeUser"
@update:visible="(e: boolean) => selectUserDialog = e" />
</template>
</div>
</template>
@@ -100,37 +104,37 @@ const selectUserDialog = ref<boolean>(false);
const nextNodeId = ref<string>('');
const isApprovalUser = computed(() => {
const currentUserId = userInfo.userInfos.user?.userId
const currentNode = hierarchicalLookup(nodeList.value,taskDetails.value?.nodeId)
const currentNodeUser = currentNode ?.userVoList?.find((item:any) => item.id === currentUserId)
selectUser.value = nextNodeIsSelectUser(nodeList.value,currentNode?.id)
const currentNode = hierarchicalLookup(nodeList.value, taskDetails.value?.nodeId)
const currentNodeUser = currentNode?.userVoList?.find((item: any) => item.id === currentUserId)
selectUser.value = nextNodeIsSelectUser(nodeList.value, currentNode?.id)
return currentNodeUser?.status === 1
})
function hierarchicalLookup(nodeList:any[],nodeId:string):any {
function hierarchicalLookup(nodeList: any[], nodeId: string): any {
for (const nodeItem of nodeList) {
if (nodeItem.id === nodeId){
if (nodeItem.id === nodeId) {
return nodeItem
}
if (nodeItem.children && nodeItem.children.length > 0){
const children = hierarchicalLookup(nodeItem.children,nodeId)
if (children){
if (nodeItem.children && nodeItem.children.length > 0) {
const children = hierarchicalLookup(nodeItem.children, nodeId)
if (children) {
return children
}
}
if (nodeItem.branch && nodeItem.branch.length > 0){
const branch = hierarchicalLookup(nodeItem.branch,nodeId)
if (branch){
if (nodeItem.branch && nodeItem.branch.length > 0) {
const branch = hierarchicalLookup(nodeItem.branch, nodeId)
if (branch) {
return branch
}
}
}
}
function nextNodeIsSelectUser(nodeList:any[],currentNodeId:any):boolean{
if (!nodeList || nodeList.length === 0){
function nextNodeIsSelectUser(nodeList: any[], currentNodeId: any): boolean {
if (!nodeList || nodeList.length === 0) {
return false
}
const index = nodeList.findIndex(item => item.id === currentNodeId)
if (index === -1){
if (index === -1) {
return false
}
const node = nodeList[index + 1]
@@ -138,25 +142,25 @@ function nextNodeIsSelectUser(nodeList:any[],currentNodeId:any):boolean{
return node?.selectUser || false
}
interface UserVoList {
id: string;
name: string;
showTime?: string;
avatar: string;
approveDesc?: string;
operType?: string;
status: number;
id: string;
name: string;
showTime?: string;
avatar: string;
approveDesc?: string;
operType?: string;
status: number;
}
interface ApprovalRecord {
id: string;
userVoList: UserVoList[];
placeholder: string;
status: number;
name: string;
type: number;
selectUser: boolean;
multiple?: null;
children?: ApprovalRecord[];
branch: { children: ApprovalRecord[] }[];
id: string;
userVoList: UserVoList[];
placeholder: string;
status: number;
name: string;
type: number;
selectUser: boolean;
multiple?: null;
children?: ApprovalRecord[];
branch: { children: ApprovalRecord[] }[];
}
const props = defineProps<{
@@ -194,7 +198,7 @@ const emit = defineEmits<{
(e: 'add-attachment'): void;
}>();
const obj = ref<any>({})
const changeUser = (checkedList: any[]) =>{
const changeUser = (checkedList: any[]) => {
obj.value[`${nextNodeId.value}_assignee_select`] = checkedList;
selectUser.value = false;
selectUserDialog.value = false;
@@ -211,7 +215,7 @@ const handleApprove = async () => {
}
approving.value = true
try {
if (selectUser.value && nextNodeId.value){
if (selectUser.value && nextNodeId.value) {
selectUserDialog.value = true;
return;
}
@@ -374,6 +378,7 @@ onMounted(() => {
display: flex;
/* gap: 8px; */
margin-bottom: 16px;
.el-button {
flex: 1;
}

View File

@@ -27,41 +27,45 @@
<!-- 标题描述上传附件 -->
<el-row class="mb10">
<el-form :model="headerForm" label-width="80px" class="w-full" :rules="headerRequiredRule" ref="headerFormRef">
<el-form :model="headerForm" label-width="80px" class="w-full" :rules="headerRequiredRule"
ref="headerFormRef">
<el-form-item :label="t('planApply.headerForm.title')" prop="title">
<el-input v-model="headerForm.title" :placeholder="t('planApply.headerForm.titlePlaceholder')"/>
<el-input v-model="headerForm.title"
:placeholder="t('planApply.headerForm.titlePlaceholder')" />
</el-form-item>
<el-form-item :label="t('planApply.headerForm.description')">
<el-input v-model="headerForm.description" :placeholder="t('planApply.headerForm.descriptionPlaceholder')"/>
<el-input v-model="headerForm.description"
:placeholder="t('planApply.headerForm.descriptionPlaceholder')" />
</el-form-item>
<el-form-item :label="t('planApply.headerForm.attachments')">
<UploadFile :modelValue="headerForm.attachments" :fileSize="20" type="simple" :limit="10"
@change="uploadChange"/>
@change="uploadChange" />
</el-form-item>
</el-form>
</el-row>
<ProjectPlanApplyForm v-model="formData" :rules="formDataRules" ref="formDataRef" :is-update="props.isUpdate"/>
<ProjectPlanApplyForm v-model="formData" :rules="formDataRules" ref="formDataRef"
:is-update="props.isUpdate" />
</div>
</div>
</template>
<script setup lang="ts">
import {reactive, ref} from 'vue';
import {useI18n} from 'vue-i18n';
import {useMessage} from '/@/hooks/message';
import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useMessage } from '/@/hooks/message';
import {
investmentProjectsPlanAdd, investmentProjectsPlanGetById,
investmentProjectsPlanUserDeptBelong
} from '/@/api/investment/investmentManagement';
import ProjectPlanApplyForm from '/@/components/investment/common/ProjectPlanApplyForm.vue';
import type {ProjectPlanApplyFormData} from '/@/components/investment/interface/types';
import type {FormInstance, FormRules} from 'element-plus';
import type { ProjectPlanApplyFormData } from '/@/components/investment/interface/types';
import type { FormInstance, FormRules } from 'element-plus';
import UploadFile from '/@/components/Upload/index.vue';
import {useRoute} from 'vue-router';
import {flowFn} from "/@/utils/flowFn";
import {addFlowForm} from "/@/api/flow/flow";
import {flowNameOptions} from "/@/hooks/enums";
import { useRoute } from 'vue-router';
import { flowFn } from "/@/utils/flowFn";
import { addFlowForm } from "/@/api/flow/flow";
import { flowNameOptions } from "/@/hooks/enums";
const props = defineProps({
isUpdate: {
@@ -69,7 +73,7 @@ const props = defineProps({
default: false
}
})
const {t} = useI18n();
const { t } = useI18n();
const message = useMessage();
const route = useRoute();
const submitLoading = ref(false);
@@ -78,7 +82,7 @@ const headerForm = reactive<{ title: string, description: string, attachments: a
description: '',
attachments: [] as any[],
});
const requiredRule = [{required: true, message: `${t('该字段必填')}`}];
const requiredRule = [{ required: true, message: `${t('该字段必填')}` }];
const headerRequiredRule = ref<FormRules<{ title: string, description: string, attachments: any[] | string }>>({
title: requiredRule,
});
@@ -150,9 +154,9 @@ const formData = ref<ProjectPlanApplyFormData>({
submitUnitLeadershipOpinion: '',
submitUnitMainLeadershipOpinion: '',
planImageQuota: '',
status:1,
processInstanceId:'',
deptId:0,
status: 1,
processInstanceId: '',
deptId: 0,
},
investmentProjects: [],
});
@@ -203,40 +207,51 @@ const formDataRules = ref<FormRules<ProjectPlanApplyFormData>>({
'entity.financialFunds': requiredRule,
'entity.planImageQuota': requiredRule,
'entity.planPaymentLimit': requiredRule,
'entity.projectApprovalFileNo':[{validator:(rule: any, value: any, callback: any) =>{
if (formData.value.entity.isProjectApprovalCompleted === '1' && !value){
callback(new Error(`${t('该字段必填')}`));
}else {
callback();
}
},required:true,trigger: ['blur', 'change']}],
'entity.projectApprovalFileInfo':[{validator:(rule: any, value: any, callback: any) =>{
if (formData.value.entity.isProjectApprovalCompleted === '1' && !value){
callback(new Error(`${t('该字段必填')}`));
}else {
callback();
}
},required: true,trigger: ['blur', 'change']}],
'entity.decisionProcedureFileNo':[{validator:(rule: any, value: any, callback: any) =>{
if (formData.value.entity.isDecisionProcedureCompleted === '1' && !value){
callback(new Error(`${t('该字段必填')}`));
}else {
callback();
}
},required:true,trigger: ['blur', 'change']}],
'entity.decisionFileInfo':[{validator:(rule: any, value: any, callback: any) =>{
if (formData.value.entity.isDecisionProcedureCompleted === '1' && !value){
callback(new Error(`${t('该字段必填')}`));
}else {
callback();
}
},required: true,trigger: ['blur', 'change']}],
'entity.projectApprovalFileNo': [{
validator: (rule: any, value: any, callback: any) => {
if (formData.value.entity.isProjectApprovalCompleted === '1' && !value) {
callback(new Error(`${t('该字段必填')}`));
} else {
callback();
}
}, required: true, trigger: ['blur', 'change']
}],
'entity.projectApprovalFileInfo': [{
validator: (rule: any, value: any, callback: any) => {
if (formData.value.entity.isProjectApprovalCompleted === '1' && !value) {
callback(new Error(`${t('该字段必填')}`));
} else {
callback();
}
}, required: true, trigger: ['blur', 'change']
}],
'entity.decisionProcedureFileNo': [{
validator: (rule: any, value: any, callback: any) => {
if (formData.value.entity.isDecisionProcedureCompleted === '1' && !value) {
callback(new Error(`${t('该字段必填')}`));
} else {
callback();
}
}, required: true, trigger: ['blur', 'change']
}],
'entity.decisionFileInfo': [{
validator: (rule: any, value: any, callback: any) => {
if (formData.value.entity.isDecisionProcedureCompleted === '1' && !value) {
callback(new Error(`${t('该字段必填')}`));
} else {
callback();
}
}, required: true, trigger: ['blur', 'change']
}],
});
const handleInitiateApproval = async () => {
try {
const headerValid = await headerFormRef.value?.validate();
const valid = await formDataRef.value?.validateForm();
if (!valid && !headerValid) return;
const headerValid = await headerFormRef.value?.validate().catch(() => false);
if (!headerValid) return;
const valid = await formDataRef.value?.validateForm().catch(() => false);
if (!valid) return;
submitLoading.value = true;
let flowIdKey = ''
const data = await investmentProjectsPlanUserDeptBelong()
@@ -256,7 +271,7 @@ const handleInitiateApproval = async () => {
default:
flowIdKey = props.isUpdate ? 'VITE_FLOWID_27' : 'VITE_FLOWID_23';
}
const {processInstanceId} = await flowFn(flowIdKey, {
const { processInstanceId } = await flowFn(flowIdKey, {
paramMap: {}
})
const flowName = props.isUpdate ? 'investmentPlanUpdates' : 'investmentPlanRegistration';
@@ -271,7 +286,7 @@ const handleInitiateApproval = async () => {
formData.value.entity.processInstanceId = processInstanceId;
formData.value.entity.projectPreliminaryPlanAttachment = JSON.stringify(formData.value.entity.projectPreliminaryPlanAttachment);
formData.value.entity.status = 1
Object.assign(formData.value.entity,{flowType:flowNameObj.value})
Object.assign(formData.value.entity, { flowType: flowNameObj.value })
const params = {
...formData.value,
entity: {
@@ -281,14 +296,14 @@ const handleInitiateApproval = async () => {
}
}
investmentProjectsPlanAdd(params)
.then(() => {
submitLoading.value = false;
message.success(t('planApply.messages.initiateApproval'));
})
.catch((err: any) => {
submitLoading.value = false;
message.error(err.msg);
});
.then(() => {
submitLoading.value = false;
message.success(t('planApply.messages.initiateApproval'));
})
.catch((err: any) => {
submitLoading.value = false;
message.error(err.msg);
});
} catch (error) {
console.log(error, 'error');
}
@@ -296,28 +311,32 @@ const handleInitiateApproval = async () => {
const saveLoading = ref<boolean>(false);
const handleSaveDraft = async () => {
const headerValid = await headerFormRef.value?.validate();
const valid = await formDataRef.value?.validateForm();
if (!valid && !headerValid) return;
saveLoading.value = true;
const flowName = props.isUpdate ? 'investmentPlanUpdates' : 'investmentPlanRegistration';
const flowNameObj = flowNameOptions.filter(item => item.label === flowName)[0]
formData.value.entity.projectPreliminaryPlanAttachment = JSON.stringify(formData.value.entity.projectPreliminaryPlanAttachment);
formData.value.entity.status = 1
Object.assign(formData.value.entity,{flowType:flowNameObj.value})
const params = {
...formData.value,
entity: {
...formData.value.entity,
attachments: formData.value.entity.attachments ? JSON.stringify(formData.value.entity.attachments) : '',
projectPreliminaryPlanAttachment: formData.value.entity.projectPreliminaryPlanAttachment ? JSON.stringify(formData.value.entity.projectPreliminaryPlanAttachment) : ''
},
temporaryStorage:{
title: headerForm.title,
businessType: flowNameObj.value,
try {
const headerValid = await headerFormRef.value?.validate().catch(() => false);
if (!headerValid) return;
const valid = await formDataRef.value?.validateForm().catch(() => false);
if (!valid) return;
saveLoading.value = true;
const flowName = props.isUpdate ? 'investmentPlanUpdates' : 'investmentPlanRegistration';
const flowNameObj = flowNameOptions.filter(item => item.label === flowName)[0]
formData.value.entity.projectPreliminaryPlanAttachment = JSON.stringify(formData.value.entity.projectPreliminaryPlanAttachment);
formData.value.entity.status = 1
Object.assign(formData.value.entity, { flowType: flowNameObj.value })
const params = {
...formData.value,
entity: {
...formData.value.entity,
attachments: formData.value.entity.attachments ? JSON.stringify(formData.value.entity.attachments) : '',
projectPreliminaryPlanAttachment: formData.value.entity.projectPreliminaryPlanAttachment ? JSON.stringify(formData.value.entity.projectPreliminaryPlanAttachment) : ''
},
temporaryStorage: {
title: headerForm.title,
businessType: flowNameObj.value,
}
}
}
investmentProjectsPlanAdd(params)
investmentProjectsPlanAdd(params)
.then(() => {
saveLoading.value = false;
message.success('保存代发成功');
@@ -326,6 +345,9 @@ const handleSaveDraft = async () => {
saveLoading.value = false;
message.error(err.msg);
});
} catch (error) {
console.log(error, 'error');
}
};
const handleLoadTemplate = () => {

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

View File

@@ -1,8 +1,8 @@
<!-- 进度申报审核-->
<script setup lang="ts">
import {onMounted} from 'vue';
import { onMounted } from 'vue';
import ApprovalAction from '/@//components/workbench/common/ApprovalAction.vue';
import {useRoute} from 'vue-router';
import { useRoute } from 'vue-router';
import ProjectProgressReportFormDeatils from '/@/components/investment/common/ProjectProgressReportFormDeatils.vue';
import {
getInvestmentProjectsProgressGetByProcessInstanceIdAPI,
@@ -15,13 +15,13 @@ const taskId = ref<string>('0');
const status = ref<'pending' | 'reviewed' | 'withdrawable'>('pending');
const projectId = ref<string>('0');
const detailFormData = ref<InvestmentProjectProgress>({} as InvestmentProjectProgress);
const getProjectDetail = (id:string) =>{
getInvestmentProjectsProgressGetByProcessInstanceIdAPI(id).then(res =>{
const getProjectDetail = (id: string) => {
getInvestmentProjectsProgressGetByProcessInstanceIdAPI(id).then(res => {
detailFormData.value = res.data
});
}
onMounted(() =>{
if (route.query.processInstanceId){
onMounted(() => {
if (route.query.processInstanceId) {
taskId.value = <string>route.query.tId;
projectId.value = <string>route.query.processInstanceId;
getProjectDetail(projectId.value);
@@ -33,11 +33,12 @@ onMounted(() =>{
<el-card>
<el-row :gutter="20">
<el-col :span="isPreview ? 24 : 18">
<FlowFormView :process-instance-id="projectId"/>
<ProjectProgressReportFormDeatils v-model="detailFormData" title="投资项目进度审核"/>
<FlowFormView :process-instance-id="projectId" />
<ProjectProgressReportFormDeatils v-model="detailFormData" title="投资项目进度审核" />
</el-col>
<el-col :span="6" v-if="!isPreview">
<ApprovalAction :status="status" :approval-records="[]" :task-id="taskId" :process-instance-id="projectId"/>
<ApprovalAction :status="status" :approval-records="[]" :task-id="taskId"
:process-instance-id="projectId" />
</el-col>
</el-row>
</el-card>

View File

@@ -26,8 +26,9 @@
</el-row>
<el-row class="mb10">
<el-form :model="headerForm" label-width="80px" class="w-full">
<el-form-item :label="t('projectExitFeedback.headerForm.title')">
<el-form :model="headerForm" :rules="headerFormRules" ref="headerFormRef" label-width="80px"
class="w-full">
<el-form-item :label="t('projectExitFeedback.headerForm.title')" prop="title" required>
<el-input v-model="headerForm.title"
:placeholder="t('projectExitFeedback.headerForm.titlePlaceholder')" />
</el-form-item>
@@ -36,7 +37,8 @@
:placeholder="t('projectExitFeedback.headerForm.descriptionPlaceholder')" />
</el-form-item>
<el-form-item :label="t('projectExitFeedback.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>
@@ -47,20 +49,25 @@
</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 ProjectExitFeedbackForm from '/@/components/investment/common/ProjectExitFeedbackForm.vue';
import { ProjectExitFeedback } from '/@/views/invMid/projectExitFeedback/interface/type';
import {addProjectExitPlanFeedback} from "/@/api/investment/projectExitPlan";
import { addProjectExitPlanFeedback } from "/@/api/investment/projectExitPlan";
import { ProjectTask } from "/@/views/invMid/projectExitPlan/interface/type";
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: [] as any[],
@@ -68,47 +75,57 @@ const headerForm = reactive<{ title: string, description: string, attachments: a
const formData = ref<ProjectExitFeedback>({
exitTime: '',
exitExecutor: '',
exitRemark: '',
exitAttachment: '',
exitRemark: '',
exitAttachment: '',
deptId: '',
});
const submitLoading = ref(false);
const handleInitiateApproval = async () => {
if (!formData.value.projectId){
message.error('项目名称必填');
return
}
submitLoading.value = true;
const attachments = JSON.stringify(headerForm.attachments);
const {processInstanceId} = await flowFn('VITE_FLOWID_36',{
paramMap:{
// miu0ilc1tfa61_assignee_select: [
// {
// "type": "user",
// "id": "1",
// "name": "admin",
// "avatar": "/admin/sys-file/local/2a14ae08150e483c93e12ac8934173e2.png"
// }
// ]
}
})
const flowNameObj = flowNameOptions.filter(item => item.label === 'exitFeedback')[0]
await addFlowForm({
title: headerForm.title,
description: headerForm.description,
attachments,
processInstanceId,
flowType: flowNameObj.value
})
formData.value.processInstanceId = processInstanceId;
const exitAttachment = JSON.stringify(formData.value.exitAttachment);
const params = { ...formData.value, exitAttachment }
addProjectExitPlanFeedback(params).then(()=>{
message.success(t('common.success'));
}).catch((err: any) => {
message.error(err.msg);
}).finally(() => {
submitLoading.value = false;
});
const headerValid = await headerFormRef.value?.validate().catch(() => false);
if (!headerValid) {
return;
}
if (!formData.value.projectId) {
message.error('项目名称必填');
return
}
submitLoading.value = true;
const attachments = JSON.stringify(headerForm.attachments);
const flowResult = await flowFn('VITE_FLOWID_36', {
paramMap: {
// miu0ilc1tfa61_assignee_select: [
// {
// "type": "user",
// "id": "1",
// "name": "admin",
// "avatar": "/admin/sys-file/local/2a14ae08150e483c93e12ac8934173e2.png"
// }
// ]
}
})
if (flowResult instanceof Error) {
submitLoading.value = false;
throw flowResult;
}
const { processInstanceId } = flowResult;
const flowNameObj = flowNameOptions.filter(item => item.label === 'exitFeedback')[0]
await addFlowForm({
title: headerForm.title,
description: headerForm.description,
attachments,
processInstanceId,
flowType: flowNameObj.value
})
formData.value.processInstanceId = processInstanceId;
const exitAttachment = JSON.stringify(formData.value.exitAttachment);
const params = { ...formData.value, exitAttachment } as ProjectTask;
addProjectExitPlanFeedback(params).then(() => {
message.success(t('common.success'));
}).catch((err: any) => {
message.error(err.msg);
}).finally(() => {
submitLoading.value = false;
});
};
const handleSaveDraft = () => {
@@ -126,17 +143,17 @@ const handleSaveTemplate = () => {
const handleViewWorkflow = () => {
message.info(t('projectExitFeedback.messages.viewWorkflow'));
};
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) => {
return {
name: item.name,
url: item.url
}
})
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) => {
return {
name: item.name,
url: item.url
}
})
}
</script>

View File

@@ -34,10 +34,12 @@ export interface ProjectExitFeedback {
/** 状态 */
status?: string;
/** 项目id */
projectId?:number;
/** 项目名称*/
projectName?:string;
/** 项目id */
projectId?: number;
/** 项目名称*/
projectName?: string;
/** 部门id */
deptId: string;
}
export interface paramsDataProjectExitPlanFeedback {
@@ -48,31 +50,31 @@ export interface paramsDataProjectExitPlanFeedback {
exitRemark: string
}
export interface projectExitPlanFeedbackItem {
id?: number,
projectName?: string,
projectId?: number,
exitRecommendation?: string,
exitMethod?: string,
executionTask?: string,
taskDescription?: string,
executor?: string,
taskStartDate?: string,
taskEndDate?: string,
createBy?: string,
createTime?: string,
updateBy?: string,
updateTime?: string,
delFlag?: string,
processInstanceId?: string,
status?: string,
reviewNotes?: string,
applicationDept?: string
id?: number,
projectName?: string,
projectId?: number,
exitRecommendation?: string,
exitMethod?: string,
executionTask?: string,
taskDescription?: string,
executor?: string,
taskStartDate?: string,
taskEndDate?: string,
createBy?: string,
createTime?: string,
updateBy?: string,
updateTime?: string,
delFlag?: string,
processInstanceId?: string,
status?: string,
reviewNotes?: string,
applicationDept?: string
}
export interface feedbackResponseData {
total: number,
records: projectExitPlanFeedbackItem[];
current: number,
size: number,
pages: number,
total: number,
records: projectExitPlanFeedbackItem[];
current: number,
size: number,
pages: number,
}

View File

@@ -1,53 +1,55 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb10">
<div class="form-header-actions" style="width: 100%;">
<div>
<el-button type="primary" icon="Check" :loading="submitLoading" @click="handleInitiateApproval">
{{ t('projectExitPlan.actions.initiateApproval') }}
</el-button>
<el-button icon="Document" @click="handleSaveDraft">
{{ t('projectExitPlan.actions.saveDraft') }}
</el-button>
<el-button icon="FolderOpened" @click="handleLoadTemplate">
{{ t('projectExitPlan.actions.loadTemplate') }}
</el-button>
<el-button icon="FolderAdd" @click="handleSaveTemplate">
{{ t('projectExitPlan.actions.saveTemplate') }}
</el-button>
</div>
<div style="margin-left:auto;">
<el-button icon="View" @click="handleViewWorkflow">
{{ t('projectExitPlan.actions.viewWorkflow') }}
</el-button>
</div>
</div>
</el-row>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb10">
<div class="form-header-actions" style="width: 100%;">
<div>
<el-button type="primary" icon="Check" :loading="submitLoading" @click="handleInitiateApproval">
{{ t('projectExitPlan.actions.initiateApproval') }}
</el-button>
<el-button icon="Document" @click="handleSaveDraft">
{{ t('projectExitPlan.actions.saveDraft') }}
</el-button>
<el-button icon="FolderOpened" @click="handleLoadTemplate">
{{ t('projectExitPlan.actions.loadTemplate') }}
</el-button>
<el-button icon="FolderAdd" @click="handleSaveTemplate">
{{ t('projectExitPlan.actions.saveTemplate') }}
</el-button>
</div>
<div style="margin-left:auto;">
<el-button icon="View" @click="handleViewWorkflow">
{{ t('projectExitPlan.actions.viewWorkflow') }}
</el-button>
</div>
</div>
</el-row>
<el-row class="mb10">
<el-form :model="headerForm" label-width="80px" class="w-full">
<el-form-item :label="t('projectExitPlan.headerForm.title')">
<el-input v-model="headerForm.title"
:placeholder="t('projectExitPlan.headerForm.titlePlaceholder')" />
</el-form-item>
<el-form-item :label="t('projectExitPlan.headerForm.description')">
<el-input v-model="headerForm.description"
:placeholder="t('projectExitPlan.headerForm.descriptionPlaceholder')" />
</el-form-item>
<el-form-item :label="t('projectExitPlan.headerForm.attachments')">
<UploadFile :modelValue="headerForm.attachments" @change="uploadChange" :fileSize="20" type="simple" :limit="10" />
</el-form-item>
</el-form>
</el-row>
<el-row class="mb10">
<el-form :model="headerForm" :rules="headerFormRules" ref="headerFormRef" label-width="80px"
class="w-full">
<el-form-item :label="t('projectExitPlan.headerForm.title')" prop="title" required>
<el-input v-model="headerForm.title"
:placeholder="t('projectExitPlan.headerForm.titlePlaceholder')" />
</el-form-item>
<el-form-item :label="t('projectExitPlan.headerForm.description')">
<el-input v-model="headerForm.description"
:placeholder="t('projectExitPlan.headerForm.descriptionPlaceholder')" />
</el-form-item>
<el-form-item :label="t('projectExitPlan.headerForm.attachments')">
<UploadFile :modelValue="headerForm.attachments" @change="uploadChange" :fileSize="20"
type="simple" :limit="10" />
</el-form-item>
</el-form>
</el-row>
<ProjectExitPlanForm v-model="formData" :rules="rules" ref="formDataRef"/>
</div>
</div>
<ProjectExitPlanForm v-model="formData" :rules="rules" ref="formDataRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { reactive } from 'vue';
import { reactive, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useMessage } from '/@/hooks/message';
@@ -56,28 +58,33 @@ import ProjectExitPlanForm from '/@/components/investment/common/ProjectExitPlan
import { FormRules } from 'element-plus';
import { addProjectExitPlan } from '/@/api/investment/projectExitPlan';
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 formDataRef = ref<HTMLFormElement | null>()
const { t } = useI18n();
const message = useMessage();
const headerForm = reactive<{ title: string, description: string, attachments: any[] | string}>({
title: '',
description: '',
attachments: [] as any[],
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: [] as any[],
});
const formData = ref<ProjectTask>({
id: undefined,
projectName: '',
exitRecommendation: '',
executionTask:'',
taskDescription:'',
executor:'',
taskStartDate:new Date().toISOString().substring(0,10),
taskEndDate:new Date().toISOString().substring(0,10),
executionTask: '',
taskDescription: '',
executor: '',
taskStartDate: new Date().toISOString().substring(0, 10),
taskEndDate: new Date().toISOString().substring(0, 10),
deptId: ''
});
const requiredRule = [{ required: true, message: `${t('该字段必填')}` }]
const rules = reactive<FormRules<ProjectTask>>({
@@ -87,13 +94,17 @@ const rules = reactive<FormRules<ProjectTask>>({
const submitLoading = ref<boolean>(false);
const handleInitiateApproval = async () => {
try {
const valid = await formDataRef?.value?.validateRef();
const headerValid = await headerFormRef.value?.validate().catch(() => false);
if (!headerValid) {
return;
}
const valid = await formDataRef?.value?.validateRef();
if (!valid) return;
submitLoading.value = true;
const folowIdKey = 'VITE_FLOWID_35'
const attachments = JSON.stringify(headerForm.attachments);
const {processInstanceId} = await flowFn(folowIdKey,{
paramMap:{
const flowResult = await flowFn(folowIdKey, {
paramMap: {
// miu0ilc1tfa61_assignee_select: [
// {
// "type": "user",
@@ -104,6 +115,11 @@ const handleInitiateApproval = async () => {
// ]
}
})
if (flowResult instanceof Error) {
submitLoading.value = false;
throw flowResult;
}
const { processInstanceId } = flowResult;
const flowNameObj = flowNameOptions.filter(item => item.label === 'exitPlan')[0]
await addFlowForm({
title: headerForm.title,
@@ -113,14 +129,14 @@ const handleInitiateApproval = async () => {
flowType: flowNameObj.value
})
formData.value.processInstanceId = processInstanceId;
addProjectExitPlan(formData.value).then((res:any) => {
addProjectExitPlan(formData.value).then((res: any) => {
useMessage().success(t('common.success'));
}).catch((err:any) => {
}).catch((err: any) => {
useMessage().error(err.msg);
}).finally(() => {
submitLoading.value = false;
});
}catch (e) {
} catch (e) {
console.log(e);
submitLoading.value = false;
}
@@ -128,26 +144,26 @@ const handleInitiateApproval = async () => {
};
const handleSaveDraft = () => {
message.info(t('projectExitPlan.messages.saveDraft'));
message.info(t('projectExitPlan.messages.saveDraft'));
};
const handleLoadTemplate = () => {
message.info(t('projectExitPlan.messages.loadTemplate'));
message.info(t('projectExitPlan.messages.loadTemplate'));
};
const handleSaveTemplate = () => {
message.info(t('projectExitPlan.messages.saveTemplate'));
message.info(t('projectExitPlan.messages.saveTemplate'));
};
const handleViewWorkflow = () => {
message.info(t('projectExitPlan.messages.viewWorkflow'));
message.info(t('projectExitPlan.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
@@ -158,13 +174,13 @@ const uploadChange = (_:any,data:any[]) =>{
<style scoped>
.layout-container .layout-padding {
height: auto;
overflow: auto;
height: auto;
overflow: auto;
}
.form-header-actions {
display: flex;
justify-content: space-between;
align-items: center;
display: flex;
justify-content: space-between;
align-items: center;
}
</style>