|
|
|
@ -69,30 +69,16 @@
|
|
|
|
|
await showDialog("确定要" + (this.edit ? '编辑' : '新增') + '吗?', this)
|
|
|
|
|
//编辑提交
|
|
|
|
|
if (this.edit) {
|
|
|
|
|
await post('lb/user/updateUser', {
|
|
|
|
|
nickname: this.userForm.nickname,
|
|
|
|
|
tel: this.userForm.tel,
|
|
|
|
|
email: this.userForm.email,
|
|
|
|
|
username: this.userForm.username,
|
|
|
|
|
office: this.userForm.office,
|
|
|
|
|
position: parseInt(this.userForm.position),
|
|
|
|
|
uId: this.userForm.uid
|
|
|
|
|
}).catch(async e => {
|
|
|
|
|
// 与后端字段保持一致
|
|
|
|
|
this.userForm.uId = this.userForm.uid
|
|
|
|
|
await post('lb/user/updateUser', this.userForm).catch(async e => {
|
|
|
|
|
await showFail(e.msg, this)
|
|
|
|
|
await stop()
|
|
|
|
|
})
|
|
|
|
|
showSuccess('编辑完成', this)
|
|
|
|
|
} else {
|
|
|
|
|
// 新增提交
|
|
|
|
|
await post('lb/user/addUser', {
|
|
|
|
|
nickname: this.userForm.nickname,
|
|
|
|
|
tel: this.userForm.tel,
|
|
|
|
|
email: this.userForm.email,
|
|
|
|
|
username: this.userForm.username,
|
|
|
|
|
office: this.userForm.office,
|
|
|
|
|
position: parseInt(this.userForm.position),
|
|
|
|
|
password: this.userForm.password
|
|
|
|
|
}).catch(async e => {
|
|
|
|
|
await post('lb/user/addUser', this.userForm).catch(async e => {
|
|
|
|
|
await showFail(e.msg, this)
|
|
|
|
|
await stop()
|
|
|
|
|
})
|
|
|
|
|