Browse Source

add api

voice
刘嘉炜 4 years ago
parent
commit
7945ea5172
  1. 3
      src/js/api.js
  2. 14
      src/pages.json
  3. 108
      src/pages/collection/detail/detail.vue
  4. 139
      src/pages/collection/record/record.vue
  5. 326
      src/pages/employee/authority_filter/authority_filter.vue
  6. 103
      src/pages/employee/authority_select/authority_select.vue
  7. 40
      src/pages/employee/manage/manage.vue
  8. 116
      src/pages/employee/review_list/review_list.vue

3
src/js/api.js

@ -14,6 +14,7 @@ export const API = {
collectionRecord:`${ORIGIN}/admin/assistant/collection/record`, // 收款记录
collectionDetails:`${ORIGIN}/admin/assistant/collection/details`, // 收款记录-收款明细
reservationOrder:`${ORIGIN}/admin/stadium/order/list`, // 预约订单
@ -31,7 +32,7 @@ API['employee'] = {
employeeAdd:`${ORIGIN}/assistant/employee/add`, // 添加员工-填写信息
employeeList:`${ORIGIN}/admin/assistant/employee/list`, // 员工列表
employeeDelete:`${ORIGIN}/admin/assistant/employee/delete`, // 移除员工
employeeGrant:`${ORIGIN}/admin/assistant/employee/grant`, // 员工授权
employeeGrant:`${ORIGIN}/admin/assistant/employee/grant`, // 员工授权/审核
adminReplace:`${ORIGIN}/admin/assistant/replace`, // 更换管理员
employeeUnreview:`${ORIGIN}/admin/assistant/employee/unreview`, // 未审核员工列表

14
src/pages.json

@ -1,12 +1,17 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
}
},
{
"path": "pages/employee/authority_filter/authority_filter",
"style": {
"navigationBarTitleText": "员工筛选"
}
},
{
"path": "pages/employee/perfect_info/perfect_info",
"style": {
"navigationBarTitleText": "员工信息"
@ -79,12 +84,7 @@
"navigationBarTitleText": "员工管理"
}
},
{
"path": "pages/employee/authority_filter/authority_filter",
"style": {
"navigationBarTitleText": "员工筛选"
}
},
{
"path": "pages/employee/authority_select/authority_select",
"style": {

108
src/pages/collection/detail/detail.vue

@ -1,17 +1,17 @@
<template>
<view class="collection-detail">
<view class="cd-address">当前所在门店欧轩智能羽毛球场馆永泰店</view>
<view class="cd-address">当前所在门店{{storeInfo.name || '-'}}</view>
<view class="cd-overview">
<picker>
<picker mode="multiSelector" :range="timerArr" @change="dateChange">
<view class="co-time">
<text>8月5</text>
<text>{{curSelectedDate.month || 0}}{{curSelectedDate.date || 0}}</text>
<view></view>
</view>
</picker>
<view class="co-total">
<view>139</view>
<view>收入 ¥ 10899.34</view>
<view>退款 ¥ 99.34</view>
<view>{{(detail.in_count || 0) + (detail.out_count || 0)}}</view>
<view>收入 ¥ {{detail.in_sum || 0}}</view>
<view>退款 ¥ {{detail.out_sum || 0}}</view>
</view>
</view>
<view class="cd-tab">
@ -19,15 +19,15 @@
<view>退款</view>
</view>
<view class="cd-list">
<view class="cl-item" v-for="e in 10" :key="e">
<image></image>
<view class="cl-item" v-for="e in receiveList" :key="e">
<image mode="aspectFill" :src="e.avatar_url"></image>
<view class="ci-info">
<view>场馆订购</view>
<view>唐浩宗</view>
<view>20:05:41</view>
<view>{{e.desc || '-'}}</view>
<view>{{e.nickname || '-'}}</view>
<view>{{e.pay_time || '-'}}</view>
</view>
<view class="ci-price">
<view class="active">-20.00</view>
<view class="active">{{e.amount || '-'}}</view>
<view>退款成功</view>
</view>
</view>
@ -36,8 +36,92 @@
</template>
<script>
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import util from '../../../utils/util'
export default {
data(){
return{
storeInfo: {}, //
detail: {}, //
receiveList: [],
timerArr: [], //
curSelectedDate: {
year: '',
month: '',
date: '',
}
}
},
onLoad(options){
let _query = util.jsonPar(options.query);
this.storeInfo = _query.store;
this.detail = _query.detail;
this.timerArr = this.getTimerArr(_query.detail.date);
this.getDetail({});
console.log('_query.detail',_query.detail)
},
methods: {
dateChange(e){
let { value } = e.detail;
let { detail } = this;
},
getTimerArr(curDate){
let _dateObj = new Date(curDate);
let _year = _dateObj.getFullYear();
let _month = util.formatNumber(_dateObj.getMonth());
let _date = util.formatNumber(_dateObj.getDate());
let _dateAmount = new Date(_year, _month, 0).getDate();
this.setCurDate(_year, _month, _date);
return [
new Array(12).fill(1).map((e,i)=>util.formatNumber(i+1)),
new Array(_dateAmount).fill(1).map((e,i)=>util.formatNumber(i+1))
]
},
getDateObj(curDate){
let _dateObj = new Date(curDate);
let _year = _dateObj.getFullYear();
let _month = util.formatNumber(_dateObj.getMonth());
let _date = util.formatNumber(_dateObj.getDate());
let _dateAmount = new Date(_year, _month, 0).getDate();
return {
year: _year,
month: _month,
date: _date,
dateAmount: _dateAmount,
}
},
setCurDate(y,m,d){
this.curSelectedDate = {
year: y,
month: m,
date: d,
}
},
getDetail({
date='2020-09-20',
type=0,
stadium_id='',
}){
servers.get({
url: API.collectionDetails,
data: {
date,
type,
stadium_id,
},
failMsg: '加载失败!'
})
.then(e=>{
console.log('明细',e);
this.receiveList = e.list || [];
})
}
}
}
</script>

139
src/pages/collection/record/record.vue

@ -2,32 +2,32 @@
<view class="collection-record">
<view class="cr-store">
<text>当前所在门店</text>
<picker>
<picker mode="selector" :range="storeList" range-key="name" @change="storeChange">
<view class="cs-frame">
<input value="欧轩智能羽毛球场馆永泰店" disabled />
<input :value="curStore.name || '-'" disabled />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</picker>
</view>
<view class="cr-overview">
<picker>
<picker mode="multiSelector" :range="timerArr" @change="dateChange">
<view class="co-time">
<text>2020年8</text>
<text>{{curDate.year || 0}}{{curDate.month || 0}}</text>
<view></view>
</view>
</picker>
<view class="co-total">
<view>139</view>
<view>收入 ¥ 10899.34</view>
<view>退款 ¥ 99.34</view>
<view>{{ (recordTotalInfo.in_total || 0) + (recordTotalInfo.out_total || 0) }}</view>
<view>收入 ¥ {{recordTotalInfo.in_amount || 0}}</view>
<view>退款 ¥ {{recordTotalInfo.out_amount || 0}}</view>
</view>
</view>
<view class="cr-list">
<view class="cl-item" v-for="e in 10" :key="e" @click="toDetail">
<view class="ci-time">8月15日</view>
<view class="ci-money">¥1242.00</view>
<view class="cl-item" v-for="(e,i) in recordList" :key="i" @click="toDetail(e)">
<view class="ci-time">{{e.date || '-'}}</view>
<view class="ci-money">¥{{e.sum || 0}}</view>
<view class="ci-info">
<view>收款100(<text>¥1089.00</text>)退款2(<text>¥234.00</text>)</view>
<view>收款{{e.in_count || 0}}(<text>¥{{e.in_sum || 0}}</text>)退款{{e.out_count || 0}}(<text>¥{{e.out_sum || 0}}</text>)</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</view>
@ -39,30 +39,131 @@
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
import util from '../../../utils/util'
import { mapState } from 'vuex';
export default {
computed: {
...mapState(['brandInfo']),
timerArr(){
let _curDate = new Date();
return [
new Array(5).fill(1).map((e,i)=>_curDate.getFullYear()-i),
new Array(12).fill(1).map((e,i)=>util.formatNumber(i+1))
]
},
},
data(){
return {
storeList: [],
curStore: {},
curDate: {},
recordList: [],
recordTotalInfo: {},
}
},
async onLoad(){
try{
util.showLoad();
let _curDate = this.getCurDate();
this.curDate = _curDate;
let _storeList = await this.getStoreList();
this.curStore = _storeList[0] || {};
this.getRecordList({
stadium_id: _storeList[0].id || '',
date: `${_curDate.year}-${_curDate.month}`
});
util.hideLoad();
}catch(err){
util.hideLoad();
}
},
methods: {
getRecordList({
date
}){
servers.get({
async dateChange(e){
try{
util.showLoad();
let { timerArr, curStore } = this;
let { value } = e.detail
let _curDate = {
year: timerArr[0][value[0]],
month: timerArr[1][value[1]],
}
await this.getRecordList({
stadium_id: curStore.id || '',
date: `${_curDate.year}-${_curDate.month}`
});
this.curDate = _curDate;
util.hideLoad();
}catch(err){
util.hideLoad();
console.warn('dateChange err',err)
}
},
async storeChange(e){
try{
util.showLoad();
let { curDate, storeList } = this;
await this.getRecordList({
stadium_id: storeList[e.detail.value].id || '',
date: `${curDate.year}-${curDate.month}`
});
this.curStore = storeList[e.detail.value];
util.hideLoad();
}catch(err){
util.hideLoad();
console.warn('dateChange err',err)
}
},
getCurDate(){
let _curDate = new Date();
return {
year: _curDate.getFullYear(),
month: util.formatNumber(_curDate.getMonth()+1),
}
},
getStoreList(){
let { brandInfo } = this;
return servers.get({
url: API.stadiumList,
data: {
brand_id: brandInfo.brand.id,
},
failMsg: '加载店铺列表失败!',
})
.then(res=>{
let _list = res.list || [];
return this.storeList = _list;
})
},
getRecordList({ date='', stadium_id='' }){
return servers.get({
url: API.collectionRecord,
data: {
date,
date,
stadium_id,
},
failMsg: '加载失败!'
})
.then(res=>{
this.recordList = res.list;
let { list, ...totalInfo} = res;
this.recordList = list || [];
this.recordTotalInfo = totalInfo || {};
return res;
})
},
toDetail(){
util.routeTo(`/pages/collection/detail/detail`,'nT');
toDetail(e){
let { curStore, curDate } = this;
let _query = {
detail: e,
store: {
id: curStore.id,
name: curStore.name
}
}
util.routeTo(`/pages/collection/detail/detail?query=${util.jsonStr(_query)}`,'nT');
}
}
}

326
src/pages/employee/authority_filter/authority_filter.vue

@ -1,58 +1,170 @@
<template>
<view class="authoeity-filter">
<view class="af-title">请选择您要筛选的权限</view>
<view class="af-section">
<view class="as-tip">
<text>*</text>
<text>请选择门店</text>
<text>(多项选择)</text>
<view class="af-content">
<view class="af-title">请选择您要筛选的权限</view>
<view class="af-section">
<view class="as-tip">
<text>*</text>
<text>请选择门店</text>
<text>(多项选择)</text>
</view>
<view class="as-select" @click="showModal('store')">
<view v-if="isShowStoreModal || isShowMeunModal"></view>
<input v-else placeholder="全部" v-model="selectedStoreTxt" disabled />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
<view class="as-tip">
<text>*</text>
<text>请小程序权限</text>
<text>(多项选择)</text>
</view>
<view class="as-select" @click="showModal('meun')">
<view v-if="isShowStoreModal || isShowMeunModal"></view>
<input v-else placeholder="全部" v-model="selectedMeunTxt" disabled />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
</view>
<view class="as-select">
<input placeholder="全部" disabled />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
<view class="as-tip">
<text>*</text>
<text>请小程序权限</text>
<text>(多项选择)</text>
<view class="af-btn" hover-class="hover-active" @click="confirmFilter">筛选</view>
</view>
<!-- 店铺权限列表 -->
<view class="ox-dark-mask" v-if="isShowStoreModal" @click.prevent="closeModal">
<view class="af-select-modal" @click.stop="()=>false">
<scroll-view class="asm-list" scroll-y>
<view class="al-item" v-for="(e,i) in storeList" :key="i" @click="storeSelect(i)">
<view :class="[e.isSelected?'active':'']">{{e.name}}</view>
<image v-if="e.isSelected" mode="aspectFit" src="/static/images/icon/selected_987.png"></image>
</view>
</scroll-view>
<view class="asm-btn" hover-class="hover-active" @click.prevent="closeModal">关闭</view>
</view>
<view class="as-select">
<input placeholder="全部" disabled />
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
</view>
<!-- 小程序权限列表 -->
<view class="ox-dark-mask" v-if="isShowMeunModal" @click.prevent="closeModal">
<view class="af-select-modal" @click.stop="()=>false">
<scroll-view class="asm-list" scroll-y>
<view class="al-item" v-for="(e,i) in meunList" :key="i" @click="meunSelect(i)">
<view :class="[e.isSelected?'active':'']">{{e.name}}</view>
<image v-if="e.isSelected" mode="aspectFit" src="/static/images/icon/selected_987.png"></image>
</view>
</scroll-view>
<view class="asm-btn" hover-class="hover-active" @click.prevent="closeModal">关闭</view>
</view>
</view>
<view class="af-btn" hover-class="hover-active">筛选</view>
</view>
</template>
<script>
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import { mapGetters, mapState } from 'vuex';
import util from '../../../utils/util';
export default {
computed: {
...mapGetters(['permissionArr']),
...mapState(['brandInfo']),
selectedStoreTxt(){
let { storeList } = this;
return storeList.filter(e=>e.isSelected).map(e=>e.name).join(',') || '';
},
selectedMeunTxt(){
let { meunList } = this;
return meunList.filter(e=>e.isSelected).map(e=>e.name).join(',') || '';
}
},
data(){
return {
storeList: [],
meunList: [],
isShowStoreModal: false,
isShowMeunModal: false,
curFilterInfo: { //
meun: '', //
store: '' //
},
}
},
onLoad(){
onLoad(options){
console.log(util.jsonPar(options.filterInfo));
this.curFilterInfo = util.jsonPar(options.filterInfo);
this.meunList = util.jsonPar(util.jsonStr(this.permissionArr));
this.getStoreList();
},
methods: {
getStoreList(brand_id=37){
confirmFilter(){
let { storeList, meunList } = this;
let _query = {};
_query['store'] = storeList.filter(e=>e.isSelected).map(e=>e.id).join(',');
_query['meun'] = meunList.filter(e=>e.isSelected).map(e=>e.key).join(',');
util.previousPageFunction({
fnName: 'changeFilter',
query:_query
})
util.routeTo();
},
meunSelect(index){
let _meunList = util.jsonPar(util.jsonStr(this.meunList));
_meunList[index]['isSelected'] = !_meunList[index]['isSelected'];
this.meunList = _meunList;
},
storeSelect(index){
let _storeList = util.jsonPar(util.jsonStr(this.storeList));
_storeList[index]['isSelected'] = !_storeList[index]['isSelected'];
this.storeList = _storeList;
},
closeModal(){
this.isShowStoreModal = false;
this.isShowMeunModal = false;
},
showModal(type){
if(type == 'store'){
this.isShowStoreModal = true;
this.isShowMeunModal = false;
return
}
if(type == 'meun'){
this.isShowStoreModal = false;
this.isShowMeunModal = true;
return
}
},
formatSelected(){
let { curFilterInfo, storeList, meunList } = this;
let _storeList = util.jsonPar(util.jsonStr(storeList));
let _meunList = util.jsonPar(util.jsonStr(meunList));
let _meuns = curFilterInfo.meun.split(',') || [];
let _store = curFilterInfo.store.split(',') || [];
this.storeList = _storeList.map(e=>{
e.isSelected = _store.some(ele=>e.id==ele);
return e;
})
this.meunList = _meunList.map(e=>{
e.isSelected = _meuns.some(ele=>e.key==ele);
return e;
})
},
getStoreList(){
let { brandInfo } = this;
util.showLoad();
servers.get({
url: API.stadiumList,
data: {
brand_id,
brand_id: brandInfo.brand.id,
},
failMsg: '加载店铺列表失败!',
})
.then(res=>{
util.hideLoad();
let _list = res.list || [];
this.storeList = _list;
this.$nextTick(_=>this.formatSelected());
})
.catch(util.hideLoad)
}
}
}
@ -60,68 +172,122 @@ export default {
<style lang="scss" scoped>
@import "../../../style/public.scss";
.authoeity-filter{
padding: 62upx 24upx 0;
.af-title{
margin-left: 18upx;
margin-bottom: 68upx;
line-height: 60upx;
font-size: 44upx;
color: #1a1a1a;
.af-content{
padding: 62upx 24upx 0;
.af-title{
margin-left: 18upx;
margin-bottom: 68upx;
line-height: 60upx;
font-size: 44upx;
color: #1a1a1a;
}
.af-section{
margin-bottom: 40upx;
padding: 40upx 30upx 0;
height: 738upx;
border-radius: 10upx;
background-color: #fff;
.as-tip{
margin-bottom: 36upx;
line-height: 40upx;
font-size: 28upx;
color: #1A1A1A;
>text{
&:first-child{
color: #EA5061;
}
&:nth-child(3){
color: #9C9C9F;
}
}
}
>picker{
width: 100%;
}
.as-select{
padding-left: 20upx;
padding-right: 34upx;
margin-bottom: 60upx;
height: 96upx;
border-radius: 10upx;
border: 2upx solid #d8d8d8;
@include centerFlex(space-between);
>image{
flex-shrink: 0;
margin-left: 14upx;
width: 28upx;
height: 28upx;
transform: rotateZ(90deg);
}
>input{
flex-grow: 1;
height: 100%;
font-size: 32upx;
color: #1a1a1a;
}
>view{
flex-grow: 1;
height: 100%;
}
}
}
.af-btn{
height: 112upx;
line-height: 112upx;
text-align: center;
border-radius: 10upx;
font-size: 32upx;
color: #fff;
background-color: $themeColor;
}
}
.af-section{
margin-bottom: 40upx;
padding: 40upx 30upx 0;
height: 738upx;
border-radius: 10upx;
.af-select-modal{
position: absolute;
left: 0;
bottom: 0;
right: 0;
width: 100%;
background-color: #fff;
.as-tip{
margin-bottom: 36upx;
line-height: 40upx;
font-size: 28upx;
color: #1A1A1A;
>text{
&:first-child{
color: #EA5061;
padding-top: 20upx;
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 */
.asm-list{
height: 600upx;
.al-item{
margin-bottom: 20upx;
padding: 20upx 24upx;
@include centerFlex(space-between);
>view{
flex-grow: 1;
font-size: 32upx;
color: #1a1a1a;
line-height: 44upx;
@include textHide(1);
}
.active{
color: $themeColor;
}
&:nth-child(3){
color: #9C9C9F;
>image{
margin-left: 20upx;
flex-shrink: 0;
width: 30upx;
height: 30upx;
}
}
}
>picker{
width: 100%;
}
.as-select{
padding-left: 20upx;
padding-right: 34upx;
margin-bottom: 60upx;
height: 96upx;
.asm-btn{
margin: 20upx auto;
height: 88upx;
width: 702upx;
line-height: 88upx;
text-align: center;
border-radius: 10upx;
border: 2upx solid #d8d8d8;
@include centerFlex(space-between);
>image{
flex-shrink: 0;
margin-left: 14upx;
width: 28upx;
height: 28upx;
transform: rotateZ(90deg);
}
>input{
flex-grow: 1;
height: 100%;
font-size: 32upx;
color: #1a1a1a;
}
background-color: $themeColor;
font-size: 32upx;
color: #fff;
font-weight: 500;
}
}
.af-btn{
height: 112upx;
line-height: 112upx;
text-align: center;
border-radius: 10upx;
font-size: 32upx;
color: #fff;
background-color: $themeColor;
}
}
</style>

103
src/pages/employee/authority_select/authority_select.vue

@ -13,7 +13,7 @@
<view>门店权限 </view>
<view>
<view>全选</view>
<switch @change="storeAllSelect" color="#009874"></switch>
<switch @change="storeAllSelect" color="#009874" :checked="isAllStoreChecked"></switch>
</view>
</view>
<view class="asa-author-list">
@ -28,7 +28,7 @@
<view>小程序权限 </view>
<view >
<view>全选</view>
<switch @change="appAllSelect" color="#009874"></switch>
<switch @change="appAllSelect" color="#009874" :checked="isAllAppChecked"></switch>
</view>
</view>
<view class="aaa-list">
@ -42,31 +42,59 @@
<view v-if="options_query.type == 'singleEdit'" class="ac-btn green" hover-class="hover-active" @click="saveEdit">保存</view>
<view v-if="options_query.type == 'singleEdit'" class="ac-btn red" hover-class="hover-active" @click="deleteEmployee">移除员工</view>
<view v-if="options_query.type == 'singleReview' || options_query.type == 'multipleReview'" class="ac-btn green" hover-class="hover-active">审核通过</view>
<view
v-if="options_query.type == 'singleReview' || options_query.type == 'multipleReview'"
class="ac-btn green"
hover-class="hover-active"
@click="reviewPass"
>审核通过</view>
<view
v-if="options_query.type == 'singleReview'"
class="ac-btn"
hover-class="hover-active"
@click="reviewFail"
>不通过</view>
</view>
</view>
</template>
<script>
import util from '../../../utils/util';
import { mapGetters } from 'vuex';
import { mapGetters, mapState } from 'vuex';
import { servers } from '../../../js/server';
import { API } from '../../../js/api';
export default {
computed: {
...mapGetters([ 'permissionArr' ]),
...mapState([ 'brandInfo' ]),
//
isAllStoreChecked(){
let { storeList } = this;
let _bol = true;
if(storeList <= 0)return false;
storeList.forEach(e=>{if(!e.isChecked)_bol = false});
return _bol;
},
//
isAllAppChecked(){
let { appPermissionArr } = this;
let _bol = true;
if(appPermissionArr <= 0)return false;
appPermissionArr.forEach(e=>{if(!e.isChecked)_bol = false});
return _bol;
}
},
data(){
return {
storeList: [],
appPermissionArr: [],
options_query: {
userInfo: {},
options_query: { //
brand_id: '', // ID
userInfo: {}, // id,name,avatar_url,mobile
userIDS: [], // id
type: '', // singleEdit-> / singleReview -> / multipleReview ->
tags: [], // id
menu: [], // key
},
}
},
@ -76,16 +104,64 @@ export default {
//
this.getStoreList({
brand_id: _query.brand_id,
tags: _query.tags
tags: _query.tags || []
});
//
this.appPermissionArr = this.formatAppSelected({
list: this.permissionArr,
menu: _query.menu
list: util.jsonPar(util.jsonStr(this.permissionArr)),
menu: _query.menu || [],
});
},
methods: {
//
reviewPass(){
let { options_query, appPermissionArr, storeList, brandInfo } = this;
let storeIDS = storeList.filter(ele=>ele.isChecked).map(e=>e.id);
let menusKEYS = appPermissionArr.filter(ele=>ele.isChecked).map(e=>e.key);
let _query = {
brand_id: brandInfo.brand.id,
ids: options_query.userIDS.join(','),
stadium_ids: storeIDS.join(','),
menus: menusKEYS.join(','),
status: 1,
}
this.reviewREQ(_query);
},
//
reviewFail(){
let { options_query, brandInfo } = this;
let _query = {
brand_id: brandInfo.brand.id,
ids: options_query.userIDS.join(','),
status: 0,
};
this.reviewREQ(_query);
},
reviewREQ: util.debounce(function(query){
util.showLoad();
servers.get({
url: API.employee.employeeGrant,
data: query,
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
setTimeout(_=>{
util.previousPageFunction({
fnName: 'getUserList',
query: null
})
util.routeTo();
},1200)
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
},300,300),
formatAppSelected({
list=[],
menu=[],
@ -138,9 +214,10 @@ export default {
url: API.employee.employeeGrant,
data: {
brand_id: options_query.brand_id,
user_id: options_query.userInfo.id,
ids: options_query.userIDS.join(','),
stadium_ids: stadium_ids.join(','),
menus: menus.join(','),
status: 1,
},
isDefaultGet: false,
})
@ -193,7 +270,7 @@ export default {
if(isAll)ele.isChecked = bol
if(ID == ele.id)ele.isChecked = bol;
return ele
})
});
},
//
appAllSelect(e){
@ -220,6 +297,7 @@ export default {
return ele
})
},
//
getStoreList({ brand_id, tags }){
util.showLoad();
servers.get({
@ -253,11 +331,12 @@ export default {
<style lang="scss" scoped>
@import "../../../style/public.scss";
.as-contetnt{
padding-top: 24upx;
switch{
transform: scale(.7);
}
.ac-user{
padding: 38upx 30upx 40upx;
padding: 14upx 30upx 40upx;
@include centerFlex(flex-start);
>image{
flex-shrink: 0;

40
src/pages/employee/manage/manage.vue

@ -44,7 +44,7 @@
<view>员工总数 <text>{{employeeInfo.total || 0}}</text></view>
</view>
<view>
<text @click="toFilter">筛选</text>
<text :class="[isFilter?'active':'']" @click="toFilter">筛选</text>
<text v-if="!isDeleteOperate" @click="openDeleteOperate">删除</text>
<text class="active" v-if="isDeleteOperate" @click="cancelDeleteOperate">取消</text>
</view>
@ -53,9 +53,9 @@
<view class="el-item" v-for="k in employeeInfo.employee" :key="k.id" @click="toAuthority(k)">
<view>
<image :class="['ei-icon', k.isDelete?'active':'']" mode="aspectFit" :src="k.isDelete?'/static/images/icon/selected_987.png':''" v-if="isDeleteOperate"></image>
<image class="ei-avatar" mode="aspectFill" :src="k.avatar_url"></image>
<image class="ei-avatar" mode="aspectFill" :src="k.avatar_url || ''"></image>
<view class="ei-info">
<view>{{k.actual_name}}</view>
<view>{{k.actual_name || '-'}}</view>
<view class="ei-author">
<view>权限</view>
<view>
@ -87,13 +87,23 @@ import { mapState } from 'vuex';
export default {
computed: {
...mapState([ 'permissionObj', 'brandInfo' ]),
isFilter(){
let { filterInfo } = this;
return !!filterInfo.meun || !!filterInfo.store
}
},
data(){
return {
isDeleteOperate: false, //
isSelectedAllDelete: false, //
isInputFocus: false,
searchTxt: '',
searchTxt: '', // key
filterInfo: { //
meun: '', //
store: '' //
},
employeeInfo: {
admin: {}, //
employee: [], //
@ -103,7 +113,7 @@ export default {
}
},
onLoad(){
this.getEmployeeList({})
this.getEmployeeList({});
},
methods: {
//
@ -114,8 +124,7 @@ export default {
if(ele.isDelete)return ele;
})
// if(_deleteArr.length<=0)return util.showNone('');
let ids = _deleteArr.map(ele=>ele.id)
console.log(ids)
let ids = _deleteArr.map(ele=>ele.id);
util.showModal({
title: '提示',
content: '移除后,改员工将无法登录和使用欧轩智能商家助手小程序',
@ -188,12 +197,16 @@ export default {
openDeleteOperate(){
this.isDeleteOperate = true;
},
//
refreshEmployList(){
let { searchTxt } = this;
let { searchTxt, filterInfo } = this;
this.getEmployeeList({
key: searchTxt
key: searchTxt,
stadium_id: filterInfo.store,
menu: filterInfo.meun
})
},
//
getEmployeeList({
stadium_id='',
@ -232,7 +245,13 @@ export default {
},
//
toFilter(){
util.routeTo(`/pages/employee/authority_filter/authority_filter`, 'nT');
let { filterInfo } = this;
util.routeTo(`/pages/employee/authority_filter/authority_filter?filterInfo=${util.jsonStr(filterInfo)}`, 'nT');
},
// authority_filter
changeFilter(filterInfo){
this.filterInfo = filterInfo;
this.$nextTick(_=>this.refreshEmployList());
},
//
toAuthority(item){
@ -243,6 +262,7 @@ export default {
let _query = {
type: 'singleEdit',
brand_id: brandInfo.brand.id,
userIDS: [item.id],
userInfo: {
id: item.id,
name: item.actual_name,

116
src/pages/employee/review_list/review_list.vue

@ -1,43 +1,40 @@
<template>
<view class="review-list">
<view class="rl-header">
<view>审核 {{reviewInfo.total}} </view>
<view>审核 {{reviewInfo.total || 0}} </view>
<view @click="selectAll">
<text>全选</text>
<image :class="[isAllSelected?'img-active':'']" mode="aspectFit" :src="isAllSelected?'/static/images/icon/selected_987.png':''"></image>
</view>
</view>
<view class="rl-users">
<view class="ru-item" v-for="(e,i) in reviewInfo.list" :key="i" @click="userSelect(i)">
<view class="ru-item" v-for="(e,i) in reviewInfo.list" :key="i">
<view>
<image :class="['ri-icon',e.isSelected?'active':'']" mode="aspectFit" :src="e.isSelected?'/static/images/icon/selected_987.png':''"></image>
<image class="ri-avatar" mode="apsectFill" :src="e.avatar_url || ''"></image>
<view>{{e.actual_name || '-'}}</view>
<image @click="userSelect(i)" :class="['ri-icon',e.isSelected?'active':'']" mode="aspectFit" :src="e.isSelected?'/static/images/icon/selected_987.png':''"></image>
<image class="ri-avatar" mode="apsectFill" :src="e.avatar_url || ''" @click="toSingleReview(e)"></image>
<view @click="toSingleReview(e)">{{e.actual_name || '-'}}</view>
</view>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png"></image>
<image mode="aspectFit" src="/static/images/icon/arrow_b2.png" @click="toSingleReview(e)"></image>
</view>
</view>
<view class="rl-btn" hover-class="hover-active">审核通过</view>
<view class="rl-btn white" hover-class="hover-active">不通过</view>
<view class="rl-btn" hover-class="hover-active" @click="reviewPass">审核通过</view>
<view class="rl-btn white" hover-class="hover-active" @click="reviewFail">不通过</view>
</view>
</template>
<script>
import { API } from '../../../js/api'
import { servers } from '../../../js/server'
import { API } from '../../../js/api';
import { servers } from '../../../js/server';
import { mapState } from 'vuex';
import util from '../../../utils/util';
export default {
computed: {
...mapState(['brandInfo']),
isAllSelected(){
let _list = this.reviewInfo.list;
let _list = this.reviewInfo.list || [];
let _bol = true;
if(_list.length<=0)return false;
_list.forEach(ele=>{
if(!ele.isSelected)_bol = false
})
_list.forEach(ele=>{ if(!ele.isSelected)_bol = false });
return _bol;
},
},
@ -52,12 +49,89 @@ export default {
this.getUserList();
},
methods: {
//
toSingleReview(userInfo){
let { brandInfo } = this;
let _query = {
brand_id: brandInfo.brand.id,
type: 'singleReview',
tags: [],
menu: [],
userIDS: [userInfo.id],
userInfo: {
id: userInfo.id,
name: userInfo.actual_name,
avatar_url: userInfo.avatar_url,
mobile: userInfo.mobile,
},
}
util.routeTo(`/pages/employee/authority_select/authority_select?query=${util.jsonStr(_query)}`,'nT');
},
//
reviewPass(){
let list = this.reviewInfo.list || [];
if(list.length <=0)return util.showNone('没有待审核员工!');
let { brandInfo } = this;
let _selectedList = list.filter(e=>e.isSelected) || [];
let query = {
brand_id: brandInfo.brand.id,
tags: [],
menu: [],
userIDS: _selectedList.map(ele=>ele.id),
};
//
if(_selectedList.length ==1){
let _user = _selectedList[0] || {};
query['type'] = 'singleReview';
query['userInfo'] = {
id: _user.id,
name: _user.actual_name,
avatar_url: _user.avatar_url,
mobile: _user.mobile,
}
}else{
query['userArr'] = _selectedList.map(ele=>ele.id);
}
util.routeTo(`/pages/employee/authority_select/authority_select?query=${util.jsonStr(query)}`,'nT');
},
//
reviewFail(){
let { list } = this.reviewInfo;
if(list.length <=0)return util.showNone('没有待审核员工!');
let { brandInfo } = this;
let _selectedList = list.filter(e=>e.isSelected) || [];
servers.get({
url: API.employee.employeeGrant,
data: {
brand_id: brandInfo.brand.id,
ids: _selectedList.map(e=>e.id) || [],
status: 0
},
isDefaultGet: false,
})
.then(e=>{
if(e.data.code == 0){
util.showNone(e.data.message || '操作成功!');
setTimeout(_=>{
this.getUserList();
},1200)
}else{
util.showNone(e.data.message || '操作失败!');
}
})
},
//
selectAll(){
let _list = this.reviewInfo.list.slice();
let { isAllSelected } = this;
_list.forEach(ele=>ele.isSelected = !isAllSelected);
this.reviewInfo.list = _list;
},
//
userSelect(index){
let _list = this.reviewInfo.list.slice();
_list[index].isSelected = !_list[index].isSelected
@ -65,16 +139,20 @@ export default {
// this.reviewInfo.list[index].isSelected = true;
this.$nextTick(this.$forceUpdate());
},
//
getUserList(){
util.showLoad();
servers.get({
url: API.employee.employeeUnreview,
data: {},
failMsg: '加载失败!'
})
.then(res=>{
console.log(res);
util.hideLoad();
res.list = res.list || [];
this.reviewInfo = res;
})
.catch(util.hideLoad)
}
}
}

Loading…
Cancel
Save