用户管理 修改

This commit is contained in:
shidongli 2022-11-29 14:02:13 +08:00
parent e7c78291d4
commit 75026d1c1c

View File

@ -797,7 +797,12 @@ export default {
const userId = row.userId || this.ids;
getUser(userId).then((response) => {
this.form = response.data;
this.form.nurseStationIds = Number(this.form.nurseStationIds);
if (!this.form.nurseStationIds) {
this.form.nurseStationIds = ''
} else {
this.form.nurseStationIds = Number(this.form.nurseStationIds);
}
// if (
// !this.form.nurseStationIds ||
// this.form.nurseStationIds == null ||
@ -843,8 +848,7 @@ export default {
this.$router.push("/system/user-auth/role/" + userId);
},
/** 提交按钮 */
submitForm: function () {
console.log(this.form);
submitForm: function () {
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) {
updateUser(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
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("新增成功");