| | |
| | | <!-- <el-button @click="cancel">取 消</el-button> --> |
| | | </div> |
| | | <div style="margin: 10px; font-size: 28px; font-weight: bold; text-align: center;">新增/编辑用户信息</div> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="128px"> |
| | | <el-form ref="form" :model="form" label-width="128px"> |
| | | <el-tabs v-model="activeName" type="card"> |
| | | <el-tab-pane label="基本信息" name="first"> |
| | | <el-row> |
| | |
| | | components: {}, |
| | | props: { |
| | | OperationType: { type: Number, }, |
| | | linterid: {}, |
| | | linterid: {type: Number}, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | |
| | | this.getdata() |
| | | }, |
| | | methods: { |
| | | //#region 页面初始化 |
| | | getdata() { |
| | | this.formShow = false |
| | | this.formLoading = true |
| | | this.getUserGroup() |
| | | if ((this.OperationType == 1 && this.copyType != 1) || (!this.OperationType && !this.copyType)) { |
| | | this.handleAdd() |
| | | } else if (this.OperationType == 3 || this.copyType == 1) { |
| | | this.$nextTick(() => { |
| | | this.handleUpdate() |
| | | }) |
| | | try { |
| | | this.formShow = false |
| | | this.formLoading = true |
| | | this.getUserGroup() |
| | | if ((this.OperationType == 1 && this.copyType != 1) || (!this.OperationType && !this.copyType)) { |
| | | this.handleAdd() |
| | | } else if (this.OperationType == 3 || this.copyType == 1) { |
| | | this.$nextTick(() => { |
| | | this.handleUpdate() |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | console.error('Error ', err) |
| | | } |
| | | }, |
| | | |
| | |
| | | handleUpdate() { |
| | | this.reset() |
| | | let rowHmainid = this.linterid |
| | | console.log("编辑用户ID",rowHmainid) |
| | | axios.get(this.baseURL + "/Xt_User/EditUser", { |
| | | params: { 'HID': rowHmainid } |
| | | }).then(response => { |
| | |
| | | //#endregion |
| | | |
| | | //#region 获取子表数据 |
| | | getUserGroup() { |
| | | async getUserGroup() { |
| | | //角色列表 |
| | | axios.get(this.baseURL + '/Xt_UserGroup/list', { |
| | | axios.get(this.baseURL + '/Xt_User/list', { |
| | | params: { |
| | | sWhere: '', |
| | | user: sessionStorage["HUserName"], |
| | | }, |
| | | }).then(response => { |
| | | let data1 = response.data |
| | | if (data1.code == 1) { |
| | | console.log(data1) |
| | | this.editData = data1.data |
| | | console.log("zhiwei",this.editData) |
| | | //this.get_DisplayUserGroupInfoList() |
| | | } |
| | | }).catch(error => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | |
| | | //#endregion |
| | | |
| | | |
| | | get_DisplayUserGroupInfoList() { |
| | | var sWhere = "and UserId='" + this.linterid + "'"; |
| | | async get_DisplayUserGroupInfoList() { |
| | | var sWhere = "and GroupId='" + this.linterid + "'"; |
| | | axios.get(this.baseURL + '/Xt_UserGroup/UserGroupInfoList', { |
| | | params: { |
| | | sWhere: sWhere, |
| | | }, |
| | | }).then(response => { |
| | | let data1 = response.data |
| | | console.log(data1) |
| | | if (data1.count == 1) { |
| | | if (data1.data.length > 0) |
| | | if (this.editData.length > 0) { |