Browse Source

Merge branch 'dev'

feat-230721
刘嘉炜 3 years ago
parent
commit
7999b8de6e
  1. 18512
      package-lock.json
  2. 11
      src/js/api.js
  3. 12
      src/pages.json
  4. 458
      src/pages/collection/info/info.vue
  5. 223
      src/pages/collection/list/list.vue
  6. 4
      src/pages/index/index.vue
  7. 280
      src/pages/turnover/turnover.vue
  8. BIN
      src/static/images/icon/question_mark.png
  9. 10
      src/subpackage/device/pages/switch_manage/switch_manage.vue

18512
package-lock.json
File diff suppressed because it is too large
View File

11
src/js/api.js

@ -20,6 +20,13 @@ export const API = {
collectionRecord: `${ORIGIN}/admin/assistant/collection/record`, // 收款记录
collectionDetails: `${ORIGIN}/admin/assistant/collection/details`, // 收款记录-收款明细
// 20220422 收款记录
consumeCountLs: `${ORIGIN}/admin/stadium/consumeCount/list`, // 收款记录
consumeCountDetailLs: `${ORIGIN}/admin/stadium/consumeCountDetail/list`, // 收款明细列表
consumeCountGetScene: `${ORIGIN}/consumeRecordScene/list`, // 场景列表
consumeCountStadiumList: `${ORIGIN}/admin/assistant/consume/stadium/list`, // 店铺列表
// reservationOrder: `${ORIGIN}/admin/stadium/order/list`, // 预约订单
reservationOrder:`${ORIGIN}/admin/assistant/stadiumOrder/list`, //k-订单管理-预约订单列表 PM:2021/4/19
@ -49,6 +56,10 @@ export const API = {
turnoverBrand: `${ORIGIN}/admin/assistant/turnover/brand/calc`, // 营业额记录-品牌
turnoverStadium: `${ORIGIN}/admin/assistant/turnover/brand/stadium/calc`, // 营业额记录-门店
// 20220415 新统计接口
consumeCountGet: `${ORIGIN}/admin/stadium/consumeCount/get`, // 收入统计获取 包含年月日近7天
turnoverDay: `${ORIGIN}/admin/assistant/turnover/calc/day`, // 营业额记录-时间选择-天
turnoverMonth: `${ORIGIN}/admin/assistant/turnover/calc/month`, // 营业额记录-时间选择-月
turnoverYear: `${ORIGIN}/admin/assistant/turnover/calc/year`, // 营业额记录-时间选择-年

12
src/pages.json

@ -104,6 +104,18 @@
}
},
{
"path": "pages/collection/info/info",
"style": {
"navigationBarTitleText": "收款明细"
}
},
{
"path": "pages/collection/list/list",
"style": {
"navigationBarTitleText": "收款记录"
}
},
{
"path": "pages/collection/detail/detail",
"style": {
"navigationBarTitleText": "收款明细"

458
src/pages/collection/info/info.vue

@ -0,0 +1,458 @@
<template>
<view class="collection-info">
<view class="ci-header">
<view class="ch-stadium">
<view class="cs-txt">当前门店</view>
<picker :range="stadiumList" range-key="name" @change="storeChange">
<view class="cs-picker">
<input :value="curStadium.name || '-'" disabled />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
</view>
<view class="ch-date-scene">
<view class="cds-item">
<view class="ci-txt">日期</view>
<view class="ci-frame ci-date">
<input disabled :value="curDate || '-'" />
<view></view>
<picker mode="date" @change="dateChange">
<image mode="aspectFit" src="/static/images/icon/calendar.png"></image>
</picker>
</view>
</view>
<view class="cds-item">
<view class="ci-txt">场景</view>
<view class="ci-frame ci-scene">
<picker class="cs-picker" :range="sceneList" range-key="name" @change="sceneChange">
<view class="cp-picker-frame">
<input disabled :value="curScene.name || '-'" />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png" style="transform: rotateZ(90deg);"></image>
</view>
</picker>
</view>
</view>
</view>
</view>
<view class="ci-tab">
<view class="ct-item" @click="typeChange(0)">
<view :class="[curType == 0?'active':'']">全部</view>
</view>
<view class="ct-item" @click="typeChange(1)">
<view :class="[curType == 1?'active':'']">退款</view>
</view>
</view>
<view class="ci-total">
收款{{ totalInfo.income_num || 0 }}<text>{{ totalInfo.income_amount || 0 }}</text>) 退款{{ totalInfo.refund_num || 0 }}<text>{{ totalInfo.refund_amount || 0 }}</text>
</view>
<view class="ci-ls">
<block v-for="(e, i) in recordLs" :key="i">
<view class="cl-item">
<view class="ci-name">
<view>{{ e.scene_name || '-' }}</view>
<view :class="e.amount<=0?'black': ''">{{ e.amount>0?'+':'' }}{{ e.amount || '-' }}</view>
</view>
<view class="ci-line">
<view>{{ e.order_no || '-' }}</view>
<view v-if="e.amount<=0">{{ e.refund_desc || '-' }}</view>
</view>
<view class="ci-line">
<view>{{ e.pay_time || '-' }}</view>
<view></view>
</view>
</view>
</block>
</view>
</view>
</template>
<script>
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
import util from '../../../utils/util'
import { mapState } from 'vuex';
export default {
computed: {
...mapState(['brandInfo']),
},
data(){
return {
optionsQuery: {
// stadium_id_filter
// brand_id
},
stadiumList: [],
curStadium: {},
sceneList: [],
curScene: {},
curDate: '',
curType: 0, // 0 -> , 1 -> 退
recordLs: [],
totalInfo: {},
page: 1
}
},
onReachBottom(){
let { curStadium, optionsQuery, curScene, curDate, curType, page } = this;
let _query = {
brand_id: optionsQuery.brand_id || '',
stadium_id: curStadium.val || '',
time_str: curDate,
scene: curScene.scene,
type: curType == 1 ? '退款' : '全部',
page: ++page
}
this.getRecordLs(_query);
},
onLoad(options){
this.optionsQuery = options || {};
this.initPage(options);
},
methods: {
typeChange(idx){
this.curType = idx;
this.$nextTick(_=>this.refreshList());
},
async initPage(options){
let _stadiumLs = await this.getStoreList(options.stadium_id_filter);
let _sceneLs = await this.getSceneList();
this.curDate = util.formatDate({});
this.$nextTick(_=>this.refreshList());
},
refreshList(){
let { curStadium, optionsQuery, curScene, curDate, curType } = this;
this.page = 1;
this.recordLs = [];
let _query = {
brand_id: optionsQuery.brand_id || '',
stadium_id: curStadium.val || '',
time_str: curDate,
scene: curScene.scene,
type: curType == 1 ? '退款' : '全部'
}
this.getRecordLs(_query);
},
dateChange(e){
this.curDate = e.detail.value;
this.$nextTick(_=>this.refreshList());
},
sceneChange(e){
let { sceneList } = this;
this.curScene = sceneList[e.detail.value];
this.$nextTick(_=>this.refreshList());
},
async storeChange(e){
let { stadiumList } = this;
this.curStadium = stadiumList[e.detail.value] || {};
await this.getSceneList();
this.$nextTick(_=>this.refreshList());
},
getRecordLs({
brand_id,
stadium_id = '', // -1
time_str, // y-m-d
scene,
type = '全部' , // /退
page_size = 15,
page = 1,
}){
let { optionsQuery } = this;
util.showLoad();
return servers.get({
url: API.consumeCountDetailLs,
data: {
brand_id,
stadium_id: stadium_id,
time_str,
page,
page_size,
scene,
type,
},
failMsg: '加载店铺列表失败!',
})
.then(res=>{
util.hideLoad();
let _list = res.list || [];
this.totalInfo = res || {};
if(page == 1)return this.recordLs = _list;
if(!_list.length)return util.showNone('没有更多!');
this.page = page;
this.recordLs = [...this.recordLs, ..._list];
})
},
//
getStoreList(stadium_id_filter = ''){
let { optionsQuery } = this;
return servers.get({
url: API.consumeCountStadiumList,
data: {
brand_id: optionsQuery.brand_id || '',
},
failMsg: '加载店铺列表失败!',
})
.then(res=>{
let _list = res || [];
let _cur = null;
// undefined => 'undefined'
if(stadium_id_filter != undefined&&stadium_id_filter != 'undefined'){
let _fiLs = _list.filter(e=> e.val == stadium_id_filter);
if(_fiLs.length)_cur = _fiLs[0];
}
if(_cur&&_cur.val){
this.curStadium = _cur;
}else{
this.curStadium = _list[0] || {};
}
return this.stadiumList = _list;
})
},
//
getSceneList(){
let { optionsQuery, curStadium } = this;
return servers.get({
url: API.consumeCountGetScene,
data: {
brand_id: optionsQuery.brand_id || '',
stadium_id: curStadium.val || '',
},
failMsg: '加载场景列表失败!',
})
.then(res=>{
let _list = res || [];
if(_list.length)this.curScene = _list[0]
return this.sceneList = _list;
})
},
}
}
</script>
<style lang="scss">
@import "~style/public.scss";
page{
background-color: #fff;
}
.collection-info{
padding-bottom: 0upx;
padding-bottom: calc( 0upx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */
padding-bottom: calc( 0upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */
.ci-header{
padding: 26upx 24upx 0;
.ch-stadium{
padding-bottom: 26upx;
@include centerFlex(space-between);
.cs-txt{
flex-shrink: 0;
flex-grow: 0;
margin-right: 20upx;
font-size: 28upx;
line-height: 40upx;
color: #9c9c9f;
}
picker{
flex-grow: 1;
}
.cs-picker{
padding: 0 20upx;
height: 92upx;
border-radius: 10upx;
background-color: #f2f1f6;
@include centerFlex(space-between);
>input{
flex-grow: 1;
height: 100%;
font-size: 28upx;
color: #1a1a1a;
}
image{
flex-grow: 0;
flex-shrink: 0;
width: 28upx;
height: 28upx;
transform: rotateZ(90deg);
}
}
}
.ch-date-scene{
margin-bottom: 30upx;
@include centerFlex(space-between);
.cds-item{
flex-grow: 0;
flex-shrink: 0;
@include centerFlex(flex-start);
.ci-txt{
margin-right: 16upx;
line-height: 34upx;
font-size: 24upx;
color: #9c9c9f;
}
.ci-frame{
height: 64upx;
border-radius: 10upx;
background-color: #f2f1f6;
}
.ci-date{
padding: 0 16upx;
width: 240upx;
@include centerFlex(space-between);
>input{
flex-grow: 1;
height: 100%;
font-size: 24upx;
color: #1a1a1a;
}
>view{
flex-grow: 0;
flex-shrink: 0;
margin: 0 14upx;
height: 32upx;
width: 2upx;
background-color: #B2B2B2;
}
picker{
flex-shrink: 0;
flex-grow: 0;
image{
margin: 0;
padding: 0;
display: block;
height: 40upx;
width: 40upx;
}
}
}
.ci-scene{
.cs-picker{
}
.cp-picker-frame{
padding: 0 20upx;
width: 264upx;
@include centerFlex(space-between);
input{
flex-grow: 1;
height: 64upx;
font-size: 24upx;
color: #1a1a1a;
}
image{
flex-shrink: 0;
flex-grow: 0;
margin-left: 16upx;
height: 28upx;
width: 28upx;
}
}
}
}
}
}
.ci-tab{
@include centerFlex(center);
border-bottom: 2upx solid #D8D8D8;
.ct-item{
flex-grow: 1;
@include centerFlex(center);
>view{
position: relative;
display: inline-block;
text-align: center;
line-height: 110upx;
height: 110upx;
font-size: 32upx;
color: #9C9C9F;
&.active{
color: $themeColor;
&::after{
content: '';
display: block;
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 200%;
height: 8upx;
border-radius: 4upx;
background-color: $themeColor;
}
}
}
}
}
.ci-total{
padding: 0 24upx;
line-height: 96upx;
font-size: 24upx;
color: #9C9C9F;
@include textHide(1);
>text{
color: #F6843E;
}
}
.ci-ls{
padding: 0 30upx;
.cl-item{
padding: 30upx 0;
&:not(:last-child){
border-bottom: 2upx solid #D8D8D8;
}
.ci-name{
margin-bottom: 8upx;
@include centerFlex(space-between);
>view{
font-size: 32upx;
color: #1a1a1a;
width: 50%;
@include textHide(1);
&+view{
text-align: right;
font-weight: 500;
color: #F6843E;
&.black{
color: #1A1A1A;
}
}
}
}
.ci-line{
@include centerFlex(space-between);
>view{
line-height: 34upx;
font-size: 24upx;
color: #9C9C9F;
@include textHide(1);
&+view{
flex-shrink: 0;
max-width: 50%;
}
}
}
}
}
}
</style>

223
src/pages/collection/list/list.vue

@ -0,0 +1,223 @@
<template>
<view class="collection-list">
<view class="cl-date">
<view class="cd-txt">收款日期</view>
<view class="cd-content">
<input class="cc-ipt" disabled :value="dateStr" />
<view class="cc-icon"></view>
<picker class="cc-img" mode="date" @change="timeChange">
<image mode="aspectFit" src="/static/images/icon/calendar.png"></image>
</picker>
</view>
</view>
<view class="cl-list">
<view class="cl-item" v-for="(e, i) in recordLs" :key="i" @click="toInfo(e)">
<view class="ci-tit-name">
<view class="ctn-name">
<view>{{ e.income_record_name || '-' }}</view>
<image mode="aspectFit" @click.stop="showModal(e)" src="/static/images/icon/question_mark.png"></image>
</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
<view class="ci-price">
<text></text>{{ e.count_type_actual_income_amount || 0 }}<text></text>
</view>
<view class="ci-tip">日总收入</view>
<view class="ci-preview">
<view class="cp-line cp-first">
<view><text class="margin">线上 ¥{{ e.online_actual_income_amount || 0 }}</text></view>
<view><text class="margin">线下 ¥{{ e.offline_actual_income_amount || 0 }}</text></view>
</view>
<view class="cp-line">
<view><text class="margin">收款{{ e.online_income_num || 0 }}</text>{{ e.online_income_amount || 0 }} </view>
<view><text class="margin">收款{{ e.offline_income_num || 0 }}</text>{{ e.offline_income_amount || 0 }}</view>
</view>
<view class="cp-line">
<view><text class="margin">退款{{ e.online_refund_num || 0 }}</text><text class="orange">{{ e.online_refund_amount || 0 }}</text> </view>
<view><text class="margin">退款{{ e.offline_refund_num || 0 }}</text><text class="orange">{{ e.offline_refund_amount || 0 }}</text></view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
import util from '../../../utils/util'
import { mapState } from 'vuex';
import numeral from 'numeral';
export default {
computed: {
...mapState(['brandInfo']),
},
data(){
return {
dateStr: '',
recordLs: []
}
},
onLoad(){
let _dateStr = util.formatDate({});
this.dateStr = _dateStr;
this.getRecordList(_dateStr);
},
methods: {
toInfo(e){
let _qyStr = `stadium_id_filter=${e.stadium_id_filter}&brand_id=${e.brand_id}`
util.routeTo(`/pages/collection/info/info?${_qyStr}`, 'nT')
},
showModal(e){
util.showModal({
title: '提示',
content: e.income_record_tips || '-'
})
},
timeChange(e){
console.warn(e);
let _date = e.detail.value || '';
this.dateStr = _date;
this.recordLs = [];
this.getRecordList(_date);
},
getRecordList(time = ''){
let { brandInfo } = this;
util.showLoad();
servers.get({
url: API.consumeCountLs,
data: {
brand_id: brandInfo.brand.id,
time_str: time
},
failMsg: '加载列表失败!'
})
.then(res=>{
util.hideLoad();
let _list = res.list || [];
this.recordLs = _list;
})
}
}
}
</script>
<style lang='scss'>
@import '~style/public.scss';
.cl-date{
padding: 26upx 24upx;
@include centerFlex(space-between);
.cd-txt{
flex-shrink: 0;
flex-grow: 0;
margin-right: 20upx;
line-height: 40upx;
font-size: 28upx;
color: #9C9C9F;
}
.cd-content{
flex-grow: 1;
padding: 26upx 20upx;
border-radius: 10upx;
background-color: #fff;
@include centerFlex(space-between);
.cc-ipt{
flex-grow: 1;
height: 100%;
font-size: 28upx;
color: #1a1a1a;
}
.cc-icon{
flex-shrink: 0;
flex-grow: 0;
margin: 0 17upx;
height: 40upx;
width: 2upx;
background-color: #f2f1f6;
}
.cc-img{
flex-shrink: 0;
flex-grow: 0;
image{
width: 40upx;
height: 40upx;
}
}
}
}
.cl-list{
padding: 0 24upx 60upx;
.cl-item{
margin-bottom: 24upx;
padding: 30upx;
height: 432upx;
border-radius: 10upx;
background-color: #fff;
.ci-tit-name{
margin-bottom: 42upx;
@include centerFlex(space-between);
.ctn-name{
>view{
line-height: 40upx;
font-size: 28upx;
color: #1a1a1a;
@include textHide(1);
}
@include centerFlex(flex-start);
}
image{
flex-shrink: 0;
flex-grow: 0;
margin-left: 12upx;
width: 28upx;
height: 28upx;
}
}
.ci-price{
text-align: center;
font-size: 64upx;
font-weight: 500;
color: #1a1a1a;
@include textHide(1);
>text{
font-size: 32upx;
}
}
.ci-tip{
line-height: 40upx;
text-align: center;
font-size: 28upx;
color: #9c9c9f;
}
.ci-preview{
padding-top: 38upx;
.cp-line{
@include centerFlex(space-between);
>view{
flex-grow: 0;
flex-shrink: 0;
width: 49%;
line-height: 32upx;
font-size: 24upx;
color: #9c9c9f;
@include textHide(1);
.margin{
margin-right: 10upx;
}
.orange{
color: #F6843E;
}
}
}
.cp-first{
margin-bottom: 24upx;
>view{
font-size: 28upx;
font-weight: 500;
color: #1A1A1A;
}
}
}
}
}
</style>

4
src/pages/index/index.vue

@ -79,14 +79,14 @@
const tabList = [
{
id: 0,
name: '营业额',
name: '收入统计',
path: '/pages/turnover/turnover',
serverKey: 1001 //
},
{
id: 1,
name: '收款记录',
path: '/pages/collection/record/record',
path: '/pages/collection/list/list',
serverKey: 1002 //
},
{

280
src/pages/turnover/turnover.vue

@ -1,23 +1,22 @@
<template>
<view class="turnover-container">
<view class="tc-tab" v-if="storeList.length > 1">
<view :class="[tabID == 0?'active':'']" @click="tabChange(0)">品牌</view>
<view :class="[tabID == 1?'active':'']" @click="tabChange(1)">门店</view>
<view :class="[tabID == 4?'active':'']" @click="tabChange(4)">品牌统计</view>
<view :class="[tabID == 3?'active':'']" @click="tabChange(3)">门店统计</view>
</view>
<view class="tc-total-section">
<!-- 品牌 -->
<view class="tts-address" v-if="tabID == 0&&storeList.length > 1">
<image class="ta-logo" :src="pageInfo.logo" mode="aspectFit"></image>
<view>{{pageInfo.name || '-'}}</view>
<!-- <image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image> -->
<view class="tts-address" v-if="tabID == 4&&storeList.length > 1">
<image class="ta-logo" :src="totalData.logo" mode="aspectFit"></image>
<view>{{totalData.brand_or_stadium_name || '-'}}</view>
</view>
<!-- 仅有一家店铺情况下没有品牌查看权限 -->
<view class="tts-address" v-else-if="tabID == 1&&storeList.length ==1">
<view class="tts-address" v-else-if="tabID == 3&&storeList.length ==1">
<view>{{curSelectStore.name || '-'}}</view>
<!-- <image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image> -->
</view>
<picker v-else-if="tabID == 1" :range="storeList" range-key="name" @change="storeChange">
<picker v-else-if="tabID == 3" :range="storeList" range-key="name" @change="storeChange">
<view class="tts-address">
<view>{{curSelectStore.name || '-'}}</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
@ -25,20 +24,27 @@
</picker>
<view class="tts-money">
<view>{{pageInfo.duration || '-'}}</view>
<view>总营业额</view>
<view><text>¥</text>{{pageInfo.total || '0'}}</view>
<view>{{totalData.brand_or_stadium_duration || '-'}}</view>
<view>
<text>总收入</text>
<image mode="aspectFit" src="/static/images/icon/question_mark.png" @click="showQuestionModal"></image>
</view>
<view><text>¥</text>{{totalData.count_type_actual_income_amount || '0'}}</view>
</view>
<view class="tts-preview">
<view>线上 ¥{{totalData.online_actual_income_amount || '0'}}</view>
<view>线下 ¥{{totalData.offline_actual_income_amount || '0'}}</view>
</view>
</view>
<view class="tc-info-section">
<view class="tis-tab">
<view :class="[timeTabID == 0?'active':'']" @click="timeTabChange(0)">日报</view>
<view :class="[timeTabID == 1?'active':'']" @click="timeTabChange(1)">近7天</view>
<view :class="[timeTabID == 2?'active':'']" @click="timeTabChange(2)">月报</view>
<view :class="[timeTabID == 3?'active':'']" @click="timeTabChange(3)">年报</view>
<view :class="[timeTabIdx == 0?'active':'']" @click="timeTabChange(0)">日报</view>
<view :class="[timeTabIdx == 1?'active':'']" @click="timeTabChange(1)">近7天</view>
<view :class="[timeTabIdx == 2?'active':'']" @click="timeTabChange(2)">月报</view>
<view :class="[timeTabIdx == 3?'active':'']" @click="timeTabChange(3)">年报</view>
</view>
<view class="tis-data">
<view class="td-date" v-if="timeTabID == 0 || timeTabID == 2 || timeTabID == 3" @click="toTimeSelect(timeTabID)">
<view class="td-date" v-if="timeTabIdx == 0 || timeTabIdx == 2 || timeTabIdx == 3" @click="toTimeSelect(timeTabIdx)">
<text>{{dataTime}}</text>
<view></view>
<image mode="aspectFit" src="/static/images/icon/calendar.png"></image>
@ -49,24 +55,35 @@
<!-- <image mode="aspectFit" src="/static/images/icon/calendar.png"></image> -->
</view>
<view class="td-tip">实际收入</view>
<view class="td-price"><text>¥</text>{{pageInfo.calc.total || 0}}</view>
<view class="td-tip">收入</view>
<view class="td-price"><text>¥</text>{{botData.count_type_actual_income_amount || 0}}</view>
<view class="td-detail">
<view>
<view class="td-first">
线上 ¥{{ botData.online_actual_income_amount || '0' }}
</view>
<view>
<text>收款笔数 </text>{{pageInfo.calc.in_count || 0}}
<text class="margin">收款{{ botData.online_income_num || '0' }} </text>
{{ botData.online_income_amount || '0' }}
</view>
<view>
<text>退款笔数 </text>{{pageInfo.calc.out_count || 0}}
<text class="margin">退款{{ botData.online_refund_num || '0' }} </text>
<text class="orange"> {{ botData.online_refund_amount || '0' }} </text>
</view>
</view>
<view>
<view class="td-first">
线下 ¥{{ botData.offline_actual_income_amount || '0' }}
</view>
<view>
<text>收款金额 </text> {{pageInfo.calc.in_total || '0.00'}}
<text class="margin">收款{{ botData.offline_income_num || '0' }} </text>
{{botData.offline_income_amount || '0'}}
</view>
<view>
<text>退款金额 </text> {{pageInfo.calc.out_total || '0.00'}}
<text class="margin">退款{{ botData.offline_refund_num || '0' }} </text>
<text class="orange"> {{ botData.offline_refund_amount || '0' }} </text>
</view>
</view>
@ -85,10 +102,10 @@ export default {
computed: {
...mapState([ 'brandInfo' ]),
dataTime(){
let { curTime, timeTabID } = this;
if(timeTabID == 0)return util.formatDate({ date: curTime.date || '', partition: 'zh' });
if(timeTabID == 2)return util.formatDate({ date: `${curTime.month}-01`, partition: 'zh' }).substr(0,8);
if(timeTabID == 3)return `${curTime.year}`;
let { curTime, timeTabIdx } = this;
if(timeTabIdx == 0)return util.formatDate({ date: curTime.date || '', partition: 'zh' });
if(timeTabIdx == 2)return util.formatDate({ date: `${curTime.month}-01`, partition: 'zh' }).substr(0,8);
if(timeTabIdx == 3)return `${curTime.year}`;
},
// 7
beforeSevenDay(){
@ -99,8 +116,11 @@ export default {
},
data(){
return {
tabID: 0,
timeTabID: 0,
tabID: 4,
timeTabIdx: 0,
totalData: {},
botData: {},
pageInfo: {
calc: {}
@ -120,12 +140,12 @@ export default {
},
async onLoad(){
try{
let { timeTabID } = this;
let { timeTabIdx } = this;
let _timeObj = this.getTime();
this.curTime = _timeObj;
let _storeList = await this.getStoreList();
if(_storeList.length == 1)this.tabID = 1;
if(_storeList.length == 1)this.tabID = 3;
this.$nextTick(this.refreshPageInfo);
}catch(err){
@ -135,31 +155,97 @@ export default {
},
methods: {
/*
count_type
3 门店总的统计
4 品牌总的统计
0 统计门店的某一天 (近7天)
1 统计门店的某一月
2 统计门店的某一年
5 统计品牌的某一天 (近7天)
6 统计品牌的某一月
7 统计品牌的某一年
*/
getCountType({ tab_id = -1, time_tab_idx = -1 }){
console.warn(tab_id, time_tab_idx, getType(time_tab_idx) + 5);
if(time_tab_idx == -1)return tab_id;
let _type = getType(time_tab_idx)
if(tab_id == 3&&_type != -1)return _type;
if(tab_id == 4&&_type != -1)return _type += 5;
function getType(idx){
switch(+idx){
case 0:
return 0
case 1:
return 0
case 2:
return 1
case 3:
return 2
default:
return -1
}
}
},
showQuestionModal(){
let { totalData } = this
util.showModal({
title: totalData.income_record_name|| '提示',
content: totalData.income_record_tips || '总收入为:线上(微信支付)+ 线下的总收入(退款已删除)',
showCancel: true,
success: mRes => {
}
})
},
//
toTimeSelect(type){
let { curTime, tabID, curSelectStore } = this;
let storeID = '';
if(tabID == 1)storeID = curSelectStore.id;
if(tabID == 3)storeID = curSelectStore.id;
if(type == 0)util.routeTo(`/pages/time_select/date/date?date=${curTime.date || ''}&store_id=${storeID}`,'nT');
if(type == 2)util.routeTo(`/pages/time_select/month/month?date=${curTime.month || ''}&store_id=${storeID}`,'nT');
if(type == 3)util.routeTo(`/pages/time_select/year/year?date=${curTime.year || ''}&store_id=${storeID}`,'nT');
},
//
refreshPageInfo(){
let { tabID, timeTabID, curSelectStore, curTime } = this;
let { tabID, timeTabIdx, curSelectStore, curTime } = this;
let _date;
if(timeTabID == 0)_date = curTime.date || ''
if(timeTabID == 1)_date = util.formatDate({}).substr(0,10);
if(timeTabID == 2)_date = `${curTime.month}-01` || '' //
if(timeTabID == 3)_date = `${curTime.year}-01-01` || ''//
if(timeTabIdx == 0)_date = curTime.date || ''
// if(timeTabIdx == 1)_date = util.formatDate({}).substr(0,10);
// 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 });
let _query = {
type: timeTabID + 1,
date: _date,
stadium_id: curSelectStore.id || '',
count_type: _type,
time_str: _date || '',
}
if(timeTabIdx == 1&&(_type == 0 || _type == 5)){
_query['time_str_min'] = util.formatDate({ date: new Date().getTime() - (7*24*60*60*1000) })
_query['time_str_max'] = util.formatDate({ })
}
if(tabID == 1)_query.stadium_id = curSelectStore.id;
//
this.getCountData({
stadium_id: curSelectStore.id || '',
count_type: this.getCountType({ tab_id: tabID })
})
this.getBrandInfo(_query);
this.getCountData(_query);
// this.getBrandInfo(_query);
},
//
storeChange(e){
@ -170,11 +256,11 @@ export default {
},
//
timeChange(date){
let { timeTabID } = this;
let { timeTabIdx } = this;
if(timeTabID == 0) this.curTime.date = date;
if(timeTabID == 2) this.curTime.month = date;
if(timeTabID == 3) this.curTime.year = date;
if(timeTabIdx == 0) this.curTime.date = date;
if(timeTabIdx == 2) this.curTime.month = date;
if(timeTabIdx == 3) this.curTime.year = date;
this.refreshPageInfo();
},
@ -191,13 +277,14 @@ export default {
}
},
tabChange: util.debounce(function(type){
this.tabID = type;
this.refreshPageInfo();
},300,300),
timeTabChange: util.debounce(function(type){
this.timeTabID = type;
this.timeTabIdx = type;
this.refreshPageInfo();
},300,300),
@ -221,6 +308,50 @@ export default {
return _list || [];
})
},
/*
count_type
3 门店总的统计
4 品牌总的统计
0 统计门店的某一天
1 统计门店的某一月
2 统计门店的某一年
5 统计品牌的某一天
6 统计品牌的某一月
7 统计品牌的某一年
*/
getCountData({
stadium_id,
count_type,
time_str = '', // = y-m-d/y-m/y
time_str_max = '', // >= y-m-d
time_str_min = '', // <= y-m-d
}){
let { brandInfo } = this;
util.showLoad();
servers.get({
url: API.consumeCountGet,
data: {
brand_id: brandInfo.brand.id,
'filter[brand_id:eq]': brandInfo.brand.id,
'filter[stadium_id:eq]': stadium_id,
'filter[count_type:eq]': count_type,
'filter[time_str:eq]': time_str,
'filter[time_str:egt]': time_str_min,
'filter[time_str:elt]': time_str_max,
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
let _data = res || {};
if(count_type == 3 || count_type == 4)return this.totalData = _data;
this.botData = _data
})
.catch(util.hideLoad)
},
getBrandInfo({
date,
@ -264,7 +395,7 @@ export default {
@include centerFlex(center);
>view{
margin: 0 70upx;
width: 176upx;
width: 228upx;
height: 72upx;
line-height: 72upx;
text-align: center;
@ -314,33 +445,59 @@ export default {
}
.tts-money{
padding-top: 48upx;
padding-bottom: 70upx;
>view{
margin-bottom: 34upx;
text-align: center;
padding: 0 24upx;
@include textHide(1);
&:first-child{
margin-bottom: 22upx;
line-height: 34upx;
font-size: 24upx;
color: #9c9c9f;
}
&:nth-child(2){
margin-bottom: 30upx;
margin-bottom: 12upx;
line-height: 40upx;
font-size: 28upx;
color: #9c9c9f;
>image{
display: inline-block;
vertical-align: middle;
width: 28upx;
height: 28upx;
margin-left: 8upx;
}
}
&:nth-child(3){
line-height: 90upx;
font-size: 76upx;
font-size: 64upx;
color: #1a1a1a;
font-weight: bold;
font-weight: 600;
>text{
font-size: 52upx;
}
}
}
}
.tts-preview{
padding-bottom: 70upx;
@include centerFlex(space-between);
>view{
width: 50%;
padding: 0 24upx;
line-height: 40upx;
text-align: center;
font-size: 28upx;
font-weight: 500;
color: #1a1a1a;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
.tc-info-section{
.tis-tab{
@ -427,6 +584,12 @@ export default {
>view{
max-width: 50%;
flex-shrink: 0;
.td-first{
margin-bottom: 24upx;
color: #1A1A1A;
font-weight: 500;
font-size: 28upx;
}
&:first-child{
margin-right: 24upx;
}
@ -434,16 +597,17 @@ export default {
margin-left: 24upx;
}
>view{
margin-bottom: 24upx;
font-weight: 500;
font-size: 32upx;
color: #1a1a1a;
font-size: 24upx;
color: #9C9C9F;
@include textHide(1);
>text{
margin-right: 10upx;
font-weight: 400;
font-size: 28upx;
color: #9C9C9F;
}
.orange{
color: #F6843E;
}
.margin{
margin-right: 12upx;
}
}
}

BIN
src/static/images/icon/question_mark.png

After

Width: 56  |  Height: 56  |  Size: 1023 B

10
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -200,7 +200,7 @@ export default {
if(switchInfo.hardware_type === 'AccessControl'&&status == 1){
//->& 20201224 5
this.operateReq({data: this.getOperateReqData({ switchInfo, status: 0 }), isTip: false, isLoad: false});
this.operateReq({data: DEVICE_FUN.AC_filterCloudACData(this.getOperateReqData({ switchInfo, status: 0 }), switchInfo), isTip: false, isLoad: false});
}
this.operateReq({ data: _data });
@ -224,8 +224,13 @@ export default {
if(switchInfo.hardware_type=="Light"&&status==2)_data.data.name = "set-rpio-lock"
//->& 20201224 5
if(switchInfo.hardware_type === 'AccessControl'&&status == 0)_data['delay'] = '5';
if(switchInfo.hardware_type === 'AccessControl'&&status == 0)_data['delay'] = '3';
// 20220507 GateControl hardware_mac_addr device_name hardware_mac_addr
// "hardware_id":id
if(switchInfo.hardware_type === 'GateControl'&&!!switchInfo.hardware_mac_addr)_data['device'] = switchInfo.hardware_mac_addr;
if(switchInfo.hardware_type === 'GateControl')_data['hardware_id'] = switchInfo.id;
return _data;
},
//
@ -253,6 +258,7 @@ export default {
let _cid = status === 1 ? enter_id :
status === 0 ? leave_id : '';
return {
// hardware_id: switchInfo.id,
name: 'gate',
value: {
tcp: hardware_net_addr + '',

Loading…
Cancel
Save