27925b94 by lihua

专区发送报告

1 parent 407d7abf
......@@ -352,6 +352,13 @@ export const htmlToWord = (params) => request({
responseType: 'blob'
})
/** 发送评测报告到邮箱 */
export const sendAnonReport = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/anon-task/send-mail-and-msg`,
method: 'post',
data: params
})
export const scanFolder = (dirPath = '') => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/anon-task/directory/scan?dirPath=${dirPath}`,
method: 'get'
......
......@@ -8,6 +8,7 @@ import {
getAnonAnalyzeResult,
getAnonTaskDetail,
htmlToWord,
sendAnonReport,
} from '@/api/modules/dataAnonymization';
import { changeNum, download } from '@/utils/common';
import { ElMessage } from 'element-plus';
......@@ -205,14 +206,14 @@ const downloadWord = () => {
let report = resultReportRef.value?.report;
dom.innerHTML = report?.innerHTML;
resultDataLoading.value = true;
loadingText.value = '报告正在下载中,请勿关闭浏览器...';
loadingText.value = '评测报告正在发送中,请勿关闭浏览器...';
downPromise.value = convertHtml2Img(report, dom).then(() => {
htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
downPromise.value = null
loadingText.value = '';
resultDataLoading.value = false;
if (res && !res.msg) {
download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word')
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('评测报告发送成功');
} else {
res?.msg && ElMessage.error(res?.msg);
}
......@@ -260,10 +261,10 @@ onBeforeMount(() => {
<!-- 连接器不需要显示下载报告按钮 -->
<template v-if="!isDataProvider">
<el-button v-show="!isWordStyle" style="margin-bottom: 8px;" type="primary" @click="transfer"
v-preReClick>生成Word评估报告</el-button>
v-preReClick>预览Word评估报告</el-button>
<div v-show="isWordStyle" style="margin-bottom: 8px;">
<el-button @click="isWordStyle = false">返回</el-button>
<el-button type="primary" @click="downloadWord">下载评估报告</el-button>
<el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button>
</div>
</template>
<anonResultAnalysis ref="resultReportRef" :show-title="true" :analysis-result-info="analysisResultInfo"
......
......@@ -164,14 +164,14 @@
:page-info="pageInfo" :result-data="resultData" :fullResultData="fullResultData" @page-change="pageChange">
</anonResultAnalysis>
<!-- 连接器只能查看报告 -->
<!-- <template #header>
<template v-if="!isDataProvider" #header>
<el-button v-show="isExecEnd && analysisResultInfo.status == 'Y' && !isWordStyle" type="primary"
v-loading="!!downPromise" @click="transfer">生成Word评估报告</el-button>
v-loading="!!downPromise" @click="transfer">预览Word评估报告</el-button>
<div v-show="isWordStyle">
<el-button @click="isWordStyle = false">返回</el-button>
<el-button type="primary" @click="downloadWord">下载评估报告</el-button>
<el-button type="primary" @click="downloadWord">确认并发送评测报告</el-button>
</div>
</template> -->
</template>
</ContentWrap>
</div>
<!-- 匿名化结果展示 -->
......@@ -232,7 +232,8 @@ import {
scanFolder,
getDicomMeta,
getDicomStatistics,
retryDicom
retryDicom,
sendAnonReport
} from '@/api/modules/dataAnonymization';
import {
parseAndDecodeUrl,
......@@ -244,7 +245,7 @@ import {
} from "@/api/modules/queryService";
import useUserStore from "@/store/modules/user";
import { useValidator } from '@/hooks/useValidator';
import { TableColumnWidth } from '@/utils/enum';
import { TableColumnWidth, USERROLE } from '@/utils/enum';
import { calcColumnWidth } from "@/utils/index";
import Moment from 'moment';
import anonTaskStepTwo from './anonTaskStepTwo.vue';
......@@ -275,6 +276,11 @@ const { required } = useValidator();
const fullscreenLoading = ref(false);
const containerRef = ref();
/** 是否是数据提供方 */
const isDataProvider = computed(() => {
return localStorage.getItem('userRole') == USERROLE.PROVIDER;
})
const qualifiedIdentifierFloderList = ref([{
enName: 'patient_birth_date',
chName: '患者出生日期',
......@@ -1962,12 +1968,12 @@ const downloadWord = () => {
loadingText.value = '报告正在下载中,请勿关闭浏览器...';
downloadLoading.value = true;
downPromise.value = convertHtml2Img(report, dom).then(() => {
htmlToWord({ html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
sendAnonReport({ taskGuid: taskGuid.value, html: encodeURIComponent(`<div>${getHTML(dom.innerHTML)}</div>`) }).then((res: any) => {
downPromise.value = null
loadingText.value = '';
downloadLoading.value = false;
if (res && !res.msg) {
download(res, (route.query.taskName || oldAnonTaskValueInfo.value.taskName) + '_匿名化评估报告.docx', 'word')
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('评测报告发送成功');
} else {
res?.msg && ElMessage.error(res?.msg);
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!