阅片人已阅列表,增加下载报告、下载影像

main
wangxiaoshuang 2024-05-11 14:03:40 +08:00
parent aef3c8e924
commit 88e559bdaa
1 changed files with 91 additions and 17 deletions

View File

@ -252,6 +252,28 @@
sortable="custom"
show-overflow-tooltip
/>
<!-- 打包状态 -->
<el-table-column
prop="PackState"
:label="$t('trials:hirVisit:table:PackState')"
show-overflow-tooltip
sortable="custom"
>
<template slot-scope="scope">
<el-tag
:type="
Number(scope.row.PackState) === 0
? 'danger'
: Number(scope.row.PackState) === 1
? 'warning'
: 'success'
"
>{{
$fd("PackState", Number(scope.row.PackState) || 0)
}}</el-tag
>
</template>
</el-table-column>
<!-- 申请状态 -->
<!-- <el-table-column
v-if="!hasPermi(['role:air'])"
@ -283,7 +305,7 @@
<!--操作-->
<el-table-column
:label="$t('common:action:action')"
min-width="100"
min-width="140"
fixed="right"
v-if="
hasPermi([
@ -312,22 +334,23 @@
icon="el-icon-collection"
@click="openApplyReReading(scope.row)"
/>
<!-- 下载报告 -->
<!-- <el-button
v-hasPermi="['trials:readTask:report']"
circle
:title="$t('trials:reading:button:uploadReport')"
icon="el-icon-collection"
@click="handleReadImage(scope.row)"
/> -->
<!-- 审核记录 -->
<!-- <el-button
v-hasPermi="['trials:readTask:auditRecord']"
circle
:title="$t('trials:auditRecord:table:auditRecords')"
icon="el-icon-collection"
@click="handleReadImage(scope.row)"
/> -->
<!--评估报告-->
<el-button
circle
v-hasPermi="['trials:readTask:report']"
icon="el-icon-document"
:title="$t('trials:trials-panel:hirVisit:EvaluationReport')"
@click="handleCommand('showReport', scope.row)"
:disabled="scope.row.ReadingTaskState !== 2"
/>
<!--下载影像-->
<el-button
circle
v-hasPermi="['trials:readTask:report']"
icon="el-icon-download"
:title="$t('trials:reading:button:uploadImages')"
@click="handleCommand('downloadImage', scope.row)"
/>
</template>
</el-table-column>
</el-table>
@ -631,6 +654,8 @@ import BaseContainer from "@/components/BaseContainer";
import Pagination from "@/components/Pagination";
import ChatForm from "./components/ChatForm";
import { getToken } from "@/utils/auth";
import { showReadReport } from "@/api/export";
import { downloadImage } from "@/utils/uploadZip.js";
const searchDataDefault = () => {
return {
SubjectCode: "",
@ -694,6 +719,7 @@ export default {
TrialReadingCriterionId: "0",
openWindow: null,
auditRecordVisible: false,
reportFlag: {},
};
},
watch: {
@ -713,6 +739,54 @@ export default {
}
},
methods: {
//
handleCommand(command, item) {
this[command](item);
},
//
async showReport(item) {
if (this.reportFlag[item.Id]) return;
let data = {
VisitTaskId: item.Id,
};
try {
if (!this.reportFlag.hasOwnProperty(item.Id)) {
this.$set(this.reportFlag, item.Id, true);
}
if (!this.reportFlag[item.Id]) {
this.reportFlag[item.Id] = true;
}
let res = await showReadReport(data);
if (res.IsSuccess) {
let a = document.createElement("a");
let href = this.OSSclientConfig.basePath + res.Result;
let fileName =
res.Result.split("/")[res.Result.split("/").length - 1];
a.download = fileName;
a.href = href;
a.click();
URL.revokeObjectURL(href);
this.$nextTick(() => {
a = null;
href = null;
});
}
this.reportFlag[item.Id] = false;
} catch (err) {
this.reportFlag[item.Id] = false;
console.log(err);
}
},
//
async downloadImage(item) {
let res = await downloadImage(
this.$route.query.trialId,
item.SourceSubjectVisitId
);
if (res) {
item.PackState = res;
}
},
getTrialCriterionList() {
getTrialCriterionList(this.trialId)
.then((res) => {