添加:移动端员工管理功能
This commit is contained in:
parent
d2db04aa37
commit
46b666b45f
|
|
@ -0,0 +1,31 @@
|
|||
import request from "@/utils/request.js";
|
||||
|
||||
// 员工管理 - 获取员工列表
|
||||
export function getStaffList(data) {
|
||||
return request.get('staff/staff_list',data);
|
||||
}
|
||||
// 员工管理 - 员工编辑
|
||||
export function editStaff(data) {
|
||||
return request.get('staff/staff_edit',data);
|
||||
}
|
||||
// 员工管理 - 获取员工信息
|
||||
export function getStaffInfo(data) {
|
||||
return request.get('staff/staff_info',data);
|
||||
}
|
||||
// 员工管理 - 员工删除
|
||||
export function delStaff(data) {
|
||||
return request.get('staff/staff_del',data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -6,13 +6,13 @@ let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
|
|||
let openPlantGrass = '-openPlantGrass-'
|
||||
|
||||
// 网络接口修改此字符 小程序域名要求https
|
||||
let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
|
||||
// let httpApi = 'https://mp.scwmbh.cn/' // 生产
|
||||
// let httpApi = 'https://bt.test.cdlfjy.com/' // 开发
|
||||
let httpApi = 'https://mp.scwmbh.cn/' // 生产
|
||||
|
||||
|
||||
// 聊天接口修改此字符 小程序聊天要求wss 例如:
|
||||
let wsApi = 'wss://bt.test.cdlfjy.com'
|
||||
// let wsApi = 'wss://mp.scwmbh.cn'
|
||||
// let wsApi = 'wss://bt.test.cdlfjy.com'
|
||||
let wsApi = 'wss://mp.scwmbh.cn'
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
12
pages.json
12
pages.json
|
|
@ -680,6 +680,18 @@
|
|||
"navigationBarTitleText": "商家管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "business/staff",
|
||||
"style": {
|
||||
"navigationBarTitleText": "员工管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "business/edit_staff",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑员工"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "orderDetail/index",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,597 @@
|
|||
<template>
|
||||
<view class="custom-content">
|
||||
<!--标题-->
|
||||
<view class="title">添加员工</view>
|
||||
<!--表单-->
|
||||
<view class="form-content">
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">用户</view>
|
||||
<view class="right">
|
||||
<view class="right-btn" @click="showConsumePopup">选择用户</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="user-content" v-if="consume_info.uid > 0">
|
||||
<image class="image-img-image" :src="info.avatar" mode="widthFix"></image>
|
||||
<view class="user-info">
|
||||
<view class="nickname">{{ consume_info.nickname}}</view>
|
||||
<view class="uid">UID:{{ consume_info.uid}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">员工头像</view>
|
||||
<view class="right">
|
||||
<view class="box-value">
|
||||
<!--图片内容-->
|
||||
<view class="image-img image-size-set" v-if="info.avatar" @click="uploadImage">
|
||||
<image class="image-img-image" :src="info.avatar" mode="widthFix"></image>
|
||||
</view>
|
||||
<!--上传图片按钮-->
|
||||
<view class="upload-btn-box image-size-set" v-else @click="uploadImage">
|
||||
<image class="upload-btn-icon" src="@/static/images/custom/creamer.png" mode="widthFix"></image>
|
||||
上传凭证
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">员工名称</view>
|
||||
<input type="text" v-model="info.nickname" maxlength="15" placeholder="请输入员工名称" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">员工账号</view>
|
||||
<input type="text" v-model="info.account" maxlength="20" placeholder="请输入员工账号" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">员工密码</view>
|
||||
<input type="password" v-model="info.pwd" maxlength="20" placeholder="请输入员工密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">确认密码</view>
|
||||
<input type="password" v-model="info.confirm_pwd" maxlength="20" placeholder="请确认密码" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">账号状态</view>
|
||||
<switch :checked="info.is_open == 1" @change="changeSwitch($event,'is_open')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="info.is_open == 1">
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">客服功能</view>
|
||||
<switch :checked="info.status == 1" @change="changeSwitch($event,'status')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">订单管理</view>
|
||||
<switch :checked="info.customer == 1" @change="changeSwitch($event,'customer')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">商品管理</view>
|
||||
<switch :checked="info.is_goods == 1" @change="changeSwitch($event,'is_goods')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">开启核销</view>
|
||||
<switch :checked="info.is_verify == 1" @change="changeSwitch($event,'is_verify')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">客户管理</view>
|
||||
<switch :checked="info.is_user == 1" @change="changeSwitch($event,'is_user')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">员工管理</view>
|
||||
<switch :checked="info.staff_manage == 1" @change="changeSwitch($event,'staff_manage')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">订单通知</view>
|
||||
<switch :checked="info.notify == 1" @change="changeSwitch($event,'notify')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line" v-if="info.notify == 1">
|
||||
<view class="line-content">
|
||||
<view class="title">通知电话</view>
|
||||
<input type="text" v-model="info.phone" placeholder="请输入通知电话" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="line">
|
||||
<view class="line-content">
|
||||
<view class="title">推广二维码</view>
|
||||
<switch :checked="info.qr_code_show == 1" @change="changeSwitch($event,'qr_code_show')" color="#437ffd" style="transform:scale(0.8)" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<!--提交按钮-->
|
||||
<view class="group-btn">
|
||||
<view class="add-btn" @click="submitInfo()">提交</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 员工选择 -->
|
||||
<uni-popup ref="selectedConsume" type="center">
|
||||
<view class="point-content">
|
||||
<view class="search-content">
|
||||
<input class="money-input" v-model="consume_search.nickname" type='text' placeholder="请输入会员昵称" />
|
||||
<view class="search-btn" @click="getConsumeList">搜索</view>
|
||||
<view class="close-btn" @click="consumeClosePopup">取消</view>
|
||||
</view>
|
||||
<view class="point-list">
|
||||
<view class="point-box" v-for="(item,index) in consume_list" :key="index">
|
||||
<view class="left">
|
||||
<image class="image" :src="item.avatar || '/static/images/f.png'"></image>
|
||||
<view class="point-info">
|
||||
<view class="point-name">
|
||||
{{ item.nickname || item.real_name }}
|
||||
<view class="point-tag" v-if="item.is_store_service == 1">已成为员工</view>
|
||||
</view>
|
||||
<view class="point-address">UID:{{ item.uid }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="selected-btn" @click="selectedConsume(item)" v-if="item.is_store_service != 1">选中</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 图片上传 -->
|
||||
<avatar @upload="doUpload" quality="1" ref="avatar" selWidth="250upx" selHeight="250upx"></avatar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import avatar from "@/components/yq-avatar/yq-avatar.vue";
|
||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
||||
import {editStaff,getStaffInfo} from "@/api/service";
|
||||
import { getCustomList } from "@/api/user.js";
|
||||
export default {
|
||||
name: 'custom',
|
||||
components: {
|
||||
avatar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 基本参数
|
||||
service_id: 0,
|
||||
mer_id: 0,
|
||||
// 表单相关
|
||||
info: {
|
||||
uid: {},
|
||||
avatar: '',
|
||||
nickname: '',
|
||||
account: '',
|
||||
confirm_pwd: '',
|
||||
pwd: '',
|
||||
is_open: 0,
|
||||
status: 0,
|
||||
customer: 0,
|
||||
is_goods: 0,
|
||||
is_verify: 0,
|
||||
is_user: 0,
|
||||
staff_manage: 0,
|
||||
notify: 0,
|
||||
phone: '',
|
||||
qr_code_show: 1,
|
||||
},
|
||||
// 关注用户列表
|
||||
consume_info: {},
|
||||
consume_list: {},
|
||||
consume_search: {
|
||||
limit: 30,
|
||||
nickname: '',
|
||||
default_consume_id: 0,
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
computed: { },
|
||||
onLoad: function(options) {
|
||||
// 参数处理
|
||||
this.service_id = options.service_id || 0;
|
||||
this.mer_id = options.mer_id || 0;
|
||||
if(this.mer_id <= 0){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '非法访问,参数不明确!',
|
||||
success: function success(res) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
// 初始化
|
||||
if(this.service_id > 0) this.getStaffInfo();
|
||||
},
|
||||
methods: {
|
||||
// 图片上传 - 触发上传
|
||||
uploadImage() {
|
||||
let avatar = this.$refs.avatar;
|
||||
avatar.fChooseImg(1,{selWidth: '350upx', selHeight: '350upx', inner: true});
|
||||
},
|
||||
// 图片上传 - 上传
|
||||
doUpload(rsp) {
|
||||
console.log(rsp)
|
||||
let _this = this
|
||||
uni.uploadFile({
|
||||
url: HTTP_REQUEST_URL + '/api/upload/image/field',
|
||||
filePath: rsp.path || '',
|
||||
name: 'field',
|
||||
formData: {
|
||||
'filename': rsp.path,
|
||||
'name': _this.imgName
|
||||
},
|
||||
header: {
|
||||
// #ifdef MP
|
||||
"Content-Type": "multipart/form-data",
|
||||
// #endif
|
||||
// [TOKENNAME]: 'Bearer ' + store.state.app.token
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
let imgData = JSON.parse(uploadFileRes.data)
|
||||
console.log('图片上传回调',imgData);
|
||||
if(imgData.data) _this.info.avatar = imgData.data.path || '';
|
||||
}
|
||||
});
|
||||
},
|
||||
// 员工选择 - 显示弹框
|
||||
showConsumePopup(){
|
||||
if(Object.keys(this.consume_list).length <= 0) this.getConsumeList();
|
||||
if(Number(this.consume_search.default_consume_id) <= 0) this.$refs.selectedConsume.open('center');
|
||||
},
|
||||
// 员工选择 - 隐藏弹框
|
||||
consumeClosePopup(){
|
||||
this.$refs.selectedConsume.close();
|
||||
},
|
||||
// 员工选择 - 获取列表
|
||||
getConsumeList(){
|
||||
let _this = this;
|
||||
getCustomList(_this.mer_id, _this.consume_search).then(res => {
|
||||
_this.consume_list = res.data.list || {};
|
||||
// 判断:是否只有一个-是则选中
|
||||
if(Object.values(_this.consume_list).length == 1){
|
||||
_this.selectedConsume(_this.consume_list[0]);
|
||||
_this.consume_search.default_consume_id = 0;
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
// 员工选择 - 选中
|
||||
selectedConsume(item){
|
||||
this.consume_info = item;
|
||||
this.consumeClosePopup();
|
||||
},
|
||||
// 提交信息
|
||||
submitInfo(){
|
||||
let _this = this;
|
||||
let info = Object.assign({},_this.info);
|
||||
info.mer_id = _this.mer_id;
|
||||
info.service_id = _this.service_id;
|
||||
info.uid = {
|
||||
id: _this.consume_info.uid
|
||||
}
|
||||
// 提交信息
|
||||
editStaff(info).then(res => {
|
||||
this.$util.Tips({
|
||||
title: res.message
|
||||
},{
|
||||
tab: 5,
|
||||
url: '/pages/admin/business/staff?mer_id=' + _this.mer_id,
|
||||
});
|
||||
}).catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开关改变
|
||||
changeSwitch(event,field){
|
||||
this.$set(this.info, field, event.detail.value ? 1 : 0);
|
||||
},
|
||||
// 获取员工信息
|
||||
getStaffInfo(){
|
||||
let _this = this;
|
||||
getStaffInfo({ service_id: _this.service_id }).then(res => {
|
||||
_this.info = res.data || {};
|
||||
_this.consume_search.default_consume_id = res.data.uid.id;
|
||||
_this.showConsumePopup();
|
||||
}).catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 触底事件
|
||||
onReachBottom() {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-content{
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
background: orange;
|
||||
padding: 0 30rpx 100rpx 30rpx;
|
||||
|
||||
.title{
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
font-size: 32rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.form-content{
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx!important;
|
||||
padding: 20rpx!important;
|
||||
.line{
|
||||
width: 100%;
|
||||
|
||||
.line-content{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: nowrap;
|
||||
.title{
|
||||
font-size: 28rpx;
|
||||
width: 150rpx;
|
||||
text-align: right;
|
||||
}
|
||||
input{
|
||||
width: calc(100% - 165rpx) !important;
|
||||
}
|
||||
.right{
|
||||
width: calc(100% - 165rpx) !important;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
.right-btn{
|
||||
color: #fff;
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.box-value{
|
||||
width: calc(100% - var(--box-width-));
|
||||
|
||||
.image-size-set{
|
||||
width: 210rpx;
|
||||
height: 210rpx;
|
||||
border: 2rpx solid #dddddd;
|
||||
border-radius: 8rpx;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
|
||||
image{
|
||||
max-width: 100% !important;
|
||||
max-height: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-btn-box{
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
display: inline-flex;
|
||||
flex-direction: column!important;
|
||||
justify-content: center;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
.upload-btn-icon{
|
||||
width: 45rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user-content{
|
||||
width: 100%;
|
||||
padding: 20rpx 0 0 150rpx;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.image-img-image{
|
||||
width: 80rpx!important;
|
||||
height: 80rpx!important;
|
||||
border-radius: 50% !important;
|
||||
margin-right: 15rpx!important;
|
||||
}
|
||||
.user-info{
|
||||
width: calc(100% - 100rpx);
|
||||
.nickname{
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.uid{
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.group-btn{
|
||||
margin-top: 80rpx!important;
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
.add-btn{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.point-content{
|
||||
background: #FFFFFF;
|
||||
width: 90vw!important;
|
||||
height: 90vh!important;
|
||||
padding: 15rpx;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.search-content{
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
.money-input{
|
||||
width: calc(100% - (100rpx * 2)) !important;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.search-btn{
|
||||
width: 100rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
}
|
||||
.close-btn{
|
||||
width: 100rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
background-color: #f56c6c;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.point-list{
|
||||
overflow: auto;
|
||||
height: calc(100% - 60rpx);
|
||||
.point-box{
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
width: 100%;
|
||||
.left{
|
||||
width: calc(100% - 110rpx);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
.image{
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
.point-info{
|
||||
width: calc(100% - 90rpx);
|
||||
.point-name{
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
font-size: 30rpx;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: nowrap;
|
||||
.point-tag{
|
||||
color: #fff;
|
||||
background-color: #e6a23c;
|
||||
border-color: #e6a23c;
|
||||
padding: 0 15rpx;
|
||||
font-size: 24rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 50rpx;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
}
|
||||
.point-address{
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
color: #cccccc;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
.selected-btn{
|
||||
width: 100rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
background-color: #67c23a;
|
||||
color: #fff;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
.point-box:not(:last-child){
|
||||
border: 2rpx solid #f6f6f6;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -4,45 +4,54 @@
|
|||
<view class="headerbox" @click="changeTips" v-if="service">
|
||||
<image :src="service.merchant.mer_avatar" mode=""></image>
|
||||
<span class='font line1'>{{service.merchant.mer_name || '暂无店铺'}}</span>
|
||||
<text v-if="!downStatus" class="iconfont icon-xiala1 spin"></text>
|
||||
<text v-else class="iconfont icon-xiala1"></text>
|
||||
<template v-if="Object.values(storeList).length > 1">
|
||||
<text v-if="!downStatus" class="iconfont icon-xiala1 spin"></text>
|
||||
<text v-else class="iconfont icon-xiala1"></text>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="business-content">
|
||||
<view v-if="Object.values(list).length > 0" class="business-content">
|
||||
<view @click="goNext(item)" class="listBox" v-for="(item,index) in list">
|
||||
<text :class="item.icon" class="businessIcon"></text>
|
||||
<view>{{item.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<emptyPage v-else title="暂无任何操作权限~"></emptyPage>
|
||||
|
||||
<shopList ref="shopList" @changeStoreClose="changeClose" @getService="getService" :is_sys='is_sys'></shopList>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import emptyPage from '@/components/emptyPage.vue'
|
||||
import shopList from '@/components/shopList';
|
||||
export default {
|
||||
name: 'business',
|
||||
components: {
|
||||
shopList
|
||||
shopList,
|
||||
emptyPage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
is_sys: '',
|
||||
downStatus: false,
|
||||
service: null
|
||||
service: null,
|
||||
storeList: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list(){
|
||||
if(!this.service) return [];
|
||||
const merId = this.service.mer_id;
|
||||
const list = [{
|
||||
type: 'customer',
|
||||
title: '客服记录',
|
||||
url: '/pages/chat/customer_list/index?type=1&mer_id=' + merId,
|
||||
icon: 'iconfont icon-kefujilu'
|
||||
}];
|
||||
const list = [];
|
||||
if(this.service.status){
|
||||
list.push({
|
||||
type: 'customer',
|
||||
title: '客服记录',
|
||||
url: '/pages/chat/customer_list/index?type=1&mer_id=' + merId,
|
||||
icon: 'iconfont icon-kefujilu'
|
||||
});
|
||||
}
|
||||
if(this.service.is_verify){
|
||||
list.push({
|
||||
title: '订单核销',
|
||||
|
|
@ -70,6 +79,13 @@
|
|||
url: '/pages/admin/custom/index?mer_id=' + merId,
|
||||
icon: 'iconfont icon-kehu-xuanzhong'
|
||||
});
|
||||
}
|
||||
if(this.service.staff_manage){
|
||||
list.push({
|
||||
title: '员工管理',
|
||||
url: '/pages/admin/business/staff?mer_id=' + merId,
|
||||
icon: 'iconfont icon-kehu-xuanzhong'
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -88,8 +104,10 @@
|
|||
});
|
||||
},
|
||||
changeTips(data) {
|
||||
this.downStatus = !this.downStatus;
|
||||
this.$refs.shopList.isShowStore();
|
||||
if(Object.values(this.storeList).length > 1){
|
||||
this.downStatus = !this.downStatus;
|
||||
this.$refs.shopList.isShowStore();
|
||||
}
|
||||
},
|
||||
changeClose() {
|
||||
this.downStatus = false;
|
||||
|
|
@ -104,9 +122,11 @@
|
|||
url: item.url,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getService: function(data) {
|
||||
this.storeList = this.$refs.shopList.storeList || {};
|
||||
|
||||
this.service = data;
|
||||
if(data && data.merchant){
|
||||
uni.setNavigationBarTitle({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,280 @@
|
|||
<template>
|
||||
<view class="custom-content">
|
||||
<!--顶部搜索框-->
|
||||
<view class="search-content">
|
||||
<view class="search-box">
|
||||
<text class="iconfont icon-sousuo" @click="getStaffList(1)"></text>
|
||||
<input class="search-input" type='text' placeholder='请输入员工名称' v-model="search.keyword" @input="getStaffList(1)" />
|
||||
</view>
|
||||
</view>
|
||||
<!-- 员工列表 -->
|
||||
<view class="custom-list">
|
||||
<view class="list-item" v-for="(item,index) in list" :key="index">
|
||||
<view class="left-avatar">
|
||||
<image v-if="item.avatar.length > 10" :src="item.avatar" mode="widthFix"/>
|
||||
</view>
|
||||
<view class="center-info">
|
||||
<view class="info-top">{{ item.nickname }}</view>
|
||||
<view class="info-bottom">UID:{{ item.uid }}</view>
|
||||
</view>
|
||||
<view class="right-btn" v-if="uid != item.uid">
|
||||
<view class="give-btn edit-btn" @click="goToEditPage(item.service_id)">编辑</view>
|
||||
<view class="give-btn del-btn" @click="delInfo(item.service_id)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--添加按钮-->
|
||||
<view class="group-btn">
|
||||
<view class="add-btn" @click="goToEditPage()">添加员工</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
import {getStaffList,delStaff} from "@/api/service";
|
||||
export default {
|
||||
name: 'custom',
|
||||
components: {},
|
||||
computed: {
|
||||
...mapGetters(['isLogin','uid', 'userInfo', 'viewColor'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mer_id: 0,
|
||||
// 员工列表
|
||||
list: [],
|
||||
search:{
|
||||
page: 1,
|
||||
limit: 20,
|
||||
keyword: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
this.mer_id = options.mer_id || 0;
|
||||
if(this.mer_id <= 0){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '非法访问,参数不明确!',
|
||||
success: function success(res) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
// 获取用户列表
|
||||
this.getStaffList(1);
|
||||
},
|
||||
methods: {
|
||||
// 提货记录
|
||||
getStaffList(page) {
|
||||
// 初始化
|
||||
let _this = this;
|
||||
if(Number(page) == 1) _this.list = [];
|
||||
// 请求参数处理
|
||||
_this.search.page = Number(page) > 0 ? Number(page) : _this.search.page;
|
||||
let search = Object.assign({},_this.search);
|
||||
search.mer_id = _this.mer_id;
|
||||
// 请求
|
||||
getStaffList(search).then(res => {
|
||||
let list = res.data.list || {};
|
||||
if (Object.values(list).length > 0) {
|
||||
_this.list = _this.$util.SplitArray(list, _this.list);
|
||||
_this.$set(_this, 'list', _this.list);
|
||||
_this.search.page++;
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
// 删除信息
|
||||
delInfo(service_id){
|
||||
let _this = this;
|
||||
uni.showModal({
|
||||
title: '确认删除当前员工?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let params = {
|
||||
service_id: service_id,
|
||||
mer_id: _this.mer_id
|
||||
};
|
||||
delStaff(params).then(res => {
|
||||
this.$util.Tips({
|
||||
title: '删除成功'
|
||||
}, () => {
|
||||
_this.getStaffList(1)
|
||||
});
|
||||
}).catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 进入员工编辑页面
|
||||
goToEditPage(service_id){
|
||||
let path = '/pages/admin/business/edit_staff?mer_id=' + this.mer_id;
|
||||
if(Number(service_id) > 0) path += '&service_id=' +service_id;
|
||||
uni.navigateTo({
|
||||
url: path,
|
||||
});
|
||||
},
|
||||
},
|
||||
// 触底事件
|
||||
onReachBottom() {
|
||||
this.getStaffList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.custom-content{
|
||||
// 搜索框
|
||||
.search-content{
|
||||
width: 100vw;
|
||||
background: url("@/static/images/custom/custom_top_bg.jpg") no-repeat;
|
||||
padding: 20rpx 30rpx;
|
||||
|
||||
.search-box{
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
padding: 10rpx 15rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 10rpx;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
|
||||
.icon-sousuo{
|
||||
width: calc(70rpx - 15rpx);
|
||||
padding-right: 15rpx;
|
||||
height: calc(70rpx - (10rpx * 2));
|
||||
line-height: calc(70rpx - (10rpx * 2));
|
||||
text-align: center;
|
||||
}
|
||||
.search-input{
|
||||
width: calc(100% - 70rpx + 15rpx);
|
||||
height: calc(70rpx - (10rpx * 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 员工列表
|
||||
.custom-list{
|
||||
width: 100vw;
|
||||
background: #FFFFFF;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
.list-item:not(:last-child){
|
||||
border-bottom: 2rpx solid #f6f6f6;
|
||||
}
|
||||
.list-item{
|
||||
--item-height-value-: 100rpx;
|
||||
|
||||
width: 100vw;
|
||||
padding: 20rpx 30rpx;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
.left-avatar{
|
||||
width: 100rpx;
|
||||
height: var(--item-height-value-);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image{
|
||||
width: 80rpx !important;
|
||||
height: 80rpx !important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
}
|
||||
.center-info{
|
||||
width: calc(100% - 100rpx - 200rpx);
|
||||
height: var(--item-height-value-);
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding-left: 10rpx;
|
||||
.info-top{
|
||||
width: 100%;
|
||||
height: calc(100rpx - 40rpx);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.info-bottom{
|
||||
width: 100%;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 26rpx;
|
||||
color: #9e9e9e;
|
||||
}
|
||||
}
|
||||
.right-btn{
|
||||
width: 200rpx;
|
||||
height: var(--item-height-value-);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.give-btn{
|
||||
padding: 6rpx 15rpx;
|
||||
border-radius: 50rpx;
|
||||
font-size: 26rpx;
|
||||
color: #FFFFFF;
|
||||
width: 95rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.edit-btn{
|
||||
background: #409eff;
|
||||
}
|
||||
.del-btn{
|
||||
background: #f56c6c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 添加员工
|
||||
.group-btn{
|
||||
width: 100vw;
|
||||
position: fixed;
|
||||
bottom: 100rpx!important;
|
||||
left: 0!important;
|
||||
padding: 0 30rpx;
|
||||
display: inline-flex;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
.add-btn{
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
color: #fff;
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
border-radius: 15rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<view class="info-bottom">积分:{{ item.merchant_integral }}</view>
|
||||
</view>
|
||||
<view class="right-btn">
|
||||
<view class="give-btn" @click="showIntegralChangePopup(item)">赠送积分</view>
|
||||
<!--<view class="give-btn" @click="showIntegralChangePopup(item)">赠送积分</view>-->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
Loading…
Reference in New Issue