723 lines
		
	
	
		
			25 KiB
		
	
	
	
		
			Plaintext
		
	
	
			
		
		
	
	
			723 lines
		
	
	
		
			25 KiB
		
	
	
	
		
			Plaintext
		
	
	
| <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')})` }} -->
 | ||
|           {{ getLesionName(orderMark,rowIndex) }}
 | ||
|         </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>
 | ||
|       <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.Type!=='group' && qs.Type!=='summary' && qs.QuestionMark !== 4 && qs.QuestionMark !== 6 && qs.QuestionMark !== 2,
 | ||
|             message: '请注明', trigger: ['blur']},
 | ||
|         ]"
 | ||
|       >
 | ||
|         <!-- 输入框 -->
 | ||
|         <template v-if="qs.Type==='input'">
 | ||
|           <el-input
 | ||
|             v-if="qs.Type==='input'"
 | ||
|             v-model="questionForm[qs.Id]"
 | ||
|             :disabled="qs.TableQuestionType===2 || !isCurrentTask || qs.QuestionMark===0 || qs.QuestionMark===1 || qs.QuestionMark===4 || readingTaskState>=2 "
 | ||
|           >
 | ||
|             <template v-if="qs.QuestionMark===0 || qs.QuestionMark===1" slot="append">mm</template>
 | ||
|           </el-input>
 | ||
|         </template>
 | ||
|         <!-- <template v-if="qs.Type==='input' && qs.QuestionMark===0">
 | ||
|           <el-col :span="16">
 | ||
|             <el-input
 | ||
|               v-if="qs.Type==='input'"
 | ||
|               v-model="questionForm[qs.Id]"
 | ||
|               :disabled="qs.TableQuestionType===2 || !isCurrentTask"
 | ||
|             />
 | ||
|           </el-col>
 | ||
|           <el-col :span="8" style="padding:0 5px">
 | ||
|             <el-button
 | ||
|               v-if="qs.QuestionMark === 0 && qs.MeasuredData=== '' && isCurrentTask"
 | ||
|               type="text"
 | ||
|               size="mini"
 | ||
|               @click="activeTool"
 | ||
|             >开始测量</el-button>
 | ||
|           </el-col>
 | ||
|         </template> -->
 | ||
|         <!-- 多行文本输入框 -->
 | ||
|         <el-input
 | ||
|           v-if="qs.Type==='textarea'"
 | ||
|           v-model="questionForm[qs.Id]"
 | ||
|           type="textarea"
 | ||
|           :autosize="{ minRows: 2, maxRows: 4}"
 | ||
|           :disabled="!isCurrentTask || readingTaskState>=2"
 | ||
|         />
 | ||
|         <!-- 下拉框 -->
 | ||
|         <el-select
 | ||
|           v-if="qs.Type==='select'"
 | ||
|           v-model="questionForm[qs.Id]"
 | ||
|           filterable
 | ||
|           :disabled="!isCurrentTask || readingTaskState>=2 || (!isBaseLineTask && qs.QuestionMark === 5 && (lesionType !== 2 || (lesionType === 2 && questionForm.IsCurrentTaskAdd === 'False'))) || qs.QuestionMark === 2"
 | ||
|           @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">
 | ||
|             <el-option
 | ||
|               v-for="item of $d[qs.DictionaryCode]"
 | ||
|               v-show="!(isBaseLineTask && (lesionType === 0 && (item.value ===2 || item.value ===3)) || lesionType === 1 && (item.value ===1 ||item.value ===2 || item.value ===3))"
 | ||
|               :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="questionForm.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 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
 | ||
|     }
 | ||
|   },
 | ||
| 
 | ||
|   mounted() {
 | ||
|     this.trialId = this.$route.query.trialId
 | ||
|     this.initForm()
 | ||
|     // this.getOrganInfoList()
 | ||
|   },
 | ||
