27925b94 by lihua

专区发送报告

1 parent 407d7abf
...@@ -352,6 +352,13 @@ export const htmlToWord = (params) => request({ ...@@ -352,6 +352,13 @@ export const htmlToWord = (params) => request({
352 responseType: 'blob' 352 responseType: 'blob'
353 }) 353 })
354 354
355 /** 发送评测报告到邮箱 */
356 export const sendAnonReport = (params) => request({
357 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/anon-task/send-mail-and-msg`,
358 method: 'post',
359 data: params
360 })
361
355 export const scanFolder = (dirPath = '') => request({ 362 export const scanFolder = (dirPath = '') => request({
356 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/anon-task/directory/scan?dirPath=${dirPath}`, 363 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/anon-task/directory/scan?dirPath=${dirPath}`,
357 method: 'get' 364 method: 'get'
......
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
8 getAnonAnalyzeResult, 8 getAnonAnalyzeResult,
9 getAnonTaskDetail, 9 getAnonTaskDetail,
10 htmlToWord, 10 htmlToWord,
11 sendAnonReport,
11 } from '@/api/modules/dataAnonymization'; 12 } from '@/api/modules/dataAnonymization';
12 import { changeNum, download } from '@/utils/common'; 13 import { changeNum, download } from '@/utils/common';
13 import { ElMessage } from 'element-plus'; 14 import { ElMessage } from 'element-plus';
...@@ -205,14 +206,14 @@ const downloadWord = () => { ...@@ -205,14 +206,14 @@ const downloadWord = () => {
205 let report = resultReportRef.value?.report; 206 let report = resultReportRef.value?.report;
206 dom.innerHTML = report?.innerHTML; 207 dom.innerHTML = report?.innerHTML;
207 resultDataLoading.value = true; 208 resultDataLoading.value = true;
208 loadingText.value = '报告正在下载中,请勿关闭浏览器...'; 209 loadingText.value = '评测报告正在发送中,请勿关闭浏览器...';
209 downPromise.value = convertHtml2Img(report, dom).then(() => { 210 downPromise.value = convertHtml2Img(report, dom).then(() => {
210 htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { 211 sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
211 downPromise.value = null 212 downPromise.value = null
212 loadingText.value = ''; 213 loadingText.value = '';
213 resultDataLoading.value = false; 214 resultDataLoading.value = false;
214 if (res && !res.msg) { 215 if (res?.code == proxy.$passCode) {
215 download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word') 216 proxy.$ElMessage.success('评测报告发送成功');
216 } else { 217 } else {
217 res?.msg && ElMessage.error(res?.msg); 218 res?.msg && ElMessage.error(res?.msg);
218 } 219 }
...@@ -260,10 +261,10 @@ onBeforeMount(() => { ...@@ -260,10 +261,10 @@ onBeforeMount(() => {
260 <!-- 连接器不需要显示下载报告按钮 --> 261 <!-- 连接器不需要显示下载报告按钮 -->
261 <template v-if="!isDataProvider"> 262 <template v-if="!isDataProvider">
262 <el-button v-show="!isWordStyle" style="margin-bottom: 8px;" type="primary" @click="transfer" 263 <el-button v-show="!isWordStyle" style="margin-bottom: 8px;" type="primary" @click="transfer"
263 v-preReClick>生成Word评估报告</el-button> 264 v-preReClick>预览Word评估报告</el-button>
264 <div v-show="isWordStyle" style="margin-bottom: 8px;"> 265 <div v-show="isWordStyle" style="margin-bottom: 8px;">
265 <el-button @click="isWordStyle = false">返回</el-button> 266 <el-button @click="isWordStyle = false">返回</el-button>
266 <el-button type="primary" @click="downloadWord">下载评估报告</el-button> 267 <el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button>
267 </div> 268 </div>
268 </template> 269 </template>
269 <anonResultAnalysis ref="resultReportRef" :show-title="true" :analysis-result-info="analysisResultInfo" 270 <anonResultAnalysis ref="resultReportRef" :show-title="true" :analysis-result-info="analysisResultInfo"
......
...@@ -164,14 +164,14 @@ ...@@ -164,14 +164,14 @@
164 :page-info="pageInfo" :result-data="resultData" :fullResultData="fullResultData" @page-change="pageChange"> 164 :page-info="pageInfo" :result-data="resultData" :fullResultData="fullResultData" @page-change="pageChange">
165 </anonResultAnalysis> 165 </anonResultAnalysis>
166 <!-- 连接器只能查看报告 --> 166 <!-- 连接器只能查看报告 -->
167 <!-- <template #header> 167 <template v-if="!isDataProvider" #header>
168 <el-button v-show="isExecEnd && analysisResultInfo.status == 'Y' && !isWordStyle" type="primary" 168 <el-button v-show="isExecEnd && analysisResultInfo.status == 'Y' && !isWordStyle" type="primary"
169 v-loading="!!downPromise" @click="transfer">生成Word评估报告</el-button> 169 v-loading="!!downPromise" @click="transfer">预览Word评估报告</el-button>
170 <div v-show="isWordStyle"> 170 <div v-show="isWordStyle">
171 <el-button @click="isWordStyle = false">返回</el-button> 171 <el-button @click="isWordStyle = false">返回</el-button>
172 <el-button type="primary" @click="downloadWord">下载评估报告</el-button> 172 <el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button>
173 </div> 173 </div>
174 </template> --> 174 </template>
175 </ContentWrap> 175 </ContentWrap>
176 </div> 176 </div>
177 <!-- 匿名化结果展示 --> 177 <!-- 匿名化结果展示 -->
...@@ -232,7 +232,8 @@ import { ...@@ -232,7 +232,8 @@ import {
232 scanFolder, 232 scanFolder,
233 getDicomMeta, 233 getDicomMeta,
234 getDicomStatistics, 234 getDicomStatistics,
235 retryDicom 235 retryDicom,
236 sendAnonReport
236 } from '@/api/modules/dataAnonymization'; 237 } from '@/api/modules/dataAnonymization';
237 import { 238 import {
238 parseAndDecodeUrl, 239 parseAndDecodeUrl,
...@@ -244,7 +245,7 @@ import { ...@@ -244,7 +245,7 @@ import {
244 } from "@/api/modules/queryService"; 245 } from "@/api/modules/queryService";
245 import useUserStore from "@/store/modules/user"; 246 import useUserStore from "@/store/modules/user";
246 import { useValidator } from '@/hooks/useValidator'; 247 import { useValidator } from '@/hooks/useValidator';
247 import { TableColumnWidth } from '@/utils/enum'; 248 import { TableColumnWidth, USERROLE } from '@/utils/enum';
248 import { calcColumnWidth } from "@/utils/index"; 249 import { calcColumnWidth } from "@/utils/index";
249 import Moment from 'moment'; 250 import Moment from 'moment';
250 import anonTaskStepTwo from './anonTaskStepTwo.vue'; 251 import anonTaskStepTwo from './anonTaskStepTwo.vue';
...@@ -275,6 +276,11 @@ const { required } = useValidator(); ...@@ -275,6 +276,11 @@ const { required } = useValidator();
275 const fullscreenLoading = ref(false); 276 const fullscreenLoading = ref(false);
276 const containerRef = ref(); 277 const containerRef = ref();
277 278
279 /** 是否是数据提供方 */
280 const isDataProvider = computed(() => {
281 return localStorage.getItem('userRole') == USERROLE.PROVIDER;
282 })
283
278 const qualifiedIdentifierFloderList = ref([{ 284 const qualifiedIdentifierFloderList = ref([{
279 enName: 'patient_birth_date', 285 enName: 'patient_birth_date',
280 chName: '患者出生日期', 286 chName: '患者出生日期',
...@@ -1962,12 +1968,12 @@ const downloadWord = () => { ...@@ -1962,12 +1968,12 @@ const downloadWord = () => {
1962 loadingText.value = '报告正在下载中,请勿关闭浏览器...'; 1968 loadingText.value = '报告正在下载中,请勿关闭浏览器...';
1963 downloadLoading.value = true; 1969 downloadLoading.value = true;
1964 downPromise.value = convertHtml2Img(report, dom).then(() => { 1970 downPromise.value = convertHtml2Img(report, dom).then(() => {
1965 htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => { 1971 sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
1966 downPromise.value = null 1972 downPromise.value = null
1967 loadingText.value = ''; 1973 loadingText.value = '';
1968 downloadLoading.value = false; 1974 downloadLoading.value = false;
1969 if (res && !res.msg) { 1975 if (res?.code == proxy.$passCode) {
1970 download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word') 1976 proxy.$ElMessage.success('评测报告发送成功');
1971 } else { 1977 } else {
1972 res?.msg && ElMessage.error(res?.msg); 1978 res?.msg && ElMessage.error(res?.msg);
1973 } 1979 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!