自动计算bug修复

uat_us
caiyiling 2024-11-12 10:50:15 +08:00
parent 237e3eed60
commit 7c01819ced
2 changed files with 9 additions and 4 deletions

View File

@ -414,6 +414,9 @@ export default {
} catch (e) { } catch (e) {
console.log(e, v) console.log(e, v)
} }
if (this.question.Type === 'class') {
this.$emit("setFormItemData", { key: this.question.Id, val: v[this.question.Id], question: v })
}
this.formItemNumberChange(this.question.Id, false) this.formItemNumberChange(this.question.Id, false)
} }
}, },
@ -711,8 +714,6 @@ export default {
case 13: case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
dataArr.push(0)
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0 num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break; break;

View File

@ -467,7 +467,12 @@ export default {
} catch (e) { } catch (e) {
console.log(e, v); console.log(e, v);
} }
if (this.question.Type === 'class') {
this.$emit("setFormItemData", { key: this.question.Id, val: v[this.question.Id], question: v })
}
this.formItemNumberChange(this.question.Id, false); this.formItemNumberChange(this.question.Id, false);
}, },
}, },
}, },
@ -636,9 +641,8 @@ export default {
case 13: case 13:
if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) { if (!isNaN(parseFloat(this.questionForm[o.TableQuestionId]))) {
dataArr.push(parseFloat(this.questionForm[o.TableQuestionId])) dataArr.push(parseFloat(this.questionForm[o.TableQuestionId]))
} else {
dataArr.push(0)
} }
num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0 num = dataArr.length === 0 ? 0 : dataArr.reduce((acc, curr) => acc && curr) ? 1 : 0
break; break;
case 14: case 14: