From d0d78b9fbe144326f136ee048bb59d314413032e Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Tue, 27 May 2025 08:45:29 +0800
Subject: [PATCH] 修改导出
---
src/views/analyse/assessApply/index.vue | 86 +++++++++++++++++++++++++++++-------------
1 files changed, 59 insertions(+), 27 deletions(-)
diff --git a/src/views/analyse/assessApply/index.vue b/src/views/analyse/assessApply/index.vue
index aca3df3..3cee65a 100644
--- a/src/views/analyse/assessApply/index.vue
+++ b/src/views/analyse/assessApply/index.vue
@@ -42,7 +42,7 @@
</el-table-column>
<el-table-column prop="experimentType" label="实验类别">
<template #default="scope">
- <span>{{developState.experimentTypeList.find(i=>i.id == scope.row.experimentType)?.name}}</span>
+ <span>{{scope.row.typeList.map(i=>i.typeName).join('、')}}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="评估申请">
@@ -55,6 +55,11 @@
<span>{{scope.row.assessApplyTime?scope.row.assessApplyTime.substring(0,16):'--'}}</span>
</template>
</el-table-column>
+ <el-table-column prop="status" label="最近评估时间" show-overflow-tooltip>
+ <template #default="scope">
+ <span>{{scope.row.experimentAssessLogs?scope.row.experimentAssessLogs.map(i=>i.assessEndTime.substring(0,16)).join(','): ''}}</span>
+ </template>
+ </el-table-column>
<el-table-column prop="stage" label="评估状态">
<template #default="scope">
<el-tag :type="scope.row.stage == 4?'success':scope.row.stage == 1?'info':''">
@@ -64,8 +69,9 @@
</el-table-column>
<el-table-column label="操作" width="250" fixed="right">
<template #default="scope">
- <el-button size="small" v-if="scope.row.stage == 3" text type="primary" :icon="Edit" @click="toReport(scope.row)">生成评估报告</el-button>
- <el-button size="small" text type="primary" :icon="Edit" @click="openRiskDialog(scope.row)">管理实验现实风险</el-button>
+ <el-button size="small" v-if="scope.row.stage >= 3 && !scope.row.reportId" text type="primary" :icon="Edit" @click="toReport(scope.row,0)">生成评估报告</el-button>
+ <el-button size="small" v-if="scope.row.stage >= 3 && scope.row.reportId" text type="primary" :icon="Edit" @click="toReport(scope.row,1)">重新生成报告</el-button>
+ <el-button size="small" text type="primary" :icon="Edit" @click="openRiskDialog(scope.row)">管理实验风险单元</el-button>
<el-button size="small" v-if="scope.row.stage == 4 && !scope.row.assessPerson" text type="primary" :icon="View" @click="openReportDialog('提交', scope.row)">提交审批</el-button>
<el-button size="small" v-if="scope.row.stage == 4 && scope.row.assessPerson" text type="primary" :icon="View" @click="openReportDialog('修改', scope.row)">修改</el-button>
<el-button size="small" v-if="scope.row.stage == 4 && scope.row.assessPerson" text type="primary" :icon="Edit" @click="openReportDialog('查看',scope.row)">查看</el-button>
@@ -132,30 +138,56 @@
}
};
-const toReport = (val: ProjectType)=>{
- ElMessageBox.confirm(`此操作将对该实验生成风险评估报告:“${val.experimentName}”,是否继续?`, '提示', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(async () => {
- let res = await assessApplyApi().toRiskReport({ id: val.id });
- if (res.data.code === 100) {
- ElMessage({
- type: 'success',
- duration: 2000,
- message: '生成报告成功'
- });
- await getAssessData();
- } else {
- ElMessage({
- type: 'warning',
- message: res.data.msg
- });
- }
- })
- .catch((error) => {
- });
+const toReport = (val: ProjectType,type: number)=>{
+ if(type == 0){
+ ElMessageBox.confirm(`此操作将对该实验生成风险评估报告:“${val.experimentName}”,是否继续?`, '提示', {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(async () => {
+ let res = await assessApplyApi().toRiskReport({ id: val.id });
+ if (res.data.code === 100) {
+ ElMessage({
+ type: 'success',
+ duration: 2000,
+ message: '生成报告成功'
+ });
+ await getAssessData();
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
+ })
+ .catch((error) => {
+ });
+ }else{
+ ElMessageBox.confirm(`此操作将对该实验重新生成风险评估报告:“${val.experimentName}”,是否继续?`, '提示', {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning'
+ })
+ .then(async () => {
+ let res = await assessApplyApi().toRiskReport({ id: val.id, reSubmit: 1});
+ if (res.data.code === 100) {
+ ElMessage({
+ type: 'success',
+ duration: 2000,
+ message: '重新生成报告成功'
+ });
+ await getAssessData();
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
+ })
+ .catch((error) => {
+ });
+ }
}
const getAllRoom = async () => {
--
Gitblit v1.9.2