| | |
| | | <!-- <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() { |
| | | try { |
| | | this.formShow = false |
| | | this.formLoading = true |
| | | this.getUserGroup() |
| | |
| | | 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) { |
| | |
| | | </el-dialog> |
| | | <!-- 编辑 --> |
| | | <el-dialog title="编辑" :visible.sync="openEdit" width="1480px" append-to-body class="xsckdBox" @close="close"> |
| | | <edit :OperationType=OperationType :linterid="this.rowForm.hmainid" @editClose="editClose" v-if="editShow" /> |
| | | <edit :OperationType="OperationType" :linterid="this.rowForm.HGroupID" @editClose="editClose" v-if="editShow" /> |
| | | </el-dialog> |
| | | <!-- 权限 --> |
| | | <el-dialog title="角色权限" :visible.sync="openQuery" width="1480px" append-to-body class="xsckdBox"> |
| | | <Query HSouceBillType="js" @editQueryClose="editQueryClose" :linterid=this.rowForm.HGroupID v-if="queryShow" /> |
| | | <Query HSouceBillType="js" @editQueryClose="editQueryClose" :linterid="this.rowForm.HGroupID" v-if="queryShow" /> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | |
| | | //#region 选中行高亮样式 |
| | | rowStyle({ row, rowIndex }) { |
| | | if (this.ids.includes(row.hmainid)) { |
| | | return { "background": "#ecf5ff" } |
| | | return { } |
| | | } |
| | | }, |
| | | //#endregion |
| | |
| | | //#region 双击行 |
| | | handleDblclick(row, column, cell, event) { |
| | | this.OperationType = 3 |
| | | this.handleEdit() |
| | | this.handleEdit(row) |
| | | }, |
| | | //#endregion |
| | | |
| | |
| | | |
| | | //#region 新增 |
| | | handleAddEdit() { |
| | | this.rowForm.hmainid = 0 |
| | | this.OperationType = 1 |
| | | this.rowForm.HGroupID = 0 |
| | | console.log(' OperationType=', this.OperationType, 'rowForm.HGroupID=', this.rowForm.HGroupID) |
| | | this.editShow = true |
| | | this.openEdit = true |
| | | }, |
| | |
| | | //#region 编辑 |
| | | handleEdit(row) { |
| | | this.rowForm = row |
| | | console.log('OperationType=', this.OperationType, 'rowForm=', this.rowForm) |
| | | this.editShow = true |
| | | this.openEdit = true |
| | | }, |