Browse Source

finish md240529 demand

tid1731
刘嘉炜 11 months ago
parent
commit
50a41765cd
  1. 6
      src/pages.json
  2. 2
      src/pages/index/index.vue
  3. 11
      src/pages/write_off/menu/menu.vue
  4. 172
      src/subpackage/verification/pages/site_people/index.vue
  5. 27
      src/subpackage/verification/pages/site_people/modules/auto_clean.vue
  6. 15
      src/subpackage/verification/pages/site_people/modules/methods_bar.vue
  7. 64
      src/subpackage/verification/pages/site_people/modules/modify_number.vue
  8. 55
      src/subpackage/verification/pages/site_people/modules/not_leave_modal.vue
  9. 6
      src/subpackage/verification/pages/site_people/modules/stadium_select.vue

6
src/pages.json

@ -177,12 +177,6 @@
}
},
{
"path": "pages/write_off/number_of_people/number_of_people",
"style": {
"navigationBarTitleText": "查询"
}
},
{
"path": "pages/write_off/menu/menu",
"style": {
"navigationBarTitleText": "核销订单"

2
src/pages/index/index.vue

@ -251,7 +251,7 @@
});
}
if(tabInfo.id === 10 || tabInfo.id === 11)return util.routeTo(tabInfo.path + `?brand_id=${indexData.brand.id}`,'nT');
if([ 10, 11, 4 ].includes(tabInfo.id))return util.routeTo(tabInfo.path + `?brand_id=${indexData.brand.id}`,'nT');
if(tabInfo.id === 12){
// if(!indexData.brand.mini_wechat_appid)return util.showNone('appid')

11
src/pages/write_off/menu/menu.vue

@ -56,9 +56,18 @@
import util from '../../../utils/util';
import { WRITE_OFF_STORE_NAME } from '../../../js/once_name';
export default {
data(){
return {
brand_id: ''
}
},
onLoad(options){
this.brand_id = options?.brand_id || ''
},
methods: {
toPeopleNum(){
util.routeTo(`/pages/write_off/number_of_people/number_of_people`, 'nT');
let _qryStr = `brand_id=${this.brand_id}`
util.routeTo(`/subpackage/verification/pages/site_people/index?${_qryStr}`, 'nT');
},
toOperate(type){
util.$_emit(WRITE_OFF_STORE_NAME, null);

172
src/subpackage/verification/pages/site_people/index.vue

@ -5,7 +5,7 @@
@change:stadium="stadiumChange"
></stadium-select>
<methods-bar
:type="igsType"
></methods-bar>
<classify-tab
@ -19,7 +19,10 @@
<view class="sp-modify" @click="modifyBtn">修改人数</view>
<view class="sp-check" @click="checkNotLeaveBtn">查看未离场订单</view>
<auto-clean></auto-clean>
<auto-clean
:auto-clean="siteInfo.present_person_number_clear"
@switch:change="switchAutoClean"
></auto-clean>
<modify-number ref="modifyNum"></modify-number>
<not-leave-modal ref="notLeaveModal"></not-leave-modal>
@ -52,6 +55,7 @@ export default {
// 0/ 1/ 2
return this.siteInfo?.igs_type || 0;
},
//
siteNum(){
let { igsType, siteInfo, tabLs } = this;
if(igsType === 0) return siteInfo?.stadium_num || 0;
@ -68,13 +72,13 @@ export default {
siteInfo: {},
tabLs: [
// { [label], [key], [number], [selected] }
]
],
intervalTimer: null
}
},
async onLoad(options){
this.$refs.stadiumSelect.initStadium(options?.brand_id || '')
.then(stadiumInfo=>{
console.log('stadiumInfo', stadiumInfo);
if(!stadiumInfo?.id) return;
this.stadiumInfo = stadiumInfo;
this.initData({
@ -83,37 +87,78 @@ export default {
})
})
},
onShow(){
this.setTimer();
},
onHide(){
this.clearTimer(this.intervalTimer);
},
onUnload(){
this.clearTimer(this.intervalTimer);
},
methods: {
stadiumChange(stadiumInfo){
console.log('stadium change', stadiumInfo);
if(!stadiumInfo?.id) return;
setTimer(){
this.intervalTimer = setInterval(()=>{
let { brand_id, id } = this.stadiumInfo;
if(!brand_id || !id) return;
this.refreshData({ brand_id, stadium_id: id });
}, 3000)
},
clearTimer(timer){
try{
clearInterval(timer);
this.intervalTimer = null;
}catch(err){
}
},
stadiumChange(sInfo){
if(!sInfo?.id) return;
this.stadiumInfo = sInfo;
this.initData({
brand_id: stadiumInfo?.brand_id || '',
stadium_id: stadiumInfo?.id || ''
brand_id: sInfo?.brand_id || '',
stadium_id: sInfo?.id || ''
})
},
async initData({ brand_id, stadium_id }){
try{
showLoad();
let _skInfo = await this.getSkNumber({ brand_id, stadium_id });
console.log('site people index initData', _skInfo);
this.siteInfo = _skInfo || {};
this.tabLs = [];
hideLoad();
if([1,2].includes(_skInfo?.igs_type)){
let _tabLs = this.getTabList(_skInfo);
_tabLs[0].selected = true;
this.tabLs = _tabLs;
}
this.resetData(_skInfo);
}catch(err){
console.warn('site people index initData err', err);
}
},
modifyBtn(){
this.$refs.modifyNum.show();
//
resetData(res){
this.siteInfo = res || {};
this.tabLs = [];
if([1,2].includes(res?.igs_type)){
let _tabLs = this.getTabList(res);
_tabLs[0].selected = true;
this.tabLs = _tabLs;
}
},
checkNotLeaveBtn(){
this.$refs.notLeaveModal.show();
async refreshData({ brand_id, stadium_id }){
let { siteInfo, tabLs } = this;
let _skInfo = await this.getSkNumber({ brand_id, stadium_id });
if(_skInfo?.igs_type === siteInfo?.igs_type){
if(_skInfo?.igs_type === 0)return this.siteInfo = _skInfo;
let _tabLs = this.getTabList(_skInfo);
let _selectedTab = tabLs.find(e=>e.selected);
let _newTabIdx = _tabLs.findIndex(e=>e.key === _selectedTab?.key);
if(_newTabIdx > -1){
_tabLs[_newTabIdx].selected = true;
this.tabLs = _tabLs;
this.siteInfo = _skInfo;
}else{
this.resetData(_skInfo);
}
}else{
this.resetData(_skInfo);
}
this.$forceUpdate();
},
getSkNumber({ brand_id, stadium_id }){
return server.post({
@ -125,34 +170,31 @@ export default {
failMsg: '加载现场人数信息失败!'
})
.then(res=>{
if(stadium_id === 156){
res.igs_type = 1;
res.hw_num = [
{ gate_id: 1, gate_name: 'A门', number: 10 },
{ gate_id: 2, gate_name: 'B门', number: 20 },
{ gate_id: 3, gate_name: 'C门', number: 30 },
]
}
if(stadium_id === 151){
res.igs_type = 2;
res.vt_num = [
{ venue_type_key: 1, venue_type_name: '羽毛球', number: 101 },
{ venue_type_key: 2, venue_type_name: '篮球', number: 210 },
{ venue_type_key: 3, venue_type_name: '乒乓球', number: 310 },
]
}
// if(stadium_id === 156){
// res.igs_type = 1;
// res.hw_num = [
// { gate_id: 1, gate_name: 'A', number: 10 },
// { gate_id: 2, gate_name: 'B', number: 20 },
// { gate_id: 3, gate_name: 'C', number: 30 },
// ]
// }
// if(stadium_id === 151){
// res.igs_type = 2;
// res.vt_num = [
// { venue_type_key: 1, venue_type_name: '', number: 101 },
// { venue_type_key: 2, venue_type_name: '', number: 210 },
// { venue_type_key: 3, venue_type_name: '', number: 310 },
// ]
// }
return res || {};
})
.catch(err=>{
console.warn('site people index getSkNumber', err);
})
},
formatSkInfo(res){
},
getTabList(res){
let _ls = [];
if(res?.igs_type === 1){
if(res?.igs_type === 1){ //
res?.hw_num?.forEach(e=>{
if(e?.gate_id)_ls.push({
label: e?.gate_name || '',
@ -161,7 +203,7 @@ export default {
})
})
}
if(res?.igs_type === 2){
if(res?.igs_type === 2){ //
res?.vt_num?.forEach(e=>{
if(e?.venue_type_key)_ls.push({
label: e?.venue_type_name || '',
@ -171,7 +213,51 @@ export default {
})
}
return _ls;
}
},
modifyBtn(){
let { siteNum, stadiumInfo, tabLs, igsType } = this;
let { brand_id, id } = stadiumInfo;
this.$refs.modifyNum.initData({
num: siteNum,
brand_id,
stadium_id: id,
igsType,
key: tabLs.find(e=>e.selected)?.key,
success: ()=>{
this.refreshData({ brand_id, stadium_id: id });
}
});
},
//
switchAutoClean(status){
let { brand_id, id } = this.stadiumInfo;
server.get({
url: API.timingOpen,
data: {
brand_id: brand_id,
stadium_id: id,
status: status
},
failMsg: '操作失败!'
})
.then(res=>{
hideLoad();
showNone('操作成功!');
setTimeout(_=>{
this.refreshData({ brand_id, stadium_id: id });
}, 1000)
})
},
checkNotLeaveBtn(){
let { tabLs, stadiumInfo, igsType } = this;
let { brand_id, id } = stadiumInfo;
this.$refs.notLeaveModal.initData({
brand_id,
stadium_id: id,
igsType,
key: tabLs.find(e=>e.selected)?.key
});
},
}
}
</script>

27
src/subpackage/verification/pages/site_people/modules/auto_clean.vue

@ -2,7 +2,7 @@
<view class="auto-clean">
<view class="ac-line">
<view class="al-txt">凌晨自动清零</view>
<switch class="al-switch"></switch>
<switch class="al-switch" color="#009777" :checked="autoClean" disabled @click="switchClick"></switch>
</view>
<view class="ac-desc">
*不开启凌晨自动清零则现场灯光按<text class="ad-txt">现场散客人数</text>去判断是否开启或关闭<text class="ad-txt">修改人数会直接影响现场灯光开关!</text>
@ -14,8 +14,31 @@
</template>
<script>
import { showModal } from "@/utils/util.js";
export default {
props: {
autoClean: {
type: Boolean,
default: false
}
},
methods: {
switchClick(){
let { autoClean } = this;
let _contentTxt = autoClean ? '是否确认关闭凌晨自动清零?' : '是否确认开启凌晨自动清零?';
showModal({
content: _contentTxt,
showCancel: true,
success: e=> {
if(e.confirm){
let _status = autoClean ? 0 : 1;
this.$emit('switch:change', _status);
}
}
})
}
}
}
</script>

15
src/subpackage/verification/pages/site_people/modules/methods_bar.vue

@ -1,7 +1,7 @@
<template>
<view class="methods-bar">
<view class="mb-top">
<view class="mt-method">现场人数统计方式按门店</view>
<view class="mt-method">现场人数统计方式{{ typeForTxt }}</view>
<view class="mt-date">{{ date || '' }}</view>
</view>
<view class="mb-tip">统计方式如需修改请前往后台散客开关灯规则处修改</view>
@ -10,11 +10,24 @@
<script>
export default {
props: {
type: {
type: Number,
default: 0
}
},
data(){
return {
date: ''
}
},
computed: {
typeForTxt(){
const { type } = this;
const tArr = ['按门店', '按门闸/门禁', '按场地分类'];
return tArr?.[type] ?? '';
}
},
mounted(){
this.$nextTick(() => {
let _date = new Date().toLocaleDateString();

64
src/subpackage/verification/pages/site_people/modules/modify_number.vue

@ -4,26 +4,84 @@
<image class="nmm-close" src="../../../static/images/x_close.png" @click="hide"></image>
<view class="nmm-tit">修改现场散客人数</view>
<view class="nmm-info">
<view class="ni-num">当前现场散客人数为012</view>
<view class="ni-num">当前现场散客人数为{{ nowNum || 0 }}</view>
<input class="ni-ipt" placeholder="请输入散客人数" v-model="changeNum" type="number" />
<view class="ni-tip">修改现场人数可能会影响现场灯光开关请谨慎操作</view>
</view>
<view class="nmm-btns">
<view @click="hide">取消</view>
<view>确认</view>
<view @click="confirm">确认</view>
</view>
</view>
</view>
</template>
<script>
import API from "../../../js/api.js";
import server from "../../../js/server.js";
import { showNone, showLoad, hideLoad } from "@/utils/util.js";
export default {
props: {
num: { default: 0 }
},
data(){
return {
visible: false
visible: false,
nowNum: 0, //
brand_id: '',
stadium_id: '',
igsType: '',
key: '', // gate_id / venue_type_key
initOptions: {},
changeNum: '',
}
},
methods: {
confirm(){
let { brand_id, stadium_id, changeNum, igsType, key } = this;
if(isNaN(changeNum))return showNone('请输入正确数量!');
let _query = { brand_id, stadium_id, number: changeNum };
let _keyName = igsType === 1 ? 'gate_id' : igsType === 2 ? 'venue_type_key' : '';
if(_keyName)_query[_keyName] = key || '';
this.setStadiumPresentNumber(_query)
},
/**
* @param { String } brand_id 品牌id
* @param { String } stadium_id 场馆id
* @param { String } venue_type_key 场地分类KEYigs_type=2时必传
* @param { String } gate_id 门禁IDigs_type=1时必传
* @param { String } number 人数
* */
setStadiumPresentNumber(_query){
showLoad();
server.post({
url: API.setStadiumPresentNumber,
data: _query,
isDefaultGet: false,
})
.then(res=>{
hideLoad();
if(res.data.code == 0){
showNone(res.data.message || '操作成功!');
this.$emit('modify:success');
this.initOptions?.success?.();
}else{
showNone(res.data.message || '操作失败!');
}
this.hide();
})
.catch(hideLoad)
},
initData(e){
let { num, brand_id, stadium_id, igsType, key, ...opts } = e;
this.nowNum = num || 0;
this.brand_id = brand_id || '';
this.stadium_id = stadium_id || '';
this.igsType = igsType || '';
this.key = key || '';
this.initOptions = opts;
this.show();
},
show(){
this.visible = true
},

55
src/subpackage/verification/pages/site_people/modules/not_leave_modal.vue

@ -4,26 +4,30 @@
<image class="nmm-close" @click="hide" src="../../../static/images/x_close.png"></image>
<view class="nmm-tit">未离场订单</view>
<view class="nmm-line">
<view class="ml-view">次卡未离场3</view>
<view class="ml-view">查看</view>
<view class="ml-view">次卡未离场{{ notLeaveInfo.person_number || 0 }}</view>
<view class="ml-view" @click="checkBtn(0)">查看</view>
</view>
<view class="nmm-line">
<view class="ml-view">计时未离场3</view>
<view class="ml-view">查看</view>
<view class="ml-view">计时未离场{{ notLeaveInfo.person_timing || 0 }}</view>
<view class="ml-view" @click="checkBtn(1)">查看</view>
</view>
<view class="nmm-line">
<view class="ml-view">年月卡未离场1</view>
<view class="ml-view">查看</view>
<view class="ml-view">年月卡未离场{{ notLeaveInfo.monthly_card || 0 }}</view>
<view class="ml-view" @click="checkBtn(0)">查看</view>
</view>
</view>
</view>
</template>
<script>
import API from "../../../js/api.js";
import server from "../../../js/server.js";
import { showNone, showLoad, hideLoad, routeTo } from "@/utils/util.js";
export default {
data(){
return {
visible: false
visible: false,
notLeaveInfo: {}
}
},
methods: {
@ -32,7 +36,42 @@ export default {
},
hide(){
this.visible = false;
}
},
initData(e){
let { igsType, key, stadium_id, brand_id } = e;
this.show();
let _keyName = igsType === 1 ? 'gate_id' : igsType === 2 ? 'venue_type_key' : '';
let _query = { brand_id, stadium_id };
if(_keyName)_query[_keyName] = key ?? '';
this.getSkNotLeavingNums(_query);
},
/**
* http://api.ouxuan.net:61080/project/11/interface/api/13892
* @param { String } brand_id 品牌id
* @param { String } stadium_id 场馆id
* @param { String } venue_type_key 场地分类KEYigs_type=2时必传
* @param { String } gate_id 门禁IDigs_type=1时必传
* */
getSkNotLeavingNums(_query){
showLoad();
return server.get({
url: API.skNotLeavingNums,
data: _query,
failMsg: '加载信息失败!'
})
.then(res=>{
hideLoad();
this.notLeaveInfo = res || {};
})
.catch(err=>{
hideLoad();
console.warn('site people not leave modal getSkNotLeavingNums err', err);
})
},
checkBtn(type){
if(type == 0)return routeTo(`/pages/write_off/search_result/search_result`, 'nT');
if(type == 1)return routeTo(`/pages/order_list/order_list?order_type=1`, 'nT');
},
}
}
</script>

6
src/subpackage/verification/pages/site_people/modules/stadium_select.vue

@ -31,9 +31,9 @@ export default {
try{
showLoad();
let _ls = await this.getStadiumLs({ brand_id });
_ls = _ls.filter(e=>{
return [167, 156, 151].includes(e.id);
})
// _ls = _ls.filter(e=>{
// return [167, 156, 151].includes(e.id);
// })
this.stadiumLs = _ls || [];
hideLoad();
if(_ls.length){

Loading…
Cancel
Save