用户管理 修改
This commit is contained in:
parent
e7c78291d4
commit
75026d1c1c
@ -797,7 +797,12 @@ export default {
|
||||
const userId = row.userId || this.ids;
|
||||
getUser(userId).then((response) => {
|
||||
this.form = response.data;
|
||||
if (!this.form.nurseStationIds) {
|
||||
this.form.nurseStationIds = ''
|
||||
} else {
|
||||
this.form.nurseStationIds = Number(this.form.nurseStationIds);
|
||||
|
||||
}
|
||||
// if (
|
||||
// !this.form.nurseStationIds ||
|
||||
// this.form.nurseStationIds == null ||
|
||||
@ -844,7 +849,6 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
console.log(this.form);
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
// this.form.nurseStationIds = this.form.nurseStationIds.join(",");
|
||||
@ -853,13 +857,26 @@ export default {
|
||||
// obj.push(this.form.nurseStationIds);
|
||||
// console.log(obj)
|
||||
// this.form.nurseStationIds = obj;
|
||||
console.log(this.form);
|
||||
|
||||
if (this.form.userId != undefined) {
|
||||
if (!this.form.nurseStationIds) {
|
||||
this.form.nurseStationIds = null
|
||||
updateUser(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
// console.log('bbb',this.form)
|
||||
});
|
||||
} else {
|
||||
this.form.nurseStationIds = Number(this.form.nurseStationIds);
|
||||
updateUser(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
// console.log('bbb',this.form)
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
addUser(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user