diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue index 2c4f5256..0f68c31c 100644 --- a/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue +++ b/src/views/trials/trials-panel/setting/reading-unit/components/QuestionFormItem.vue @@ -451,8 +451,6 @@ export default { }) break case 6: - console.log(this.questionForm[o.QuestionId]) - console.log(this.questionForm) this.questionForm[o.QuestionId].forEach((q, qi) => { if (qi === 0) { num = parseFloat(q[o.TableQuestionId]) @@ -515,7 +513,6 @@ export default { formItemNumberChange(questionId, isTable) { if (isTable) { this.calculationList.forEach((v, i) => { - console.log(v, i) var find = v.CalculateQuestionList.filter(o => { return o.QuestionId === questionId }) @@ -548,23 +545,38 @@ export default { this.question.TableQuestions.Questions.forEach(v => { if (v.Type === 'number' && v.DataSource === 1) { var CalculateQuestions = JSON.parse(v.CalculateQuestions) - var num + var num,arr=[] CalculateQuestions.forEach((o, i) => { if (i === 0) { - num = this.QuestionsForm[o.TableQuestionId] + num = parseFloat(this.QuestionsForm[o.TableQuestionId]) + arr = [num]; } else { switch (v.CustomCalculateMark) { case 1: - num += this.QuestionsForm[o.TableQuestionId] + num += parseFloat(this.QuestionsForm[o.TableQuestionId]) break case 2: - num -= this.QuestionsForm[o.TableQuestionId] + num -= parseFloat(this.QuestionsForm[o.TableQuestionId]) break case 3: - num *= this.QuestionsForm[o.TableQuestionId] + num *= parseFloat(this.QuestionsForm[o.TableQuestionId]) break 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 } } @@ -626,7 +638,6 @@ export default { this.$emit('setFormItemData', obj) }, async uploadScreenshot(param) { - console.log(this.visitTaskId) if (!this.visitTaskId) { const loading = this.$loading({ target: document.querySelector('.ecrf-wrapper'),