用户管理列表对接~

This commit is contained in:
JasonChen
2023-08-01 16:01:45 +08:00
parent ba1d0ced53
commit e13db9fa5e
3 changed files with 51 additions and 140 deletions

10
src/api/user.js Normal file
View File

@@ -0,0 +1,10 @@
import request from '@/utils/request'
// 用户列表
export function getMiddlesUser (parameter) {
return request({
url: '/middles/user/children',
method: 'get',
params: parameter
})
}

View File

@@ -7,23 +7,18 @@
<a-row :gutter="48"> <a-row :gutter="48">
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-form-item label="用户昵称"> <a-form-item label="用户昵称">
<a-input v-model="queryParam.order_no" placeholder="用户昵称" /> <a-input v-model="queryParam.nickname" placeholder="用户昵称" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-form-item label="用户昵称"> <a-form-item label="用户手机号">
<a-input v-model="queryParam.item_id" placeholder="用户昵称" /> <a-input v-model="queryParam.username" placeholder="用户手机号" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="顶点账号">
<a-input v-model="queryParam.item_id" placeholder="顶点账号" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-form-item label="身份筛选" has-feedback> <a-form-item label="身份筛选" has-feedback>
<a-select v-model="queryParam.business_type_id" @change="onBusinessChange" placeholder="身份筛选"> <a-select v-model="queryParam.identity_id" placeholder="身份筛选">
<a-select-option v-for="item in businessArray" :key="item.id" :value="item.id">{{ item.title }}</a-select-option> <a-select-option v-for="item in indentitys" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -31,13 +26,6 @@
<a-button type="primary" @click="search"><a-icon type="search" />搜索</a-button> <a-button type="primary" @click="search"><a-icon type="search" />搜索</a-button>
<a-button class="ml8" type="primary" @click="onAddRole"><a-icon type="plus" />新增</a-button> <a-button class="ml8" type="primary" @click="onAddRole"><a-icon type="plus" />新增</a-button>
<a-button class="ml8" @click="resetSearch"><a-icon type="undo" />重置</a-button> <a-button class="ml8" @click="resetSearch"><a-icon type="undo" />重置</a-button>
<a-button
v-if="exports_can"
class="ml8"
type="dashed"
shape="round"
icon="download"
@click="exports"/>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@@ -50,16 +38,22 @@
ref="table" ref="table"
:columns="columns" :columns="columns"
:data="loadData" :data="loadData"
:rowKey="(row) => row.order_item_id" :rowKey="(row) => row.user_id"
showPagination="auto" showPagination="auto"
bordered bordered
size="default" size="default"
:scroll="{ x: 1200, y: 1000 }"> :scroll="{ x: 1200, y: 1000 }">
<!-- 申请用户 实习顾问 法务老师 --> <div slot="user_id" slot-scope="text, record">{{ record.user.user_id }}</div>
<div slot="user" slot-scope="text, record" style="color: #1890ff"> <div slot="nickname" slot-scope="text, record" >{{ record.user.nickname || '-' }}</div>
<div>{{ record.user }}</div> <div slot="name" slot-scope="text, record">{{ record.user.name || '-' }}</div>
<div slot="username" slot-scope="text, record">{{ record.user.username || '-' }}</div>
<div slot="identity" slot-scope="text, record">
<img v-if="record.identity&& record.identity.cover" :src="record.identity.cover" alt="" style="width:60px">
<span v-else> {{ record.identity.name }}</span>
</div> </div>
<!-- 创建时间 --> <div slot="invite" slot-scope="text, record" style="color: #1890ff">{{ record.user.invite || '-' }}</div>
<div slot="parent" slot-scope="text, record">{{ record.parent.nickname }}<div>{{ record.parent.username }}</div></div>
<span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span> <span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span>
<!-- 操作 --> <!-- 操作 -->
<div slot="actions" slot-scope="text, record"> <div slot="actions" slot-scope="text, record">
@@ -73,22 +67,16 @@
<script> <script>
import { STable, UserInfo } from '@/components' import { STable, UserInfo } from '@/components'
import DeriveButton from '@/components/OrderDetailInfo/DeriveButton' import DeriveButton from '@/components/OrderDetailInfo/DeriveButton'
import { institutionsExports } from '@/api/storage'
import moment from 'moment' import moment from 'moment'
import { import { getMiddlesUser } from '@/api/user'
getList,
init,
canExport
} from '@/api/organization'
import storage from 'store'
import EditInvite from './widgets/EditInvite.vue' import EditInvite from './widgets/EditInvite.vue'
import AddRole from './widgets/AddRole.vue' import AddRole from './widgets/AddRole.vue'
// 列表规格 // 列表规格
const columns = [ const columns = [
{ {
title: '用户id', title: '用户ID',
dataIndex: 'order_id', scopedSlots: { customRender: 'user_id' },
align: 'center', align: 'center',
width: 80 width: 80
}, },
@@ -97,36 +85,31 @@ const columns = [
children: [ children: [
{ {
title: '昵称', title: '昵称',
dataIndex: 'name', scopedSlots: { customRender: 'nickname' },
key: 'name',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
title: '真实姓名', title: '真实姓名',
dataIndex: 'name1', scopedSlots: { customRender: 'name' },
key: 'name1',
align: 'center', align: 'center',
width: 140 width: 140
}, },
{ {
title: '用户手机', title: '用户手机',
dataIndex: 'name23', scopedSlots: { customRender: 'username' },
key: 'name23',
align: 'center', align: 'center',
width: 140 width: 140
}, },
{ {
title: '身份', title: '身份',
dataIndex: 'name2', scopedSlots: { customRender: 'identity' },
key: 'name2',
align: 'center', align: 'center',
width: 140 width: 140
}, },
{ {
title: '邀请码', title: '邀请码',
dataIndex: 'name554', scopedSlots: { customRender: 'invite' },
key: 'name5',
align: 'center', align: 'center',
width: 140 width: 140
} }
@@ -136,7 +119,7 @@ const columns = [
}, },
{ {
title: '推荐人手机号', title: '推荐人手机号',
dataIndex: 'user22', scopedSlots: { customRender: 'parent' },
width: 140, width: 140,
align: 'center' align: 'center'
}, },
@@ -166,82 +149,32 @@ export default {
}, },
data () { data () {
return { return {
exports_can: false,
columns, columns,
searchType: false, // 展示全部的搜索 indentitys: [
businessArray: [], // 业务类型 { id: 1, name: '普通用户' },
statusArray: [], // 机构列表 { id: 2, name: 'VIP' },
{ id: 4, name: '创客' },
{ id: 6, name: '代理商' }
], // 业务类型
queryParam: { queryParam: {
order_no: '', // 订单编号 username: undefined,
institution: '', // 机构名称 nickname: undefined,
item_id: '', // 机构编号 identity_id: undefined
nickname: '', // 下单人
business_type_id: '', // 业务类型
status: '', // 机构状态
paid_at: undefined, // 下单时间
audit_at: undefined, // 执行时间
settle_at: undefined // 结案时间
}, },
listCount: 0, listCount: 0,
loadData: (parameter) => { loadData: (parameter) => {
const requestParameters = Object.assign({}, parameter, this.queryParam) const requestParameters = Object.assign({}, parameter, this.queryParam)
return getList(requestParameters) return getMiddlesUser(requestParameters)
} }
} }
}, },
watch: { watch: {
$route (to, from) { $route (to, from) {
if ( console.log(to)
(from.name === 'Detail' && to.name === 'FristCheckrderIndex') ||
(from.name === 'Home' && to.name === 'FristCheckrderIndex') ||
(from.name === 'AssignrderIndex' && to.name === 'FristCheckrderIndex') ||
(from.name === 'SignInrderIndex' && to.name === 'FristCheckrderIndex') ||
(from.name === 'ReCheckrderIndex' && to.name === 'FristCheckrderIndex') ||
(from.name === 'HandleService' && to.name === 'FristCheckrderIndex') ||
(from.name === 'CompleteOrder' && to.name === 'FristCheckrderIndex')
) {
this.$refs.table.loadData()
} }
}
},
created () {
this.init()
}, },
methods: { methods: {
moment, moment,
// 获取检索的基本样式
init () {
init().then(res => {
this.statusArray = res.status // 机构状态
this.businessArray = res.type // 业务类型
this.canExports()
})
},
// 更改创建时间
onCreateChange (dates, dateStrings) {
this.queryParam.paid_at = dateStrings
},
// 更改执行时间
onCarryChange (dates, dateStrings) {
this.queryParam.audit_at = dateStrings
},
// 更改结案时间
onSettleChange (dates, dateStrings) {
this.queryParam.settle_at = dateStrings
},
// 处理状态
onDisposeChange (e) {
this.queryParam.dispose = e
},
// 业务类型
onBusinessChange (e) {
this.queryParam.business_type_id = e
},
// 机构状态
onOrganizationChange (e) {
this.queryParam.status = e
},
// 搜索列表 // 搜索列表
search () { search () {
this.$refs.table.refresh(true) // 重置接口且刷先到第一页 this.$refs.table.refresh(true) // 重置接口且刷先到第一页
@@ -249,44 +182,12 @@ export default {
// 重置搜索列表 // 重置搜索列表
resetSearch () { resetSearch () {
this.queryParam = { this.queryParam = {
order_no: '', // 订单编号 username: undefined,
institution: '', // 机构名称 nickname: undefined,
item_id: '', // 机构编号 identity_id: undefined
nickname: '', // 下单人
business_type_id: '', // 业务类型
status: '', // 机构状态
paid_at: undefined, // 下单时间
audit_at: undefined, // 执行时间
settle_at: undefined// 结案时间
} }
this.$refs.table.refresh(true) // 重置接口且刷先到第一页 this.$refs.table.refresh(true) // 重置接口且刷先到第一页
}, },
// 机构是否能导出
canExports () {
console.log('canExports')
canExport(storage.get('userid')).then(res => {
this.exports_can = res.exports
})
},
// 导出列表
exports () {
const params = this.queryParam
params.audit_at = this.queryParam.audit_at || ''
params.paid_at = this.queryParam.paid_at || ''
params.settle_at = this.queryParam.settle_at || ''
if (this.listCount > 0) {
let downUrl = institutionsExports() + '?user_id=' + storage.get('userid')
for (const key in params) {
downUrl = downUrl + '&' + key + '=' + params[key]
}
window.open(downUrl)
} else {
this.$notification.error({
message: '温馨提醒',
description: '数据为空不能下载!'
})
}
},
// 新增用户 // 新增用户
onAddRole () { onAddRole () {
console.log('add....') console.log('add....')