功能完成报表任务完成

This commit is contained in:
2023-02-11 00:39:10 +08:00
parent 4bb155021c
commit 2aaab6a744
7 changed files with 90 additions and 69 deletions

View File

@@ -12,7 +12,7 @@ Page({
this.setData({expendID,rangeDate})
},
onShow() {
app.$api.listBillGroupDetail({expendId:this.data.expendID,rangeDate:this.data.rangeDate}).then(res =>{
app.$api.listGroupDetail({expendId:this.data.expendID,rangeDate:this.data.rangeDate}).then(res =>{
if (res.data){
let sumMoney = res.data.sumMoney
let billList = res.data.billList

View File

@@ -72,27 +72,7 @@ function initLineChart1(canvas, width, height, dpr) {
}
}
},
series: [{
name: '支出',
type: 'line',
smooth: true,
data: [18, 36, 65, 30, 78, 40, 33,123,123,12,23,123,123,123,123,213,23,21,12,31,3,12,32,31,3,31,5,4324,1,74,123,43]
}, {
name: '收入',
type: 'line',
smooth: true,
data: [12, 50, 51, 35, 70, 30, 20]
}, {
name: '转账',
type: 'line',
smooth: true,
data: [10, 30, 31, 50, 40, 20, 10]
}, {
name: '还款',
type: 'line',
smooth: true,
data: [50, 80, 11, 25, 30, 110, 20]
}]
series: line1Data
};
chart.setOption(option);
return chart;
@@ -134,27 +114,7 @@ function initLineChart2(canvas, width, height, dpr) {
}
// show: false
},
series: [{
name: '支出',
type: 'line',
smooth: true,
data: [18, 36, 65, 30, 78, 40, 33]
}, {
name: '收入',
type: 'line',
smooth: true,
data: [12, 50, 51, 35, 70, 30, 20]
}, {
name: '转账',
type: 'line',
smooth: true,
data: [10, 30, 31, 50, 40, 20, 10]
}, {
name: '还款',
type: 'line',
smooth: true,
data: [50, 80, 11, 25, 30, 110, 20]
}]
series: line2Data
};
chart.setOption(option);
return chart;
@@ -198,6 +158,78 @@ Page({
}
},
updateView(){
app.$api.listBillGroup({'rangeDate':this.data.showDate}).then(res => {
if (res){
let payTypeList = res.data
pieData = [];
if (payTypeList){
payTypeList.forEach(x => {
pieData = pieData.concat({
sId: x.expendId,
sDate: this.data.showDate,
value: x.progress,
name: x.moneyName
});
})
}
this.setData({payTypeList})
}
})
app.$api.listBillChart({'rangeDate':this.data.showDate}).then(res => {
if (res.data){
line1Data = [];
line2Data = [];
line1Data = line1Data.concat({
name: '支出',
type: 'line',
smooth: true,
data: res.data.lineDayExpend
})
line1Data = line1Data.concat({
name: '收入',
type: 'line',
smooth: true,
data: res.data.lineDayIncome
})
line1Data = line1Data.concat({
name: '转账',
type: 'line',
smooth: true,
data: res.data.lineDayTransfer
})
line1Data = line1Data.concat({
name: '还款',
type: 'line',
smooth: true,
data: res.data.lineDayRepayment
})
// 近六个月
line2Data = line2Data.concat({
name: '支出',
type: 'line',
smooth: true,
data: res.data.lineMonthExpend
})
line2Data = line2Data.concat({
name: '收入',
type: 'line',
smooth: true,
data: res.data.lineMonthIncome
})
line2Data = line2Data.concat({
name: '转账',
type: 'line',
smooth: true,
data: res.data.lineMonthTransfer
})
line2Data = line2Data.concat({
name: '还款',
type: 'line',
smooth: true,
data: res.data.lineMonthRepayment
})
}
})
app.$api.listBillByAMonth({'rangeDate':this.data.showDate}).then(res => {
if (res.data){
let accountList = res.data.accountList
@@ -220,23 +252,6 @@ Page({
this.setData({incomeList})
}
})
app.$api.listBillGroup({'rangeDate':this.data.showDate}).then(res => {
if (res){
let payTypeList = res.data
pieData = [];
if (payTypeList){
payTypeList.forEach(x => {
pieData = pieData.concat({
sId: x.expendId,
sDate: this.data.showDate,
value: x.progress,
name: x.moneyName
});
})
}
this.setData({payTypeList})
}
})
},
showPicker(e) {
const { mode } = e.currentTarget.dataset;

View File

@@ -44,6 +44,9 @@
/>
</t-cell-group>
</view>
<view wx:else class="empty-view" >
<t-empty icon="chart-bubble" description="本月无账单记录" />
</view>
<view class="placeholder"/>
</view>
</t-tab-panel>

View File

@@ -17,12 +17,12 @@
}
.chart_title{
margin-top: 18rpx;
margin-left: 20rpx;
margin-left: 25rpx;
color: orange;
}
.chart-title2{
margin-top: 50rpx;
margin-left: 20rpx;
margin-left: 25rpx;
color: orange;
}
ec-canvas {