|
@@ -26,6 +26,7 @@
|
|
|
<li><span>手机号:</span><input type="text"
|
|
<li><span>手机号:</span><input type="text"
|
|
|
v-model="newUserPhone"
|
|
v-model="newUserPhone"
|
|
|
@change="checkPhone()"
|
|
@change="checkPhone()"
|
|
|
|
|
+ maxlength="11"
|
|
|
placeholder="请输入手机号"></li>
|
|
placeholder="请输入手机号"></li>
|
|
|
<li><span>邮箱:</span><input type="text"
|
|
<li><span>邮箱:</span><input type="text"
|
|
|
v-model="newUserEmail"
|
|
v-model="newUserEmail"
|
|
@@ -177,14 +178,25 @@
|
|
|
},
|
|
},
|
|
|
// 绑定未注册用户
|
|
// 绑定未注册用户
|
|
|
addNewUser () {
|
|
addNewUser () {
|
|
|
- if (this.newEmailCheck && this.newPhoneCheck) {
|
|
|
|
|
- this.$http.post('/basic/user', {userEmail: this.newUserEmail, userName: this.newUserName, userSex: this.sex, userTel: this.newUserPhone})
|
|
|
|
|
- .then(response => {
|
|
|
|
|
- if (response) {
|
|
|
|
|
- this.onRemind('增加用户成功' + this.newUserName)
|
|
|
|
|
- this.$router.push('/mobile/user/staff')
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (!this.newUserPhone || this.newUserPhone === '') {
|
|
|
|
|
+ this.onRemind('请输入手机号码')
|
|
|
|
|
+ this.newPhoneCheck = false
|
|
|
|
|
+ } else if (!this.newUserEmail || this.newUserEmail === '') {
|
|
|
|
|
+ this.onRemind('请输入邮箱')
|
|
|
|
|
+ this.newEmailCheck = false
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.newEmailCheck && this.newPhoneCheck) {
|
|
|
|
|
+ this.$http.post('/basic/user', {userEmail: this.newUserEmail, userName: this.newUserName, userSex: this.sex, userTel: this.newUserPhone})
|
|
|
|
|
+ .then(response => {
|
|
|
|
|
+ if (response) {
|
|
|
|
|
+ this.onRemind('增加用户成功' + this.newUserName)
|
|
|
|
|
+ this.$router.push('/mobile/user/staff')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.checkPhone()
|
|
|
|
|
+ this.checkEmail()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 取消绑定
|
|
// 取消绑定
|