uat_us
caiyiling 2024-03-28 09:31:19 +08:00
commit 9c16e74d3e
1 changed files with 21 additions and 10 deletions

View File

@ -451,8 +451,6 @@ export default {
}) })
break break
case 6: case 6:
console.log(this.questionForm[o.QuestionId])
console.log(this.questionForm)
this.questionForm[o.QuestionId].forEach((q, qi) => { this.questionForm[o.QuestionId].forEach((q, qi) => {
if (qi === 0) { if (qi === 0) {
num = parseFloat(q[o.TableQuestionId]) num = parseFloat(q[o.TableQuestionId])
@ -515,7 +513,6 @@ export default {
formItemNumberChange(questionId, isTable) { formItemNumberChange(questionId, isTable) {
if (isTable) { if (isTable) {
this.calculationList.forEach((v, i) => { this.calculationList.forEach((v, i) => {
console.log(v, i)
var find = v.CalculateQuestionList.filter(o => { var find = v.CalculateQuestionList.filter(o => {
return o.QuestionId === questionId return o.QuestionId === questionId
}) })
@ -548,23 +545,38 @@ export default {
this.question.TableQuestions.Questions.forEach(v => { this.question.TableQuestions.Questions.forEach(v => {
if (v.Type === 'number' && v.DataSource === 1) { if (v.Type === 'number' && v.DataSource === 1) {
var CalculateQuestions = JSON.parse(v.CalculateQuestions) var CalculateQuestions = JSON.parse(v.CalculateQuestions)
var num var num,arr=[]
CalculateQuestions.forEach((o, i) => { CalculateQuestions.forEach((o, i) => {
if (i === 0) { if (i === 0) {
num = this.QuestionsForm[o.TableQuestionId] num = parseFloat(this.QuestionsForm[o.TableQuestionId])
arr = [num];
} else { } else {
switch (v.CustomCalculateMark) { switch (v.CustomCalculateMark) {
case 1: case 1:
num += this.QuestionsForm[o.TableQuestionId] num += parseFloat(this.QuestionsForm[o.TableQuestionId])
break break
case 2: case 2:
num -= this.QuestionsForm[o.TableQuestionId] num -= parseFloat(this.QuestionsForm[o.TableQuestionId])
break break
case 3: case 3:
num *= this.QuestionsForm[o.TableQuestionId] num *= parseFloat(this.QuestionsForm[o.TableQuestionId])
break break
case 4: case 4:
num /= this.QuestionsForm[o.TableQuestionId] num /= parseFloat(this.QuestionsForm[o.TableQuestionId])
break
case 7:
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]))
num += parseFloat(this.QuestionsForm[o.TableQuestionId])
num = arr.length === 0 ? 0 : num / arr.length
break
case 8:
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]))
num = arr.length === 0 ? 0 : Math.max(...arr)
break
case 9:
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]))
num = arr.length === 0 ? 0 : Math.min(...arr)
// console.log('min', this.questionForm[o.QuestionId], arr, num)
break break
} }
} }
@ -626,7 +638,6 @@ export default {
this.$emit('setFormItemData', obj) this.$emit('setFormItemData', obj)
}, },
async uploadScreenshot(param) { async uploadScreenshot(param) {
console.log(this.visitTaskId)
if (!this.visitTaskId) { if (!this.visitTaskId) {
const loading = this.$loading({ const loading = this.$loading({
target: document.querySelector('.ecrf-wrapper'), target: document.querySelector('.ecrf-wrapper'),