fix: 修复销售BD等无法选择部门问题 & feat:新增用户查询功能
This commit is contained in:
parent
e2b5a10fcf
commit
0f380ec86e
|
@ -3,7 +3,10 @@ import request from '@/utils/request'
|
||||||
// 获取部门列表
|
// 获取部门列表
|
||||||
export const reqGetDepartments = () => request({ url: `/WRD-admin/sys/dept/list`, method: 'get' })
|
export const reqGetDepartments = () => request({ url: `/WRD-admin/sys/dept/list`, method: 'get' })
|
||||||
|
|
||||||
// 获取部门列表
|
// 获取所有部门
|
||||||
|
export const reqGetAllDepartments = () => request({ url: `/WRD-admin/sys/dept/listAll`, method: 'get' })
|
||||||
|
|
||||||
|
// 获取区域及城市
|
||||||
export const reqGetRegionAndCity = () => request({ url: `/WRD-admin/sys/user/ReignAndCity`, method: 'get' })
|
export const reqGetRegionAndCity = () => request({ url: `/WRD-admin/sys/user/ReignAndCity`, method: 'get' })
|
||||||
|
|
||||||
// 不带部门
|
// 不带部门
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="user-container">
|
<div class="user-container">
|
||||||
<el-form label-width="80px" :inline="true" class="button-headers">
|
<el-form label-width="80px" :inline="true" class="button-headers">
|
||||||
<!-- <el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="model" placeholder="请输入GID"></el-input>
|
<el-input v-model="name" placeholder="请输入用户姓名" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search"
|
<el-button type="primary" icon="el-icon-search" @click="userSearch">查询</el-button>
|
||||||
>查询</el-button
|
|
||||||
>
|
|
||||||
<el-button type="default" @click="resetSearch">清空</el-button> -->
|
|
||||||
<el-button type="primary" @click="showAddUserDialog">添加用户</el-button>
|
<el-button type="primary" @click="showAddUserDialog">添加用户</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
|
@ -159,6 +156,7 @@ export default {
|
||||||
loadingOfGetUserList: false,
|
loadingOfGetUserList: false,
|
||||||
loadingOfSaveUserButton: false,
|
loadingOfSaveUserButton: false,
|
||||||
dialogUserVisible: false,
|
dialogUserVisible: false,
|
||||||
|
name: '',
|
||||||
user: {},
|
user: {},
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
|
@ -209,15 +207,15 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async fetchDepartmentsList() {
|
async fetchDepartmentsList() {
|
||||||
const result = await this.$API.select.reqGetDepartments()
|
const result = await this.$API.select.reqGetAllDepartments()
|
||||||
if (result.code == 0) {
|
if (result.code === 0) {
|
||||||
this.departmentList = result.data
|
this.departmentList = result.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fetchRolesList() {
|
async fetchRolesList() {
|
||||||
const resOfGetRolesList = await this.$API.role.reqGetRoleList()
|
const resOfGetRolesList = await this.$API.role.reqGetRoleList()
|
||||||
|
|
||||||
if (resOfGetRolesList.code == 0) {
|
if (resOfGetRolesList.code === 0) {
|
||||||
this.roles = resOfGetRolesList.data
|
this.roles = resOfGetRolesList.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -230,6 +228,9 @@ export default {
|
||||||
page: page,
|
page: page,
|
||||||
limit: limit
|
limit: limit
|
||||||
}
|
}
|
||||||
|
if (this.name) {
|
||||||
|
queryInfo.name = this.name
|
||||||
|
}
|
||||||
const resOfFetchUserList = await this.$API.user.reqGetUserList(queryInfo)
|
const resOfFetchUserList = await this.$API.user.reqGetUserList(queryInfo)
|
||||||
if (resOfFetchUserList.code == 0) {
|
if (resOfFetchUserList.code == 0) {
|
||||||
this.total = resOfFetchUserList.data.total
|
this.total = resOfFetchUserList.data.total
|
||||||
|
@ -355,6 +356,9 @@ export default {
|
||||||
if (theRole) {
|
if (theRole) {
|
||||||
return theRole.name
|
return theRole.name
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
userSearch() {
|
||||||
|
this.fetchUsersList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ module.exports = {
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: 'http://139.219.4.195:8003',
|
target: 'http://139.219.4.195:8003',
|
||||||
// 测试地址
|
// 测试地址
|
||||||
// target: 'http://192.168.1.161:8003',
|
// target: 'http://192.168.1.169:8003',
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue