数值问题答案为NE保存bug修复
parent
1f51bbd178
commit
da252ae4df
|
|
@ -114,7 +114,7 @@
|
||||||
v-else
|
v-else
|
||||||
type="number"
|
type="number"
|
||||||
@change="(val) => { formItemChange(val, item) }"
|
@change="(val) => { formItemChange(val, item) }"
|
||||||
@input="(val) => questionForm[item.Id] = val.replace(/[^\d.]/g, '')"
|
@input="numberInput(item.Id)"
|
||||||
@blur="handleBlur(questionForm[item.Id], questionForm, item)"
|
@blur="handleBlur(questionForm[item.Id], questionForm, item)"
|
||||||
v-model.trim="questionForm[item.Id]" :disabled="readingTaskState === 2">
|
v-model.trim="questionForm[item.Id]" :disabled="readingTaskState === 2">
|
||||||
<template slot="append" v-if="item.Unit !== 0">{{ item.Unit !== 4 ? $fd('ValueUnit', item.Unit) : item.CustomUnit }}</template>
|
<template slot="append" v-if="item.Unit !== 0">{{ item.Unit !== 4 ? $fd('ValueUnit', item.Unit) : item.CustomUnit }}</template>
|
||||||
|
|
@ -369,7 +369,7 @@ export default {
|
||||||
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
|
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
|
||||||
questions.forEach(item => {
|
questions.forEach(item => {
|
||||||
if (type.includes(item.Type)) {
|
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 : item.Answer : item.Answer
|
const answer = item.Type === 'select' && item.OptionTypeEnum === 1 && item.Answer ? JSON.parse(item.Answer) : item.Answer
|
||||||
this.$set(this.questionForm, item.Id, answer)
|
this.$set(this.questionForm, item.Id, answer)
|
||||||
}
|
}
|
||||||
if (item.QuestionType === 1013) {
|
if (item.QuestionType === 1013) {
|
||||||
|
|
@ -498,7 +498,6 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
formItemChange(val, item) {
|
formItemChange(val, item) {
|
||||||
console.log('formItemChange: ', item.QuestionName, val)
|
|
||||||
this.formChanged = true
|
this.formChanged = true
|
||||||
// if (item.Type === 'number') {
|
// if (item.Type === 'number') {
|
||||||
// this.limitBlur(item.Id, item.ValueType)
|
// this.limitBlur(item.Id, item.ValueType)
|
||||||
|
|
@ -546,6 +545,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
numberOrNEInput(id) {
|
numberOrNEInput(id) {
|
||||||
|
this.formChanged = true
|
||||||
// this.questionForm[id] = this.questionForm[id].toUpperCase();
|
// this.questionForm[id] = this.questionForm[id].toUpperCase();
|
||||||
if (!this.questionForm[id]) {
|
if (!this.questionForm[id]) {
|
||||||
return
|
return
|
||||||
|
|
@ -564,6 +564,11 @@ export default {
|
||||||
this.questionForm[id] = value
|
this.questionForm[id] = value
|
||||||
this.$set(this.questionForm, id, value)
|
this.$set(this.questionForm, id, value)
|
||||||
},
|
},
|
||||||
|
numberInput(id) {
|
||||||
|
this.formChanged = true
|
||||||
|
let value = this.questionForm[id].replace(/[^\d.]/g, '')
|
||||||
|
this.$set(this.questionForm, id, value)
|
||||||
|
},
|
||||||
handleNumberOrNEBlur(item) {
|
handleNumberOrNEBlur(item) {
|
||||||
if (this.questionForm[item.Id] && !isNaN(parseFloat(this.questionForm[item.Id]))) {
|
if (this.questionForm[item.Id] && !isNaN(parseFloat(this.questionForm[item.Id]))) {
|
||||||
if (item.ValueType === 3) {
|
if (item.ValueType === 3) {
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
v-else
|
v-else
|
||||||
type="number"
|
type="number"
|
||||||
@change="(val) => { formItemChange(val, item) }"
|
@change="(val) => { formItemChange(val, item) }"
|
||||||
@input="(val) => questionForm[item.Id] = val.replace(/[^\d.]/g, '')"
|
@input="numberInput(item.Id)"
|
||||||
@blur="handleBlur(questionForm[item.Id], questionForm, item)"
|
@blur="handleBlur(questionForm[item.Id], questionForm, item)"
|
||||||
v-model.trim="questionForm[item.Id]" :disabled="readingTaskState === 2">
|
v-model.trim="questionForm[item.Id]" :disabled="readingTaskState === 2">
|
||||||
<template slot="append" v-if="item.Unit !== 0">{{ item.Unit !== 4 ? $fd('ValueUnit', item.Unit) : item.CustomUnit }}</template>
|
<template slot="append" v-if="item.Unit !== 0">{{ item.Unit !== 4 ? $fd('ValueUnit', item.Unit) : item.CustomUnit }}</template>
|
||||||
|
|
@ -369,7 +369,7 @@ export default {
|
||||||
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
|
const type = ['number', 'radio', 'select', 'input', 'textarea', 'calculation']
|
||||||
questions.forEach(item => {
|
questions.forEach(item => {
|
||||||
if (type.includes(item.Type)) {
|
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 : item.Answer : item.Answer
|
const answer = item.Type === 'select' && item.OptionTypeEnum === 1 && item.Answer ? JSON.parse(item.Answer) : item.Answer
|
||||||
this.$set(this.questionForm, item.Id, answer)
|
this.$set(this.questionForm, item.Id, answer)
|
||||||
}
|
}
|
||||||
if (item.QuestionType === 1013) {
|
if (item.QuestionType === 1013) {
|
||||||
|
|
@ -541,6 +541,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
numberOrNEInput(id) {
|
numberOrNEInput(id) {
|
||||||
|
this.formChanged = true
|
||||||
// this.questionForm[id] = this.questionForm[id].toUpperCase();
|
// this.questionForm[id] = this.questionForm[id].toUpperCase();
|
||||||
if (!this.questionForm[id]) {
|
if (!this.questionForm[id]) {
|
||||||
return
|
return
|
||||||
|
|
@ -559,6 +560,11 @@ export default {
|
||||||
this.questionForm[id] = value
|
this.questionForm[id] = value
|
||||||
this.$set(this.questionForm, id, value)
|
this.$set(this.questionForm, id, value)
|
||||||
},
|
},
|
||||||
|
numberInput(id) {
|
||||||
|
this.formChanged = true
|
||||||
|
let value = this.questionForm[id].replace(/[^\d.]/g, '')
|
||||||
|
this.$set(this.questionForm, id, value)
|
||||||
|
},
|
||||||
handleNumberOrNEBlur(item) {
|
handleNumberOrNEBlur(item) {
|
||||||
if (this.questionForm[item.Id] && !this.questionForm[item.Id].startsWith('N')) {
|
if (this.questionForm[item.Id] && !this.questionForm[item.Id].startsWith('N')) {
|
||||||
if (item.ValueType === 3) {
|
if (item.ValueType === 3) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue