1
1
<template >
2
- <Dialog v-model =" dialogVisible" title =" 推广人列表 " width =" 75%" >
2
+ <Dialog v-model =" dialogVisible" title =" 推广订单列表 " width =" 75%" >
3
3
<ContentWrap >
4
4
<!-- 搜索工作栏 -->
5
5
<el-form
6
- class =" -mb-15px"
7
- :model =" queryParams"
8
6
ref =" queryFormRef"
9
7
:inline =" true"
8
+ :model =" queryParams"
9
+ class =" -mb-15px"
10
10
label-width =" 85px"
11
11
>
12
- <el-form-item label =" 用户类型" prop =" level " >
13
- <el-radio-group v-model =" queryParams.level " @change =" handleQuery" >
14
- <el-radio-button checked >全部</el-radio-button >
15
- <el-radio-button value =" 1" >一级推广人</el-radio-button >
16
- <el-radio-button value =" 2" >二级推广人</el-radio-button >
12
+ <el-form-item label =" 用户类型" prop =" sourceUserLevel " >
13
+ <el-radio-group v-model =" queryParams.sourceUserLevel " @change =" handleQuery" >
14
+ <el-radio-button :value = " 0 " >全部</el-radio-button >
15
+ <el-radio-button : value =" 1" >一级推广人</el-radio-button >
16
+ <el-radio-button : value =" 2" >二级推广人</el-radio-button >
17
17
</el-radio-group >
18
18
</el-form-item >
19
19
<el-form-item label =" 状态" prop =" status" >
20
20
<el-select
21
21
v-model =" queryParams.status"
22
- placeholder =" 请选择状态"
23
- clearable
24
22
class =" !w-240px"
23
+ clearable
24
+ placeholder =" 请选择状态"
25
25
>
26
26
<el-option
27
27
v-for =" dict in getIntDictOptions(DICT_TYPE.BROKERAGE_RECORD_STATUS)"
34
34
<el-form-item label =" 绑定时间" prop =" createTime" >
35
35
<el-date-picker
36
36
v-model =" queryParams.createTime"
37
- value-format =" YYYY-MM-DD HH:mm:ss"
38
- type =" daterange"
39
- start-placeholder =" 开始日期"
40
- end-placeholder =" 结束日期"
41
37
:default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')]"
42
38
class =" !w-240px"
39
+ end-placeholder =" 结束日期"
40
+ start-placeholder =" 开始日期"
41
+ type =" daterange"
42
+ value-format =" YYYY-MM-DD HH:mm:ss"
43
43
/>
44
44
</el-form-item >
45
45
<el-form-item >
46
- <el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
47
- <el-button @click =" resetQuery" ><Icon icon =" ep:refresh" class =" mr-5px" /> 重置</el-button >
46
+ <el-button @click =" handleQuery" >
47
+ <Icon class =" mr-5px" icon =" ep:search" />
48
+ 搜索
49
+ </el-button >
50
+ <el-button @click =" resetQuery" >
51
+ <Icon class =" mr-5px" icon =" ep:refresh" />
52
+ 重置
53
+ </el-button >
48
54
</el-form-item >
49
55
</el-form >
50
56
</ContentWrap >
51
57
52
58
<!-- 列表 -->
53
59
<ContentWrap >
54
- <el-table v-loading =" loading" :data =" list" :stripe =" true" :show-overflow-tooltip =" true" >
55
- <el-table-column label = " 订单编号 " align =" center" prop = " bizId " min-width =" 80px" />
56
- <el-table-column label = " 用户编号 " align =" center" prop = " sourceUserId " min-width =" 80px" />
57
- <el-table-column label = " 头像 " align = " center " prop =" sourceUserAvatar" width =" 70px" >
60
+ <el-table v-loading =" loading" :data =" list" :show-overflow-tooltip =" true" :stripe =" true" >
61
+ <el-table-column align =" center" label = " 订单编号 " min-width =" 80px" prop = " bizId " />
62
+ <el-table-column align =" center" label = " 用户编号 " min-width =" 80px" prop = " sourceUserId " />
63
+ <el-table-column align = " center " label = " 头像 " prop =" sourceUserAvatar" width =" 70px" >
58
64
<template #default =" scope " >
59
65
<el-avatar :src =" scope.row.sourceUserAvatar" />
60
66
</template >
61
67
</el-table-column >
62
- <el-table-column label = " 昵称 " align =" center" prop = " sourceUserNickname " min-width =" 80px" />
68
+ <el-table-column align =" center" label = " 昵称 " min-width =" 80px" prop = " sourceUserNickname " />
63
69
<el-table-column
64
- label = " 佣金 "
70
+ :formatter = " fenToYuanFormat "
65
71
align =" center"
66
- prop = " price "
72
+ label = " 佣金 "
67
73
min-width =" 100px"
68
- :formatter = " fenToYuanFormat "
74
+ prop = " price "
69
75
/>
70
- <el-table-column label = " 状态 " align =" center" prop = " status " min-width =" 85" >
76
+ <el-table-column align =" center" label = " 状态 " min-width =" 85" prop = " status " >
71
77
<template #default =" scope " >
72
78
<dict-tag :type =" DICT_TYPE.BROKERAGE_RECORD_STATUS" :value =" scope.row.status" />
73
79
</template >
74
80
</el-table-column >
75
81
<el-table-column
76
- label = " 创建时间 "
82
+ :formatter = " dateFormatter "
77
83
align =" center"
84
+ label =" 创建时间"
78
85
prop =" createTime"
79
- :formatter =" dateFormatter"
80
86
width =" 180px"
81
87
/>
82
88
</el-table >
83
89
<!-- 分页 -->
84
90
<Pagination
85
- :total =" total"
86
- v-model:page =" queryParams.pageNo"
87
91
v-model:limit =" queryParams.pageSize"
92
+ v-model:page =" queryParams.pageNo"
93
+ :total =" total"
88
94
@pagination =" getList"
89
95
/>
90
96
</ContentWrap >
91
97
</Dialog >
92
98
</template >
93
99
94
- <script setup lang="ts">
100
+ <script lang="ts" setup >
95
101
import { dateFormatter } from ' @/utils/formatTime'
96
102
import * as BrokerageRecordApi from ' @/api/mall/trade/brokerage/record'
97
103
import { BrokerageRecordBizTypeEnum } from ' @/utils/constants'
@@ -101,8 +107,6 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
101
107
/** 推广订单列表 */
102
108
defineOptions ({ name: ' BrokerageOrderListDialog' })
103
109
104
- const message = useMessage () // 消息弹窗
105
-
106
110
const loading = ref (true ) // 列表的加载中
107
111
const total = ref (0 ) // 列表的总页数
108
112
const list = ref ([]) // 列表的数据
@@ -111,7 +115,7 @@ const queryParams = reactive({
111
115
pageSize: 10 ,
112
116
userId: null ,
113
117
bizType: BrokerageRecordBizTypeEnum .ORDER .type ,
114
- level: ' ' ,
118
+ sourceUserLevel: 0 ,
115
119
createTime: [],
116
120
status: null
117
121
})
@@ -130,7 +134,12 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
130
134
const getList = async () => {
131
135
loading .value = true
132
136
try {
133
- const data = await BrokerageRecordApi .getBrokerageRecordPage (queryParams )
137
+ // 处理全部的情况
138
+ const userLevel = queryParams .sourceUserLevel === 0 ? undefined : queryParams .sourceUserLevel
139
+ const data = await BrokerageRecordApi .getBrokerageRecordPage ({
140
+ ... queryParams ,
141
+ sourceUserLevel: userLevel
142
+ })
134
143
list .value = data .list
135
144
total .value = data .total
136
145
} finally {
0 commit comments