预览计算问题修改
parent
0343ba6043
commit
372213c7e5
|
@ -433,7 +433,6 @@ export default {
|
|||
this.addOrEdit.visible = false
|
||||
},
|
||||
logic(rules, num = 0) {
|
||||
console.log(rules,'rules')
|
||||
try {
|
||||
if (rules.CalculateQuestionList.length === 0) {
|
||||
return false
|
||||
|
@ -452,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])
|
||||
|
@ -516,14 +513,12 @@ 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
|
||||
})
|
||||
// find的自动计算值number
|
||||
console.log('find', find)
|
||||
if (find) {
|
||||
console.log(v,'111111')
|
||||
var num = this.logic(v)
|
||||
if (num !== false) {
|
||||
this.$emit('setFormItemData', { key: v.QuestionId, val: num })
|
||||
|
@ -537,7 +532,6 @@ export default {
|
|||
})
|
||||
// find的自动计算值number
|
||||
if (find) {
|
||||
console.log(v,'222222')
|
||||
var num = this.logic(v)
|
||||
if (num !== false) {
|
||||
this.$emit('setFormItemData', { key: v.QuestionId, val: num })
|
||||
|
@ -551,12 +545,10 @@ export default {
|
|||
this.question.TableQuestions.Questions.forEach(v => {
|
||||
if (v.Type === 'number' && v.DataSource === 1) {
|
||||
var CalculateQuestions = JSON.parse(v.CalculateQuestions)
|
||||
var num, minArr=[],maxArr=[],arr=[]
|
||||
var num,arr=[]
|
||||
CalculateQuestions.forEach((o, i) => {
|
||||
if (i === 0) {
|
||||
num = parseFloat(this.QuestionsForm[o.TableQuestionId])
|
||||
minArr = [num];
|
||||
maxArr = [num];
|
||||
arr = [num];
|
||||
} else {
|
||||
switch (v.CustomCalculateMark) {
|
||||
|
@ -578,12 +570,12 @@ export default {
|
|||
num = arr.length === 0 ? 0 : num / arr.length
|
||||
break
|
||||
case 8:
|
||||
maxArr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]))
|
||||
num = maxArr.length === 0 ? 0 : Math.max(...maxArr)
|
||||
arr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]))
|
||||
num = arr.length === 0 ? 0 : Math.max(...arr)
|
||||
break
|
||||
case 9:
|
||||
minArr.push(parseFloat(this.QuestionsForm[o.TableQuestionId]))
|
||||
num = minArr.length === 0 ? 0 : Math.min(...minArr)
|
||||
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
|
||||
}
|
||||
|
@ -646,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'),
|
||||
|
|
Loading…
Reference in New Issue