diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue
index 8889bae9..8a05e509 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionFormItem.vue
@@ -69,6 +69,10 @@
:rules="[
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (question.RelevanceValueList.includes(isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] : questionForm[question.RelevanceId].toString())))) && question.Type!=='group' && question.Type!=='summary',
message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
+ {
+ validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput :(rule,value,callback )=>{callback()},
+ trigger: ['blur', 'change']
+ }
]"
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
>
@@ -228,9 +232,10 @@
/>
{ formItemNumberChange(val, question) }"
+ @input="numberInput(question.Id)"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
v-model="questionForm[question.Id]"
:disabled="readingTaskState === 2"
@@ -240,7 +245,8 @@
%
-1) {
if (value.split('.')[1].length >= this.digitPlaces) {
@@ -510,7 +531,10 @@ export default {
}
},
handleBlur(value, a, b) {
- this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ let reg = new RegExp(/[a-zA-Z]/, 'ig')
+ if(!reg.test(value)) {
+ this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ }
},
deleteTableCol(row, index) {
this.$confirm(this.$t('trials:uploadNonDicoms:message:msg1')).then(() => {
diff --git a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue
index 251666fd..42acda72 100644
--- a/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms/customize/CustomizeQuestionTableFormItem.vue
@@ -7,6 +7,10 @@
:rules="[
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type!=='group' && question.Type!=='summary',
message: $t('common:ruleMessage:select'), trigger: ['blur', 'change']},
+ {
+ validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput :(rule,value,callback )=>{callback()},
+ trigger: ['blur', 'change']
+ }
]"
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
>
@@ -144,19 +148,21 @@
{formItemNumberChange(val, question)})"
+ @input="numberInput(question.Id)"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
v-model="questionForm[question.Id]"
>
{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}
@@ -342,6 +348,25 @@ export default {
// }
},
methods: {
+ numberInput(id,notId = false) {
+ if(notId ) {
+ this.calculationValue = this.calculationValue.toUpperCase();
+ }else {
+ this.questionForm[id] = this.questionForm[id].toUpperCase();
+ }
+ },
+ validatorNumberInput(rule, value, callback) {
+ let reg = new RegExp(/^(?:-?(?:(?:0|[1-9]\d*)(?:\.\d+)?|\.\d+)|NE)$/, 'g')
+ if (value === '') {
+ callback(new Error(this.$t('common:ruleMessage:specify')));
+ } else {
+ if (!reg.test(value)) {
+ callback(new Error(this.$t('trials:reading:ruleMessage:validatorNumberInput')));
+ }else{
+ callback();
+ }
+ }
+ },
save() {
},
openAddTableCol(row) {
@@ -382,7 +407,11 @@ export default {
}
},
handleBlur(value, a, b) {
- this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ let reg = new RegExp(/[a-zA-Z]/, 'ig')
+ if(!reg.test(value)) {
+ this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ }
+ // this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
},
handleCalculationBlur(v) {
this.calculationValue = parseFloat(v).toFixed(this.digitPlaces)
diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue
index df3e2b38..7441a60c 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionFormItem.vue
@@ -121,6 +121,10 @@
:rules="[
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && (question.RelevanceValueList.includes(isNaN(parseFloat(questionForm[question.RelevanceId])) ? questionForm[question.RelevanceId] : questionForm[question.RelevanceId].toString())))) && question.Type!=='group' && question.Type!=='summary',
message: $t('common:ruleMessage:specify'), trigger: ['blur', 'change']},
+ {
+ validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput :(rule,value,callback )=>{callback()},
+ trigger: ['blur', 'change']
+ }
]"
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
>
@@ -354,9 +358,10 @@
{ formItemNumberChange(val, question) }"
+ @input="numberInput(question.Id)"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
v-model="questionForm[question.Id]"
:disabled="readingTaskState === 2"
@@ -367,7 +372,8 @@
-1) {
if (value.split('.')[1].length >= this.digitPlaces) {
@@ -656,7 +677,11 @@ export default {
}
},
handleBlur(value, a, b) {
- this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ let reg = new RegExp(/[a-zA-Z]/, 'ig')
+ if(!reg.test(value)) {
+ this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ }
+ // this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
},
handleMarkedQsBlur(value, a, b, question) {
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
diff --git a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionTableFormItem.vue b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionTableFormItem.vue
index 12add325..0be8dc0a 100644
--- a/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionTableFormItem.vue
+++ b/src/views/trials/trials-panel/reading/dicoms3D/components/customize/QuestionTableFormItem.vue
@@ -7,6 +7,10 @@
:rules="[
{ required: (question.IsRequired === 0 || (question.IsRequired ===1 && question.RelevanceId && !!~question.RelevanceValueList.indexOf(questionForm[question.RelevanceId]))) && question.Type!=='group' && question.Type!=='summary',
message: $t('common:ruleMessage:select'), trigger: ['blur', 'change']},
+ {
+ validator: question.Type === 'number' && !question.TypeValue ? validatorNumberInput :(rule,value,callback )=>{callback()},
+ trigger: ['blur', 'change']
+ }
]"
:class="[question.Type==='group'?'mb':question.Type==='upload'?'uploadWrapper':'']"
>
@@ -217,19 +221,21 @@
{formItemNumberChange(val, question)})"
+ @input="numberInput(question.Id)"
@blur="handleBlur(questionForm[question.Id], questionForm, question.Id)"
v-model="questionForm[question.Id]"
>
{{question.Unit !== 4 ? $fd('ValueUnit', question.Unit) : question.CustomUnit}}
@@ -420,6 +426,25 @@ export default {
if (this.type === 'edit') return
},
methods: {
+ numberInput(id,notId = false) {
+ if(notId ) {
+ this.calculationValue = this.calculationValue.toUpperCase();
+ }else {
+ this.questionForm[id] = this.questionForm[id].toUpperCase();
+ }
+ },
+ validatorNumberInput(rule, value, callback) {
+ let reg = new RegExp(/^(?:-?(?:(?:0|[1-9]\d*)(?:\.\d+)?|\.\d+)|NE)$/, 'g')
+ if (value === '') {
+ callback(new Error(this.$t('common:ruleMessage:specify')));
+ } else {
+ if (!reg.test(value)) {
+ callback(new Error(this.$t('trials:reading:ruleMessage:validatorNumberInput')));
+ }else{
+ callback();
+ }
+ }
+ },
save() {
},
openAddTableCol(row) {
@@ -449,7 +474,11 @@ export default {
}
},
handleBlur(value, a, b) {
- this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ let reg = new RegExp(/[a-zA-Z]/, 'ig')
+ if(!reg.test(value)) {
+ this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
+ }
+ // this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))
},
handleMarkedQsBlur(value, a, b, question) {
this.$set(a, b, parseFloat(value).toFixed(this.digitPlaces))