Browse Source

fix statistics

organize
刘嘉炜 3 years ago
parent
commit
a317561c0f
  1. 2
      src/js/server.js
  2. 6
      src/pages/collection/info/info.vue
  3. 12
      src/pages/collection/list/list.vue
  4. 10
      src/pages/turnover/turnover.vue

2
src/js/server.js

@ -1,6 +1,6 @@
import util from '../utils/util';
// import { app as vm } from '../main';
const islog = false;
const islog = true;
export class Server {

6
src/pages/collection/info/info.vue

@ -1,7 +1,7 @@
<template>
<view class="collection-info">
<view class="ci-header">
<view class="ch-stadium" v-if="optionsQuery.stadium_id != 0">
<view class="ch-stadium">
<view class="cs-txt">当前门店</view>
<picker :range="stadiumList" range-key="name" @change="storeChange">
<view class="cs-picker">
@ -52,7 +52,7 @@
<block v-for="(e, i) in recordLs" :key="i">
<view class="cl-item">
<view class="ci-name">
<view>{{ e.desc || '-' }}</view>
<view>{{ e.scene_name || '-' }}</view>
<view :class="e.amount<=0?'black': ''">{{ e.amount>0?'+':'' }}{{ e.amount || '-' }}</view>
</view>
<view class="ci-line">
@ -214,7 +214,7 @@ export default {
}
if(_cur&&_cur.id){
this.curStadium = _cur;
}else if(!!+stadium_id){
}else{
this.curStadium = _all;
}
return this.stadiumList = _list;

12
src/pages/collection/list/list.vue

@ -20,7 +20,7 @@
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
<view class="ci-price">
<text></text>{{ e.day_actual_income_amount || 0 }}<text>.00</text>
<text></text>{{ e.count_type_actual_income_amount || 0 }}<text>.00</text>
</view>
<view class="ci-tip">日总收入</view>
<view class="ci-preview">
@ -59,7 +59,7 @@ export default {
}
},
onLoad(){
let _dateStr = util.formatDate({date: '2022-04-12'});
let _dateStr = util.formatDate({});
this.dateStr = _dateStr;
this.getRecordList(_dateStr);
},
@ -75,11 +75,14 @@ export default {
},
timeChange(e){
console.warn(e);
this.dateStr = e.detail.value;
let _date = e.detail.value || '';
this.dateStr = _date;
this.recordLs = [];
this.getRecordList(_date);
},
getRecordList(time = ''){
let { brandInfo } = this;
console.warn(brandInfo)
util.showLoad();
servers.get({
url: API.consumeCountLs,
data: {
@ -89,6 +92,7 @@ export default {
failMsg: '加载列表失败!'
})
.then(res=>{
util.hideLoad();
let _list = res.list || [];
this.recordLs = _list;
})

10
src/pages/turnover/turnover.vue

@ -219,8 +219,10 @@ export default {
let _date;
if(timeTabIdx == 0)_date = curTime.date || ''
// if(timeTabIdx == 1)_date = util.formatDate({}).substr(0,10);
if(timeTabIdx == 2)_date = `${curTime.month}-01` || '' //
if(timeTabIdx == 3)_date = `${curTime.year}-01-01` || ''//
// if(timeTabIdx == 2)_date = `${curTime.month}-01` || '' //
if(timeTabIdx == 2)_date = curTime.month || '' //
// if(timeTabIdx == 3)_date = `${curTime.year}-01-01` || ''//
if(timeTabIdx == 3)_date = curTime.year || ''//
let _type = this.getCountType({ tab_id: tabID, time_tab_idx: timeTabIdx });
@ -337,8 +339,8 @@ export default {
'filter[stadium_id:eq]': stadium_id,
'filter[count_type:eq]': count_type,
'filter[time_str:eq]': time_str,
'filter[time_str:egt]': time_str_max,
'filter[time_str:elt]': time_str_min,
'filter[time_str:egt]': time_str_min,
'filter[time_str:elt]': time_str_max,
},
failMsg: '加载失败!'
})

Loading…
Cancel
Save