From 83b6c9f2cc22f5ed96abfa4c80f78aae8c901a3d Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Fri, 28 Feb 2025 10:24:09 +0800 Subject: [PATCH] 1 --- .../visit/crc-upload/components/studyInfo.vue | 214 +++++++++--------- 1 file changed, 110 insertions(+), 104 deletions(-) diff --git a/src/views/trials/trials-panel/visit/crc-upload/components/studyInfo.vue b/src/views/trials/trials-panel/visit/crc-upload/components/studyInfo.vue index 837c3210..f1a86870 100644 --- a/src/views/trials/trials-panel/visit/crc-upload/components/studyInfo.vue +++ b/src/views/trials/trials-panel/visit/crc-upload/components/studyInfo.vue @@ -14,7 +14,7 @@ icon="el-icon-delete" @click="handleBatchDelete" > - {{ $t("trials:uploadedDicoms:action:delete") }} + {{ $t('trials:uploadedDicoms:action:delete') }} - {{ $t("trials:uploadedDicoms:action:preview") }} + {{ $t('trials:uploadedDicoms:action:preview') }} + + @@ -223,7 +229,9 @@ v-for="bodyPart in trialBodyPartTypes" :key="bodyPart" :label="bodyPart" - >{{ $fd("Bodypart", bodyPart,'Code',BodyPart,'Name') }}{{ + $fd('Bodypart', bodyPart, 'Code', BodyPart, 'Name') + }} @@ -258,7 +266,7 @@ type="primary" @click="editStudyInfoVisible = false" > - {{ $t("common:button:cancel") }} + {{ $t('common:button:cancel') }} - {{ $t("common:button:save") }} + {{ $t('common:button:save') }} @@ -291,18 +299,18 @@ import { getSubjectVisitUploadedStudyList, deleteStudyList, updateModality, -} from "@/api/trials"; -import moment from "moment"; -import { getToken } from "@/utils/auth"; -import uploadPetClinicalData from "./uploadPetClinicalData.vue"; +} from '@/api/trials' +import moment from 'moment' +import { getToken } from '@/utils/auth' +import uploadPetClinicalData from './uploadPetClinicalData.vue' export default { - name: "StudyInfo", + name: 'StudyInfo', components: { uploadPetClinicalData }, props: { data: { type: Object, default() { - return {}; + return {} }, }, }, @@ -310,12 +318,12 @@ export default { return { editStudyInfoVisible: false, studyForm: { - StudyCode: "", + StudyCode: '', IsDicomData: true, - Modalities: "", + Modalities: '', BodyPartForEdit: [], SeriesCount: null, - StudyTime: "", + StudyTime: '', }, deleteArr: [], studyLoading: false, @@ -331,189 +339,187 @@ export default { petVisible: false, rowData: {}, - BodyPart:{} - }; + BodyPart: {}, + } }, async mounted() { - this.getStudyInfo(); + this.getStudyInfo() this.BodyPart.Bodypart = await this.$getBodyPart(this.$route.query.trialId) }, methods: { // 预览临床数据 handlePreviewClinicalData(row) { - this.rowData = row; - this.petVisible = true; + this.rowData = row + this.petVisible = true }, // 打开检查信息编辑框 handleEditStudy(row) { - this.editStudyInfoVisible = true; - this.studyForm = { ...row }; - var bodyPart = []; - if (this.studyForm.BodyPartForEdit.indexOf("|") !== -1) { - bodyPart = this.studyForm.BodyPartForEdit.split("|"); - } else if (this.studyForm.BodyPartForEdit !== "") { - bodyPart.push(this.studyForm.BodyPartForEdit); + this.editStudyInfoVisible = true + this.studyForm = { ...row } + var bodyPart = [] + if (this.studyForm.BodyPartForEdit.indexOf('|') !== -1) { + bodyPart = this.studyForm.BodyPartForEdit.split('|') + } else if (this.studyForm.BodyPartForEdit !== '') { + bodyPart.push(this.studyForm.BodyPartForEdit) } - this.studyForm.BodyPartForEdit = bodyPart; + this.studyForm.BodyPartForEdit = bodyPart }, // 更新拍片部位/拍片类型信息 handleUpdateStudyInfo() { - this.$refs["studyForm"].validate((valid) => { - if (!valid) return; - this.btnLoading = true; - this.studyForm.BodyPart = this.studyForm.BodyPartForEdit.join("|"); - this.studyForm.Modality = this.studyForm.Modalities; + this.$refs['studyForm'].validate((valid) => { + if (!valid) return + this.btnLoading = true + this.studyForm.BodyPart = this.studyForm.BodyPartForEdit.join('|') + this.studyForm.Modality = this.studyForm.Modalities var params = { id: this.studyForm.StudyId, subjectVisitId: this.data.Id, type: 1, modality: this.studyForm.Modality, bodyPart: this.studyForm.BodyPart, - }; + } updateModality(this.data.TrialId, params) .then((res) => { - this.btnLoading = false; + this.btnLoading = false if (res.IsSuccess) { - this.getStudyInfo(); - this.$message.success( - this.$t("common:message:savedSuccessfully") - ); - this.editStudyInfoVisible = false; + this.getStudyInfo() + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.editStudyInfoVisible = false } }) .catch(() => { - this.btnLoading = false; - }); - }); + this.btnLoading = false + }) + }) }, getStudyInfo() { - this.studyLoading = true; + this.studyLoading = true getSubjectVisitUploadedStudyList(this.data.Id) .then((res) => { - this.studyList = res.Result; - this.studyLoading = false; - this.relationInfo = res.OtherInfo; - console.log(this.relationInfo); + this.studyList = res.Result + this.studyLoading = false + this.relationInfo = res.OtherInfo + console.log(this.relationInfo) this.trialBodyPartTypes = this.relationInfo.BodyPartTypes - ? this.relationInfo.BodyPartTypes.split("|") - : []; + ? this.relationInfo.BodyPartTypes.split('|') + : [] this.trialModalitys = this.relationInfo.Modalitys - ? this.relationInfo.Modalitys.split("|") - : []; - console.log(this.trialBodyPartTypes); - console.log(this.trialModalitys); + ? this.relationInfo.Modalitys.split('|') + : [] + console.log(this.trialBodyPartTypes) + console.log(this.trialModalitys) }) .catch(() => { - this.studyLoading = false; - }); + this.studyLoading = false + }) }, // 批量删除 handleBatchDelete() { - this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), { - type: "warning", + this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), { + type: 'warning', distinguishCancelAndClose: true, }) .then(() => { - this.studyLoading = true; + this.studyLoading = true deleteStudyList(this.trialId, this.data.Id, this.deleteArr) .then((res) => { if (res.IsSuccess) { - this.getStudyInfo(); - this.$emit("getList"); + this.getStudyInfo() + this.$emit('getList') this.$message.success( - this.$t("trials:uploadedDicoms:message:deleteSuccessfully") - ); + this.$t('trials:uploadedDicoms:message:deleteSuccessfully') + ) } }) .catch(() => { - this.studyLoading = true; - }); + this.studyLoading = true + }) }) - .catch(() => {}); + .catch(() => {}) }, // 预览所有影像 handlePreviewAllFiles() { - var tokenKey = getToken(); + var tokenKey = getToken() const routeData = this.$router.resolve({ path: `/showvisitdicoms?trialId=${this.data.TrialId}&visitInfo=${this.data.VisitName}(${this.data.VisitNum})&subjectVisitId=${this.data.Id}&isFromCRCUpload=1&TokenKey=${tokenKey}`, - }); - var newWindow = window.open(routeData.href, "_blank"); - this.$emit("setOpenWindow", newWindow); + }) + var newWindow = window.open(routeData.href, '_blank') + this.$emit('setOpenWindow', newWindow) }, // 预览影像 handleViewStudy(row) { - var token = getToken(); + var token = getToken() const routeData = this.$router.resolve({ path: `/showdicom?studyId=${row.StudyId}&isFromCRCUpload=1&TokenKey=${token}&type=Study`, - }); - var newWindow = window.open(routeData.href, "_blank"); - this.$emit("setOpenWindow", newWindow); + }) + var newWindow = window.open(routeData.href, '_blank') + this.$emit('setOpenWindow', newWindow) }, // 删除某个检查 handleDeleteStudy(row) { - this.$confirm(this.$t("trials:uploadedDicoms:message:deleteMes"), { - type: "warning", + this.$confirm(this.$t('trials:uploadedDicoms:message:deleteMes'), { + type: 'warning', distinguishCancelAndClose: true, }) .then(() => { - this.studyLoading = true; + this.studyLoading = true deleteStudyList(this.trialId, this.data.Id, [row.StudyId]) .then((res) => { if (res.IsSuccess) { - this.getStudyInfo(); - this.$emit("getList"); + this.getStudyInfo() + this.$emit('getList') this.$message.success( - this.$t("trials:uploadedDicoms:message:deleteSuccessfully") - ); + this.$t('trials:uploadedDicoms:message:deleteSuccessfully') + ) } }) .catch(() => { - this.studyLoading = true; - }); + this.studyLoading = true + }) }) - .catch(() => {}); + .catch(() => {}) }, getBodyPart(bodyPart) { - if (!bodyPart) return ""; - var separator = ","; - if (bodyPart.indexOf("|") > -1) { - separator = "|"; - } else if (bodyPart.indexOf(",") > -1) { - separator = ","; - } else if (bodyPart.indexOf(",") > -1) { - separator = ","; + if (!bodyPart) return '' + var separator = ',' + if (bodyPart.indexOf('|') > -1) { + separator = '|' + } else if (bodyPart.indexOf(',') > -1) { + separator = ',' + } else if (bodyPart.indexOf(',') > -1) { + separator = ',' } - var arr = bodyPart.split(separator); - var newArr = arr.map(i => { - return this.$fd('Bodypart', i.trim(),'Code',this.BodyPart,'Name') + var arr = bodyPart.split(separator) + var newArr = arr.map((i) => { + return this.$fd('Bodypart', i.trim(), 'Code', this.BodyPart, 'Name') }) - return newArr.join(" | "); + return newArr.join(' | ') }, // 获取勾选项 handleSelectionChange(val) { - this.deleteArr = []; + this.deleteArr = [] val.forEach((item) => { - this.deleteArr.push(item.StudyId); - }); + this.deleteArr.push(item.StudyId) + }) }, // 设置已删除行勾选状态 hasDeleted(row) { if (row.IsDeleted) { - return false; + return false } else { - return true; + return true } }, // 设置已删除序列行样式 tableRowClassName({ row, rowIndex }) { if (row.IsDeleted) { - return "delete-row"; + return 'delete-row' } else { - return ""; + return '' } }, }, -}; +}