{ formItemChange(val, item) }"
@input="(val) => questionForm[item.Id] = val.replace(/[^\d.]/g, '')"
@blur="handleBlur(questionForm[item.Id], questionForm, item)"
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))
+ }
+ }
+ },
}
}