141 lines
2.9 KiB
Vue
141 lines
2.9 KiB
Vue
<template>
|
|
<div class="addClerk">
|
|
<div class="item">
|
|
<span class="tips">*</span>
|
|
<div class="border">
|
|
<span class="label">姓名</span>
|
|
<span class="value">
|
|
<input type="text" placeholder="请输入" v-model="userName">
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<span class="tips"></span>
|
|
<div class="border">
|
|
<span class="label">电话</span>
|
|
<span class="value">
|
|
<input type="tel" placeholder="请输入" v-model="userPhone" maxlength="11">
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="btn" @click="save">确认添加</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {mapState} from 'vuex'
|
|
|
|
export default {
|
|
name: 'addClerk',
|
|
appName: '新增店员',
|
|
|
|
data () {
|
|
return {
|
|
id: '',
|
|
userPhone: '',
|
|
userName: ''
|
|
}
|
|
},
|
|
|
|
computed: {...mapState(['user'])},
|
|
|
|
onLoad (query) {
|
|
this.id = query.id
|
|
},
|
|
|
|
methods: {
|
|
save () {
|
|
|
|
if (!this.userName) {
|
|
return this.$u.toast('请输入姓名')
|
|
}
|
|
|
|
if (!this.userPhone) {
|
|
// return this.$u.toast('请输入电话')
|
|
}
|
|
|
|
this.$loading()
|
|
this.$http.post('/app/CompanyUser/addOrupdate', {
|
|
userName: this.userName,
|
|
userPhone: this.userPhone,
|
|
companyId: this.id
|
|
}).then(res => {
|
|
if (res.code === 0) {
|
|
this.$u.toast('提交成功')
|
|
|
|
setTimeout(() => {
|
|
uni.$emit('updateUser')
|
|
uni.navigateBack({
|
|
delta: 1
|
|
})
|
|
}, 500)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.addClerk {
|
|
.item{
|
|
width: 100%;
|
|
padding-left: 14px;
|
|
background: #FFF;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
margin-bottom: 16px;
|
|
.tips{
|
|
width: 18px;
|
|
font-size: 32px;
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
color: #FF4466;
|
|
line-height: 44px;
|
|
padding: 34px 0 34px 0;
|
|
}
|
|
.border{
|
|
width: calc(100% - 18px);
|
|
padding: 34px 32px 34px 0;
|
|
line-height: 44px;
|
|
line-height: 44px;
|
|
font-size: 32px;
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
color: #333;
|
|
display: flex;
|
|
box-sizing: border-box;
|
|
.label{
|
|
width: 170px;
|
|
}
|
|
.value{
|
|
width: calc(100% - 170px);
|
|
text-align: right;
|
|
img{
|
|
width: 32px;
|
|
height: 32px;
|
|
margin-left: 8px;
|
|
vertical-align: middle;
|
|
}
|
|
}
|
|
.color-999{
|
|
color: #999;
|
|
}
|
|
}
|
|
}
|
|
.btn{
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
text-align: center;
|
|
height: 112px;
|
|
line-height: 112px;
|
|
background: #3975C6;
|
|
box-shadow: inset 0px 2px 0px 0px #EEEEEE;
|
|
font-size: 32px;
|
|
font-family: PingFangSC-Medium, PingFang SC;
|
|
font-weight: 500;
|
|
color: #FFF;
|
|
}
|
|
}
|
|
</style>
|