|  |  |  | 
|---|
|  |  |  | <el-form-item label="组织" prop="companyName"> | 
|---|
|  |  |  | <el-input v-model="searchForm.companyName" v-trim placeholder="请输入组织" @keypress.enter.native="search"/> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="角色" prop="roleId"> | 
|---|
|  |  |  | <el-select v-model="searchForm.roleId" placeholder="请选择角色" @change="search"> | 
|---|
|  |  |  | <el-option :label="item.name" :value="item.id" v-for="(item, index) in rolesList" :key="index"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <!--            <el-form-item label="所属部门" prop="rootDeptId">--> | 
|---|
|  |  |  | <!--        <DepartmentSelect v-model="searchForm.rootDeptId" placeholder="请选择所属部门" clearable/>--> | 
|---|
|  |  |  | <!--      </el-form-item>--> | 
|---|
|  |  |  | 
|---|
|  |  |  | <li v-permissions="['system:user:delete']"><el-button icon="el-icon-delete" @click="deleteByIdInBatch">删除</el-button></li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | :default-sort = "{prop: 'createTime', order: 'descending'}" | 
|---|
|  |  |  | stripe | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | @sort-change="handleSortChange" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | :height="tableHeightNew" | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | :default-sort = "{prop: 'createTime', order: 'descending'}" | 
|---|
|  |  |  | stripe | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | @sort-change="handleSortChange" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column type="selection" width="55"></el-table-column> | 
|---|
|  |  |  | <!--        <el-table-column prop="avatar" label="头像" width="80px" class-name="table-column-avatar" fixed="left">--> | 
|---|
|  |  |  | <!--          <template slot-scope="{row}">--> | 
|---|
|  |  |  | 
|---|
|  |  |  | <ul> | 
|---|
|  |  |  | <li v-for="role in row.roles" :key="role.id">{{role.name}}</li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="prohibitStatus" label="禁止登录" min-width="160px" class-name="table-column-strings"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-switch | 
|---|
|  |  |  | v-model="row.prohibitStatus" | 
|---|
|  |  |  | @change="changeStatus($event, row.id)" | 
|---|
|  |  |  | active-color="#13ce66" | 
|---|
|  |  |  | inactive-color="#ff4949" | 
|---|
|  |  |  | :active-value="0" | 
|---|
|  |  |  | :inactive-value="1"> | 
|---|
|  |  |  | </el-switch> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="prohibitRemark" label="禁用备注" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column label="初始化密码" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.needChangePwd === 0">{{row.firstPassword}}</span> | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="createUser" label="创建人" min-width="100px"> | 
|---|
|  |  |  | 
|---|
|  |  |  | import ResetPwdWindow from '@/components/system/user/ResetPwdWindow' | 
|---|
|  |  |  | import DepartmentSelect from '@/components/common/DepartmentSelect' | 
|---|
|  |  |  | import PositionSelect from '@/components/common/PositionSelect' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import { fetchAll as fetchAllRoles, fetchAll } from '@/api/system/role' | 
|---|
|  |  |  | import { updUserProhibitStatus } from '@/api/system/user' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'SystemUser', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | 
|---|
|  |  |  | rootDeptId: null, // 部门ID | 
|---|
|  |  |  | positionId: null, // 岗位ID | 
|---|
|  |  |  | companyName: null, // 企业名称 | 
|---|
|  |  |  | roleId: null, // 角色 | 
|---|
|  |  |  | mobile: '' // 手机号码 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | rolesList: [] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | 
|---|
|  |  |  | }] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | fetchAllRoles() | 
|---|
|  |  |  | .then(records => { | 
|---|
|  |  |  | this.rolesList = records | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | changeStatus(prohibitStatus, id) { | 
|---|
|  |  |  | console.log(id) | 
|---|
|  |  |  | console.log(prohibitStatus) | 
|---|
|  |  |  | updUserProhibitStatus({ | 
|---|
|  |  |  | prohibitStatus, | 
|---|
|  |  |  | id | 
|---|
|  |  |  | }).then(res => { | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|