用户管理

dev
yujialong 3 years ago
parent 1c8fbb6547
commit 7497294cb8
  1. 4
      src/config/index.js
  2. 17
      src/utils/api.js
  3. 4
      src/views/customer/Dashboard.vue
  4. 2
      src/views/setting/Person.vue
  5. 1678
      src/views/user/AddUser.vue
  6. 152
      src/views/user/User.vue

@ -17,6 +17,10 @@ export default {
* @description 默认密码 * @description 默认密码
*/ */
initialPassword: '111aaa', initialPassword: '111aaa',
/**
* 所属平台1->职站 2->数据平台
*/
platformId: 1,
/** /**
* @description 系统列表 * @description 系统列表
*/ */

@ -2,6 +2,7 @@
let host = 'http://39.108.250.202' let host = 'http://39.108.250.202'
let host1 = 'http://192.168.31.151:9000' let host1 = 'http://192.168.31.151:9000'
let host2 = 'http://192.168.31.125:9000' let host2 = 'http://192.168.31.125:9000'
let host3 = 'http://192.168.31.140:9000'
export default { export default {
logins: `${host}/liuwanr/userInfo/adminLogins`, //登录 logins: `${host}/liuwanr/userInfo/adminLogins`, //登录
@ -9,7 +10,6 @@ export default {
queryUser: `${host}/liuwanr/userInfo/queryUserInfo`, //查询用户新版 queryUser: `${host}/liuwanr/userInfo/queryUserInfo`, //查询用户新版
deleteUser: `${host}/liuwanr/userInfo/deleteUserInfo`, //删除用户新版 deleteUser: `${host}/liuwanr/userInfo/deleteUserInfo`, //删除用户新版
updateUser: `${host}/liuwanr/user/updateUser`, //编辑用户 updateUser: `${host}/liuwanr/user/updateUser`, //编辑用户
queryUserInfoDetails: `${host}/liuwanr/userInfo/queryUserInfoDetails`, //查询用户详情新版
queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在 queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在
queryUserOR: `${host}/liuwanr/userInfo/queryUserOR`, //查询系统列表详情 queryUserOR: `${host}/liuwanr/userInfo/queryUserOR`, //查询系统列表详情
queryWorkNumberIsExist:`${host}/liuwanr/userInfo/queryWorkNumberIsExist`,//查询学号、工号是否存在 queryWorkNumberIsExist:`${host}/liuwanr/userInfo/queryWorkNumberIsExist`,//查询学号、工号是否存在
@ -25,7 +25,6 @@ export default {
updateOR: `${host}/liuwanr/userInfo/updateOR`, //更新用户组织架构 updateOR: `${host}/liuwanr/userInfo/updateOR`, //更新用户组织架构
deletePlatform: `${host}/liuwanr/userInfo/deletePlatform`, //更新用户组织架构 deletePlatform: `${host}/liuwanr/userInfo/deletePlatform`, //更新用户组织架构
updateUserRoleId: `${host}/liuwanr/userInfo/updateUserRoleId`, //更新用户角色id接口 updateUserRoleId: `${host}/liuwanr/userInfo/updateUserRoleId`, //更新用户角色id接口
resetPwd:`${host}/evaluation/tms/system/resetPwd`,
deleteCustomer: `${host}/liuwanr/customer/deleteCustomer`, //删除客户 deleteCustomer: `${host}/liuwanr/customer/deleteCustomer`, //删除客户
updateCustomer: `${host}/liuwanr/customer/updateCustomer`, //更新客户 updateCustomer: `${host}/liuwanr/customer/updateCustomer`, //更新客户
@ -39,6 +38,20 @@ export default {
querySchoolData: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息 querySchoolData: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息
queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`, //查询系统列表 queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`, //查询系统列表
// 用户管理
delUserAccount: `${host3}/users/userAccount/delUserAccount`,
queryUserInfoDetails: `${host3}/users/userAccount/queryUserInfoDetails`,
queryUserInfoList: `${host3}/users/userAccount/queryUserInfoList`,
resetPwd: `${host3}/users/userAccount/resetPwd`,
selectAccountDetail: `${host3}/users/userAccount/selectAccountDetail`,
selectUserSysBind: `${host3}/users/userAccount/selectUserSysBind`,
updatePersonCenter: `${host3}/users/userAccount/updatePersonCenter`,
updateUserAvatars: `${host3}/users/userAccount/updateUserAvatars`,
userInfo: `${host3}/users/userAccount/userInfo`,
checkCode: `${host3}/users/userAccount/checkCode`,
findPasswordByEmail: `${host3}/users/userAccount/findPasswordByEmail`,
findPasswordByPhone: `${host3}/users/userAccount/findPasswordByPhone`,
queryOrder: `${host}/liuwanr/order/queryOrder`, //查询订单 queryOrder: `${host}/liuwanr/order/queryOrder`, //查询订单
queryOrderDetails: `${host}/liuwanr/order/queryOrderDetails`, //查询订单详情 queryOrderDetails: `${host}/liuwanr/order/queryOrderDetails`, //查询订单详情
queryOrderCustomer: `${host}/liuwanr/order/queryOrderCustomer`, //查询订单客户 queryOrderCustomer: `${host}/liuwanr/order/queryOrderCustomer`, //查询订单客户

@ -79,10 +79,10 @@
<el-table-column prop="adminName" label="账号" align="center"> <el-table-column prop="adminName" label="账号" align="center">
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" width="270" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text">重置密码</el-button> <el-button type="text">重置密码</el-button>
<!-- <el-button type="text">查看</el-button> --> <el-button type="text">查看</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button type="text" @click="permission">应用权限</el-button> <el-button type="text" @click="permission">应用权限</el-button>

@ -5,7 +5,7 @@
<div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;"> <div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="this.api.uploadUserAvatars" :action="this.api.updateUserAvatars"
:data="{userId:this.userId}" :data="{userId:this.userId}"
name="file" name="file"
:limit="3" :limit="3"

File diff suppressed because it is too large Load Diff

@ -52,7 +52,7 @@
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="创建时间" class="userRadio"> <el-form-item label="创建时间" class="userRadio">
<el-radio-group v-model="form.month" @change="itemRadio"> <el-radio-group v-model="form.month">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@ -60,12 +60,12 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="自定义"> <el-form-item label="自定义">
<el-date-picker v-model="form.date" align="right" unlink-panels type="daterange" <el-date-picker v-model="form.date" align="right" unlink-panels type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="selectTime" clearable></el-date-picker> start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input> <el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -83,7 +83,7 @@
<span>用户列表</span> <span>用户列表</span>
</div> </div>
<div> <div>
<el-button type="primary" size="small" round class="mag" @click="adduser">新增用户</el-button> <!-- <el-button type="primary" size="small" round @click="adduser">新增用户</el-button> -->
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
@ -91,35 +91,32 @@
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<!-- <el-table-column prop="userAccount" label="用户账号" align="center"> <el-table-column prop="account" label="用户账号" align="center">
</el-table-column> -->
<el-table-column prop="userName" label="姓名" align="center">
</el-table-column>
<el-table-column prop="countries" label="国家" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="provinceName" label="省份" align="center"> <el-table-column prop="userName" label="姓名" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="cityName" label="城市" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校名称" align="center"> <el-table-column prop="platformName" label="来源" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="NewaccountRole" label="账号角色" align="center"> <el-table-column prop="phone" label="手机号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="creationTime" label="创建时间" align="center"> <el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center"> <el-table-column prop="logInNumber" label="登录次数" align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" width="270" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="text">查看</el-button> --> <el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <!-- <el-button type="text" @click="edit(scope.row)">编辑</el-button> -->
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button> <el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-switch v-model="scope.row.disableAccount" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.disableAccount ? '禁用' : '启用'" @change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="totals">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -133,6 +130,8 @@ export default {
name: 'dashboard', name: 'dashboard',
data() { data() {
return { return {
platformId: this.$config.platformId,
searchTimer: null,
form: { form: {
name: '', name: '',
countries: '中国', countries: '中国',
@ -189,12 +188,38 @@ export default {
id: 12, id: 12,
name: '1年内' name: '1年内'
}], }],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 1, totals: 1,
multipleSelection: [] multipleSelection: []
}; };
}, },
watch: {
'form.keyword': function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
},
'form.month': function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.form.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.form.date = []
}
},
'form.date': function(val){
if(val.length){
this.form.startTime = val[0]
this.form.endTime = val[1]
}else{
this.form.startTime = ''
this.form.endTime = ''
}
this.initData()
}
},
mounted() { mounted() {
this.getData() this.getData()
}, },
@ -210,27 +235,19 @@ export default {
endTime: this.form.endTime, endTime: this.form.endTime,
roleId: this.form.accountRole, roleId: this.form.accountRole,
searchContent: this.form.keyword, searchContent: this.form.keyword,
pageNo: this.pageNo, platformId: this.platformId,
pageSize: this.pageSize page: this.page,
size: this.pageSize
} }
this.$get(this.api.queryUser,data).then(res => { this.$get(this.api.queryUserInfoList,data).then(res => {
res.message.rows.forEach(e => { this.userData = res.message.list
if(e.roleId.length > 1) { this.totals = res.message.totalCount
let NewaccountRole = []
let roleIds = e.roleId.split(',')
roleIds.forEach((n,k) => {
NewaccountRole.push(this.roleStatus(n))
})
e.NewaccountRole = NewaccountRole.join(',')
}else{
e.NewaccountRole = this.roleStatus(e.roleId)
}
})
this.userData = res.message.rows
this.totals = res.message.total
}).catch(res => {}); }).catch(res => {});
}, },
initData(){
this.page = 1
this.getData()
},
// //
clearprovince(){ clearprovince(){
this.form.city = '', this.form.city = '',
@ -240,7 +257,7 @@ export default {
getCity(){ getCity(){
this.clearprovince() this.clearprovince()
this.getCityData() this.getCityData()
this.pageNo = 1 this.page = 1
this.getData() this.getData()
}, },
getCityData(){ getCityData(){
@ -259,7 +276,7 @@ export default {
getSchool(){ getSchool(){
this.clearcity() this.clearcity()
this.getSchoolData() this.getSchoolData()
this.pageNo = 1 this.page = 1
this.getData() this.getData()
}, },
getSchoolData(){ getSchoolData(){
@ -271,30 +288,8 @@ export default {
this.schoolList = res.message this.schoolList = res.message
}).catch(res => {}); }).catch(res => {});
}, },
onSearch(){
this.pageNo = 1
this.getData()
},
itemRadio(val){
this.form.month = val
this.form.date = ''
this.form.startTime = ''
this.form.endTime = ''
this.getData()
},
selectTime(val){
if(val){
this.form.startTime = val[0]
this.form.endTime = val[1]
}else{
this.form.startTime = ''
this.form.endTime = ''
}
this.form.month = ''
this.getData()
},
currentChange(val) { currentChange(val) {
this.pageNo = val; this.page = val;
this.getData(); this.getData();
}, },
permission(){ permission(){
@ -308,19 +303,22 @@ export default {
this.$store.commit("userData", { user_id : row.userId}); this.$store.commit("userData", { user_id : row.userId});
this.$router.push('/adduser'); this.$router.push('/adduser');
}, },
show(row){
this.$store.commit("userData", { user_id : row.userId});
this.$router.push('/adduser');
},
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}) }).then(() => {
.then(() => { this.$get(this.api.delUserAccount,{
let arr = [] userId: row.userId,
arr.push(row.userId) isdel: 1
this.$post(this.api.deleteUser,arr).then(res => { }).then(res => {
this.$message.success('删除成功'); this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {})
}) }).catch(() => {})
.catch(() => {});
}, },
resetPassword(row){ resetPassword(row){
this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', { this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', {
@ -330,7 +328,7 @@ export default {
userId: row.userId, userId: row.userId,
} }
this.$get(this.api.resetPwd,data).then(res => { this.$get(this.api.resetPwd,data).then(res => {
if(res.errmessage == 'success'){ if(res.message == 'success'){
this.$message.success('重置成功') this.$message.success('重置成功')
}else{ }else{
this.$message.error('重置失败') this.$message.error('重置失败')
@ -339,6 +337,16 @@ export default {
}).catch(() => { }).catch(() => {
}); });
}, },
switchOff(val,row,index) {
let data = {
id: row.id,
isDisable: val
}
this.$post(this.api.updateClient,data).then((res) => {
this.$message.success(val ? '启用成功' : '禁用成功')
}).catch((res) => {
})
},
getRowKeys(row) { getRowKeys(row) {
return row.userId; return row.userId;
}, },

Loading…
Cancel
Save