|   methods: {
 | ||
|     initForm() {
 | ||
|       this.questions.forEach(item => {
 | ||
|         var val = this.answers[item.Id]
 | ||
|         if (item.DictionaryCode) {
 | ||
|           val = this.answers[item.Id] ? Number(this.answers[item.Id]) : ''
 | ||
|         }
 | ||
| 
 | ||
|         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)
 | ||
| 
 | ||
|       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.questionForm.MeasureData) {
 | ||
|         // 十字线工具 且是靶病灶  器官只能是淋巴结类型
 | ||
|         if (this.questionForm.MeasureData.type === 'Bidirectional') {
 | ||
|           this.organList = []
 | ||
|           this.getOrganInfoList(1)
 | ||
|         } else if (this.questionForm.MeasureData.type === 'Length') {
 | ||
|           // 长径测量工具 且是靶病灶  器官只能是非淋巴结类型
 | ||
|           this.organList = []
 | ||
|           this.getOrganInfoList(0)
 | ||
|         } else {
 | ||
|           this.organList = []
 | ||
|           this.getOrganInfoList()
 | ||
|         }
 | ||
|       } else {
 | ||
|         this.organList = []
 | ||
|         this.getOrganInfoList()
 | ||
|       }
 | ||
|       this.isRender = true
 | ||
|     },
 | ||
|     getLesionName(orderMark, rowIndex) {
 | ||
|       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)
 | ||
|         return `${orderMark}${String(x).padStart(2, '0')}${y}`
 | ||
|       } else {
 | ||
|         return `${orderMark}${String(x).padStart(2, '0')}`
 | ||
|       }
 | ||
|     },
 | ||
|     getQuestionId(questionMark) {
 | ||
|       var idx = this.questions.findIndex(i => i.QuestionMark === questionMark)
 | ||
|       if (idx > -1) {
 | ||
|         return this.questions[idx].Id
 | ||
|       } else {
 | ||
|         return ''
 | ||
|       }
 | ||
|     },
 | ||
|     handleLocation() {
 | ||
|       Store.$emit('imageLocation', this.questionForm)
 | ||
|     },
 | ||
|     getOrganInfoList(isLymphNodes) {
 | ||
|       var param = {
 | ||
|         trialId: this.trialId,
 | ||
|         lesionType: this.lesionType,
 | ||
|         isEnable: true
 | ||
|       }
 | ||
|       if (isLymphNodes !== undefined && isLymphNodes !== null) {
 | ||
|         param.isLymphNodes = isLymphNodes
 | ||
|       }
 | ||
|       getTrialOrganList(param).then(res => {
 | ||
|         this.organList = res.Result
 | ||
|       })
 | ||
|     },
 | ||
|     lesionTypeChange(v) {
 | ||
|       // const loading = this.$loading({ fullscreen: true })
 | ||
|       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)
 | ||
|             // loading.close()
 | ||
|             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.questions.forEach(item => {
 | ||
|             item.Answer = this.questionForm[item.Id] ? this.questionForm[item.Id] : ''
 | ||
|             arr.push(item)
 | ||
|           })
 | ||
|           if (v === 0 || v === 1) {
 | ||
|             // this.lesionType === 0 && this.questionForm.MeasureData
 | ||
|             if (this.questionForm.MeasureData) {
 | ||
|               // 十字线工具 且是靶病灶  器官只能是结节靶病灶类型
 | ||
|               if (this.questionForm.MeasureData.type === 'Bidirectional') {
 | ||
|                 this.organList = []
 | ||
|                 this.getOrganInfoList(1)
 | ||
|               } else if (this.questionForm.MeasureData.type === 'Length') {
 | ||
|                 // 长径测量工具 且是靶病灶  器官只能是非结节靶病灶类型
 | ||
|                 this.organList = []
 | ||
|                 this.getOrganInfoList(0)
 | ||
|               } else {
 | ||
|                 this.organList = []
 | ||
|                 this.getOrganInfoList()
 | ||
|               }
 | ||
|               this.questionForm[this.getQuestionId(5)] = ''
 | ||
|               this.questionForm[this.getQuestionId(4)] = ''
 | ||
|               this.questionForm[this.getQuestionId(6)] = ''
 | ||
|               this.questionForm[this.getQuestionId(2)] = ''
 | ||
|             }
 | ||
|           } else {
 | ||
|             this.organList = []
 | ||
|             this.getOrganInfoList(0)
 | ||
|           }
 | ||
| 
 | ||
|           Store.$emit('imageLocation', this.questionForm)
 | ||
|           var type = null
 | ||
|           if (this.questionForm.isSave !== false) {
 | ||
|             await this.deleteLesionInfo()
 | ||
|             type = 0
 | ||
|           } else {
 | ||
|             type = 1
 | ||
|           }
 | ||
|           Store.$emit('changeLesionType', { questionForm: arr, oldLesionType: this.lesionType, newLesionType: v, rowIndex: this.questionForm.RowIndex, measureData: this.questionForm.MeasureData, type })
 | ||
|           // loading.close()
 | ||
|         } else {
 | ||
|           this.$set(this.questionForm, 'LesionType', this.originalQuestionForm.LesionType)
 | ||
|           // loading.close()
 | ||
|         }
 | ||
|       })
 | ||
|     },
 | ||
