@@ -241,7 +279,10 @@ export default {
m1Id: '',
m2Id: '',
m3Id: '',
- avgId: ''
+ avgId: '',
+ sRoiStartDistanceId: '',
+ sRoiEndDistanceId: '',
+ sRoiDistanceId: ''
}
},
computed: {
@@ -328,9 +369,21 @@ export default {
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
questions.forEach(item => {
if (type.includes(item.Type)) {
- const answer = item.Type === 'select' && item.OptionTypeEnum === 1 && item.Answer ? JSON.parse(item.Answer) : item.Type === 'number' || item.Type === 'calculation' ? isNaN(parseFloat(item.Answer)) ? null : parseFloat(item.Answer) : item.Answer
+ const answer = item.Type === 'select' && item.OptionTypeEnum === 1 && item.Answer ? JSON.parse(item.Answer) : item.Type === 'number' || item.Type === 'calculation' ? isNaN(parseFloat(item.Answer)) ? null : item.Answer : item.Answer
this.$set(this.questionForm, item.Id, answer)
}
+ if (item.QuestionType === 1013) {
+ // ROI起始回撤距离
+ this.sRoiStartDistanceId = item.Id
+ }
+ if (item.QuestionType === 1014) {
+ // ROI终止回撤距离
+ this.sRoiEndDistanceId = item.Id
+ }
+ if (item.QuestionType === 1015) {
+ // ROI段落总长度
+ this.sRoiDistanceId = item.Id
+ }
if (item.Childrens.length > 0) {
this.setQuestionForm(item.Childrens)
}
@@ -443,13 +496,17 @@ export default {
setMeasuredData(measureData) {
},
- formItemChange(val, question) {
+ formItemChange(val, item) {
this.formChanged = true
- if (question.Type === 'number') {
- this.limitBlur(question.Id, question.ValueType)
+ // if (item.Type === 'number') {
+ // this.limitBlur(item.Id, item.ValueType)
+ // }
+ if (item.Childrens && item.Childrens.length > 0) {
+ this.resetChild(item.Childrens)
}
- if (question.Childrens && question.Childrens.length > 0) {
- this.resetChild(question.Childrens)
+ if ((item.QuestionType === 1013 || item.QuestionType === 1014) && !isNaN(parseFloat(this.questionForm[this.sRoiStartDistanceId])) && !isNaN(parseFloat(this.questionForm[this.sRoiEndDistanceId]))) {
+ let num = parseFloat(this.questionForm[this.sRoiEndDistanceId]) - parseFloat(this.questionForm[this.sRoiStartDistanceId])
+ this.$set(this.questionForm, this.sRoiDistanceId, parseFloat(num).toFixed(this.digitPlaces))
}
},
resetChild(obj) {
@@ -471,6 +528,72 @@ export default {
this.$set(this.questionForm, qId, this.numberToFixed(value))
}
},
+ validatorNumberOrNEInput(rule, value, callback) {
+ let reg = new RegExp(/^(?:-?(?:(?:0|[1-9]\d*)(?:\.\d+)?|\.\d+)|NE)$/, 'g')
+ if (value === '') {
+ callback();
+ } else {
+ if (!reg.test(value)) {
+ callback(new Error(this.$t('trials:reading:ruleMessage:validatorNumberInput')));
+ } else {
+ callback();
+ }
+ }
+ },
+ numberOrNEInput(id) {
+ // this.questionForm[id] = this.questionForm[id].toUpperCase();
+ if (!this.questionForm[id]) {
+ return
+ }
+ let value = this.questionForm[id].toUpperCase().replace(/[^0-9.NE]/g, '')
+ if (value.startsWith('N')) {
+ if (value.length > 2) {
+ value = value.substring(0, 2)
+ }
+ if (value.length === 2 && value[1] !== 'E') {
+ value = 'N'
+ }
+ } else {
+ value = value.replace(/[NE]/g, '')
+ }
+ this.questionForm[id] = value
+ this.$set(this.questionForm, id, value)
+ },
+ handleNumberOrNEBlur(item) {
+ if (this.questionForm[item.Id] && !this.questionForm[item.Id].startsWith('N')) {
+ if (item.ValueType === 3) {
+ // 文本
+ this.$set(this.questionForm, item.Id, value)
+ } else {
+ const num = parseFloat(this.questionForm[item.Id])
+ if (!isNaN(num)) {
+ this.$set(this.questionForm, item.Id, parseFloat(num).toFixed(this.digitPlaces))
+ if (item.ValueType === 0) {
+ // 整型
+ this.$set(this.questionForm, item.Id, parseInt(num))
+ } else if (item.ValueType === 1 || item.ValueType === 2){
+ // 小数、百分比
+ this.$set(this.questionForm, item.Id, parseFloat(num).toFixed(this.digitPlaces))
+ }
+ }
+ }
+
+ }
+ },
+ handleBlur(value, a, item) {
+ if (!value || item.ValueType === 3) return false
+ const num = parseFloat(this.questionForm[item.Id])
+ if (!isNaN(num)) {
+ this.$set(this.questionForm, item.Id, parseFloat(num).toFixed(this.digitPlaces))
+ if (item.ValueType === 0) {
+ // 整型
+ this.$set(this.questionForm, item.Id, parseInt(num))
+ } else if (item.ValueType === 1 || item.ValueType === 2){
+ // 小数、百分比
+ this.$set(this.questionForm, item.Id, parseFloat(num).toFixed(this.digitPlaces))
+ }
+ }
+ },
numberToFixed(v) {
if (this.digitPlaces > -1) {
return isNaN(parseFloat(v)) ? null : `${parseFloat(v).toFixed(this.digitPlaces)}`
@@ -631,11 +754,11 @@ export default {
}
const res = await submitTableQuestion(params)
if (res.IsSuccess) {
- // this.refreshQuestions()
- await this.getReadingQuestionAndAnswer(this.visitTaskId)
- this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
- this.$refs['ecrf2'].getQuestions(this.visitTaskId, true)
- this.$refs['ecrf3'].getQuestions(this.visitTaskId, true)
+ this.refreshQuestions()
+ // await this.getReadingQuestionAndAnswer(this.visitTaskId)
+ // this.$refs['ecrf'].getQuestions(this.visitTaskId, true)
+ // this.$refs['ecrf2'].getQuestions(this.visitTaskId, true)
+ // this.$refs['ecrf3'].getQuestions(this.visitTaskId, true)
DicomEvent.$emit('getReportInfo', true)
// 保存成功!
this.addOrEdit.visible = false
@@ -666,7 +789,8 @@ export default {
}
const res = await deleteReadingRowAnswer(param)
if (res.IsSuccess) {
- await this.getReadingQuestionAndAnswer(this.visitTaskId)
+ this.refreshQuestions()
+ // await this.getReadingQuestionAndAnswer(this.visitTaskId)
DicomEvent.$emit('getReportInfo', true)
// '删除成功!'
this.$message.success(this.$t('common:message:deletedSuccessfully'))
@@ -699,7 +823,7 @@ export default {
}
},
async uploadDlgClose() {
- await this.getReadingQuestionAndAnswer(this.visitTaskId)
+ this.refreshQuestions()
DicomEvent.$emit('getReportInfo', true)
this.upload.visible = false
},
@@ -883,5 +1007,8 @@ export default {
z-index: 2;
}
}
+ ::v-deep.el-tag.el-tag--info {
+ color: #000;
+ }
}
diff --git a/src/views/trials/trials-panel/reading/dicoms/components/QuestionItem.vue b/src/views/trials/trials-panel/reading/dicoms/components/QuestionItem.vue
index 3a6dba11..ba60e88b 100644
--- a/src/views/trials/trials-panel/reading/dicoms/components/QuestionItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/components/QuestionItem.vue
@@ -169,7 +169,16 @@
- questionForm[question.Id] = val.replace(/[^\d.]/g, '')"
+ @blur="handleBlur(questionForm[question.Id], questionForm, question)"
+ v-model.trim="questionForm[question.Id]" :disabled="readingTaskState === 2">
+ {{ question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit }}
+ %
+
+
@@ -387,7 +396,21 @@ export default {
this.fileList.splice(this.fileList.findIndex(f => f.url === file.url), 1)
this.urls.splice(this.fileList.findIndex(f => f === file.url), 1)
this.$emit('setFormItemData', { key: this.question.Id, val: this.urls.length > 0 ? this.urls.join('|') : '' })
- }
+ },
+ handleBlur(value, a, item) {
+ if (!value || item.ValueType === 3) return false
+ const num = parseFloat(this.questionForm[item.Id])
+ if (!isNaN(num)) {
+ this.$set(this.questionForm, item.Id, parseFloat(num).toFixed(this.digitPlaces))
+ if (item.ValueType === 0) {
+ // 整型
+ this.$set(this.questionForm, item.Id, parseInt(num))
+ } else if (item.ValueType === 1 || item.ValueType === 2){
+ // 小数、百分比
+ this.$set(this.questionForm, item.Id, parseFloat(num).toFixed(this.digitPlaces))
+ }
+ }
+ },
}
}
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 80f17222..04f2b61d 100644
--- a/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/components/Questions.vue
@@ -179,7 +179,9 @@ export default {
v.IsBaseLineTask = this.isBaseLineTask
if (v.Type === 'group' && v.GroupClassify !== this.groupClassify) continue
if (!v.IsPage && v.Type !== 'group' && v.Type !== 'summary' && i.Id) {
- this.$set(this.questionForm, v.Id, v.Answer ? v.Answer : null)
+ const answer = v.Type === 'select' && v.OptionTypeEnum === 1 && v.Answer ? JSON.parse(v.Answer) : v.Answer
+ this.$set(this.questionForm, v.Id, answer ? answer : null)
+ // this.$set(this.questionForm, v.Id, v.Answer ? v.Answer : null)
if (v.QuestionType === 44) {
// 影像质量评估
this.imageQualityId = v.Id
@@ -210,6 +212,7 @@ export default {
// 脾底位置
this.spleenBottomId = v.Id
}
+
}
if (v.Childrens.length > 0) {
this.setChild(v.Childrens)
@@ -231,7 +234,8 @@ export default {
obj.forEach(i => {
i.IsBaseLineTask = this.isBaseLineTask
if (i.Type !== 'group' && i.Type !== 'summary' && i.Id) {
- this.$set(this.questionForm, i.Id, i.Answer ? i.Answer : null)
+ const answer = i.Type === 'select' && i.OptionTypeEnum === 1 && i.Answer ? JSON.parse(i.Answer) : i.Answer
+ this.$set(this.questionForm, i.Id, answer ? answer : null)
if (i.QuestionType === 44) {
// 影响质量评估
this.imageQualityId = i.Id
@@ -342,7 +346,7 @@ export default {
var answers = []
var imageQuality = null
for (const k in this.questionForm) {
- answers.push({ id: k, answer: this.questionForm[k] })
+ answers.push({ id: k, answer: Array.isArray(this.questionForm[k]) ? JSON.stringify(this.questionForm[k]) : this.questionForm[k] })
if (k === this.imageQualityId) {
imageQuality = this.questionForm[k]
}
@@ -685,7 +689,6 @@ export default {
this.setQuestionStatus(this.questions, this.measurements[idx].QuestionType)
},
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)
@@ -785,6 +788,7 @@ export default {
if (obj.key === this.spleenStatusId) {
this.setSpleenCommentDisplay()
}
+
this.formChanged = true
},
setQuestions() {