diff --git a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue index fe8a227a..8dbf49ec 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/Fusion/Questions.vue @@ -105,10 +105,11 @@ export default { this.resetSuvQuestions() }) FusionEvent.$on('addAnnotation', obj => { - this.$set(obj, 'SaveEnum', 0) + this.$set(obj, 'SaveEnum', 1) this.addAnnotation(obj) }) FusionEvent.$on('removeAnnotation', obj => { + this.$set(obj, 'SaveEnum', 0) this.removeAnnotation(obj) }) FusionEvent.$on('locateAnnotation', obj => { @@ -235,7 +236,12 @@ export default { handleSave() { this.$refs['questions'].validate((valid) => { if (!valid) return - + // 是否有标记未保存 + var existUnSave = this.checkAnnotationStatus(this.questions) + if (existUnSave) { + this.$alert(this.$t('trials:lugano:message:saveWarning1')) + return + } // 肝脏血池SUVmax const liverSUVmax = !isNaN(parseFloat(this.questionForm[this.liverSuvmaxId])) ? parseFloat(this.questionForm[this.liverSuvmaxId]) : 0 // 纵膈血池SUVmax @@ -295,6 +301,18 @@ export default { this.loading = false }) }, + checkAnnotationStatus(obj) { + for (let i = 0; i < obj.length; i++) { + if (obj[i].SaveEnum === 1) { + return true + } + if (obj[i].Childrens && obj[i].Childrens.length > 0) { + if (this.checkAnnotationStatus(obj[i].Childrens)) { + return true + } + } + } + }, addAnnotation(obj) { const { Id, QuestionType } = obj this.currentQsId = Id @@ -443,19 +461,19 @@ export default { } }, setQuestionStatus(obj, questionType) { - console.log(obj, questionType) for (let i = 0; i < obj.length; i++) { if (obj[i].QuestionType === questionType) { this.$set(obj[i], 'SaveEnum', 1) - break + return true } if (obj[i].Childrens && obj[i].Childrens.length > 0) { - this.setQuestionStatus(obj[i].Childrens, questionType) + if (this.setQuestionStatus(obj[i].Childrens, questionType)) { + return true + } } } }, setOutsideMeasuredData(measurement) { - console.log('setOutsideMeasuredData: ', measurement) if ((measurement.data.remark === 'Liver' && this.liverIsInsideVolume === false) || (measurement.data.remark === 'Mediastinum' && this.lungIsInsideVolume === false)) { return } diff --git a/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue b/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue index 6705149f..a3948634 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue @@ -119,6 +119,7 @@ export default { this.addAnnotation(obj) }) DicomEvent.$on('removeAnnotation', obj => { + this.$set(obj, 'SaveEnum', 0) this.removeAnnotation(obj) }) DicomEvent.$on('saveAnnotation', obj => { @@ -251,8 +252,15 @@ export default { handleSave() { this.$refs['questions'].validate(async(valid) => { if (!valid) return + // lugano标准校验脾脏状态是否符合要求 if (this.criterionType === 2 && this.groupClassify === 3) { + // 是否有标记未保存 + var existUnSave = this.checkAnnotationStatus(this.questions) + if (existUnSave) { + this.$alert(this.$t('trials:lugano:message:saveWarning')) + return + } var currentSpleenStatus = this.questionForm[this.spleenStatusId] var currentSpleenLength = this.questionForm[this.spleenLengthId] currentSpleenStatus = isNaN(parseInt(currentSpleenStatus)) ? null : parseInt(currentSpleenStatus) @@ -337,6 +345,18 @@ export default { this.loading = false }) }, + checkAnnotationStatus(obj) { + for (let i = 0; i < obj.length; i++) { + if (obj[i].SaveEnum === 1) { + return true + } + if (obj[i].Childrens && obj[i].Childrens.length > 0) { + if (this.checkAnnotationStatus(obj[i].Childrens)) { + return true + } + } + } + }, setSpleenCommentDisplay() { if (this.spleenCommentsId && this.spleenStatusId) { for (let i = 0; i < this.questions[0].Childrens.length; i++) { @@ -573,10 +593,12 @@ export default { for (let i = 0; i < obj.length; i++) { if (obj[i].QuestionType === questionType) { this.$set(obj[i], 'SaveEnum', 1) - break + return true } if (obj[i].Childrens && obj[i].Childrens.length > 0) { - this.setQuestionStatus(obj[i].Childrens, questionType) + if (this.setQuestionStatus(obj[i].Childrens, questionType)) { + return true + } } } },