IVUS自动计算更改

uat_us
caiyiling 2024-09-06 18:01:21 +08:00
parent f39050e220
commit 4569f16050
2 changed files with 13 additions and 7 deletions

View File

@ -390,20 +390,25 @@ export default {
}, },
calculate(qsMarkArr, type) { calculate(qsMarkArr, type) {
var num = 0 var num = 0
qsMarkArr.map((qsmark, i) => { for (let i = 0; i< qsMarkArr.length; i++) {
const mark = qsMarkArr[i]
const v = this.questionForm[this.getQuestionId(mark)]
if (isNaN(parseFloat(v))) {
num = null
break
}
if (i === 0) { if (i === 0) {
const v = this.questionForm[this.getQuestionId(qsmark)] num = parseFloat(v)
num = isNaN(parseFloat(v)) ? 0 : parseFloat(v)
} else { } else {
const v = this.questionForm[this.getQuestionId(qsmark)]
switch (type) { switch (type) {
case '-': case '-':
num -= isNaN(parseFloat(v)) ? 0 : parseFloat(v) num -= parseFloat(v)
break break
} }
} }
}) }
return parseFloat(num).toFixed(this.digitPlaces)
return num === null ? num : num.toFixed(this.digitPlaces)
}, },
limitBlur(qId, valueType) { limitBlur(qId, valueType) {
const value = this.questionForm[qId] const value = this.questionForm[qId]

View File

@ -638,6 +638,7 @@ export default {
async close(questionsObj) { async close(questionsObj) {
if (questionsObj) { if (questionsObj) {
this.getReadingQuestionAndAnswer(questionsObj.visitTaskId) this.getReadingQuestionAndAnswer(questionsObj.visitTaskId)
this.refreshQuestions()
} }
this.activeItem.activeRowIndex = null this.activeItem.activeRowIndex = null
this.activeItem.activeCollapseId = null this.activeItem.activeCollapseId = null