irc_web/.svn/pristine/1a/1a512bc36e2a86b7977cd96e32e...

1290 lines
53 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<el-form
v-if="isRender"
ref="measurementForm"
v-loading="loading"
:model="questionForm"
size="mini"
class="measurement-form"
>
<div class="base-dialog-body">
<div style="display: flex;justify-content: space-between;">
<h3 v-if="questionName" style="color: #ddd;padding: 5px 0px;margin: 0;">
<!-- {{ `${questionName} (${orderMark}${String(rowIndex).padStart(2, '0')})` }} -->
{{ lesionName }}
</h3>
<!-- 关闭 -->
<div>
<i class="el-icon-circle-close" style="font-size: 25px;cursor: pointer;" @click="handleClose" />
</div>
</div>
<el-form-item
label="病灶类型"
prop="LesionType"
:rules="[
{ required:true,message: '请注明', trigger: ['blur']},
]"
>
<!-- 下拉框 -->
<el-select
v-model="questionForm.LesionType"
filterable
:disabled="!isCurrentTask || readingTaskState>=2 || !isBaseLineTask"
@change="((val)=>{lesionTypeChange(val)})"
>
<el-option
v-for="item of $d.LesionType"
v-show="!(isBaseLineTask && item.value === 2)"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</el-select>
</el-form-item>
<!-- :rules="[
{ required: (qs.IsRequired === 0 || (qs.IsRequired ===1 && qs.RelevanceId && (questionForm[qs.RelevanceId] === qs.RelevanceValue))) && qs.Type!=='group' && qs.Type!=='summary' && qs.QuestionMark !== 4 && qs.QuestionMark !== 6 && qs.QuestionMark !== 2,
message: '请注明', trigger: ['blur']},
]" -->
<el-form-item
v-for="qs in questions"
v-show="qs.ShowQuestion!==2"
:key="qs.Id"
:label="`${qs.QuestionName}`"
:prop="qs.Id"
:rules="[
{ required: (qs.IsRequired === 0 || (qs.IsRequired ===1 && qs.RelevanceId && (questionForm[qs.RelevanceId] === qs.RelevanceValue)) || (qs.QuestionMark === 6 && questionForm.IsCanEditPosition === true) || (questionForm.IsCanEditPosition && qs.QuestionMark === 10)) && qs.Type!=='group' && qs.Type!=='summary',
message: '请注明', trigger: ['blur','change']},
]"
>
<!-- {{ isCurrentTaskAdd }}
{{ questionForm.IsCanEditPosition }} -->
<!-- 输入框 -->
<template v-if="qs.Type==='input' || qs.Type==='number'">
<!-- {{ ((qs.QuestionMark === 6 && isCurrentTaskAdd === 'False') || (qs.QuestionMark === 6 && isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition)) }} -->
<el-input
v-if="qs.Type==='input' || qs.Type==='number'"
v-model="questionForm[qs.Id]"
:disabled="!isCurrentTask || readingTaskState>=2 || qs.QuestionMark === 0 || qs.QuestionMark === 1 || qs.QuestionMark === 2 || qs.QuestionMark === 5 || (qs.QuestionMark === 6 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answers.SplitOrMergeLesionName))|| (qs.QuestionMark === 8 && (isCurrentTaskAdd === 'False' || !!answers.SplitOrMergeLesionName) && lesionType !== 2) || (qs.QuestionMark === 10 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answers.SplitOrMergeLesionName))"
>
<template v-if="(qs.QuestionMark===0 || qs.QuestionMark===1) && qs.Unit" slot="append">
{{ $fd('ValueUnit', parseInt(qs.Unit)) }}
</template>
</el-input>
</template>
<!-- 多行文本输入框 -->
<el-input
v-if="qs.Type==='textarea'"
v-model="questionForm[qs.Id]"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:disabled="!isCurrentTask || readingTaskState>=2"
/>
<!-- 下拉框 -->
<!-- :disabled="!isCurrentTask || readingTaskState>=2 || (!isBaseLineTask && qs.QuestionMark === 5 && isCurrentTaskAdd === 'False') || qs.QuestionMark === 2 || (qs.QuestionMark === 8 && !isBaseLineTask && isCurrentTaskAdd === 'False')" -->
<el-select
v-if="qs.Type==='select'"
v-model="questionForm[qs.Id]"
filterable
:disabled="!isCurrentTask || readingTaskState>=2 || qs.QuestionMark === 0 || qs.QuestionMark === 1 || qs.QuestionMark === 2 || qs.QuestionMark === 5 || (qs.QuestionMark === 6 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answers.SplitOrMergeLesionName))|| (qs.QuestionMark === 8 && (isCurrentTaskAdd === 'False'|| !!answers.SplitOrMergeLesionName) && lesionType !== 2) || (qs.QuestionMark === 10 && (isCurrentTaskAdd === 'False' || (isCurrentTaskAdd === 'True' && !questionForm.IsCanEditPosition) || !!answers.SplitOrMergeLesionName))"
@change="((val)=>{formItemChange(val, qs)})"
>
<template v-if="qs.TableQuestionType === 1">
<el-option
v-for="item in organList"
:key="item.Id"
:label="item[qs.DataTableColumn]"
:value="item[qs.DataTableColumn]"
/>
</template>
<template v-else-if="qs.DictionaryCode && qs.QuestionMark === 7 && isBaseLineTask">
<el-option
v-for="item of $d[qs.DictionaryCode]"
v-show="(lesionType === 0 && item.value ===0) || (lesionType === 1 && (item.value ===0))"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</template>
<template v-else-if="qs.DictionaryCode && qs.QuestionMark === 7 && !isBaseLineTask">
<template v-if="isCurrentTaskAdd=== 'True' && lesionType === 2">
<el-option
v-for="item of $d[qs.DictionaryCode]"
v-show="item.value === 0 || item.value === 1"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</template>
<el-option
v-for="item of $d[qs.DictionaryCode]"
v-else
:key="item.id"
:value="item.value"
:label="item.label"
/>
</template>
<template v-else-if="qs.DictionaryCode && qs.QuestionMark !== 7">
<el-option
v-for="item of $d[qs.DictionaryCode]"
:key="item.id"
:value="item.value"
:label="item.label"
/>
</template>
<template v-else>
<el-option
v-for="val in qs.TypeValue.split('|')"
:key="val"
:label="val"
:value="val"
/>
</template>
</el-select>
<!-- 单选 -->
<el-radio-group
v-if="qs.Type==='radio'"
v-model="questionForm[qs.id]"
:disabled="!isCurrentTask || readingTaskState>=2"
>
<el-radio
v-for="val in qs.options.split('|')"
:key="val"
:label="val"
>
{{ val }}
</el-radio>
</el-radio-group>
</el-form-item>
</div>
<div
v-if="isCurrentTask && readingTaskState<2"
class="base-dialog-footer"
style="text-align:right;margin-top:10px;"
>
<el-form-item>
<!-- 清除标记 -->
<el-button
v-if="questionForm.MeasureData"
size="mini"
@click="handleDeleteMeasureData"
>
清除标记
</el-button>
<!-- 删除 -->
<el-button
v-if="isCurrentTaskAdd !== 'False'"
size="mini"
@click="handleDelete"
>
删除
</el-button>
<!-- 保存 -->
<el-button
size="mini"
@click="handleSave"
>
{{ $t('common:button:save') }}
</el-button>
</el-form-item>
</div>
</el-form>
</template>
<script>
import { getTrialOrganList, submitTableQuestion, deleteReadingRowAnswer } from '@/api/trials'
import DicomEvent from './DicomEvent'
import store from '@/store'
export default {
name: 'MeasurementForm',
props: {
questions: {
type: Array,
default() { return [] }
},
answers: {
type: Object,
default() { return {} }
},
lesionType: {
type: Number,
required: true
},
visitTaskId: {
type: String,
required: true
},
parentQsId: {
type: String,
required: true
},
isCurrentTask: {
type: Boolean,
required: true
},
readingTaskState: {
type: Number,
required: true
},
isBaseLineTask: {
type: Boolean,
required: true
},
orderMark: {
type: String,
default: ''
},
questionName: {
type: String,
required: true
},
rowIndex: {
type: String,
required: true
},
tableQuestions: {
type: Array,
default() { return [] }
}
},
data() {
return {
questionForm: {},
loading: false,
trialId: '',
organList: [],
lesionNameId: '',
lesionOrganId: '',
lesionLocId: '',
originalQuestionForm: {},
isRender: false,
toolType: '',
lesionName: '',
isCurrentTaskAdd: 'False',
splitOrMergeLesionName: '',
lesionMark: ''
}
},
mounted() {
this.trialId = this.$route.query.trialId
this.initForm()
},
methods: {
async initForm() {
const loading = this.$loading({ fullscreen: true })
this.questions.forEach(item => {
var val = this.answers[item.Id]
if (item.DictionaryCode) {
val = this.answers[item.Id] ? Number(this.answers[item.Id]) : ''
}
if (this.isBaseLineTask && item.QuestionMark === 7 && this.lesionType === 0) {
val = 0
}
if (this.isBaseLineTask && item.QuestionMark === 7 && this.lesionType === 1) {
val = 0
}
this.$set(this.questionForm, item.Id, val)
})
this.$set(this.questionForm, 'MeasureData', this.answers.MeasureData ? JSON.parse(this.answers.MeasureData) : '')
this.$set(this.questionForm, 'RowIndex', this.answers.RowIndex ? this.answers.RowIndex : '')
this.$set(this.questionForm, 'isSave', this.answers.isSave)
this.$set(this.questionForm, 'RowId', this.answers.RowId ? this.answers.RowId : '')
this.$set(this.questionForm, 'IsCanEditPosition', this.answers.IsCanEditPosition === 'True')
this.$set(this.questionForm, 'IsDicomReading', this.answers.IsDicomReading !== 'False')
this.toolType = this.questionForm.MeasureData ? this.questionForm.MeasureData.type : ''
if (!this.questionForm.LesionType) {
this.$set(this.questionForm, 'LesionType', this.lesionType)
}
this.lesionNameId = this.getQuestionId(4)
this.lesionOrganId = this.getQuestionId(5)
this.lesionLocId = this.getQuestionId(6)
this.originalQuestionForm = { ...this.questionForm }
// this.lesionType === 0 && this.questionForm.MeasureData
if (this.answers.measureObj) {
await this.setMeasureData(this.answers.measureObj)
} else {
if (this.questionForm.MeasureData) {
// 十字线工具 且是靶病灶 器官只能是淋巴结类型
if (this.questionForm.MeasureData.type === 'Bidirectional') {
this.organList = []
await this.getOrganInfoList(1)
} else if (this.questionForm.MeasureData.type === 'Length') {
// 直径测量工具 且是靶病灶 器官只能是非淋巴结类型
this.organList = []
await this.getOrganInfoList(0)
} else {
this.organList = []
await this.getOrganInfoList()
}
} else {
this.organList = []
await this.getOrganInfoList()
}
}
this.lesionName = this.getLesionInfo(this.orderMark, this.rowIndex)
this.isCurrentTaskAdd = this.answers.IsCurrentTaskAdd ? this.answers.IsCurrentTaskAdd : 'True'
this.lesionMark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
this.isRender = true
loading.close()
},
getLesionName(orderMark, rowIndex) {
var lessionName = ''
var rowIndexArr = rowIndex.split('.')
var x = parseInt(rowIndexArr[0])
var y = parseInt(rowIndexArr[1])
if (y > 0) {
y = String.fromCharCode(parseInt(rowIndexArr[1]) - 1 + 65 + 32)
lessionName = `${orderMark}${String(x).padStart(2, '0')}${y}`
} else {
lessionName = `${orderMark}${String(x).padStart(2, '0')}`
}
return lessionName
},
getLesionInfo(orderMark, rowIndex) {
var arr = []
var lessionName = ''
var rowIndexArr = rowIndex.split('.')
var x = parseInt(rowIndexArr[0])
var y = parseInt(rowIndexArr[1])
if (y > 0) {
y = String.fromCharCode(parseInt(rowIndexArr[1]) - 1 + 65 + 32)
lessionName = `${orderMark}${String(x).padStart(2, '0')}${y}`
arr.push(lessionName)
} else {
lessionName = `${orderMark}${String(x).padStart(2, '0')}`
arr.push(lessionName)
}
if (this.answers.SplitOrMergeLesionName && parseInt(this.answers.SplitOrMergeType) === 0) {
arr.push(`(Split from ${this.answers.SplitOrMergeLesionName})`)
}
return arr.join(' ')
},
getQuestionId(questionMark) {
var idx = this.questions.findIndex(i => i.QuestionMark === questionMark)
if (idx > -1) {
return this.questions[idx].Id
} else {
return ''
}
},
handleLocation() {
DicomEvent.$emit('imageLocation', this.questionForm)
},
getOrganInfoList(isLymphNodes = null) {
return new Promise(resolve => {
var param = {
trialId: this.trialId,
visitTaskId: this.visitTaskId,
lesionType: this.lesionType,
isEnable: true
}
if (isLymphNodes !== undefined && isLymphNodes !== null) {
param.isLymphNodes = isLymphNodes
}
getTrialOrganList(param).then(res => {
this.organList = res.Result
resolve()
})
})
},
async lesionTypeChange(v) {
this.$emit('determineExistsUnsavedLession', async val => {
if (val) {
if (this.questionForm.MeasureData && this.questionForm.MeasureData.type === 'ArrowAnnotate' && v === 0) {
this.$confirm('不可测量的病灶不允许设置为靶病灶!', {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {})
.catch(() => {})
this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType)
return
}
// 判断是否超过该病灶类型个数的最大值
var idx = this.tableQuestions.findIndex(item => item.LesionType === v)
if (idx > -1 && !!this.tableQuestions[idx].MaxQuestionCount && this.tableQuestions[idx].MaxQuestionCount <= this.tableQuestions[idx].TableQuestions.Answers.length) {
this.$confirm(`${this.tableQuestions[idx].QuestionName}个数最多不能超过${this.tableQuestions[idx].MaxQuestionCount}个`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType)
return
}
var arr = []
this.questionForm[this.getQuestionId(8)] = ''
this.questionForm[this.getQuestionId(5)] = ''
this.questionForm[this.getQuestionId(4)] = ''
this.questionForm[this.getQuestionId(6)] = ''
this.questionForm[this.getQuestionId(2)] = ''
this.questions.forEach(item => {
item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : ''
arr.push(item)
})
DicomEvent.$emit('imageLocation', this.questionForm)
var type = null
if (this.questionForm.isSave !== false) {
await this.deleteLesionInfo()
type = 0
} else {
type = 1
}
DicomEvent.$emit('changeLesionType', { questionForm: arr, oldLesionType: this.lesionType, newLesionType: v, rowIndex: this.questionForm.RowIndex, measureData: this.questionForm.MeasureData, type })
} else {
this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType)
}
})
},
deleteLesionInfo() {
return new Promise((resolve, reject) => {
var param = {
visitTaskId: this.visitTaskId,
questionId: this.parentQsId,
rowIndex: this.questionForm.RowIndex
}
deleteReadingRowAnswer(param)
.then(async res => {
if (res.IsSuccess) {
// await store.dispatch('reading/getMeasuredData', this.visitTaskId)
// this.$emit('refreshReadingQuestionAndAnswer', 0)
// var measureData = { ...this.questionForm.MeasureData }
// if (measureData) {
// Store.$emit('resetMeasuredData', measureData.instanceId)
// }
// Store.$emit('refreshVisitList', this.visitTaskId)
DicomEvent.$emit('getReportInfo', true)
}
resolve()
}).catch(() => {
reject()
})
})
},
formItemChange(v, question) {
// this.$emit('determineExistsUnsavedLession', val => {
// if (val) {
// } else {
// this.$set(this.questionForm, question.Id, this.originalQuestionForm[question.Id])
// }
// })
if (question.QuestionMark === 8 && question.RelationQuestions.length > 0) {
// 当选择部位时,联动器官、位置、是否淋巴结问题答案
var index = this.organList.findIndex(item => item[question.DataTableColumn] === v)
if (index > -1) {
var selected = this.organList[index]
question.RelationQuestions.map(qs => {
var val = selected[qs.DataTableColumn]
// if (typeof val === 'boolean') {
// // val = this.$fd('YesOrNo', val)
// }
this.$set(this.questionForm, qs.Id, val)
})
this.$set(this.questionForm, 'IsCanEditPosition', selected['IsCanEditPosition'])
} else {
question.RelationQuestions.map(qs => {
this.$set(this.questionForm, qs.Id, '')
})
}
}
if (question.Id === this.lesionOrganId || question.Id === this.lesionLocId) {
// 设置病灶名称
this.$set(this.questionForm, this.lesionNameId, `${this.questionForm[this.lesionOrganId]} ${this.questionForm[this.lesionLocId]}`)
}
this.$set(this.questionForm, 'isSave', false)
var isLymphLesion = this.getQuestionVal(2)
isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null
const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6)
const lesionLength = Number(this.getQuestionVal(0))
const lesionShort = Number(this.getQuestionVal(1))
const lesionState = Number(this.getQuestionVal(7))
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, lesionShort, lesionState, isLesionSaved: false, lesionLength, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
},
setMeasureData(measureData) {
return new Promise(resolve => {
if (measureData) {
// 获取长径(0)
// const loading = this.$loading({ fullscreen: true })
if (measureData.type === 'Length' || measureData.type === 'Bidirectional') {
var lengthObj = this.questions.find(i => i.QuestionMark === 0)
var length = ''
if (measureData.type === 'Length') {
length = measureData.data.length ? measureData.data.length.toFixed(2) : ''
} else if (measureData.type === 'Bidirectional') {
length = measureData.data.longestDiameter
}
this.$set(this.questionForm, lengthObj.Id, length)
// 获取短径(1)
var shortObj = this.questions.find(i => i.QuestionMark === 1)
var short = ''
if (measureData.type === 'Bidirectional') {
short = measureData.data.shortestDiameter
}
this.$set(this.questionForm, shortObj.Id, short)
}
// if (this.toolType !== measureData.type) {
// 获取器官问题
// var organ = this.getQuestionVal(5)
// 十字线工具 器官只能是淋巴结类型
if (measureData.type === 'Bidirectional') {
this.organList = []
this.getOrganInfoList(1)
} else if (measureData.type === 'Length') {
// 直径测量工具 且是靶病灶 器官只能是非淋巴结类型
this.organList = []
this.getOrganInfoList(0)
} else {
this.organList = []
this.getOrganInfoList()
}
// if (this.toolType) {
// this.questionForm[this.getQuestionId(8)] = ''
// this.questionForm[this.getQuestionId(5)] = ''
// this.questionForm[this.getQuestionId(6)] = ''
// this.questionForm[this.getQuestionId(2)] = ''
// }
var data = {}
if (measureData.isDicomReading === false) {
this.$set(this.questionForm, 'IsDicomReading', false)
data = {
Id: '',
IsDicomReading: false,
StudyId: measureData.studyId,
InstanceId: measureData.instanceId,
SeriesId: measureData.seriesId,
MeasureData: measureData,
QuestionId: this.parentQsId,
RowIndex: this.questionForm.RowIndex,
RowId: this.questionForm.RowId,
VisitTaskId: this.visitTaskId
}
} else {
this.$set(this.questionForm, 'IsDicomReading', true)
measureData.data.remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
data = {
Id: '',
IsDicomReading: true,
StudyId: measureData.studyId,
InstanceId: measureData.instanceId,
SeriesId: measureData.seriesId,
MeasureData: measureData,
QuestionId: this.parentQsId,
RowIndex: this.questionForm.RowIndex,
RowId: this.questionForm.RowId,
VisitTaskId: this.visitTaskId
}
}
// Store.$emit('addTemporaryMeasuredData', data)
store.dispatch('reading/addMeasuredData', { visitTaskId: this.visitTaskId, data: data })
DicomEvent.$emit('getMeasureData')
// Store.$emit('updateImage', measureData.instanceId)
this.$set(this.questionForm, 'isSave', false)
this.$set(this.questionForm, 'MeasureData', measureData)
}
var isLymphLesion = this.getQuestionVal(2)
isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null
const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6)
const lesionLength = Number(this.getQuestionVal(0))
const lesionShort = Number(this.getQuestionVal(1))
const lesionState = Number(this.getQuestionVal(7))
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, lesionShort, lesionLength, lesionState, isLesionSaved: false, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
this.toolType = measureData.type
resolve()
})
// loading.close()
// this.handleSave()
},
returnFloat(num) {
if (num) return
var value = Math.round(parseFloat(num) * 100) / 100
var s = value.toString().split('.')
if (s.length === 1) {
value = value.toString() + '.00'
return value
}
if (s.length > 1) {
if (s[1].length < 2) {
value = value.toString() + '0'
}
return value
}
},
getQuestionVal(questionMark) {
var idx = this.questions.findIndex(i => i.QuestionMark === questionMark)
if (idx > -1) {
var questionId = this.questions[idx].Id
return this.questionForm[questionId]
} else {
return ''
}
},
handleSave() {
this.$refs.measurementForm.validate(valid => {
if (!valid) return
const loading = this.$loading({ fullscreen: true })
var measureData = this.questionForm.MeasureData
var lesionState = this.getQuestionVal(7)
var lesionLength = Number(this.getQuestionVal(0))
var lesionShort = Number(this.getQuestionVal(1))
var lymphNodes = this.getQuestionVal(2)
lymphNodes = (lymphNodes !== null && lymphNodes !== undefined) ? parseInt(lymphNodes) : null
if (this.isBaseLineTask) {
// 基线
// 靶病灶且状态为存在0
if (this.lesionType === 0 && lesionState === 0) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具,短径大于等于15mm
if (!(measureData && measureData.type === 'Bidirectional' && !this.isBaseLineTask && lesionShort >= 15)) {
this.$confirm(`评估状态为存在的淋巴结靶病灶需使用长短径测量工具添加标记且短径须大于等于15mm`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结靶病灶 直径测量工具 长径须大于等于10mm且不小于2倍层厚
if (!(measureData && measureData.type === 'Length' && lesionLength >= 10 && lesionLength >= 2 * measureData.thick)) {
this.$confirm(`评估状态为存在的非淋巴结靶病灶需使用长短径测量工具或直径测量工具添加标记长径须大于等于10mm且不小于2倍层厚`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 非靶病灶且状态为存在0
if (this.lesionType === 1 && lesionState === 0) {
if (lymphNodes === 1) {
// 淋巴结非靶病灶 必须使用长短径测量工具或箭头工具
if (!(measureData && (measureData.type === 'Bidirectional' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为存在的淋巴结非靶病灶需使用长短径测量工具或箭头工具添加标记`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 直径测量工具或箭头工具
if (!(measureData && (measureData.type === 'Length' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为存在的非淋巴结靶病灶需使用直径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
} else {
// 非基线
// 靶病灶且状态为存在0
if (this.lesionType === 0 && lesionState === 0) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具
if (!(measureData && measureData.type === 'Bidirectional')) {
this.$confirm(`评估状态为存在的淋巴结靶病灶需使用长短径测量工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结靶病灶 直径测量工具,长径大于0mm
if (!(measureData && measureData.type === 'Length')) {
this.$confirm(`评估状态为存在的非淋巴结靶病灶需使用直径测量工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 靶病灶且状态为太小1
if (this.lesionType === 0 && lesionState === 1) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用箭头工具短径记录为5mm
if (!(measureData && (measureData.type === 'ArrowAnnotate' || measureData.type === 'Bidirectional'))) {
this.$confirm(`评估状态为太小的淋巴结靶病灶需使用长短径工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
} else if (measureData && measureData.type === 'ArrowAnnotate') {
const shortId = this.getQuestionId(1)
this.$set(this.questionForm, shortId, 5)
lesionShort = 5
} else if (measureData && measureData.type === 'Bidirectional' && lesionShort > 5) {
this.$confirm(`评估状态为太小的淋巴结靶病灶短径需小于或等于5mm`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结靶病灶 直径工具长径小于5mm/箭头工具长径记录为5mm
if (!(measureData && (measureData.type === 'ArrowAnnotate' || measureData.type === 'Length'))) {
this.$confirm(`评估状态为太小的非淋巴结靶病灶需使用直径工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
} else if (measureData && measureData.type === 'ArrowAnnotate') {
const lengthId = this.getQuestionId(0)
this.$set(this.questionForm, lengthId, 5)
lesionLength = 5
} else if (measureData && measureData.type === 'Length' && lesionLength > 5) {
this.$confirm(`评估状态为太小的淋巴结靶病灶长径需小于或等于5mm`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 靶病灶且状态为无法评估2
if (this.lesionType === 0 && lesionState === 2) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 不需要添加标记
if (measureData) {
this.$confirm(`评估状态为无法评估的淋巴结靶病灶不需要添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结靶病灶 不需要添加标记
if (measureData) {
this.$confirm(`状态为无法评估的非淋巴结靶病灶不需要添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 靶病灶且状态为消失3
if (this.lesionType === 0 && lesionState === 3) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 使用箭头工具
if (!(measureData && (measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为消失的淋巴结靶病灶需使用箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结靶病灶 箭头工具
if (!(measureData && measureData.type === 'ArrowAnnotate')) {
this.$confirm(`评估状态为消失的非淋巴结靶病灶只能使用箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
// if (!(measureData && measureData.type === 'Bidirectional' && lesionLength > 0)) {
// this.$confirm(`该病灶长径大于0mm,不允许评估为消失!`, {
// type: 'warning',
// showCancelButton: false,
// callback: action => {}
// })
// loading.close()
// return
// }
}
}
// 非靶病灶且状态为存在0
if (this.lesionType === 1 && lesionState === 0) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Bidirectional' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为存在的淋巴结非靶病灶需使用长短径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 直径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Length' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为存在的非淋巴结非靶病灶需使用直径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 非靶病灶且状态为显著增大1
if (this.lesionType === 1 && lesionState === 1) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Bidirectional' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为显著增大的淋巴结非靶病灶需使用长短径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 直径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Length' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为显著增大的非淋巴结非靶病灶需使用直径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 非靶病灶且状态为无法评估2
if (this.lesionType === 1 && lesionState === 2) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 无标记
if (measureData) {
this.$confirm(`评估状态为无法评估的淋巴结非靶病灶不需要添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 无标记
if (measureData) {
this.$confirm(`评估状态为无法评估的非淋巴结非靶病灶不需要添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 非靶病灶且状态为消失3
if (this.lesionType === 1 && lesionState === 3) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具、箭头工具
if (!(measureData && (measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为消失的淋巴结非靶病灶需使用箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 箭头工具
if (!(measureData && (measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为消失的非淋巴结非靶病灶需使用箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 新病灶且状态为存在0
if (this.lesionType === 2 && lesionState === 0) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Bidirectional' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为存在的淋巴结新病灶需使用长短径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 直径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Length' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为存在的非淋巴结新病灶需使用直径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 新病灶且状态为疑似1
if (this.lesionType === 2 && lesionState === 1) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Bidirectional' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为疑似的淋巴结新病灶需使用长短径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 直径测量工具、箭头工具
if (!(measureData && (measureData.type === 'Length' || measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为疑似的非淋巴结新病灶需使用直径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 新病灶且状态为无法评估2
if (this.lesionType === 2 && lesionState === 2) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具、箭头工具
if (measureData) {
this.$confirm(`评估状态为无法评估的淋巴结新病灶不需要添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 非淋巴结非靶病灶 直径测量工具、箭头工具
if (measureData) {
this.$confirm(`评估状态为无法评估的非淋巴结新病灶不需要添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
}
}
// 新病灶且状态为消失3
if (this.lesionType === 2 && lesionState === 3) {
if (lymphNodes === 1) {
// 淋巴结靶病灶 必须使用长短径测量工具、箭头工具
if (!(measureData && (measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为消失的淋巴结新病灶需使用长短径测量工具或箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
} else {
// 箭头工具
if (!(measureData && (measureData.type === 'ArrowAnnotate'))) {
this.$confirm(`评估状态为消失的非淋巴结新病灶需使用箭头工具添加标记!`, {
type: 'warning',
showCancelButton: false,
callback: action => {}
})
loading.close()
return
}
// if (!(measureData && measureData.type === 'Bidirectional' && lesionLength > 0)) {
// this.$confirm(`该病灶长径大于0mm,不允许评估为消失!`, {
// type: 'warning',
// showCancelButton: false,
// callback: action => {}
// })
// loading.close()
// return
// }
}
}
}
// 靶病灶状态为0存在一定存在长径或者长短径长径、十字线
// 普通靶病灶长径大于10mm且不小于2倍层厚基线校验
// 淋巴结靶病灶短径大于15mm且不小于2倍层厚基线校验
var answers = []
var reg = new RegExp(/^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/)
for (const k in this.questionForm) {
// if (k === 'isSave' || k === 'RowIndex' || k === 'RowId' || k === 'InstanceId' || k === 'SeriesId' || k === 'MeasureData' || k === 'IsCurrentTaskAdd' || k === 'LesionType' || k === 'SplitOrMergeLesionName' || k === 'SplitOrMergeType') continue
if (reg.test(k)) {
if (answers.findIndex(i => i.tableQuestionId === k) === -1) {
answers.push({ tableQuestionId: k, answer: this.questionForm[k] })
}
}
}
// measureData.data.remark = `${this.orderMark}${String(this.questionForm.RowIndex).padStart(2, '0')}`
var params = {
questionId: this.parentQsId,
rowIndex: this.answers.RowIndex,
visitTaskId: this.visitTaskId,
trialId: this.trialId,
measureData: measureData ? JSON.stringify(measureData) : '',
answerList: answers,
isCanEditPosition: this.questionForm.IsCanEditPosition,
studyId: measureData ? this.questionForm.MeasureData.studyId : '',
seriesId: measureData ? this.questionForm.MeasureData.seriesId : '',
instanceId: measureData ? this.questionForm.MeasureData.instanceId : ''
}
if (this.questionForm.IsDicomReading === false) {
params.isDicomReading = false
}
submitTableQuestion(params).then(async res => {
this.$message.success('保存成功!')
this.$set(this.questionForm, 'isSave', true)
this.originalQuestionForm = { ...this.questionForm }
loading.close()
var isLymphLesion = this.getQuestionVal(2)
isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null
var lesionOrgan = this.getQuestionVal(6)
if (!this.questionForm.RowId) {
this.$set(this.questionForm, 'RowId', res.Result.RowId)
}
const lesionPart = this.getQuestionVal(8)
const lesionState = Number(this.getQuestionVal(7))
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, lesionShort, isLesionSaved: true, lesionLength, lesionState, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
// this.$emit('getReadingQuestionAndAnswer')
this.$emit('close')
DicomEvent.$emit('getReportInfo', true)
}).catch(() => { loading.close() })
})
},
handleDeleteMeasureData() {
// this.$emit('determineExistsUnsavedLession', val => {
// if (val) {
// }
// })
this.$confirm('是否确认清除标记?', {
type: 'warning',
distinguishCancelAndClose: true
})
.then(async() => {
// 重置长短径
var lengId = this.getQuestionId(0)
this.$set(this.questionForm, lengId, '')
var shortId = this.getQuestionId(1)
this.$set(this.questionForm, shortId, '')
this.$set(this.questionForm, 'isSave', false)
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData })
DicomEvent.$emit('getMeasureData')
// Store.$emit('updateImage', this.questionForm.MeasureData.instanceId)
var isLymphLesion = this.getQuestionVal(2)
isLymphLesion = isLymphLesion ? parseInt(isLymphLesion) : null
const lesionPart = this.getQuestionVal(8)
const lesionOrgan = this.getQuestionVal(6)
const lesionLength = Number(this.getQuestionVal(0))
const lesionShort = Number(this.getQuestionVal(1))
const lesionState = Number(this.getQuestionVal(7))
this.$set(this.questionForm, 'IsDicomReading', true)
this.$emit('resetQuestions', { isLymphLesion, lesionPart, lesionOrgan, lesionShort, lesionState, isLesionSaved: false, lesionLength, rowIndex: this.rowIndex, questionId: this.parentQsId, anwsers: this.questionForm })
if (!this.questionForm.IsDicomReading) {
DicomEvent.$emit('removeNoneDicomMeasureData', this.questionForm.MeasureData)
}
this.$set(this.questionForm, 'MeasureData', '')
})
.catch(() => {})
},
handleDelete() {
// 判断是否存在未保存的病灶
// this.$emit('determineExistsUnsavedLession', val => {
// if (val) {
// }
// })
this.$confirm('是否确认删除?', {
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) {
// this.$emit('getReadingQuestionAndAnswer')
if (this.questionForm.MeasureData) {
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData })
}
// await store.dispatch('reading/removeReadingQuestionAndAnswer', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
DicomEvent.$emit('getMeasureData')
this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
DicomEvent.$emit('getReportInfo', true)
if (!this.questionForm.IsDicomReading) {
DicomEvent.$emit('removeNoneDicomMeasureData', this.questionForm.MeasureData)
}
this.$message.success('删除成功!')
loading.close()
}
}).catch(() => { loading.close() })
} else {
const loading = this.$loading({ fullscreen: true })
// 移除新建病灶并关闭窗口
if (this.questionForm.MeasureData) {
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData })
}
DicomEvent.$emit('getMeasureData')
this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
loading.close()
}
})
},
handleClose() {
if (!this.questionForm.RowId) {
this.$confirm('当前病灶为新建病灶,未保存。如果关闭窗口,将会删除病灶信息,是否继续?', {
type: 'warning',
distinguishCancelAndClose: true
})
.then(async() => {
// 移除新建病灶并关闭窗口
if (this.questionForm.MeasureData) {
await store.dispatch('reading/removeMeasuredData', { visitTaskId: this.visitTaskId, measureData: this.questionForm.MeasureData })
}
// await store.dispatch('reading/removeReadingQuestionAndAnswer', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
DicomEvent.$emit('getMeasureData')
this.$emit('close', { lesionType: this.lesionType, rowIndex: this.rowIndex, visitTaskId: this.visitTaskId })
})
.catch(() => {})
} else {
if (this.questionForm.isSave === false) {
this.$confirm('当前病灶信息有更新,未保存,是否继续?', {
type: 'warning',
distinguishCancelAndClose: true
})
.then(() => {
this.$emit('close')
})
.catch(() => {})
} else {
this.$emit('close')
}
}
}
}
}
</script>
<style lang="scss" scoped>
.measurement-form{
>>>.el-form-item__label{
color: #c3c3c3;
}
>>>.el-input .el-input__inner{
background-color: transparent;
color: #ddd;
border: 1px solid #5e5e5e;
}
>>>.el-form-item{
display: flex;
flex-direction: row;
justify-content: flex-start;
}
>>>.el-form-item__content{
flex: 1;
}
>>>.el-input.is-disabled .el-input__inner{
background-color: #646464a1;
}
>>>.el-select.is-disabled .el-input__inner{
background-color: #646464a1;
}
.el-form-item__content
.el-select{
width: 100%;
}
.input-width1{
width: calc(100% -60px)!important;
}
.input-width2{
width: 100% !important;
}
}
</style>