<template>
|
<div class='addclerk_page'>
|
<NavTop title="店员详情" @click-left="backlast"></NavTop>
|
<div class="content">
|
<div class="must-has-box">
|
<van-field v-model="formData.name" label="店员姓名" readonly placeholder="请输入店员姓名" />
|
<van-field v-model="formData.mblNo" label="店员手机号" readonly placeholder="请输入店员手机号" />
|
<van-field v-model="formData.email" label="联系邮箱" readonly placeholder="请输入联系邮箱" />
|
</div>
|
<div class="must-has-box must-has-box-btn">
|
<van-cell left title="停启用">
|
<template #right-icon>
|
<van-switch v-model="checked" @change='changeStatus' active-color="#00B578" size="24" />
|
</template>
|
</van-cell>
|
</div>
|
<!-- <Button class='save_btn' @click="savePassworde">保存</Button> -->
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { Cell, CellGroup,Toast,Field,Switch } from "vant";
|
import Vue from 'vue';
|
Vue.use(Switch);
|
export default {
|
name:'',
|
components: {
|
Cell,
|
CellGroup,
|
Field,
|
},
|
data() {
|
return {
|
formData:{
|
mblNo:"",
|
name:"",
|
email:""
|
},
|
checked:false,
|
id:''
|
};
|
},
|
computed: {
|
userInfo(){
|
return this.$store.state.userInfo
|
}
|
},
|
created() {
|
this.id =this.$route.query.id;
|
this.getDetail(this.$route.query.id);
|
},
|
mounted() {
|
|
},
|
methods: {
|
backlast(){ this.$router.go(-1);},
|
savePassworde(){
|
if(!this.formData.mblNo){
|
Toast.fail('请输入手机号');
|
return false
|
}
|
if(!this.formData.name){
|
Toast.fail('请输入姓名');
|
return false
|
}
|
if(!this.formData.email){
|
Toast.fail('请输入邮箱');
|
return false
|
}
|
this.$api.post('/store/addStoreClient',this.formData).then(res=>{
|
Toast.success({
|
message:'添加成功',
|
onClose:()=>{
|
this.$router.go(-1)
|
}
|
})
|
})
|
},
|
getDetail(id){
|
let {platId} = this.userInfo;
|
let data ={platId};
|
data.mgrId = this.id*1;
|
this.$api.post('/store/storeClientDtl',data).then(res=>{
|
this.formData =res.body;
|
res.body.status==1?this.checked =true:this.checked=false;
|
})
|
},
|
changeStatus(){
|
let {platId} = this.userInfo;
|
let data ={platId};
|
data.mgrId = this.id*1;
|
this.$api.post('/user/freezeMgr',data).then(res=>{
|
Toast.success({
|
message:this.checked?"已启用":"已停用",
|
})
|
})
|
}
|
}
|
};
|
</script>
|
|
<style scoped lang="less">
|
.addclerk_page{
|
background-color: #FAFAFC;
|
height: 100vh;
|
padding-top: 44px;
|
box-sizing: border-box;
|
.content {
|
box-sizing: border-box;
|
padding: 16px 16px 21px;
|
.tit-class {
|
text-align: left;
|
color: #333;
|
font-size: 14px;
|
margin-left: 12px;
|
}
|
.maybe-has-box {
|
margin-bottom: 12px;
|
}
|
.must-has-box {
|
border-radius: 8px;
|
background: #fff;
|
.iconfont {
|
font-size: 18px;
|
}
|
}
|
}
|
.tips{
|
color: #999999;
|
font-size: 12px;
|
margin-bottom: 20px;
|
text-align: left;
|
}
|
.save_btn{
|
margin-top: 40px;
|
}
|
.van-field{
|
border-radius: 8px;
|
}
|
.van-cell__title{
|
text-align: left;
|
}
|
.van-field__control{
|
text-align: right;
|
}
|
.must-has-box-btn{
|
margin-top: 12px;
|
}
|
}
|
</style>
|