|
@@ -434,7 +434,8 @@ export default {
|
|
console.log(res, '垃圾产生量')
|
|
console.log(res, '垃圾产生量')
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
Object.keys(this.rubbishWeightData).map(item => {
|
|
Object.keys(this.rubbishWeightData).map(item => {
|
|
- this.rubbishWeightData[item] = this.formatter(Math.round((res.data.list.find(key => key.rubbishType == item).rubbishWeight) / 1000))
|
|
|
|
|
|
+ let p = res.data.list.find(key => key.rubbishType == item)
|
|
|
|
+ this.rubbishWeightData[item] = p ? this.formatter(Math.round(p.rubbishWeight / 1000)) : 0
|
|
})
|
|
})
|
|
this.rubbishWeightTotal = this.formatter(Math.round(res.data.total / 1000))
|
|
this.rubbishWeightTotal = this.formatter(Math.round(res.data.total / 1000))
|
|
} else {
|
|
} else {
|