| | |
| | | <template> |
| | | <div class="list"> |
| | | <TableCustom :queryForm="pagination" :tableData="data" :total="pagination.total" |
| | | @currentChange="handleCurrentChange" @sizeChange="handleSizeChange"> |
| | | @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"> |
| | | <template #search> |
| | | <el-form label-width="100px" inline> |
| | | <el-form-item label="人员搜索"> |
| | |
| | | </el-form-item> |
| | | <el-form-item style="margin-left: 63px;"> |
| | | <el-button @click="reset">重置</el-button> |
| | | <el-button type="primary" @click="onSubmit">查询</el-button> |
| | | <el-button type="primary" @click="onSubmit" style="margin-left: 10px;">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | |
| | | <div class="status_class"> |
| | | <div :class="row.status == 0 ? 'green' : 'red'"></div> |
| | | <div>{{ row.status == 0 ? '正常' : '禁用' }}</div> |
| | | <div v-if="row.status == 1" style="cursor: pointer" |
| | | @click="; (dialogVisibleView = true), (rowView = row), $forceUpdate()"> |
| | | <i class="el-icon-warning"></i> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column label="操作" width="300"> |
| | | <template slot-scope="{ row }"> |
| | | <div> |
| | | <el-button type="text" @click="edit(row)">编辑</el-button> |
| | | <el-button type="text" @click="edit(row)">账号继承</el-button> |
| | | <el-button v-if="row.status != 0" type="text" @click="updateStatus(row, true)"> |
| | | <el-button type="text" @click="edit(row)" class="action-button">编辑</el-button> |
| | | <el-button type="text" @click="inherit(row)" class="action-button">账号继承</el-button> |
| | | <el-button v-if="row.status != 0" type="text" @click="updateStatus(row, true)" class="action-button"> |
| | | 启用 |
| | | </el-button> |
| | | <el-button v-if="row.status == 0" type="text" @click="updateStatus(row, false)"> |
| | | <el-button v-if="row.status == 0" type="text" @click="updateStatus(row, false)" class="action-button"> |
| | | 禁用 |
| | | </el-button> |
| | | <el-button type="text" @click="detail(row)">重置密码</el-button> |
| | | <el-button type="text" @click="del(row)">删除</el-button> |
| | | <el-button type="text" @click="detail(row)" class="action-button">重置密码</el-button> |
| | | <el-button type="text" @click="del(row)" class="action-button">删除</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCustom> |
| | | |
| | | <AddEdit v-if="dialogVisible" :row="row" :deptList="deptList" :deptType="deptTypeList" :roleList="roleList" |
| | | <AddEdit v-if="dialogVisible" :row="row" :deptType="deptTypeList" :roleList="roleList" |
| | | :dialogVisible="dialogVisible" @close="dialogVisible = false, row = {}" @confirm="confirm" /> |
| | | <ResetPassword v-if="passwordVisible" :row="row" :dialogVisible="passwordVisible" |
| | | @close="passwordVisible = false, row = {}" @confirm="passwordConfirm" /> |
| | | <ViewData v-if="dialogVisibleView" :row="rowView" :dialogVisible="dialogVisibleView" |
| | | @close="dialogVisibleView = false, rowView = {}" /> |
| | | <Disb v-if="disbDialogVisible" :row="disbRow" :dialogVisible="disbDialogVisible" |
| | | @close="disbDialogVisible = false, disbRow = {}" @confirm="disbConfirm" /> |
| | | <ShowDelConfirm :show="delShow" @close="delShow = false" @confirm="delConfirm" title="确认要删除该人员吗?" |
| | |
| | | <script> |
| | | import { getList, add, edit, delDept, roleList, updatePwd, changeStatus, typeList } from './service' |
| | | import AddEdit from './components/add-edit.vue' |
| | | import ViewData from './components/view-data.vue' |
| | | import Disb from './components/disb.vue' |
| | | import ResetPassword from './components/reset-password.vue' |
| | | import Inherit from './components/inherit.vue' |
| | |
| | | name: 'User', |
| | | components: { |
| | | AddEdit, |
| | | ViewData, |
| | | Disb, |
| | | ResetPassword, |
| | | Inherit, |
| | |
| | | inheritDialogVisible: false,//账号继承 |
| | | data: [],//列表数据 |
| | | nickNameOrPhone: '',//人员搜索 |
| | | deptId: [],//部门 |
| | | roleId: [],//角色 |
| | | status: '',//状态 |
| | | roleList: [],//角色列表 |
| | |
| | | }, |
| | | watch: {}, |
| | | created() { |
| | | // this.getRoleList() |
| | | // this.getListData() |
| | | // this.getTypeList() |
| | | this.getRoleList() |
| | | this.getListData() |
| | | }, |
| | | mounted() { }, |
| | | methods: { |
| | |
| | | }, |
| | | getRoleList() { |
| | | roleList().then((res) => { |
| | | this.roleList = res.data.data |
| | | this.roleList = res |
| | | }) |
| | | }, |
| | | delConfirm() { |
| | |
| | | this.row = row |
| | | this.dialogVisible = true |
| | | }, |
| | | inherit(row) { |
| | | this.inheritRow = row |
| | | this.inheritDialogVisible = true |
| | | }, |
| | | updateStatus(row, type) { |
| | | if (type) { |
| | | changeStatus({ ...row, status: 0 }).then(() => { |
| | |
| | | }, |
| | | async getListData() { |
| | | let obj = { |
| | | ...this.pagination, |
| | | pageNum: this.pagination.pageNum, |
| | | pageSize: this.pagination.pageSize, |
| | | nickNameOrPhone: this.nickNameOrPhone, |
| | | deptIds: this.deptId, |
| | | roleIds: this.roleId, |
| | | status: this.status, |
| | | } |
| | | this.listLoading = true |
| | | const { |
| | | data: { |
| | | data: { records, total }, |
| | | }, |
| | | } = await getList(obj) |
| | | const { records,total } = await getList(obj) |
| | | this.data = records |
| | | this.pagination.total = total |
| | | this.timeOutID = setTimeout(() => { |
| | |
| | | reset() { |
| | | this.nickNameOrPhone = '' |
| | | this.roleId = [] |
| | | this.deptId = [] |
| | | this.status = '' |
| | | this.pagination.pageNum = 1 |
| | | this.getListData() |
| | |
| | | height: 100%; |
| | | } |
| | | |
| | | .action-button { |
| | | margin-right: 8px; |
| | | } |
| | | |
| | | .green { |
| | | background-color: green; |
| | | } |