|     deleteLesionInfo() {
 | ||
|       return new Promise((resolve, reject) => {
 | ||
|         var param = {
 | ||
|           visitTaskId: this.visitTaskId,
 | ||
|           questionId: this.parentQsId,
 | ||
|           rowIndex: this.questionForm.RowIndex
 | ||
|         }
 | ||
|         deleteReadingRowAnswer(param)
 | ||
|           .then(res => {
 | ||
|             if (res.IsSuccess) {
 | ||
|               // this.$emit('refreshReadingQuestionAndAnswer', 0)
 | ||
|               // var measureData = { ...this.questionForm.MeasureData }
 | ||
|               // if (measureData) {
 | ||
|               //   Store.$emit('resetMeasuredData', measureData.instanceId)
 | ||
|               // }
 | ||
|               Store.$emit('getReportInfo', true)
 | ||
|             }
 | ||
|             resolve()
 | ||
|           }).catch(() => {
 | ||
|             reject()
 | ||
|           })
 | ||
|       })
 | ||
|     },
 | ||
|     formItemChange(v, question) {
 | ||
|       this.$emit('determineExistsUnsavedLession', val => {
 | ||
|         if (val) {
 | ||
|           if (question.QuestionMark === 5 && 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)
 | ||
|               })
 | ||
|             } 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)
 | ||
|           // this.handleSave()
 | ||
|         } else {
 | ||
|           this.$set(this.questionForm, question.Id, this.originalQuestionForm[question.Id])
 | ||
|         }
 | ||
|       })
 | ||
|     },
 | ||
|     setMeasureData(measureData) {
 | ||
|       setTimeout(() => {
 | ||
|       // 获取长径(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)
 | ||
|         }
 | ||
|         // 获取器官问题
 | ||
|         var organ = this.getQuestionVal(5)
 | ||
|         // this.lesionType === 0 && !organ
 | ||
|         if (!organ) {
 | ||
|         // 十字线工具 器官只能是淋巴结类型
 | ||
|           if (measureData.type === 'Bidirectional') {
 | ||
|             this.organList = []
 | ||
|             this.getOrganInfoList(1)
 | ||
|           } else if (measureData.type === 'Length') {
 | ||
|           // 长径测量工具 且是靶病灶  器官只能是非淋巴结类型
 | ||
|             this.organList = []
 | ||
|             this.getOrganInfoList(0)
 | ||
|           }
 | ||
|         }
 | ||
|         measureData.data.remark = this.getLesionName(this.orderMark, this.questionForm.RowIndex)
 | ||
|         var data = {
 | ||
|           Id: measureData.data.uuid,
 | ||
|           StudyId: measureData.studyId,
 | ||
|           InstanceId: measureData.instanceId,
 | ||
|           SeriesId: measureData.seriesId,
 | ||
|           MeasureData: measureData,
 | ||
|           QuestionId: this.parentQsId,
 | ||
|           RowIndex: this.questionForm.RowIndex,
 | ||
|           VisitTaskId: this.visitTaskId
 | ||
|         }
 | ||
|         Store.$emit('addTemporaryMeasuredData', data)
 | ||
|         this.$set(this.questionForm, 'isSave', false)
 | ||
|         this.$set(this.questionForm, 'MeasureData', measureData)
 | ||
|       // loading.close()
 | ||
|       // this.handleSave()
 | ||
|       }, 500)
 | ||
|     },
 | ||
|     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 }
 | ||
|         // if (!measureData) {
 | ||
|         //   this.$confirm(`该病灶未注明标记`, {
 | ||
|         //     type: 'warning',
 | ||
|         //     showCancelButton: false,
 | ||
|         //     callback: action => {}
 | ||
|         //   })
 | ||
|         //   return
 | ||
|         // }
 | ||
|         // 普通靶病灶:长径大于10mm且不小于2倍层厚
 | ||
|         // 淋巴结靶病灶:短径大于15mm且不小于2倍层厚
 | ||
|         if (measureData) {
 | ||
|           var lymphNodes = this.getQuestionVal(2)
 | ||
|           lymphNodes = lymphNodes ? parseInt(lymphNodes) : null
 | ||
|           var lesionLength = Number(this.getQuestionVal(0))
 | ||
|           var lesionShort = Number(this.getQuestionVal(1))
 | ||
|           if ((lymphNodes === 1) && this.lesionType === 0) {
 | ||
|             if (!(lesionShort && measureData.thick && lesionShort > 15 && lesionShort >= 2 * measureData.thick)) {
 | ||
|               this.$confirm(`淋巴结靶病灶短径应大于15mm且不小于2倍层厚`, {
 | ||
|                 type: 'warning',
 | ||
|                 showCancelButton: false,
 | ||
|                 callback: action => {}
 | ||
|               })
 | ||
|               loading.close()
 | ||
|               return
 | ||
|             }
 | ||
|           }
 | ||
|           if ((lymphNodes === 0) && this.lesionType === 0) {
 | ||
|             if (!(lesionLength && measureData.thick && lesionLength > 10 && lesionLength >= 2 * measureData.thick)) {
 | ||
|               this.$confirm(`普通靶病灶长径应大于10mm且不小于2倍层厚`, {
 | ||
|                 type: 'warning',
 | ||
|                 showCancelButton: false,
 | ||
|                 callback: action => {}
 | ||
|               })
 | ||
|               loading.close()
 | ||
|               return
 | ||
|             }
 | ||
|           }
 | ||
|         }
 | ||
