crc上传DICOM影像页上传临床数据流程简化
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
7d634fb2e5
commit
a549341d3b
|
@ -265,14 +265,44 @@
|
|||
{{ $t("trials:uploadClinicalData:button:downloadTemplate") }}
|
||||
</el-button>
|
||||
<!-- 新增 -->
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
icon="el-icon-plus"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click.native.prevent="addFile(cd.Id, cd.ClinicalDataTrialSetId)"
|
||||
>
|
||||
{{ $t("common:button:new") }}
|
||||
</el-button> -->
|
||||
<!-- 新增 -->
|
||||
<el-button
|
||||
icon="el-icon-plus"
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="btnLoading"
|
||||
:loading="btnLoading"
|
||||
>
|
||||
{{ $t("common:button:new") }}
|
||||
</el-button>
|
||||
<input
|
||||
type="file"
|
||||
name="file"
|
||||
multiple
|
||||
ref="addFile"
|
||||
style="
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
"
|
||||
:accept="faccept.join(',')"
|
||||
@change="
|
||||
($event) =>
|
||||
beginScanFiles($event, cd.Id, cd.ClinicalDataTrialSetId)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<el-table :data="cd.PDFFileList" style="width: 100%" height="300">
|
||||
<el-table-column type="index" width="50" />
|
||||
|
@ -444,8 +474,9 @@ import {
|
|||
deletePreviousHistory,
|
||||
deletePreviousOther,
|
||||
deletePreviousSurgery,
|
||||
getCRCClinicalData,
|
||||
addOrUpdateReadingClinicalData,
|
||||
} from "@/api/trials";
|
||||
import { getCRCClinicalData } from "@/api/trials";
|
||||
import PreviousRadiotherapy from "./previousRadiotherapy";
|
||||
import PreviousSurgery from "./previousSurgery";
|
||||
import PreviousOther from "./previousOther";
|
||||
|
@ -492,9 +523,11 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
faccept: [".pdf"],
|
||||
isShow: false,
|
||||
userTypeEnumInt: zzSessionStorage.getItem("userTypeEnumInt") * 1,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
PreviousHistoryList: [],
|
||||
PreviousSurgeryList: [],
|
||||
PreviousOtherList: [],
|
||||
|
@ -516,6 +549,93 @@ export default {
|
|||
this.getClinicalData();
|
||||
},
|
||||
methods: {
|
||||
beginScanFiles(e, id, clinicalDataTrialSetId) {
|
||||
this.currentRow = {
|
||||
Id: id,
|
||||
ClinicalDataTrialSetId: clinicalDataTrialSetId,
|
||||
SubjectId: this.data.SubjectId,
|
||||
};
|
||||
this.currentRow.TrialId = this.$route.query.trialId;
|
||||
var files = e.target.files;
|
||||
this.fileList = [];
|
||||
for (var i = 0; i < files.length; ++i) {
|
||||
const fileName = files[i].name;
|
||||
var extendName = fileName
|
||||
.substring(fileName.lastIndexOf("."))
|
||||
.toLocaleLowerCase();
|
||||
if (this.faccept.indexOf(extendName) !== -1) {
|
||||
let obj = {
|
||||
size: files[i].size,
|
||||
type: extendName.split(".")[1],
|
||||
file: files[i],
|
||||
};
|
||||
this.fileList.push(obj);
|
||||
}
|
||||
}
|
||||
this.handleUploadFile();
|
||||
this.$refs.addFile.forEach((item) => {
|
||||
item.value = null;
|
||||
});
|
||||
},
|
||||
async handleUploadFile() {
|
||||
this.btnLoading = true;
|
||||
this.loading = true;
|
||||
this.addFileList = [];
|
||||
try {
|
||||
for (var i = 0; i < this.fileList.length; ++i) {
|
||||
const file = await this.fileToBlob(this.fileList[i].file);
|
||||
var timestamp = Date.now();
|
||||
const res = await this.OSSclient.put(
|
||||
`/${this.trialId}/ClinicalData/${timestamp}_${this.fileList[i].file.name}`,
|
||||
file
|
||||
);
|
||||
this.addFileList.push({
|
||||
fileName: this.fileList[i].file.name,
|
||||
path: this.$getObjectName(res.url),
|
||||
url: this.$getObjectName(res.url),
|
||||
type: this.fileList[i].type,
|
||||
size: this.fileList[i].size,
|
||||
});
|
||||
}
|
||||
this.saveClinicalData();
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
this.btnLoading = false;
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
saveClinicalData() {
|
||||
this.btnLoading = true;
|
||||
this.loading = true;
|
||||
var param = {
|
||||
id: this.currentRow.Id,
|
||||
trialId: this.currentRow.TrialId,
|
||||
subjectId: this.currentRow.SubjectId,
|
||||
readingId: this.subjectVisitId,
|
||||
clinicalDataTrialSetId: this.currentRow.ClinicalDataTrialSetId,
|
||||
isVisit: true,
|
||||
deleteFileIds: [],
|
||||
addFileList: this.addFileList,
|
||||
};
|
||||
if (this.studyData.StudyId) {
|
||||
param.StudyId = this.studyData.StudyId;
|
||||
}
|
||||
addOrUpdateReadingClinicalData(param)
|
||||
.then((response) => {
|
||||
this.btnLoading = false;
|
||||
this.loading = false;
|
||||
// 刷新文件列表并关闭弹窗
|
||||
this.getClinicalData();
|
||||
this.$message.success(
|
||||
this.$t("trials:uploadClinicalData:message:uploadSuccessfully")
|
||||
);
|
||||
this.$emit("getStudyInfo");
|
||||
})
|
||||
.catch(() => {
|
||||
this.btnLoading = false;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getClinicalData() {
|
||||
this.loading = true;
|
||||
this.data.TrialId = this.$route.query.trialId;
|
||||
|
|
Loading…
Reference in New Issue