diff --git a/yanshouban/src/views/analysis/statistics/index.vue b/yanshouban/src/views/analysis/statistics/index.vue index 295e45b..146a035 100644 --- a/yanshouban/src/views/analysis/statistics/index.vue +++ b/yanshouban/src/views/analysis/statistics/index.vue @@ -126,7 +126,7 @@ import {QuestionGetAll,excelToTicketTypeSalesSituation} from '@/api/piaowu' export default { data() { return { - +flag:false, total: 1, pageSize: 10, currentPage: 1, @@ -241,11 +241,15 @@ export default { } if (['销售数量(张)', '客单价(元)', '销售金额(元)'].includes(column.label)) { const values = data.map(item => Number(item[column.property])) + if (!values.every(value => isNaN(value))) { sums[index] = values.reduce((prev, curr) => { const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { return prev; } @@ -259,8 +263,8 @@ export default { }); return sums; - } }, + handleCurrentChange(val) { this.currentPage = val }, @@ -281,7 +285,8 @@ export default { }; } } - } + }, + }, }