From 20e7bce4b0c485698ce0f6e59f9e074e455476a5 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期四, 22 五月 2025 17:11:41 +0800 Subject: [PATCH] 修改导出 --- src/views/analyse/assessApply/components/reportDialog.vue | 18 ++++++++++++------ src/views/analyse/assessApply/index.vue | 4 ++-- index.html | 4 ++++ src/views/analyse/identify/index.vue | 3 ++- src/views/analyse/assessApply/index.ts | 1 + public/static/exampleScience.docx | 0 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 6989242..8d27343 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,10 @@ <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta http-equiv="Cache-Control" content="no-cache,no-store,must-revalidate"/> + <meta http-equiv="Cache" content="no-cache"> + <meta http-equiv="Pragma" content="no-cache" /> + <meta http-equiv="Expires" content="0" /> <meta name="keywords" content="vue-next-admin,vue-prev-admin,vue-admin-wonderful,后台管理系统一站式平台模板,希望可以帮你完成快速开发。vue2.x,vue2.0,vue2,vue3,vue3.x,vue3.0,CompositionAPI,typescript,element plus,element,plus,admin,wonderful,wonderful-next,vue-next-admin,vite,vite-admin,快速,高效,后台模板,后台系统,管理系统" diff --git a/public/static/exampleScience.docx b/public/static/exampleScience.docx index 7dbe241..d159e81 100644 --- a/public/static/exampleScience.docx +++ b/public/static/exampleScience.docx Binary files differ diff --git a/src/views/analyse/assessApply/components/reportDialog.vue b/src/views/analyse/assessApply/components/reportDialog.vue index 5f53c12..f5ba557 100644 --- a/src/views/analyse/assessApply/components/reportDialog.vue +++ b/src/views/analyse/assessApply/components/reportDialog.vue @@ -275,6 +275,7 @@ }, allPersonList: [], allRoomList: [], + phaList: [], systemPersonList: [], experimentTypeList: [ {id: 1, name: '化学类'}, @@ -333,7 +334,6 @@ // } // } } - console.log(reportDialogState.reportForm,'form') }; const isValidKey = (key: string | number | symbol, object:object): key is keyof typeof object =>{ @@ -345,7 +345,8 @@ experimentId: id, pageIndex: 1, pageSize: 10, - tag: 3 + tag: 3, + exportTag:true }); if(res.data.code === 100){ reportDialogState.reportForm = { @@ -384,6 +385,7 @@ reportDialogState.reportForm[i] = res.data.data[0][i]; } } + reportDialogState.phaList = res.data.data[0].riskPlanMethodBO ?res.data.data[0].riskPlanMethodBO: [] const arr = reportDialogState.reportForm.experimentAndType.map(item => item.type.experimentType) typeValue.value = arr.join(',') } @@ -543,9 +545,13 @@ } }) data.riskLevel = levelExample - - data.tableData = data.oldRiskAssess ?data.oldRiskAssess: [] - + // data.tableData = data.oldRiskAssess ?data.oldRiskAssess: [] + data.phaData = reportDialogState.phaList.map(item=>{ + return { + ...item, + riskLevelName: item.riskLevel == 1?'低风险':item.riskLevel == 2?'一般风险':item.riskLevel == 3?'较大风险':item.riskLevel == 4?'重大风险':'--' + } + }) data.riskSource = data.riskSource ? data.riskSource.map(item => { return { ...item, @@ -555,7 +561,7 @@ data.safeRiskAnalysis = data.safeRiskAnalysis ?data.safeRiskAnalysis : '' - + console.log(data,'data') try { generateWordDocument(templatePath, data, `材料科学姑苏实验室安全风险评估表---${data.experimentName}.docx`); diff --git a/src/views/analyse/assessApply/index.ts b/src/views/analyse/assessApply/index.ts index ea7e1fb..216bdc5 100644 --- a/src/views/analyse/assessApply/index.ts +++ b/src/views/analyse/assessApply/index.ts @@ -34,6 +34,7 @@ reportFormRules: object allPersonList: Array<AllPersonListType> systemPersonList: Array<AllPersonListType> + phaList: [] allRoomList: Array<RoomType>, experimentTypeList: Array<Type> riskSourceTypeList: Array<Type> diff --git a/src/views/analyse/assessApply/index.vue b/src/views/analyse/assessApply/index.vue index fc96371..929a87a 100644 --- a/src/views/analyse/assessApply/index.vue +++ b/src/views/analyse/assessApply/index.vue @@ -69,8 +69,8 @@ </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,0)">生成评估报告</el-button> - <el-button size="small" v-if="scope.row.stage == 4" text type="primary" :icon="Edit" @click="toReport(scope.row,1)">重新生成报告</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> diff --git a/src/views/analyse/identify/index.vue b/src/views/analyse/identify/index.vue index bf418a2..dc594f1 100644 --- a/src/views/analyse/identify/index.vue +++ b/src/views/analyse/identify/index.vue @@ -21,10 +21,11 @@ :json-data="identifyState.allData" :fields="fields" default-value="--" + type="primary" name="风险辨识记录.xls" v-if="identifyState.isAdmin" > - <el-button plain :icon="Download" style="margin-left: 12px">导出</el-button> + <el-button type="primary" :icon="Download" style="margin-left: 12px">导出</el-button> </vue3-json-excel> </div> </el-row> -- Gitblit v1.9.2