| | |
| | | getStatisticsTable() { |
| | | getStatisticsTable().then(res => { |
| | | if(res.code == 1000) { |
| | | let result = res.list |
| | | // this.tableData = result |
| | | this.headerArry = result |
| | | console.log('this.headerArry====',this.headerArry) |
| | | // this.getData(result) |
| | | let data = [] |
| | | result.forEach((item,index) => { |
| | | let row = item.dataList |
| | | row.forEach((e,i) => { |
| | | let a = Object.assign({},e,{name: item.item}) |
| | | data.push(a) |
| | | }) |
| | | }) |
| | | this.tableData = result |
| | | console.log( this.tableData,' this.tableData===========') |
| | | console.log( this.headerArry,'this.headerArry===========') |
| | | |
| | | this.tableData = res.list |
| | | } |
| | | }) |
| | | }, |
| | | getData(result) { |
| | | let row = [] |
| | | this.tableData.forEach((e,index) => { |
| | | // row.push({ |
| | | // name: e.item |
| | | // }) |
| | | if(index == 0) { |
| | | this.headerArry = e |
| | | } |
| | | |
| | | e.dataList.forEach((c,i) => { |
| | | row.push({ |
| | | name: e.item, |
| | | "month": c.month , |
| | | "totalIncome": c.totalIncome, |
| | | "taxesIncome": c.taxesIncome, |
| | | "pay": c.pay, |
| | | "balance": c.balance, |
| | | "surplus": c.surplus || null |
| | | }) |
| | | }) |
| | | // this.headerArry = row |
| | | // this.tableData = row |
| | | console.log(this.headerArry) |
| | | }) |
| | | }, |
| | | shebaoShouzhiZongbiaoEcharts() { |