| 
 | ||
|         var answers = []
 | ||
|         for (const k in this.questionForm) {
 | ||
|           if (k === 'isSave' || k === 'RowIndex' || k === 'InstanceId' || k === 'SeriesId' || k === 'MeasureData' || k === 'IsCurrentTaskAdd' || k === 'LesionType') continue
 | ||
|           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,
 | ||
|           seriesId: measureData ? this.questionForm.MeasureData.seriesId : '',
 | ||
|           instanceId: measureData ? this.questionForm.MeasureData.instanceId : ''
 | ||
|         }
 | ||
|         submitTableQuestion(params).then(res => {
 | ||
|           loading.close()
 | ||
|           this.$message.success('保存成功!')
 | ||
| 
 | ||
|           var measureData = { ...this.questionForm.MeasureData }
 | ||
| 
 | ||
|           this.$set(this.questionForm, 'isSave', true)
 | ||
|           this.originalQuestionForm = { ...this.questionForm }
 | ||
|           this.$emit('refreshReadingQuestionAndAnswer', 1)
 | ||
|           if (measureData) {
 | ||
|             Store.$emit('resetMeasuredData', measureData.instanceId)
 | ||
|           }
 | ||
|           Store.$emit('getReportInfo', true)
 | ||
|         }).catch(() => { loading.close() })
 | ||
|       })
 | ||
|     },
 | ||
|     handleDeleteMeasureData() {
 | ||
|       this.$confirm('是否确认删除?', {
 | ||
|         type: 'warning',
 | ||
|         distinguishCancelAndClose: true
 | ||
|       })
 | ||
|         .then(() => {
 | ||
|           // 重置长短径
 | ||
|           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)
 | ||
|           Store.$emit('removeToolState', this.questionForm.MeasureData)
 | ||
|           this.$set(this.questionForm, 'MeasureData', '')
 | ||
|           this.organList = []
 | ||
|           // this.handleSave()
 | ||
|           this.getOrganInfoList()
 | ||
|         })
 | ||
|         .catch(() => {})
 | ||
|     },
 | ||
|     handleDelete() {
 | ||
|       // 判断是否存在未保存的病灶
 | ||
|       this.$emit('determineExistsUnsavedLession', val => {
 | ||
|         if (val) {
 | ||
|           this.$confirm('是否确认删除?', {
 | ||
|             type: 'warning',
 | ||
|             distinguishCancelAndClose: true
 | ||
|           })
 | ||
|             .then(() => {
 | ||
|               const loading = this.$loading({ fullscreen: true })
 | ||
|               var param = {
 | ||
|                 visitTaskId: this.visitTaskId,
 | ||
|                 questionId: this.parentQsId,
 | ||
|                 rowIndex: this.questionForm.RowIndex
 | ||
|               }
 | ||
|               deleteReadingRowAnswer(param)
 | ||
|                 .then(res => {
 | ||
|                   loading.close()
 | ||
|                   if (res.IsSuccess) {
 | ||
|                     var measureData = { ...this.questionForm.MeasureData }
 | ||
|                     if (measureData) {
 | ||
|                       Store.$emit('resetMeasuredData', measureData.instanceId)
 | ||
|                     }
 | ||
|                     this.$emit('refreshReadingQuestionAndAnswer', 0)
 | ||
|                     Store.$emit('getReportInfo', true)
 | ||
|                     this.$message.success('删除成功!')
 | ||
|                   }
 | ||
|                 }).catch(() => { loading.close() })
 | ||
|             })
 | ||
|         }
 | ||
|       })
 | ||
|     },
 | ||
|     handleClose() {
 | ||
|       if (this.questionForm.isSave === false) {
 | ||
|         this.$confirm('当前病灶信息未保存!', {
 | ||
|           type: 'warning',
 | ||
|           distinguishCancelAndClose: true
 | ||
|         })
 | ||
|           .then(() => {})
 | ||
|           .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>
 |