diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 4a98c09..875ce9f 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -711,10 +711,6 @@ export default { ); this.form = response.data; if (this.form.nurseStationIds) { - this.form.nurseStationIds = this.form.nurseStationIds.split(","); - this.form.nurseStationIds = this.form.nurseStationIds.map(e => { - return (e = Number(e)); - }); this.form.nurseStationIdstwo = this.form.nurseStationIdstwo.split( "," ); @@ -771,26 +767,26 @@ export default { // obj.push(this.form.nurseStationIds); // this.form.nurseStationIds = obj; if (this.form.userId != undefined) { - if (!this.form.nurseStationIds) { + if (!this.form.nurseStationIdstwo) { this.form.nurseStationIds = null; - updateUser(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); } else { - // this.form.nurseStationIds = Number(this.form.nurseStationIds); this.form.nurseStationIds = this.form.nurseStationIdstwo.join( "," ); - updateUser(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); } + updateUser(this.form).then(response => { + this.$modal.msgSuccess("修改成功"); + this.open = false; + this.getList(); + }); } else { - this.form.nurseStationIds = this.form.nurseStationIdstwo.join(","); + if (this.form.nurseStationIdstwo) { + this.form.nurseStationIds = this.form.nurseStationIdstwo.join( + "," + ); + } else { + this.form.nurseStationIds = null; + } addUser(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false;