功能完成报表任务完成

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

@@ -88,6 +88,10 @@ t-cell {
bottom:50rpx; bottom:50rpx;
} }
/* 占位置 */ /* 占位置 */
.empty-view {
color: red;
margin-top: 200rpx;
}
.placeholder { .placeholder {
height: 168rpx; height: 168rpx;
} }

View File

@@ -12,7 +12,7 @@ Page({
this.setData({expendID,rangeDate}) this.setData({expendID,rangeDate})
}, },
onShow() { 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){ if (res.data){
let sumMoney = res.data.sumMoney let sumMoney = res.data.sumMoney
let billList = res.data.billList let billList = res.data.billList

View File

@@ -72,27 +72,7 @@ function initLineChart1(canvas, width, height, dpr) {
} }
} }
}, },
series: [{ series: line1Data
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]
}]
}; };
chart.setOption(option); chart.setOption(option);
return chart; return chart;
@@ -134,27 +114,7 @@ function initLineChart2(canvas, width, height, dpr) {
} }
// show: false // show: false
}, },
series: [{ series: line2Data
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]
}]
}; };
chart.setOption(option); chart.setOption(option);
return chart; return chart;
@@ -198,6 +158,78 @@ Page({
} }
}, },
updateView(){ 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 => { app.$api.listBillByAMonth({'rangeDate':this.data.showDate}).then(res => {
if (res.data){ if (res.data){
let accountList = res.data.accountList let accountList = res.data.accountList
@@ -220,23 +252,6 @@ Page({
this.setData({incomeList}) 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) { showPicker(e) {
const { mode } = e.currentTarget.dataset; const { mode } = e.currentTarget.dataset;

View File

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

View File

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

View File

@@ -18,7 +18,3 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.empty-view {
margin-top: 200rpx;
}

View File

@@ -1,10 +1,10 @@
import utils from './util' import utils from './util'
//testURL //testURL
// const BASE_URL = 'http://127.0.0.1:8080/wx'; const BASE_URL = 'http://127.0.0.1:8080/wx';
//devURL //devURL
// const BASE_URL = 'https://lmqhznn.goho.co/wx'; // const BASE_URL = 'https://lmqhznn.goho.co/wx';
//prodURL //prodURL
const BASE_URL = 'https://www.qnforever.top/wx'; // const BASE_URL = 'https://www.qnforever.top/wx';
function buildURL(url, needToken) { function buildURL(url, needToken) {
let userId = wx.getStorageSync('userId'); let userId = wx.getStorageSync('userId');
if (!userId && url != '/user/login') { if (!userId && url != '/user/login') {
@@ -250,8 +250,11 @@ export default {
listBillGroup(params){ listBillGroup(params){
return fetchPost('/user/bills/group/list' ,params,true,false); return fetchPost('/user/bills/group/list' ,params,true,false);
}, },
listBillGroupDetail(params){ listGroupDetail(params){
return fetchPost('/user/bills/group/detail' ,params,true,false); return fetchPost('/user/bills/group/detail' ,params,true,false);
}, },
listBillChart(params) {
return fetchPost('/user/bills/line/chart' ,params,true,false);
}
} }