|
|
@@ -1,176 +1,94 @@ |
|
|
|
<template> |
|
|
|
<div class="user"> |
|
|
|
<!-- <basic-container> |
|
|
|
<el-row :span="24"> |
|
|
|
<el-col |
|
|
|
:xs="24" |
|
|
|
:sm="24" |
|
|
|
:md="5" |
|
|
|
class="user__tree"> |
|
|
|
<avue-tree |
|
|
|
:option="treeOption" |
|
|
|
:data="treeData" |
|
|
|
@node-click="nodeClick"> |
|
|
|
<span class="el-tree-node__label" slot-scope="{ node, data }"> |
|
|
|
<el-tooltip class="item" effect="dark" content="无数据权限" placement="right-start" v-if="data.isLock"> |
|
|
|
<span>{{node.label}} <i class="el-icon-lock"></i></span> |
|
|
|
</el-tooltip> |
|
|
|
<span v-if="!data.isLock">{{node.label}}</span> |
|
|
|
</span> |
|
|
|
</avue-tree> |
|
|
|
</el-col> |
|
|
|
<el-col |
|
|
|
:xs="24" |
|
|
|
:sm="24" |
|
|
|
:md="19" |
|
|
|
class="user__main"> |
|
|
|
<avue-crud |
|
|
|
ref="crud" |
|
|
|
:option="option" |
|
|
|
v-model="form" |
|
|
|
:page.sync="page" |
|
|
|
:table-loading="listLoading" |
|
|
|
:before-open="handleOpenBefore" |
|
|
|
:data="list" |
|
|
|
@on-load="getList" |
|
|
|
@search-change="searchChange" |
|
|
|
@refresh-change="refreshChange" |
|
|
|
@size-change="sizeChange" |
|
|
|
@current-change="currentChange" |
|
|
|
@row-update="update" |
|
|
|
@row-save="create"> |
|
|
|
<template slot="menuLeft"> |
|
|
|
<el-button |
|
|
|
v-if="sys_user_add" |
|
|
|
class="filter-item" |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="$refs.crud.rowAdd()">添加 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template |
|
|
|
slot="username" |
|
|
|
slot-scope="scope"> |
|
|
|
<span>{{ scope.row.username }}</span> |
|
|
|
</template> |
|
|
|
<template |
|
|
|
slot="role" |
|
|
|
slot-scope="scope"> |
|
|
|
<span |
|
|
|
v-for="(role,index) in scope.row.roleList" |
|
|
|
:key="index"> |
|
|
|
<el-tag>{{ role.roleName }} </el-tag> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
<template |
|
|
|
slot="deptId" |
|
|
|
slot-scope="scope"> |
|
|
|
{{ scope.row.deptName }} |
|
|
|
</template> |
|
|
|
<template |
|
|
|
slot="lockFlag" |
|
|
|
slot-scope="scope"> |
|
|
|
<el-tag>{{ scope.label }}</el-tag> |
|
|
|
</template> |
|
|
|
<template |
|
|
|
slot="menu" |
|
|
|
slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
v-if="sys_user_edit" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row,scope.index)">编辑 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
v-if="sys_user_del" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
icon="el-icon-delete" |
|
|
|
@click="deletes(scope.row,scope.index)">删除 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template |
|
|
|
slot="deptIdForm" |
|
|
|
slot-scope="scope"> |
|
|
|
<avue-input-tree |
|
|
|
v-model="form.deptId" |
|
|
|
:node-click="getNodeData" |
|
|
|
:dic="treeDeptData" |
|
|
|
:props="defaultProps" |
|
|
|
placeholder="请选择所属部门"/> |
|
|
|
</template> |
|
|
|
<template |
|
|
|
slot="roleForm" |
|
|
|
slot-scope="scope"> |
|
|
|
<avue-select |
|
|
|
v-model="role" |
|
|
|
:dic="rolesOptions" |
|
|
|
:props="roleProps" |
|
|
|
multiple |
|
|
|
placeholder="请选择角色"/> |
|
|
|
</template> |
|
|
|
</avue-crud> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</basic-container> --> |
|
|
|
<div class="top" style="margin-left:10px"> |
|
|
|
<div class="chose"> |
|
|
|
<div :class="choseFlag?'ch1':'ch2'" style="border-right:1px solid #ccc" @click="choseFlag=true">注册用户</div> |
|
|
|
<div :class="!choseFlag?'ch1':'ch2'" @click="choseFlag=false">组织用户</div> |
|
|
|
</div> |
|
|
|
<!-- 当他为注册用户的时候 --> |
|
|
|
<div class="top" style="margin-left:10px" v-if="choseFlag"> |
|
|
|
<el-form :inline="true" :model="searchMsg" class="demo-form-inline" ref="searchForm"> |
|
|
|
<el-form-item label="用户名" prop="name"> |
|
|
|
<el-input v-model="searchMsg.name" clearable placeholder="请输入用户名"></el-input> |
|
|
|
<el-form-item label="身份" prop="flag"> |
|
|
|
<el-input v-if="searchMsg.flag==1" v-model="searchMsg.username" clearable placeholder="请输入"> |
|
|
|
<el-select v-model="searchMsg.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange"> |
|
|
|
<el-option label="登陆账号" value="1"></el-option> |
|
|
|
<el-option label="用户名" value="2"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-input> |
|
|
|
<el-input v-else v-model="searchMsg.name" clearable placeholder="请输入"> |
|
|
|
<el-select v-model="searchMsg.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange"> |
|
|
|
<el-option label="登陆账号" value="1"></el-option> |
|
|
|
<el-option label="用户名" value="2"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="登录名" prop="username"> |
|
|
|
<el-input v-model="searchMsg.username" clearable placeholder="请输入登录名"></el-input> |
|
|
|
<el-form-item label="所属组织" prop="orgName"> |
|
|
|
<el-input v-model="searchMsg.orgName" clearable placeholder="请输入所属组织名称"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="身份" prop="value" v-if="form.sign!=1"> |
|
|
|
<el-select v-model="searchMsg.value" clearable placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="item in rolesOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.desc" |
|
|
|
:value="item.value" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="search">查询</el-button> |
|
|
|
<el-button type="primary" @click="reset">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 当他为组织用户的时候 --> |
|
|
|
<div class="top" style="margin-left:10px" v-else> |
|
|
|
<el-form :inline="true" :model="searchMsg1" class="demo-form-inline" ref="searchForm1"> |
|
|
|
<el-form-item label="身份" prop="flag"> |
|
|
|
<el-input v-if="searchMsg1.flag==1" v-model="searchMsg1.username" clearable placeholder="请输入"> |
|
|
|
<el-select v-model="searchMsg1.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange1"> |
|
|
|
<el-option label="登陆账号" value="1"></el-option> |
|
|
|
<el-option label="用户名" value="2"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-input> |
|
|
|
<el-input v-else v-model="searchMsg1.name" clearable placeholder="请输入"> |
|
|
|
<el-select v-model="searchMsg1.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange1"> |
|
|
|
<el-option label="登陆账号" value="1"></el-option> |
|
|
|
<el-option label="用户名" value="2"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="组织类型" prop="queryOrgType"> |
|
|
|
<el-select v-model="searchMsg1.queryOrgType" clearable placeholder="请选择"> |
|
|
|
<el-option label="平台用户" value="0"></el-option> |
|
|
|
<el-option label="代理商用户" value="1"></el-option> |
|
|
|
<el-option label="公司用户" value="2"></el-option> |
|
|
|
<el-option label="楼盘用户" value="3"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="楼盘" prop="houseId"> |
|
|
|
<el-select v-model="searchMsg.houseId" clearable placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="item in houseNameList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.propertyName" |
|
|
|
:value="item.id" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
<el-form-item label="用户身份" prop="userRoleType"> |
|
|
|
<el-select v-model="searchMsg1.userRoleType" clearable placeholder="请选择"> |
|
|
|
<el-option label="项目总" value="2"></el-option> |
|
|
|
<el-option label="客服" value="3"></el-option> |
|
|
|
<el-option label="策划" value="4"></el-option> |
|
|
|
<el-option label="经理" value="5"></el-option> |
|
|
|
<el-option label="置业顾问" value="6"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="公司" prop="orgCode" v-if="form.sign!=1"> |
|
|
|
<el-select v-model="searchMsg.orgCode" clearable placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="item in orgList" |
|
|
|
:key="item.orgCode" |
|
|
|
:label="item.name" |
|
|
|
:value="item.orgCode" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
<el-form-item label="状态" prop="lockFlag"> |
|
|
|
<el-select v-model="searchMsg1.lockFlag" clearable placeholder="请选择"> |
|
|
|
<el-option label="启用" value="0"></el-option> |
|
|
|
<el-option label="禁用" value="1"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="search">查询</el-button> |
|
|
|
<el-button type="primary" @click="$refs.searchForm.resetFields()">重置</el-button> |
|
|
|
<el-button type="primary" @click="search1">查询</el-button> |
|
|
|
<el-button type="primary" @click="reset1">重置</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div style="margin: 0 0 10px 10px"> |
|
|
|
<el-button type="primary" :disabled='checkRole.length==0' @click="delIds">批量删除</el-button> |
|
|
|
<!-- <el-button type="primary" :disabled='checkRole.length==0' @click="delIds">批量删除</el-button> --> |
|
|
|
<el-button type="primary" @click="addRole">添加</el-button> |
|
|
|
</div> |
|
|
|
<!-- 表格 --> |
|
|
|
<div class="con" style="margin-left:10px;"> |
|
|
|
<el-table |
|
|
|
:data="tableData" |
|
|
|
v-if="choseFlag" |
|
|
|
border |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
style="width: 100%;" |
|
|
@@ -183,63 +101,86 @@ |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
type="index" |
|
|
|
label="序号" |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="houseName" |
|
|
|
label="楼盘" |
|
|
|
width="180"> |
|
|
|
prop="name" |
|
|
|
label="用户名"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="登录手机" |
|
|
|
prop="username" |
|
|
|
label="登录名" |
|
|
|
width="180"> |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="name" |
|
|
|
label="用户名"> |
|
|
|
prop="userRoleTypeName" |
|
|
|
label="性别"> |
|
|
|
<template slot-scope="{row}"> |
|
|
|
{{row.sex==0?'男':'女'}} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="用户角色" |
|
|
|
prop="roleName" |
|
|
|
> |
|
|
|
<!-- <template slot-scope="scope"> |
|
|
|
{{scope.row.roleList[0].roleName}} |
|
|
|
</template> --> |
|
|
|
prop="orgName" |
|
|
|
label="所属组织"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="userRoleTypeName" |
|
|
|
label="身份"> |
|
|
|
prop="createTime" |
|
|
|
label="注册时间"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="lockFlag" |
|
|
|
label="状态"> |
|
|
|
prop="address" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-tag |
|
|
|
:type="scope.row.lockFlag === '0' ? 'success' : 'danger'" |
|
|
|
disable-transitions>{{scope.row.lockFlag==0?'启用':'禁用'}}</el-tag> |
|
|
|
<el-tooltip style="font-size:18px" effect="dark" content="密码重置" placement="top-start"> |
|
|
|
<i class="el-icon-unlock" style="color:#ff892a;" @click="resetPwd(scope.row)"></i> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip style="font-size:18px" effect="dark" content="查看" placement="top-start"> |
|
|
|
<i class="el-icon-zoom-in" style="color:#008EF2;" @click="editRole(scope.row,true)"></i> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip style="font-size:18px" effect="dark" content="编辑" placement="top-start"> |
|
|
|
<i class="el-icon-edit" style="color:red" @click="editRole(scope.row,false)"></i> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip style="font-size:18px" effect="dark" content="删除" placement="top-start"> |
|
|
|
<i class="el-icon-close" style="color:#428bca" @click="deletes(scope.row)"></i> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip style="font-size:18px" effect="dark" content="修改客户信息状态" placement="top-start"> |
|
|
|
<i class="el-icon-view" style="color:#428bca" @click="editStatus(scope.row)"></i> |
|
|
|
</el-tooltip> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<el-table |
|
|
|
:data="tableData1" |
|
|
|
v-else |
|
|
|
border |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
style="width: 100%;" |
|
|
|
:header-cell-style="{textAlign: 'center'}" |
|
|
|
:cell-style="{ textAlign: 'center' }" |
|
|
|
> |
|
|
|
<el-table-column |
|
|
|
prop="orgName" |
|
|
|
label="公司"> |
|
|
|
type="selection" |
|
|
|
width="55" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="name" |
|
|
|
label="用户名"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="createTime" |
|
|
|
label="创建时间"> |
|
|
|
label="登录手机" |
|
|
|
prop="username" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column |
|
|
|
prop="address" |
|
|
|
label="账号状态"> |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column |
|
|
|
prop="showPhoneStatus" |
|
|
|
label="客户号码显示"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{scope.row.showPhoneStatus==0?'是':'否'}} |
|
|
|
</template> |
|
|
|
prop="userRoleTypeName" |
|
|
|
label="性别"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="所属组织" |
|
|
|
label="公司"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="createTime" |
|
|
|
label="注册时间"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="address" |
|
|
@@ -297,13 +238,11 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="身份:" prop="userRoleType" v-if="sign==1||form.sign==1"> |
|
|
|
<el-select v-model="form.userRoleType" placeholder="请选择用户身份"> |
|
|
|
<el-option |
|
|
|
v-for="item in rolesOptions" |
|
|
|
:key="item.value" |
|
|
|
:label="item.desc" |
|
|
|
:value="item.value" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
<el-option label="项目总" value="2"></el-option> |
|
|
|
<el-option label="客服" value="3"></el-option> |
|
|
|
<el-option label="策划" value="4"></el-option> |
|
|
|
<el-option label="经理" value="5"></el-option> |
|
|
|
<el-option label="置业顾问" value="6"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="登录名:" prop="username"> |
|
|
@@ -375,10 +314,20 @@ |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="手机号验证" :visible.sync="phoneVisible" @close='$refs.phoneForm.resetFields()' width="400px"> |
|
|
|
<el-form :model="phoneForm" label-width="100px" ref="phoneForm" :rules="phoneRules"> |
|
|
|
<el-form-item label="登陆手机:" prop="phone"> |
|
|
|
<el-input style="width:200px" type="tel" maxlength="11" v-model.number="phoneForm.phone" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div style="display:flex; justify-content: space-around;" > |
|
|
|
<el-button @click="phoneVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="nextshow">确 定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="密码重置" :visible.sync="passwordVisible" @close='$refs.passwordForm.resetFields()' width="400px"> |
|
|
|
<el-form :model="passwordForm" label-width="120px" ref="passwordForm" :rules="passwordRules"> |
|
|
|
<el-form :model="passwordForm" label-width="100px" ref="passwordForm" :rules="passwordRules"> |
|
|
|
<el-form-item label="重置密码:" prop="password"> |
|
|
|
<el-input v-model="passwordForm.password" show-password></el-input> |
|
|
|
</el-form-item> |
|
|
@@ -393,7 +342,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {addObj, delObj, fetchList, putObj} from '@/api/admin/user' |
|
|
|
import {addObj, delObj, del1Obj,fetchList, putObj} from '@/api/admin/user' |
|
|
|
import { getStore, setStore } from '@/util/store' |
|
|
|
import {deptRoleList} from '@/api/admin/role' |
|
|
|
import {fetchTree} from '@/api/admin/dept' |
|
|
@@ -403,7 +352,21 @@ |
|
|
|
export default { |
|
|
|
name: 'SysUser', |
|
|
|
data() { |
|
|
|
var validatePass = (rule, value, callback) => { |
|
|
|
if (value === '') { |
|
|
|
callback(new Error('请输入手机号')); |
|
|
|
} else { |
|
|
|
if (value) { |
|
|
|
if(!(/^1[3456789]\d{9}$/.test(value))){ |
|
|
|
// alert("手机号码不合法,请重新输入"); |
|
|
|
callback(new Error('手机号码不合法,请重新输入')); |
|
|
|
} |
|
|
|
} |
|
|
|
callback(); |
|
|
|
} |
|
|
|
}; |
|
|
|
return { |
|
|
|
choseFlag:true, |
|
|
|
treeClick: '', //点击样式 |
|
|
|
keywork: '', //搜索关键字 |
|
|
|
selectLabel: '', //下拉框显示名称 |
|
|
@@ -466,11 +429,20 @@ |
|
|
|
}, |
|
|
|
rolesOptions: [], |
|
|
|
searchMsg:{ |
|
|
|
flag:'1', |
|
|
|
name:'', //用户名 |
|
|
|
username:'',//登录名 |
|
|
|
orgName:'',//所属组织 |
|
|
|
}, |
|
|
|
searchMsg1:{ |
|
|
|
flag:'1', |
|
|
|
name:'', //用户名 |
|
|
|
username:'',//登录名 |
|
|
|
value:'',//身份 |
|
|
|
houseId:'',//楼盘 |
|
|
|
orgCode:''//公司 |
|
|
|
orgName:'',//所属组织 |
|
|
|
userRoleType:'',//用户身份 |
|
|
|
lockFlag:'',//状态 |
|
|
|
queryOrgType:'',//组织类型 |
|
|
|
|
|
|
|
}, |
|
|
|
sign:'', //用户标示,0系统用户,1公司用户 2运营用户 |
|
|
|
roleNameList:[], |
|
|
@@ -480,6 +452,7 @@ |
|
|
|
orgNameList:[], |
|
|
|
RoleByOrgCodeList:[], |
|
|
|
tableData:[], |
|
|
|
tableData1:[], |
|
|
|
checkRole:[], |
|
|
|
formTitle:'新增', |
|
|
|
dialogFormVisible:false, |
|
|
@@ -489,9 +462,19 @@ |
|
|
|
password:"", |
|
|
|
userId:null |
|
|
|
}, |
|
|
|
phoneForm:{ |
|
|
|
phone:'' |
|
|
|
}, |
|
|
|
phoneVisible:false,//验证手机号 |
|
|
|
userRoleFlag:true, |
|
|
|
passwordVisible:false, |
|
|
|
orgList:[], |
|
|
|
phoneRules:{ |
|
|
|
phone: [ |
|
|
|
{ required: true, message: '请填写手机号', trigger: 'blur' }, |
|
|
|
{ validator: validatePass, trigger: 'blur' } |
|
|
|
] |
|
|
|
}, |
|
|
|
passwordRules:{ |
|
|
|
password: [ |
|
|
|
{ required: true, message: '请填写密码', trigger: 'blur' }, |
|
|
@@ -532,6 +515,16 @@ |
|
|
|
...mapGetters(['permissions']) |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
choseFlag(newval,oldval){ |
|
|
|
console.log(newval,oldval) |
|
|
|
this.page.current=1 |
|
|
|
this.roleList() |
|
|
|
if(newval){ |
|
|
|
// 注册用户 |
|
|
|
}else{ |
|
|
|
//组织用户 |
|
|
|
} |
|
|
|
}, |
|
|
|
role() { |
|
|
|
this.form.role = this.role |
|
|
|
}, |
|
|
@@ -545,34 +538,117 @@ |
|
|
|
this.sys_user_add = this.permissions['sys_user_add'] |
|
|
|
this.sys_user_edit = this.permissions['sys_user_edit'] |
|
|
|
this.sys_user_del = this.permissions['sys_user_del'] |
|
|
|
// return |
|
|
|
// 获取用户信息 |
|
|
|
let info=getStore({name:'userInfo'}) |
|
|
|
this.sign=info.sign |
|
|
|
console.log(info); |
|
|
|
this.init() |
|
|
|
// let info=getStore({name:'userInfo'}) |
|
|
|
// this.sign=info.sign |
|
|
|
// console.log(info); |
|
|
|
// this.init() |
|
|
|
this.roleList() //table 列表 |
|
|
|
this.getHouseList() //楼盘名称 |
|
|
|
this.userDeptTree()// 获取部门树 |
|
|
|
this.getNodeData() |
|
|
|
this.deptGetOrgList()//获取公司列表 |
|
|
|
// this.userDeptTree()// 获取部门树 |
|
|
|
// this.deptGetOrgList()//获取公司列表 |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 下一步 |
|
|
|
nextshow(){ |
|
|
|
this.$refs.phoneForm.validate(valid=>{ |
|
|
|
if(valid){ |
|
|
|
// 验证电话号码 |
|
|
|
this.$api.api.verPhone(this.phoneForm.phone) |
|
|
|
.then(res=>{ |
|
|
|
console.log(res) |
|
|
|
// 判断数据是否已经有了 |
|
|
|
if(res.data){ |
|
|
|
// 没有用户 |
|
|
|
console.log(res.data.sysUser); |
|
|
|
}else{ |
|
|
|
console.log('没有用户'); |
|
|
|
} |
|
|
|
}) |
|
|
|
// return |
|
|
|
this.phoneVisible=false |
|
|
|
this.dialogFormVisible=true |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
search(){ |
|
|
|
console.log(this.searchMsg,'搜索内容'); |
|
|
|
return |
|
|
|
this.roleList() |
|
|
|
}, |
|
|
|
search1(){ |
|
|
|
console.log(this.searchMsg1,'搜索内容'); |
|
|
|
return |
|
|
|
this.roleList() |
|
|
|
}, |
|
|
|
flagchange(val){ |
|
|
|
// if(val==1){ |
|
|
|
|
|
|
|
// } |
|
|
|
this.searchMsg.name='' |
|
|
|
this.searchMsg.username='' |
|
|
|
}, |
|
|
|
flagchange1(){ |
|
|
|
this.searchMsg1.name='' |
|
|
|
this.searchMsg1.username='' |
|
|
|
}, |
|
|
|
reset(){ |
|
|
|
this.searchMsg={ |
|
|
|
flag:'1', |
|
|
|
name:'', //用户名 |
|
|
|
username:'',//登录名 |
|
|
|
orgName:'',//所属组织 |
|
|
|
} |
|
|
|
}, |
|
|
|
reset1(){ |
|
|
|
this.searchMsg1={ |
|
|
|
flag:'1', |
|
|
|
name:'', //用户名 |
|
|
|
username:'',//登录名 |
|
|
|
orgName:'',//所属组织 |
|
|
|
userRoleType:'',//用户身份 |
|
|
|
lockFlag:'',//状态 |
|
|
|
queryOrgType:'',//组织类型 |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取用户列表 |
|
|
|
roleList(){ |
|
|
|
fetchList({...this.page,...this.searchMsg}) |
|
|
|
.then(res=>{ |
|
|
|
// console.log(res); |
|
|
|
if(res.code==0){ |
|
|
|
this.tableData=res.data.records |
|
|
|
this.page.total=res.data.total |
|
|
|
}else{ |
|
|
|
this.$message.waring(res.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(this.choseFlag){ |
|
|
|
// 注册用户列表 |
|
|
|
this.$api.api.registerUserList({...this.page,...this.searchMsg,orgType:localStorage.getItem('orgType')}) |
|
|
|
.then(res=>{ |
|
|
|
// console.log(res); |
|
|
|
if(res.code==0){ |
|
|
|
this.tableData=res.data.records |
|
|
|
this.page.total=res.data.total |
|
|
|
}else{ |
|
|
|
this.$message.waring(res.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
// 组织用户列表 |
|
|
|
this.$api.api.orgUserList({...this.page,...this.searchMsg,orgType:localStorage.getItem('orgType')}) |
|
|
|
.then(res=>{ |
|
|
|
// console.log(res); |
|
|
|
if(res.code==0){ |
|
|
|
this.tableData1=res.data.records |
|
|
|
this.page.total=res.data.total |
|
|
|
}else{ |
|
|
|
this.$message.waring(res.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// fetchList({...this.page,...this.searchMsg}) |
|
|
|
// .then(res=>{ |
|
|
|
// // console.log(res); |
|
|
|
// if(res.code==0){ |
|
|
|
// this.tableData=res.data.records |
|
|
|
// this.page.total=res.data.total |
|
|
|
// }else{ |
|
|
|
// this.$message.waring(res.msg) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 获取部门树 |
|
|
|
userDeptTree(){ |
|
|
@@ -615,7 +691,8 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
addRole(){ |
|
|
|
this.dialogFormVisible=true |
|
|
|
this.phoneVisible=true |
|
|
|
// this.dialogFormVisible=true |
|
|
|
this.addFlag=true |
|
|
|
this.editFlag=false |
|
|
|
this.formTitle='添加' |
|
|
@@ -696,13 +773,6 @@ |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 获取楼盘列表 |
|
|
|
getHouseList(){ |
|
|
|
this.$api.api.queryHouseByUsername() |
|
|
|
.then(res=>{ |
|
|
|
this.houseNameList=res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
resetForm(){ |
|
|
|
this.$refs.form.resetFields() |
|
|
|
this.form.deptName='' |
|
|
@@ -714,7 +784,7 @@ |
|
|
|
// 重置用户密码 |
|
|
|
resetPwd(row){ |
|
|
|
// console.log(row); |
|
|
|
this.passwordForm.userId=row.id |
|
|
|
this.passwordForm.userId=row.userId |
|
|
|
this.passwordVisible=true |
|
|
|
}, |
|
|
|
editpwd(){ |
|
|
@@ -878,18 +948,6 @@ |
|
|
|
this.RoleByOrgCodeList=[] |
|
|
|
} |
|
|
|
}, |
|
|
|
init() { |
|
|
|
fetchTree().then(response => { |
|
|
|
this.treeData = response.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
// nodeClick(data) { |
|
|
|
// console.log(data); |
|
|
|
// this.form.roleName=data.name |
|
|
|
// this.form.roleId=data.id |
|
|
|
// // this.page.page = 1 |
|
|
|
// // this.getList(this.page, {deptId: data.id}) |
|
|
|
// }, |
|
|
|
getList(page, params) { |
|
|
|
this.listLoading = true |
|
|
|
fetchList(Object.assign({ |
|
|
@@ -902,12 +960,6 @@ |
|
|
|
this.listLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
getNodeData() { |
|
|
|
this.$api.api.getAllUserRoleType().then(response => { |
|
|
|
console.log(response); |
|
|
|
this.rolesOptions = response.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
searchChange(param, done) { |
|
|
|
this.searchForm = param |
|
|
|
this.page.currentPage = 1 |
|
|
@@ -982,11 +1034,20 @@ |
|
|
|
type: 'warning' |
|
|
|
} |
|
|
|
).then(() => { |
|
|
|
delObj(row.id) |
|
|
|
if(this.choseFlag){ |
|
|
|
delObj(row.userId) |
|
|
|
.then(() => { |
|
|
|
this.roleList() |
|
|
|
this.$notify.success('删除成功') |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
delObj1({id:row.userId,orgType:localStorage.getItem('orgType'),accountId:row.accountId}) |
|
|
|
.then(() => { |
|
|
|
this.roleList() |
|
|
|
this.$notify.success('删除成功') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// .catch(() => { |
|
|
|
// this.$notify.error('删除失败') |
|
|
|
// }) |
|
|
@@ -995,7 +1056,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style lang="scss"> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.user { |
|
|
|
height: 100%; |
|
|
|
|
|
|
@@ -1014,5 +1075,36 @@ |
|
|
|
color: #4D74D6; |
|
|
|
font-weight: 600; |
|
|
|
} |
|
|
|
.chose{ |
|
|
|
display: flex; |
|
|
|
height: 40px; |
|
|
|
border: 1px solid #ccc; |
|
|
|
text-align: center; |
|
|
|
width: 140px; |
|
|
|
margin: 10px; |
|
|
|
div{ |
|
|
|
text-align: center; |
|
|
|
line-height: 40px; |
|
|
|
// width: 100px; |
|
|
|
width: 70px; |
|
|
|
} |
|
|
|
.ch1{ |
|
|
|
background: cornflowerblue; |
|
|
|
color:#fff; |
|
|
|
} |
|
|
|
.ch2{ |
|
|
|
|
|
|
|
color:#ccc; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// .top{ |
|
|
|
// /deep/ .el-form-item__content{ |
|
|
|
// display: inline-flex ; |
|
|
|
// } |
|
|
|
// } |
|
|
|
.input-with-select .el-input-group__prepend { |
|
|
|
background-color: #fff; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|