Commit 0f254ac4337cc11f397c5eb53a25ec09b4614955
Merge branch 'master' of http://39.98.150.180/webapp/GreenwayWeb
Showing
1 changed file
with
8 additions
and
3 deletions
yanshouban/src/views/analysis/statistics/index.vue
| ... | ... | @@ -126,7 +126,7 @@ import {QuestionGetAll,excelToTicketTypeSalesSituation} from '@/api/piaowu' |
| 126 | 126 | export default { |
| 127 | 127 | data() { |
| 128 | 128 | return { |
| 129 | - | |
| 129 | +flag:false, | |
| 130 | 130 | total: 1, |
| 131 | 131 | pageSize: 10, |
| 132 | 132 | currentPage: 1, |
| ... | ... | @@ -241,11 +241,15 @@ export default { |
| 241 | 241 | } |
| 242 | 242 | if (['销售数量(张)', '客单价(元)', '销售金额(元)'].includes(column.label)) { |
| 243 | 243 | const values = data.map(item => Number(item[column.property])) |
| 244 | + | |
| 244 | 245 | if (!values.every(value => isNaN(value))) { |
| 245 | 246 | sums[index] = values.reduce((prev, curr) => { |
| 246 | 247 | const value = Number(curr); |
| 248 | + | |
| 247 | 249 | if (!isNaN(value)) { |
| 250 | + | |
| 248 | 251 | return prev + curr; |
| 252 | + | |
| 249 | 253 | } else { |
| 250 | 254 | return prev; |
| 251 | 255 | } |
| ... | ... | @@ -259,8 +263,8 @@ export default { |
| 259 | 263 | }); |
| 260 | 264 | |
| 261 | 265 | return sums; |
| 262 | - } | |
| 263 | 266 | }, |
| 267 | + | |
| 264 | 268 | handleCurrentChange(val) { |
| 265 | 269 | this.currentPage = val |
| 266 | 270 | }, |
| ... | ... | @@ -281,7 +285,8 @@ export default { |
| 281 | 285 | }; |
| 282 | 286 | } |
| 283 | 287 | } |
| 284 | - } | |
| 288 | + }, | |
| 289 | + }, | |
| 285 | 290 | } |
| 286 | 291 | </script> |
| 287 | 292 | ... | ... |