|
@@ -15,7 +15,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="revenue-line">
|
|
|
- <ColumnChart v-if="chartData.series[0].data.length" :chartData="chartData" :title="title" :opts="opts"/>
|
|
|
+ <ColumnChart v-if="chartData.series[0].data.length || chartData.series[1].data.length" :chartData="chartData" :title="title" :opts="opts"/>
|
|
|
<view class="empty" v-else>
|
|
|
<u-empty></u-empty>
|
|
|
</view>
|
|
@@ -57,7 +57,7 @@
|
|
|
}]
|
|
|
},
|
|
|
legend: {
|
|
|
- show: false
|
|
|
+ show: true
|
|
|
},
|
|
|
dataLabel: false,
|
|
|
extra: {
|
|
@@ -73,10 +73,14 @@
|
|
|
return {
|
|
|
chartData: {
|
|
|
categories: [],
|
|
|
- series: [{
|
|
|
- name: '',
|
|
|
- data: []
|
|
|
- }]
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '路段',
|
|
|
+ data: []
|
|
|
+ }, {
|
|
|
+ name: '停车场',
|
|
|
+ data: []
|
|
|
+ }]
|
|
|
},
|
|
|
searchContent: {
|
|
|
text: '',
|
|
@@ -88,37 +92,41 @@
|
|
|
queryDate: ''
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getDict();
|
|
|
- },
|
|
|
+ // created() {
|
|
|
+ // this.getDict();
|
|
|
+ // },
|
|
|
methods: {
|
|
|
getData({ reportType, queryDate }) {
|
|
|
this.reportType = reportType
|
|
|
this.queryDate = queryDate
|
|
|
- this.getIncomeData()
|
|
|
+ this.getDict();
|
|
|
},
|
|
|
getDict() {
|
|
|
uni.$u.api.getDictApi({ type: 'income_type'}).then(res => {
|
|
|
- console.log(res)
|
|
|
if (res.code === 200) {
|
|
|
- let list = res.data.map((item => {
|
|
|
- return {
|
|
|
- text: item.dictLabel,
|
|
|
- value: item.dictValue
|
|
|
- }
|
|
|
- }))
|
|
|
- this.dictList = [list]
|
|
|
+ let list = res.data.map((item => {
|
|
|
+ return {
|
|
|
+ text: item.dictLabel,
|
|
|
+ value: item.dictValue
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ this.dictList = [list]
|
|
|
+ if (!this.searchContent.value) {
|
|
|
this.searchContent = this.dictList[0][0]
|
|
|
+ }
|
|
|
+ this.getIncomeData()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getIncomeData() {
|
|
|
+ this.chartData.categories = []
|
|
|
+ this.chartData.series[0].data = []
|
|
|
+ this.chartData.series[1].data = []
|
|
|
uni.$u.api.operationalAnalysisApi.getIncomeDataApi({
|
|
|
reportType: this.reportType,
|
|
|
queryDate: this.queryDate,
|
|
|
incomeType: this.searchContent.value
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
if (res.code === 200) {
|
|
|
if (res.data.itemList && res.data.itemList.length) {
|
|
|
this.chartData.categories = res.data.itemList.map(item => {
|
|
@@ -127,9 +135,22 @@
|
|
|
this.chartData.series[0].data = res.data.itemList.map(item => {
|
|
|
return item.amt
|
|
|
})
|
|
|
- } else {
|
|
|
- this.chartData.categories = []
|
|
|
- this.chartData.series[0].data = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ uni.$u.api.operationalAnalysisApi.getParkingIncomeDataApi({
|
|
|
+ reportType: this.reportType,
|
|
|
+ queryDate: this.queryDate,
|
|
|
+ incomeType: this.searchContent.value
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (res.data.itemList && res.data.itemList.length) {
|
|
|
+ this.chartData.categories = res.data.itemList.map(item => {
|
|
|
+ return item.statisTime
|
|
|
+ })
|
|
|
+ this.chartData.series[1].data = res.data.itemList.map(item => {
|
|
|
+ return item.amt
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|