|
|
@@ -60,7 +60,7 @@
|
|
|
</div>
|
|
|
<div class="staff-footer">
|
|
|
<div class="cancel handle" @click="cancelBind">取消</div>
|
|
|
- <div class="agree handle" @click="sureBindNewUser">确定绑定</div>
|
|
|
+ <div class="agree handle" @click="sureBindNewUser()">确定绑定</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="staff-list" v-if="reBindError">
|
|
|
@@ -108,6 +108,7 @@
|
|
|
},
|
|
|
computed: {
|
|
|
userInfo () {
|
|
|
+ console.log(this.$store.state.option.user.data)
|
|
|
return this.$store.state.option.user.data
|
|
|
}
|
|
|
},
|
|
|
@@ -246,13 +247,25 @@
|
|
|
},
|
|
|
// 确定绑定已注册用户
|
|
|
sureBindNewUser () {
|
|
|
- this.$http.get('/basic/user/bindUser', {params: {userUU: this.newUserInfo.userUU}})
|
|
|
- .then(response => {
|
|
|
- if (response) {
|
|
|
- this.onRemind('增加用户成功' + this.newUserInfo.userName)
|
|
|
- this.$router.push('/mobile/user/staff')
|
|
|
+ let isFlag = false
|
|
|
+ if (this.newUserInfo.enterprises.length) {
|
|
|
+ this.newUserInfo.enterprises.forEach(item => {
|
|
|
+ if (item.uu === this.user.data.enterprise.uu) {
|
|
|
+ isFlag = true
|
|
|
}
|
|
|
})
|
|
|
+ }
|
|
|
+ if (isFlag) {
|
|
|
+ this.onRemind('该用户已绑定到当前企业,不可重复绑定!')
|
|
|
+ } else {
|
|
|
+ this.$http.get('/basic/user/bindUser', {params: {userUU: this.newUserInfo.userUU}})
|
|
|
+ .then(response => {
|
|
|
+ if (response) {
|
|
|
+ this.onRemind('增加用户成功' + this.newUserInfo.userName)
|
|
|
+ this.$router.push('/mobile/user/staff')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|