trade: 分销业务后台功能:推广订单列表
This commit is contained in:
parent
2aa372d8f4
commit
0582d41972
@ -316,3 +316,16 @@ export const BrokerageUserTypeEnum = {
|
||||
name: '二级推广人'
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 佣金记录业务类型枚举
|
||||
*/
|
||||
export const BrokerageRecordBizTypeEnum = {
|
||||
ORDER: {
|
||||
type: 1,
|
||||
name: '获得推广佣金'
|
||||
},
|
||||
WITHDRAW: {
|
||||
type: 2,
|
||||
name: '提现申请'
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,12 @@
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="编号" align="center" prop="id" min-width="60" />
|
||||
<el-table-column label="用户编号" align="center" prop="userId" min-width="80" />
|
||||
<el-table-column label="头像" align="center" prop="userAvatar" width="70px">
|
||||
<template #default="scope">
|
||||
<el-avatar :src="scope.row.userAvatar" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" align="center" prop="userNickname" min-width="80px" />
|
||||
<el-table-column label="业务类型" align="center" prop="bizType" min-width="85">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.BROKERAGE_RECORD_BIZ_TYPE" :value="scope.row.bizType" />
|
||||
|
155
src/views/mall/trade/brokerage/user/BrokerageOrderListDialog.vue
Normal file
155
src/views/mall/trade/brokerage/user/BrokerageOrderListDialog.vue
Normal file
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" title="推广人列表" width="75%">
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="85px"
|
||||
>
|
||||
<el-form-item label="用户类型" prop="userType">
|
||||
<el-radio-group v-model="queryParams.userType" @change="handleQuery">
|
||||
<el-radio-button
|
||||
v-for="item in BrokerageUserTypeEnum"
|
||||
:key="item.type"
|
||||
:label="item.type"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.BROKERAGE_RECORD_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="订单编号" align="center" prop="bizId" min-width="80px" />
|
||||
<el-table-column label="用户编号" align="center" prop="sourceUserId" min-width="80px" />
|
||||
<el-table-column label="头像" align="center" prop="sourceUserAvatar" width="70px">
|
||||
<template #default="scope">
|
||||
<el-avatar :src="scope.row.sourceUserAvatar" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" align="center" prop="sourceUserNickname" min-width="80px" />
|
||||
<el-table-column
|
||||
label="佣金"
|
||||
align="center"
|
||||
prop="price"
|
||||
min-width="100px"
|
||||
:formatter="fenToYuanFormat"
|
||||
/>
|
||||
<el-table-column label="状态" align="center" prop="status" min-width="85">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.BROKERAGE_RECORD_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="170px"
|
||||
/>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as BrokerageRecordApi from '@/api/mall/trade/brokerage/record'
|
||||
import { BrokerageRecordBizTypeEnum, BrokerageUserTypeEnum } from '@/utils/constants'
|
||||
import { fenToYuanFormat } from '@/utils/formatter'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
|
||||
/** 推广订单列表 */
|
||||
defineOptions({ name: 'BrokerageOrderListDialog' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
bizType: BrokerageRecordBizTypeEnum.ORDER.type,
|
||||
userType: BrokerageUserTypeEnum.ALL.type,
|
||||
createTime: []
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
/** 打开弹窗 */
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const open = async (userId: number) => {
|
||||
dialogVisible.value = true
|
||||
queryParams.userId = userId
|
||||
resetQuery()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await BrokerageRecordApi.getBrokerageRecordPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
</script>
|
@ -18,9 +18,6 @@
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio-button>
|
||||
<!-- <el-radio-button :label="0">全部</el-radio-button>-->
|
||||
<!-- <el-radio-button :label="1">一级推广人</el-radio-button>-->
|
||||
<!-- <el-radio-button :label="2">二级推广人</el-radio-button>-->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="绑定时间" prop="bindUserTime">
|
||||
|
@ -183,7 +183,10 @@
|
||||
</ContentWrap>
|
||||
<!-- 修改上级推广人表单 -->
|
||||
<UpdateBindUserForm ref="updateBindUserFormRef" @success="getList" />
|
||||
<!-- 推广人列表 -->
|
||||
<BrokerageUserListDialog ref="brokerageUserListDialogRef" />
|
||||
<!-- 推广订单列表 -->
|
||||
<BrokerageOrderListDialog ref="brokerageOrderListDialogRef" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -193,6 +196,7 @@ import { checkPermi } from '@/utils/permission'
|
||||
import { fenToYuanFormat } from '@/utils/formatter'
|
||||
import UpdateBindUserForm from '@/views/mall/trade/brokerage/user/UpdateBindUserForm.vue'
|
||||
import BrokerageUserListDialog from '@/views/mall/trade/brokerage/user/BrokerageUserListDialog.vue'
|
||||
import BrokerageOrderListDialog from '@/views/mall/trade/brokerage/user/BrokerageOrderListDialog.vue'
|
||||
|
||||
defineOptions({ name: 'TradeBrokerageUser' })
|
||||
|
||||
@ -258,7 +262,10 @@ const openBrokerageUserTable = (id: number) => {
|
||||
}
|
||||
|
||||
/** 打开推广订单列表 */
|
||||
const openBrokerageOrderTable = (id: number) => {}
|
||||
const brokerageOrderListDialogRef = ref()
|
||||
const openBrokerageOrderTable = (id: number) => {
|
||||
brokerageOrderListDialogRef.value.open(id)
|
||||
}
|
||||
|
||||
/** 打开表单:修改上级推广人 */
|
||||
const updateBindUserFormRef = ref()
|
||||
|
Loading…
Reference in New Issue
Block a user