From a549341d3b053e6028c413402e09627e50f8bb6b Mon Sep 17 00:00:00 2001
From: "DESKTOP-6C3NK6N\\WXS" <815034831@qq.com>
Date: Wed, 14 Aug 2024 14:31:36 +0800
Subject: [PATCH] =?UTF-8?q?crc=E4=B8=8A=E4=BC=A0DICOM=E5=BD=B1=E5=83=8F?=
=?UTF-8?q?=E9=A1=B5=E4=B8=8A=E4=BC=A0=E4=B8=B4=E5=BA=8A=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=AE=80=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/uploadPetClinicalData.vue | 124 +++++++++++++++++-
1 file changed, 122 insertions(+), 2 deletions(-)
diff --git a/src/views/trials/trials-panel/visit/crc-upload/components/uploadPetClinicalData.vue b/src/views/trials/trials-panel/visit/crc-upload/components/uploadPetClinicalData.vue
index 7969e031..1b22bd21 100644
--- a/src/views/trials/trials-panel/visit/crc-upload/components/uploadPetClinicalData.vue
+++ b/src/views/trials/trials-panel/visit/crc-upload/components/uploadPetClinicalData.vue
@@ -265,14 +265,44 @@
{{ $t("trials:uploadClinicalData:button:downloadTemplate") }}
-
{{ $t("common:button:new") }}
+ -->
+
+
+ {{ $t("common:button:new") }}
+
+ beginScanFiles($event, cd.Id, cd.ClinicalDataTrialSetId)
+ "
+ />
@@ -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;