|
@@ -4,8 +4,7 @@
|
|
|
<view class="same-month">
|
|
<view class="same-month">
|
|
|
<view class="title">
|
|
<view class="title">
|
|
|
<view class="vertical-line"></view>
|
|
<view class="vertical-line"></view>
|
|
|
- <view class="title-txt"><text class="caption">当月详情</text><text
|
|
|
|
|
- class="hah">/</text>时间更新到{{sameMonthData.dataTime}}</view>
|
|
|
|
|
|
|
+ <view class="title-txt"><text class="caption">当月详情</text><text class="hah">/</text>时间更新到{{sameMonthData.dataTime}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="content-details">
|
|
<view class="content-details">
|
|
|
<view class="item">
|
|
<view class="item">
|
|
@@ -177,7 +176,7 @@
|
|
|
if (res.data.data.length == 0) {
|
|
if (res.data.data.length == 0) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
let zongEnd = res.data.data[0].zongEnd
|
|
let zongEnd = res.data.data[0].zongEnd
|
|
|
let totalMoney = res.data.data[0].totalMoney
|
|
let totalMoney = res.data.data[0].totalMoney
|
|
|
let totalPower = res.data.data[0].totalPower
|
|
let totalPower = res.data.data[0].totalPower
|
|
@@ -230,42 +229,48 @@
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '加载数据异常',
|
|
title: '加载数据异常',
|
|
|
duration: 1500
|
|
duration: 1500
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ return;
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ var tableData = []
|
|
|
for (let i = 0; i < res.data.rows.length; i++) {
|
|
for (let i = 0; i < res.data.rows.length; i++) {
|
|
|
- let dataTime = res.data.rows[i].dataTime
|
|
|
|
|
- let zongStart = res.data.rows[i].zongStart
|
|
|
|
|
- let zongEnd = res.data.rows[i].zongEnd
|
|
|
|
|
- let totalPower = res.data.rows[i].totalPower
|
|
|
|
|
- let totalMoney = res.data.rows[i].totalMoney
|
|
|
|
|
|
|
+ let dataTime = res.data.rows[i].dataTime;
|
|
|
|
|
+ let zongStart = res.data.rows[i].zongStart;
|
|
|
|
|
+ let zongEnd = res.data.rows[i].zongEnd;
|
|
|
|
|
+ let totalPower = res.data.rows[i].totalPower;
|
|
|
|
|
+ let totalMoney = res.data.rows[i].totalMoney;
|
|
|
|
|
|
|
|
- zongStart = zongStart.toFixed(2)
|
|
|
|
|
- zongEnd = zongEnd.toFixed(2)
|
|
|
|
|
- totalPower = totalPower.toFixed(2)
|
|
|
|
|
- totalMoney = totalMoney.toFixed(2)
|
|
|
|
|
|
|
+ zongStart = zongStart.toFixed(2);
|
|
|
|
|
+ zongEnd = zongEnd.toFixed(2);
|
|
|
|
|
+ totalPower = totalPower.toFixed(2);
|
|
|
|
|
+ totalMoney = totalMoney.toFixed(2);
|
|
|
|
|
|
|
|
if (this.moneyPer <= 0.00) {
|
|
if (this.moneyPer <= 0.00) {
|
|
|
if (totalPower > 0.00 && totalMoney > 0.00) {
|
|
if (totalPower > 0.00 && totalMoney > 0.00) {
|
|
|
- let moneyPer = totalMoney / totalPower
|
|
|
|
|
- this.moneyPer = moneyPer.toFixed(2)
|
|
|
|
|
|
|
+ let moneyPer = totalMoney / totalPower;
|
|
|
|
|
+ this.moneyPer = moneyPer.toFixed(2);
|
|
|
|
|
|
|
|
if (this.moneyPer <= 0.00) {
|
|
if (this.moneyPer <= 0.00) {
|
|
|
- this.moneyPer = 0.61
|
|
|
|
|
|
|
+ this.moneyPer = 0.61;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- totalMoney = '¥' + totalMoney
|
|
|
|
|
- this.tableData.push({
|
|
|
|
|
|
|
+ totalMoney = '¥' + totalMoney;
|
|
|
|
|
+ tableData.push({
|
|
|
dataTime,
|
|
dataTime,
|
|
|
zongStart,
|
|
zongStart,
|
|
|
zongEnd,
|
|
zongEnd,
|
|
|
totalPower,
|
|
totalPower,
|
|
|
totalMoney
|
|
totalMoney
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+ this.tableData = tableData.filter(function(item, index, self) {
|
|
|
|
|
+ return index === self.findIndex(function(t) {
|
|
|
|
|
+ return t.dataTime === item.dataTime && t.totalPower === item.totalPower && t.totalMoney === item.totalMoney;
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -364,4 +369,4 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|