diff --git a/package/packagestat/pages/stat/stat.vue b/package/packagestat/pages/stat/stat.vue
index 996530d..9320405 100644
--- a/package/packagestat/pages/stat/stat.vue
+++ b/package/packagestat/pages/stat/stat.vue
@@ -11,29 +11,12 @@
{{item.data.recharge==null?0:item.data.recharge.total}}
-
-
- {{item.data.recharge==null?0:item.data.recharge.cash}}
-
-
-
-
-
- {{item.data.recharge==null?0:item.data.recharge.total_online}}
-
-
-
+
- {{item.data.recharge==null?0:item.data.recharge.pos}}
+ {{mod.value}}
@@ -41,31 +24,12 @@
{{item.data.refund}}
-
-
-
- {{item.data.refund_by_methods==null?0:item.data.refund_by_methods.cash}}
-
-
-
+
-
- {{item.data.refund_by_methods==null?0:(item.data.refund_by_methods.online)}}
-
-
-
-
-
+
+ {{mod.label}}
+ {{mod.value}}
@@ -74,29 +38,12 @@
{{item.data.budget.total}}
-
-
- {{item.data.budget.cash}}
-
-
-
+
- {{item.data.budget.online}}
-
-
-
-
-
+
+ {{mod.label}}
+ {{mod.value}}
@@ -143,10 +90,12 @@
for (var m of that.info) {
that.loadData(m.type, i,
function(r, i) {
- console.log(r.recharge)
-
-
- r.refund_by_methods.online =parseFloat(r.refund_by_methods.weixin) +parseFloat(r.refund_by_methods.alipay);
+ console.log(r.recharge)
+
+
+ r.refund_by_methods = r.refund_by_methods || {};
+ r.recharge = r.recharge || {};
+ r.refund_by_methods.online = that.num(r.refund_by_methods.weixin) + that.num(r.refund_by_methods.alipay);
that.info[i].data = r;
@@ -154,15 +103,142 @@
total: r.recharge.total - r.refund,
- cash: r.recharge.cash - r.refund_by_methods.cash,
-
- online: r.recharge.total_online - r.refund_by_methods.weixin-r.refund_by_methods.alipay
+ cash: that.num(r.recharge.cash) - that.num(r.refund_by_methods.cash),
+ weixin: that.num(r.recharge.weixin) - that.num(r.refund_by_methods.weixin),
+ alipay: that.num(r.recharge.alipay) - that.num(r.refund_by_methods.alipay),
+ pos: that.num(r.recharge.pos) - that.num(r.refund_by_methods.pos),
+ offline_pos: that.num(r.recharge.offline_pos) - that.num(r.refund_by_methods.offline_pos),
+ offline_qrcode: that.num(r.recharge.offline_qrcode) - that.num(r.refund_by_methods.offline_qrcode),
+ transfer: that.num(r.recharge.transfer) - that.num(r.refund_by_methods.transfer),
+ offline_cash: that.num(r.recharge.offline_cash) - that.num(r.refund_by_methods.offline_cash)
};
})
i++;
}
},
methods: {
+ num: function(v) {
+ return parseFloat(v || 0);
+ },
+ getRechargeOfflineTotal: function(recharge) {
+ recharge = recharge || {};
+ return this.num(recharge.pos) + this.num(recharge.transfer) + this.num(recharge.offline_pos) + this
+ .num(recharge.offline_qrcode) + this.num(recharge.offline_cash);
+ },
+ getRefundOfflineTotal: function(refundByMethods) {
+ refundByMethods = refundByMethods || {};
+ return this.num(refundByMethods.pos) + this.num(refundByMethods.transfer) + this.num(
+ refundByMethods.offline_pos) + this.num(refundByMethods.offline_qrcode) + this.num(
+ refundByMethods.offline_cash);
+ },
+ getRechargeItems: function(recharge) {
+ recharge = recharge || {};
+ return [{
+ label: "现金(元)",
+ value: this.num(recharge.cash),
+ barClass: ""
+ }, {
+ label: "微信(元)",
+ value: this.num(recharge.weixin),
+ barClass: "green"
+ }, {
+ label: "支付宝(元)",
+ value: this.num(recharge.alipay),
+ barClass: "blue"
+ }, {
+ label: "刷卡(元)",
+ value: this.num(recharge.pos),
+ barClass: ""
+ }, {
+ label: "线下POS(元)",
+ value: this.num(recharge.offline_pos),
+ barClass: "green"
+ }, {
+ label: "线下二维码(元)",
+ value: this.num(recharge.offline_qrcode),
+ barClass: "blue"
+ }, {
+ label: "转账(元)",
+ value: this.num(recharge.transfer),
+ barClass: ""
+ }, {
+ label: "线下现金(元)",
+ value: this.num(recharge.offline_cash),
+ barClass: "green"
+ }];
+ },
+ getRefundItems: function(refundByMethods) {
+ refundByMethods = refundByMethods || {};
+ return [{
+ label: "现金(元)",
+ value: this.num(refundByMethods.cash),
+ barClass: ""
+ }, {
+ label: "微信(元)",
+ value: this.num(refundByMethods.weixin),
+ barClass: "green"
+ }, {
+ label: "支付宝(元)",
+ value: this.num(refundByMethods.alipay),
+ barClass: "blue"
+ }, {
+ label: "刷卡(元)",
+ value: this.num(refundByMethods.pos),
+ barClass: ""
+ }, {
+ label: "线下POS(元)",
+ value: this.num(refundByMethods.offline_pos),
+ barClass: "green"
+ }, {
+ label: "线下二维码(元)",
+ value: this.num(refundByMethods.offline_qrcode),
+ barClass: "blue"
+ }, {
+ label: "转账(元)",
+ value: this.num(refundByMethods.transfer),
+ barClass: ""
+ }, {
+ label: "线下现金(元)",
+ value: this.num(refundByMethods.offline_cash),
+ barClass: "green"
+ }];
+ },
+ getBudgetItems: function(budget) {
+ budget = budget || {};
+ return [{
+ label: "现金(元)",
+ value: this.num(budget.cash),
+ barClass: ""
+ }, {
+ label: "微信(元)",
+ value: this.num(budget.weixin),
+ barClass: "green"
+ }, {
+ label: "支付宝(元)",
+ value: this.num(budget.alipay),
+ barClass: "blue"
+ }, {
+ label: "刷卡(元)",
+ value: this.num(budget.pos),
+ barClass: ""
+ }, {
+ label: "线下POS(元)",
+ value: this.num(budget.offline_pos),
+ barClass: "green"
+ }, {
+ label: "线下二维码(元)",
+ value: this.num(budget.offline_qrcode),
+ barClass: "blue"
+ }, {
+ label: "转账(元)",
+ value: this.num(budget.transfer),
+ barClass: ""
+ }, {
+ label: "线下现金(元)",
+ value: this.num(budget.offline_cash),
+ barClass: "green"
+ }];
+ },
toinfo: function(item, type) {
uni.navigateTo({
url: "../statinfo/statinfo?type=" + type + "&from=" + item.type
@@ -219,6 +295,7 @@
.statBox {
display: flex;
margin-top: 20rpx;
+ flex-wrap: wrap;
}
.statItem {
diff --git a/unpackage/dist/build/web/index.html b/unpackage/dist/build/web/index.html
index 3bec175..a92ff11 100644
--- a/unpackage/dist/build/web/index.html
+++ b/unpackage/dist/build/web/index.html
@@ -1,2 +1,2 @@
护工管理
\ No newline at end of file
+ document.write('')