文件下载
parent
96cff33b25
commit
551095fbd2
|
@ -298,9 +298,9 @@ export function getPatientSubejctVisitList(param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载影像
|
// 下载影像
|
||||||
export function getSubjectImageZipInfo(id) {
|
export function getSubjectImageZipInfo(id, id2) {
|
||||||
return request({
|
return request({
|
||||||
url: `/Patient/getSubjectImageZipInfo/${id}`,
|
url: `/Patient/getSubjectImageZipInfo/${id}/${id2}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,9 @@ import Vue from 'vue';
|
||||||
import {
|
import {
|
||||||
getSubjectImageZipInfo,
|
getSubjectImageZipInfo,
|
||||||
} from "@/api/trials/visit.js";
|
} from "@/api/trials/visit.js";
|
||||||
export const downloadImage = async (id) => {
|
export const downloadImage = async (id, id2) => {
|
||||||
try {
|
try {
|
||||||
let res = await getSubjectImageZipInfo(id);
|
let res = await getSubjectImageZipInfo(id, id2);
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
let item = res.Result;
|
let item = res.Result;
|
||||||
await setfolder(item);
|
await setfolder(item);
|
||||||
|
@ -18,52 +18,44 @@ export const downloadImage = async (id) => {
|
||||||
};
|
};
|
||||||
const setfolder = async (item) => {
|
const setfolder = async (item) => {
|
||||||
const zip = new JSZip(); // 创建实例对象
|
const zip = new JSZip(); // 创建实例对象
|
||||||
|
let patientIds = item.PatientList.map(i => i.PatientIdStr);
|
||||||
|
let zipName = `${item.SubjectCode}_${patientIds.join(',')}`;
|
||||||
let zipObj = {};
|
let zipObj = {};
|
||||||
const promises = [];
|
const promises = [];
|
||||||
for (let patient of item.PatientList) {
|
for (let visit of item.VisitList) {
|
||||||
if (!zipObj[patient.PatientIdStr]) {
|
if (!zipObj[`${visit.VisitName}`]) {
|
||||||
zipObj[patient.PatientIdStr] = zip.folder(
|
zipObj[`${visit.VisitName}`] = zip.folder(visit.VisitName);
|
||||||
`${item.SubjectCode}_${patient.PatientIdStr}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
for (let visit of patient.VisitList) {
|
for (let study of visit.StudyList) {
|
||||||
if (!zipObj[`${patient.PatientIdStr}${visit.VisitName}`]) {
|
let date = study.StudyTime.split(" ")[0];
|
||||||
zipObj[`${patient.PatientIdStr}${visit.VisitName}`] = zipObj[
|
for (let series of study.SeriesList) {
|
||||||
patient.PatientIdStr
|
if (
|
||||||
].folder(visit.VisitName);
|
!zipObj[
|
||||||
}
|
`${visit.VisitName}${series.Modality}`
|
||||||
for (let study of visit.StudyList) {
|
]
|
||||||
let date = study.StudyTime.split(" ")[0];
|
) {
|
||||||
for (let series of study.SeriesList) {
|
zipObj[
|
||||||
if (
|
`${visit.VisitName}${series.Modality}`
|
||||||
!zipObj[
|
] = zipObj[`${visit.VisitName}`].folder(
|
||||||
`${patient.PatientIdStr}${visit.VisitName}${series.Modality}`
|
`${date}_${series.Modality}`
|
||||||
]
|
);
|
||||||
) {
|
}
|
||||||
|
for (let instance of series.InstancePathList) {
|
||||||
|
let obj = {
|
||||||
|
subjectCode: item.SubjectCode,
|
||||||
|
visitName: visit.VisitName,
|
||||||
|
date: study.StudyTime.split(" ")[0],
|
||||||
|
modality: series.Modality,
|
||||||
|
instancePath: instance.Path,
|
||||||
|
dicomName: instance.Path.split("/Dicom/")[1],
|
||||||
|
};
|
||||||
|
const promise = handleBatchDown(
|
||||||
|
obj,
|
||||||
zipObj[
|
zipObj[
|
||||||
`${patient.PatientIdStr}${visit.VisitName}${series.Modality}`
|
`${visit.VisitName}${series.Modality}`
|
||||||
] = zipObj[`${patient.PatientIdStr}${visit.VisitName}`].folder(
|
],
|
||||||
`${date}_${series.Modality}`
|
);
|
||||||
);
|
promises.push(promise);
|
||||||
}
|
|
||||||
for (let instance of series.InstancePathList) {
|
|
||||||
let obj = {
|
|
||||||
subjectCode: item.SubjectCode,
|
|
||||||
patientIdStr: patient.PatientIdStr,
|
|
||||||
visitName: visit.VisitName,
|
|
||||||
date: study.StudyTime.split(" ")[0],
|
|
||||||
modality: series.Modality,
|
|
||||||
instancePath: instance.Path,
|
|
||||||
dicomName: instance.Path.split("/Dicom/")[1],
|
|
||||||
};
|
|
||||||
const promise = handleBatchDown(
|
|
||||||
obj,
|
|
||||||
zipObj[
|
|
||||||
`${patient.PatientIdStr}${visit.VisitName}${series.Modality}`
|
|
||||||
]
|
|
||||||
);
|
|
||||||
promises.push(promise);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +73,7 @@ const setfolder = async (item) => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
saveAs(res, item.SubjectCode + new Date().getTime() + "_CV.zip"); // 使用FileSaver.saveAs保存文件,文件名可自定义
|
saveAs(res, zipName + ".zip"); // 使用FileSaver.saveAs保存文件,文件名可自定义
|
||||||
zipObj = null;
|
zipObj = null;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -239,6 +239,7 @@ export default {
|
||||||
let params = {
|
let params = {
|
||||||
PatientId: this.Patient.PatientId,
|
PatientId: this.Patient.PatientId,
|
||||||
SubjectId: item.SubjectId,
|
SubjectId: item.SubjectId,
|
||||||
|
TrialId: item.TrialId,
|
||||||
};
|
};
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let res = await deleteSubjectPatientBinding(params);
|
let res = await deleteSubjectPatientBinding(params);
|
||||||
|
|
|
@ -139,7 +139,6 @@
|
||||||
label="Called AE"
|
label="Called AE"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
min-width="140"
|
min-width="140"
|
||||||
sortable="custom"
|
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span
|
<span
|
||||||
|
@ -157,7 +156,6 @@
|
||||||
label="Calling AE"
|
label="Calling AE"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
min-width="140"
|
min-width="140"
|
||||||
sortable="custom"
|
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span
|
<span
|
||||||
|
|
|
@ -147,15 +147,15 @@
|
||||||
<!-- 授权时长 -->
|
<!-- 授权时长 -->
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$t('trials:trials-list:table:durationAuthorized')"
|
:label="$t('trials:trials-list:table:durationAuthorized')"
|
||||||
prop="AuthorizationYear"
|
prop="AuthorizationDuration"
|
||||||
>
|
>
|
||||||
<div style="position: relative">
|
<div style="position: relative">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="trialForm.AuthorizationYear"
|
v-model="trialForm.AuthorizationDuration"
|
||||||
type="number"
|
type="number"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
<span style="position: absolute; right: -20px; top: 0">年</span>
|
<span style="position: absolute; right: -20px; top: 0">月</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 授权时间 -->
|
<!-- 授权时间 -->
|
||||||
|
@ -249,7 +249,7 @@ export default {
|
||||||
CriterionTypeList: [],
|
CriterionTypeList: [],
|
||||||
ContactUser: "",
|
ContactUser: "",
|
||||||
ContactPhone: "",
|
ContactPhone: "",
|
||||||
AuthorizationYear: null,
|
AuthorizationDuration: null,
|
||||||
AuthorizationDate: null,
|
AuthorizationDate: null,
|
||||||
},
|
},
|
||||||
indicationGrouping: null,
|
indicationGrouping: null,
|
||||||
|
@ -263,7 +263,7 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// 授权时长
|
// 授权时长
|
||||||
AuthorizationYear: [
|
AuthorizationDuration: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: this.$t(
|
message: this.$t(
|
||||||
|
|
|
@ -224,7 +224,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!--授权时长-->
|
<!--授权时长-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="AuthorizationYear"
|
prop="AuthorizationDuration"
|
||||||
:label="$t('trials:trials-list:table:durationAuthorized')"
|
:label="$t('trials:trials-list:table:durationAuthorized')"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
|
|
|
@ -518,7 +518,7 @@ export default {
|
||||||
downloadReport() {},
|
downloadReport() {},
|
||||||
// 下载影像
|
// 下载影像
|
||||||
async downloadImage(item) {
|
async downloadImage(item) {
|
||||||
downloadImage(item.SubjectId);
|
downloadImage(item.SubjectId, item.SubjectVisitId);
|
||||||
},
|
},
|
||||||
// 评估报告
|
// 评估报告
|
||||||
showReport(item) {
|
showReport(item) {
|
||||||
|
|
|
@ -378,7 +378,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 下载报告
|
// 下载报告
|
||||||
downloadReport(item) {
|
downloadReport(item) {
|
||||||
downloadImage(item.SubjectId);
|
downloadImage(item.SubjectId, item.SourceSubjectVisitId);
|
||||||
},
|
},
|
||||||
// 阅片结果
|
// 阅片结果
|
||||||
readResult(row) {
|
readResult(row) {
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
<el-descriptions-item
|
<el-descriptions-item
|
||||||
:label="$t('trials:trials-list:table:durationAuthorized')"
|
:label="$t('trials:trials-list:table:durationAuthorized')"
|
||||||
>
|
>
|
||||||
{{ trialInfo.AuthorizationYear }}年
|
{{ trialInfo.AuthorizationDuration }}年
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!--授权日期-->
|
<!--授权日期-->
|
||||||
<el-descriptions-item
|
<el-descriptions-item
|
||||||
|
|
Loading…
Reference in New Issue