|
@@ -165,7 +165,7 @@ export default {
|
|
|
|
|
|
|
|
|
return this.months.reduce((prev, key) => {
|
|
|
- return addition(prev, (row.result[key]['1'] || {}).num || 0)
|
|
|
+ return addition(prev, ((row.result[key] || {})['1'] || {}).num || 0)
|
|
|
},0)
|
|
|
},
|
|
|
getField(month, row, isTotalPrice){
|
|
@@ -179,7 +179,7 @@ export default {
|
|
|
return Number(total_price) === 0 ? "0元" : unit2TenThousand(total_price) + "元"
|
|
|
}
|
|
|
|
|
|
- return (row.result[month]['1'] || {}).num || 0
|
|
|
+ return ((row.result[month] || {})['1'] || {}).num || 0
|
|
|
},
|
|
|
async searchList() {
|
|
|
// if(!this.year){
|
|
@@ -192,12 +192,13 @@ export default {
|
|
|
start_y: this.year,
|
|
|
});
|
|
|
|
|
|
- if (res.code === 0 && res.data && res.data.result.length > 0) {
|
|
|
- this.tableData = res.data.result
|
|
|
- const { noAddr } = res.data
|
|
|
+ if (res.code === 0 && res.data) {
|
|
|
+ const result = Object.keys(res.data.result).reduce((prev, key) => ([...prev, res.data.result[key]]),[])
|
|
|
+ this.tableData = result
|
|
|
+ const { noAddr } = res.data
|
|
|
|
|
|
const tableData = []
|
|
|
- for(const item of res.data.result){
|
|
|
+ for(const item of result){
|
|
|
const { name, result } = (item || {});
|
|
|
for(let i = 0; i < 2; i++){
|
|
|
tableData.push({name,
|