fix(invitation): 修复邀请关系手机号与邀请码筛选并预加载统计
This commit is contained in:
@@ -42,6 +42,13 @@ export interface AdminRebateRow {
|
||||
}
|
||||
|
||||
export interface AdminInvitationQuery {
|
||||
phone?: string
|
||||
invite_code?: string
|
||||
inviter_phone?: string
|
||||
invitee_phone?: string
|
||||
order_no?: string
|
||||
trade_role?: string
|
||||
distribution_site_id?: number
|
||||
inviter_id?: number
|
||||
invitee_id?: number
|
||||
page?: number
|
||||
|
||||
@@ -55,9 +55,9 @@ const rebateQuery = reactive({
|
||||
const rebates = ref<any[]>([])
|
||||
const rebatesTotal = ref(0)
|
||||
|
||||
onMounted(async () => {
|
||||
await loadSites()
|
||||
await loadConfig()
|
||||
onMounted(() => {
|
||||
// 三个页签的数据一起预加载,避免邀请关系/返利流水标签在首次进入时显示 0。
|
||||
void Promise.all([loadSites(), loadConfig(), loadInvitations(), loadRebates()])
|
||||
})
|
||||
|
||||
async function loadSites() {
|
||||
@@ -169,6 +169,16 @@ function handleTabChange(tab: 'config' | 'invitations' | 'rebates') {
|
||||
}
|
||||
}
|
||||
|
||||
function searchInvitations() {
|
||||
invitationQuery.page = 1
|
||||
void loadInvitations()
|
||||
}
|
||||
|
||||
function searchRebates() {
|
||||
rebateQuery.page = 1
|
||||
void loadRebates()
|
||||
}
|
||||
|
||||
function cycleLabel(cycle: string) {
|
||||
switch (cycle) {
|
||||
case 'first_month':
|
||||
@@ -295,20 +305,20 @@ function cycleLabel(cycle: string) {
|
||||
<div class="filter-bar">
|
||||
<el-input
|
||||
v-model="invitationQuery.phone"
|
||||
placeholder="搜索手机号"
|
||||
placeholder="邀请人/被邀请人手机号"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
@keyup.enter="loadInvitations"
|
||||
style="width: 210px"
|
||||
@keyup.enter="searchInvitations"
|
||||
/>
|
||||
<el-input
|
||||
v-model="invitationQuery.invite_code"
|
||||
placeholder="搜索邀请码"
|
||||
placeholder="邀请码(支持模糊搜索)"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter="loadInvitations"
|
||||
style="width: 180px"
|
||||
@keyup.enter="searchInvitations"
|
||||
/>
|
||||
<el-button type="primary" :icon="Search" @click="loadInvitations">查询</el-button>
|
||||
<el-button :icon="Refresh" @click="loadInvitations">刷新</el-button>
|
||||
<el-button type="primary" :icon="Search" @click="searchInvitations">查询</el-button>
|
||||
<el-button :icon="Refresh" @click="searchInvitations">刷新</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
@@ -374,24 +384,24 @@ function cycleLabel(cycle: string) {
|
||||
placeholder="订单号"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
@keyup.enter="loadRebates"
|
||||
@keyup.enter="searchRebates"
|
||||
/>
|
||||
<el-input
|
||||
v-model="rebateQuery.inviter_phone"
|
||||
placeholder="邀请人手机号"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter="loadRebates"
|
||||
@keyup.enter="searchRebates"
|
||||
/>
|
||||
<el-input
|
||||
v-model="rebateQuery.invitee_phone"
|
||||
placeholder="被邀请人手机号"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
@keyup.enter="loadRebates"
|
||||
@keyup.enter="searchRebates"
|
||||
/>
|
||||
<el-button type="primary" :icon="Search" @click="loadRebates">查询</el-button>
|
||||
<el-button :icon="Refresh" @click="loadRebates">刷新</el-button>
|
||||
<el-button type="primary" :icon="Search" @click="searchRebates">查询</el-button>
|
||||
<el-button :icon="Refresh" @click="searchRebates">刷新</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
|
||||
Reference in New Issue
Block a user