From af586a11879e203e1edc9471eddfb10436aaea10 Mon Sep 17 00:00:00 2001 From: caiyiling <1321909229@qq.com> Date: Wed, 17 Jul 2024 18:11:00 +0800 Subject: [PATCH] =?UTF-8?q?PCWG=E6=A0=87=E5=87=86=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dicoms/components/PCWG/QuestionForm.vue | 359 +++++++++--------- .../dicoms/components/PCWG/QuestionList.vue | 128 ++++++- .../components/RecistBM/QuestionForm.vue | 11 +- 3 files changed, 319 insertions(+), 179 deletions(-) diff --git a/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionForm.vue b/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionForm.vue index d002ae92..dbcbc734 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionForm.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionForm.vue @@ -484,8 +484,8 @@ export default { const lesionPart = this.getQuestionVal(8) const lesionOrgan = this.getQuestionVal(6) - const lesionState = Number(this.getQuestionVal(7)) - const lesionNum = Number(this.getQuestionVal(11)) + const lesionState = this.getQuestionVal(7) + const lesionNum = this.getQuestionVal(11) this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, saveTypeEnum: this.questionForm.saveTypeEnum, lesionNum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) }, @@ -547,8 +547,8 @@ export default { this.$set(this.questionForm, 'MeasureData', measureData) const lesionPart = this.getQuestionVal(8) const lesionOrgan = this.getQuestionVal(6) - const lesionState = Number(this.getQuestionVal(7)) - const lesionNum = Number(this.getQuestionVal(11)) + const lesionState = this.getQuestionVal(7) + const lesionNum = this.getQuestionVal(11) this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, lesionNum, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) this.toolType = measureData.type @@ -572,10 +572,15 @@ export default { } }, getQuestionVal(questionMark) { - var idx = this.questions.findIndex(i => i.QuestionMark === questionMark) + const idx = this.questions.findIndex(i => i.QuestionMark === questionMark) if (idx > -1) { - var questionId = this.questions[idx].Id - return this.questionForm[questionId] + const questionId = this.questions[idx].Id + const answer = this.questionForm[questionId] + if (isNaN(parseFloat(answer))) { + return answer + } else { + return parseFloat(answer) + } } else { return '' } @@ -619,78 +624,79 @@ export default { // 生成Blob对象(文件对象) return new Blob([bytesCode], { type: imgtype }) }, - handleSave() { - this.$refs.measurementForm.validate(async valid => { - if (!valid) return - var lesionState = this.getQuestionVal(7) - var measureData = this.questionForm.MeasureData - // 非基线 - if (!this.isBaseLineTask) { - // 新病灶 2 - // 病灶状态为“存在”的新病灶,请使用箭头工具添加标记2 - if (this.lesionType === 2 && lesionState === 2) { - if (!(measureData && measureData.type === 'ArrowAnnotate')) { - this.$confirm(this.$t('trials:readingPGWC:warnning:msg2'), { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - loading.close() - return - } - } - // 既往新病灶 3 - // 病灶状态为“存在”的既往新病灶,请使用箭头工具添加标记2 - if (this.lesionType === 3 && lesionState === 2) { - if (!(measureData && measureData.type === 'ArrowAnnotate')) { - this.$confirm(this.$t('trials:readingPGWC:warnning:msg3'), { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - loading.close() - return - } - } - // 病灶状态为“良性”的既往新病灶,请使用箭头工具添加标记3 - if (this.lesionType === 3 && lesionState === 3) { - if (!(measureData && measureData.type === 'ArrowAnnotate')) { - this.$confirm(this.$t('trials:readingPGWC:warnning:msg4'), { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - loading.close() - return - } - } - // 病灶状态为“消失”的既往新病灶,请使用箭头工具添加标记1 - if (this.lesionType === 3 && lesionState === 1) { - if (!(measureData && measureData.type === 'ArrowAnnotate')) { - this.$confirm(this.$t('trials:readingPGWC:warnning:msg5'), { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - loading.close() - return - } - } - // 病灶状态为“不可评估”的既往新病灶,不需要添加标记4 - if (this.lesionType === 3 && lesionState === 4) { - if (measureData) { - this.$confirm(this.$t('trials:readingPGWC:warnning:msg6'), { - type: 'warning', - showCancelButton: false, - callback: action => {} - }) - loading.close() - return - } + async handleSave() { + const valid = await this.$refs.measurementForm.validate() + if (!valid) return + var lesionState = this.getQuestionVal(7) + var measureData = this.questionForm.MeasureData + // 非基线 + if (!this.isBaseLineTask) { + // 新病灶 2 + // 病灶状态为“存在”的新病灶,请使用箭头工具添加标记2 + if (this.lesionType === 2 && lesionState === 2) { + if (!(measureData && measureData.type === 'ArrowAnnotate')) { + this.$confirm(this.$t('trials:readingPGWC:warnning:msg2'), { + type: 'warning', + showCancelButton: false, + callback: action => {} + }) + loading.close() + return } } - const loading = this.$loading({ fullscreen: true }) - DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType, isMarked: !!measureData }, async val => { + // 既往新病灶 3 + // 病灶状态为“存在”的既往新病灶,请使用箭头工具添加标记2 + if (this.lesionType === 3 && lesionState === 2) { + if (!(measureData && measureData.type === 'ArrowAnnotate')) { + this.$confirm(this.$t('trials:readingPGWC:warnning:msg3'), { + type: 'warning', + showCancelButton: false, + callback: action => {} + }) + loading.close() + return + } + } + // 病灶状态为“良性”的既往新病灶,请使用箭头工具添加标记3 + if (this.lesionType === 3 && lesionState === 3) { + if (!(measureData && measureData.type === 'ArrowAnnotate')) { + this.$confirm(this.$t('trials:readingPGWC:warnning:msg4'), { + type: 'warning', + showCancelButton: false, + callback: action => {} + }) + loading.close() + return + } + } + // 病灶状态为“消失”的既往新病灶,请使用箭头工具添加标记1 + if (this.lesionType === 3 && lesionState === 1) { + if (!(measureData && measureData.type === 'ArrowAnnotate')) { + this.$confirm(this.$t('trials:readingPGWC:warnning:msg5'), { + type: 'warning', + showCancelButton: false, + callback: action => {} + }) + loading.close() + return + } + } + // 病灶状态为“不可评估”的既往新病灶,不需要添加标记4 + if (this.lesionType === 3 && lesionState === 4) { + if (measureData) { + this.$confirm(this.$t('trials:readingPGWC:warnning:msg6'), { + type: 'warning', + showCancelButton: false, + callback: action => {} + }) + loading.close() + return + } + } + } + const loading = this.$loading({ fullscreen: true }) + DicomEvent.$emit('getScreenshots', { questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, visitTaskId: this.visitTaskId, lesionName: this.lesionMark, lesionType: this.lesionType, isMarked: !!measureData }, async val => { + try { var picturePath = '' if (val && measureData) { var pictureObj = await this.uploadScreenshots(`${new Date().getTime()}`, val) @@ -724,106 +730,115 @@ export default { organInfoId: this.questionForm.OrganInfoId, markTool: measureData ? measureData.type : '' } - submitTableQuestion(params).then(async res => { - try { - this.$message.success(this.$t('common:message:savedSuccessfully')) - this.currentMarkTool = measureData ? measureData.type : '' - this.$set(this.questionForm, 'saveTypeEnum', 2) - this.originalQuestionForm = { ...this.questionForm } - loading.close() - var isLymphLesion = this.getQuestionVal(2) - isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null - var lesionOrgan = this.getQuestionVal(6) - this.$set(this.questionForm, 'RowId', res.Result.RowId) - const lesionPart = this.getQuestionVal(8) - const lesionState = Number(this.getQuestionVal(7)) - const lesionNum = Number(this.getQuestionVal(11)) - this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, saveTypeEnum: this.questionForm.saveTypeEnum, lesionState, lesionNum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) - DicomEvent.$emit('getMeasureData') - this.$emit('close') - DicomEvent.$emit('getReportInfo', true) - DicomEvent.$emit('setMeasuredToolsPassive') - } catch (e) { - console.log(e) - } - }).catch(() => { loading.close() }) - }) - }) - }, - handleDeleteMeasureData() { - this.$confirm(this.$t('trials:reading:warnning:msg47'), { - type: 'warning', - distinguishCancelAndClose: true - }) - .then(async() => { - if (this.questionForm.RowId) { - this.$set(this.questionForm, 'saveTypeEnum', 1) - } else { - this.$set(this.questionForm, 'saveTypeEnum', 0) - } - var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex) - await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark }) - DicomEvent.$emit('getMeasureData') - const lesionPart = this.getQuestionVal(8) - const lesionOrgan = this.getQuestionVal(6) - const lesionState = Number(this.getQuestionVal(7)) - const lesionNum = Number(this.getQuestionVal(11)) + const res = await submitTableQuestion(params) + if (res.IsSuccess) { + this.$message.success(this.$t('common:message:savedSuccessfully')) + this.currentMarkTool = measureData ? measureData.type : '' + this.$set(this.questionForm, 'saveTypeEnum', 2) + this.originalQuestionForm = { ...this.questionForm } - this.$set(this.questionForm, 'MeasureData', '') - let anwsers = null - if (this.answers.measureObj) { - anwsers = Object.assign({ measureObj: '' }, this.questionForm) - } else { - anwsers = Object.assign({}, this.questionForm) - } - this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, lesionNum, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: anwsers }) - DicomEvent.$emit('refreshStudyListMeasureData') - }) - .catch(() => {}) - }, - handleDelete() { - this.$confirm(this.$t('trials:reading:warnning:msg48'), { - type: 'warning', - distinguishCancelAndClose: true - }) - .then(async() => { - if (this.questionForm.RowId) { - const loading = this.$loading({ fullscreen: true }) - var param = { - visitTaskId: this.visitTaskId, - questionId: this.parentQsId, - rowId: this.questionForm.RowId - } - deleteReadingRowAnswer(param) - .then(async res => { - loading.close() - if (res.IsSuccess) { - if (this.questionForm.MeasureData) { - var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex) - await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark }) - } - DicomEvent.$emit('getMeasureData') - this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId }) - DicomEvent.$emit('getReportInfo', true) - this.$message.success(this.$t('common:message:deletedSuccessfully')) - loading.close() - } - }).catch(() => { loading.close() }) - } else { - const loading = this.$loading({ fullscreen: true }) - // 移除新建病灶并关闭窗口 - if (this.questionForm.MeasureData) { - var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex) - await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark }) - } + var isLymphLesion = this.getQuestionVal(2) + isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null + var lesionOrgan = this.getQuestionVal(6) + this.$set(this.questionForm, 'RowId', res.Result.RowId) + const lesionPart = this.getQuestionVal(8) + const lesionState = this.getQuestionVal(7) + const lesionNum = this.getQuestionVal(11) + this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, saveTypeEnum: this.questionForm.saveTypeEnum, lesionState, lesionNum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) DicomEvent.$emit('getMeasureData') - this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId }) - DicomEvent.$emit('refreshStudyListMeasureData') + this.$emit('close') + DicomEvent.$emit('getReportInfo', true) + DicomEvent.$emit('setMeasuredToolsPassive') loading.close() } - }) + } catch (e) { + console.log(e) + loading.close() + } + }) + }, + async handleDeleteMeasureData() { + // 是否确认清除标记? + const confirm = await this.$confirm( + this.$t('trials:reading:warnning:msg47'), + { + type: 'warning', + distinguishCancelAndClose: true + } + ) + if (confirm !== 'confirm') return + + if (this.questionForm.RowId) { + this.$set(this.questionForm, 'saveTypeEnum', 1) + } else { + this.$set(this.questionForm, 'saveTypeEnum', 0) + } + var remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex) + await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark }) + DicomEvent.$emit('getMeasureData') + const lesionPart = this.getQuestionVal(8) + const lesionOrgan = this.getQuestionVal(6) + const lesionState = this.getQuestionVal(7) + const lesionNum = this.getQuestionVal(11) + + this.$set(this.questionForm, 'MeasureData', '') + let anwsers = null + if (this.answers.measureObj) { + anwsers = Object.assign({ measureObj: '' }, this.questionForm) + } else { + anwsers = Object.assign({}, this.questionForm) + } + this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, lesionNum, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: anwsers }) + DicomEvent.$emit('refreshStudyListMeasureData') + }, + async handleDelete() { + // 是否确认删除? + const loading = this.$loading({ fullscreen: true }) + try { + const confirm = await this.$confirm( + this.$t('trials:reading:warnning:msg48'), + { + type: 'warning', + distinguishCancelAndClose: true + } + ) + if (confirm !== 'confirm') return + if (this.questionForm.RowId) { + var param = { + visitTaskId: this.visitTaskId, + questionId: this.parentQsId, + rowId: this.questionForm.RowId + } + const res = await deleteReadingRowAnswer(param) + if (res.IsSuccess) { + if (this.questionForm.MeasureData) { + const remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex) + await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark }) + } + DicomEvent.$emit('getMeasureData') + this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId }) + DicomEvent.$emit('getReportInfo', true) + this.$message.success(this.$t('common:message:deletedSuccessfully')) + } + loading.close() + } else { + // 移除新建病灶并关闭窗口 + if (this.questionForm.MeasureData) { + const remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex) + await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData, questionId: this.parentQsId, rowIndex: this.questionForm.RowIndex, orderMarkName: remark }) + } + + DicomEvent.$emit('getMeasureData') + this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId }) + DicomEvent.$emit('refreshStudyListMeasureData') + loading.close() + } + } catch (e) { + console.log(e) + loading.close() + } }, handleClose() { if (!this.questionForm.RowId) { @@ -866,7 +881,7 @@ export default { this.$set(this.questionForm, stateId, 4) const lesionPart = this.getQuestionVal(8) const lesionOrgan = this.getQuestionVal(6) - const lesionState = !isNaN(parseInt(this.getQuestionVal(7))) ? parseInt(this.getQuestionVal(7)) : '' + const lesionState = this.getQuestionVal(7) this.$emit('resetQuestions', { lesionPart, lesionOrgan, lesionState, saveTypeEnum: this.questionForm.saveTypeEnum, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm }) } } diff --git a/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionList.vue b/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionList.vue index 1ca23a1f..86105c2e 100644 --- a/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionList.vue +++ b/src/views/trials/trials-panel/reading/dicoms/components/PCWG/QuestionList.vue @@ -2,10 +2,20 @@
-

- {{ subjectCode }} - {{ taskBlindName }} -

+
+

+ {{ subjectCode }} + {{ taskBlindName }} +

+
+ + + +
+