完善分销功能
This commit is contained in:
parent
0cafd8651b
commit
2d35ab3b7d
|
|
@ -666,6 +666,80 @@ export function distributionCashPay(data) {
|
|||
});
|
||||
}
|
||||
|
||||
// 分销-分销员:添加分销员
|
||||
export function distributionUser(data, method = 'post') {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/distribution/user`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 分销员:分销员列表 下级用户列表
|
||||
export function distributionUserPage(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/distribution/user`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 分销员:开通记录
|
||||
export function distributionOpenFlow(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/distribution/openFlow`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 分销员:分销明细
|
||||
export function distributionFlowGet(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/distribution/distributionFlow`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 分销员:用户提现列表
|
||||
export function distributionWithdrawFlow(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/distribution/withdrawFlow`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 分销员:充值二维码获取
|
||||
export function distributionRechargeQrCode(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/distribution/rechargeQrCode`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 店铺列表, 只允许管理员调用
|
||||
export function shopInfoList(params) {
|
||||
return request({
|
||||
url: `${Account_BaseUrl}/admin/shopInfo`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 分销, 金额记录
|
||||
export function distributionShopFlow(params) {
|
||||
return request({
|
||||
url: `${Market_BaseUrl}/admin/distribution/flow`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
|
|
@ -0,0 +1,111 @@
|
|||
<!-- 增加或者减少余额弹窗 -->
|
||||
<template>
|
||||
<el-dialog :title="`余额${form.type == 1 ? '增加' : '扣减'}`" width="400px" v-model="visible" @closed="onClose">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px" label-position="left">
|
||||
<el-form-item label="店铺名称">
|
||||
<el-input v-model="row.shopName" readonly style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="`${form.type == 1 ? '充值' : '扣减'}金额`" prop="expense">
|
||||
<el-input v-model="form.expense" placeholder="请输入金额" style="width: 300px;"
|
||||
@input="e => form.expense = filterNumberInput(e)">
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
<div>当前余额:<span style="color: red;">{{ multiplyAndFormat(row.amount) }}</span></div>
|
||||
</el-form-item>
|
||||
<el-form-item label="扣减原因" v-if="form.type == 2" prop="reason">
|
||||
<el-input type="textarea" :rows="5" v-model="form.reason" placeholder="请输入扣减原因,必填 "></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitHandle" :loading="loading">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { distributionCashPay } from '@/api/coupon'
|
||||
import { ElNotification } from 'element-plus'
|
||||
import { multiplyAndFormat, filterNumberInput } from '@/utils'
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
const loading = ref(false)
|
||||
const formRef = ref(null)
|
||||
const row = ref({
|
||||
shopName: '',
|
||||
money: 0
|
||||
})
|
||||
const form = ref({
|
||||
expense: '',
|
||||
type: 1,
|
||||
reason: ''
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
expense: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入充值金额',
|
||||
triiger: 'blur'
|
||||
}
|
||||
],
|
||||
reason: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入扣减原因',
|
||||
triiger: 'blur'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
function onClose() {
|
||||
form.value = {
|
||||
expense: '',
|
||||
type: 1,
|
||||
reason: ''
|
||||
}
|
||||
formRef.value.resetFields()
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
function submitHandle() {
|
||||
formRef.value.validate(async (valid) => {
|
||||
try {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
await distributionCashPay({
|
||||
shopId: row.value.id,
|
||||
amount: form.value.type == 1 ? form.value.expense : form.value.expense * -1,
|
||||
remark: form.value.reason
|
||||
})
|
||||
emit('success')
|
||||
visible.value = false
|
||||
|
||||
ElNotification({
|
||||
title: '注意',
|
||||
message: `${form.value.type == 1 ? '增加' : '扣减'}成功`,
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 显示
|
||||
function show(obj = {}, type = 1) {
|
||||
visible.value = true
|
||||
row.value = { ...obj }
|
||||
form.value.type = type
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
<!-- 充值记录 -->
|
||||
<template>
|
||||
<el-dialog :title="`记录(${tableRow.shopName})`" width="1200px" v-model="visible">
|
||||
<el-form label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="至" start-placeholder="开始日期时间"
|
||||
end-placeholder="结束日期时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
@change="timeChange" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryForm.type" placeholder="类型" style="width: 200px;">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in statusList" :key="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" :loading="tableData.loading" @click="searchHandle">搜索</el-button>
|
||||
<el-button icon="Refresh" :loading="tableData.loading" @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="row">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading" height="500px">
|
||||
<el-table-column label="类型">
|
||||
<template #default="scope">
|
||||
{{statusList.find(item => item.value === scope.row.type).label}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动金额" prop="expense">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.changeAmount || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动后金额" prop="balance">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.amount || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动原因" prop="remark"></el-table-column>
|
||||
<el-table-column label="关联账单" prop="orderNo"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
:page-sizes="[10, 20, 50, 100]" background layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { distributionShopFlow } from '@/api/coupon'
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
const statusList = ref([
|
||||
{
|
||||
value: '',
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 'manual_recharge',
|
||||
label: '增加'
|
||||
},
|
||||
{
|
||||
value: 'manual_sub',
|
||||
label: '减少'
|
||||
},
|
||||
{
|
||||
value: 'self_recharge',
|
||||
label: '自助充值'
|
||||
},
|
||||
{
|
||||
value: 'refund',
|
||||
label: '退款'
|
||||
},
|
||||
{
|
||||
value: 'sub',
|
||||
label: '系统扣减'
|
||||
}
|
||||
])
|
||||
const dateRange = ref([])
|
||||
const resetQueryForm = ref({
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
type: '',
|
||||
})
|
||||
const queryForm = ref({ ...resetQueryForm.value })
|
||||
|
||||
function searchHandle() {
|
||||
tableData.page = 1
|
||||
getTableData()
|
||||
}
|
||||
|
||||
function resetHandle() {
|
||||
dateRange.value = []
|
||||
queryForm.value = { ...resetQueryForm.value }
|
||||
searchHandle()
|
||||
}
|
||||
|
||||
const tableData = reactive({
|
||||
loading: false,
|
||||
list: [],
|
||||
total: 0,
|
||||
page: 1,
|
||||
size: 10
|
||||
})
|
||||
|
||||
// 选择时间
|
||||
function timeChange(e) {
|
||||
if (e == null) {
|
||||
queryForm.value.startTime = ''
|
||||
queryForm.value.endTime = ''
|
||||
} else {
|
||||
queryForm.value.startTime = e[0]
|
||||
queryForm.value.endTime = e[1]
|
||||
}
|
||||
tableData.page = 1
|
||||
// getTableData()
|
||||
}
|
||||
|
||||
// 分页大小发生变化
|
||||
function handleSizeChange(e) {
|
||||
tableData.pageSize = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
// 分页发生变化
|
||||
function handleCurrentChange(e) {
|
||||
tableData.page = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
async function getTableData() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
const res = await distributionShopFlow({
|
||||
shopId: tableRow.value.id,
|
||||
page: tableData.page,
|
||||
size: tableData.size,
|
||||
...queryForm.value
|
||||
})
|
||||
tableData.list = res.records
|
||||
tableData.total = +res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
const tableRow = ref('')
|
||||
function show(row) {
|
||||
dateRange.value = []
|
||||
queryForm.value = { ...resetQueryForm.value }
|
||||
tableRow.value = { ...row }
|
||||
visible.value = true
|
||||
getTableData()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.row {
|
||||
padding-top: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
<!-- 分销 商家充值 -->
|
||||
<template>
|
||||
<div class="gyq_container">
|
||||
<div class="gyq_content">
|
||||
<div class="row">
|
||||
<div class="center">
|
||||
<el-input v-model="searchValue" style="width: 300px;" placeholder="请输入内容" clearable @clear="getTableData">
|
||||
<template #prepend>名称</template>
|
||||
</el-input>
|
||||
<el-button type="primary" @click="searchHandle">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading">
|
||||
<el-table-column prop="name" label="店铺名称" width="300">
|
||||
<template #default="scope">
|
||||
<div class="shop_info">
|
||||
<el-avatar :src="scope.row.logo" shape="square" :size="50"></el-avatar>
|
||||
<div class="info">
|
||||
<div class="name">
|
||||
{{ scope.row.shopName }}
|
||||
</div>
|
||||
<div class="tag">
|
||||
<el-tag effect="dark" type="success" disable-transitions
|
||||
v-if="scope.row.profiles == 'release'">正式</el-tag>
|
||||
<el-tag effect="dark" type="warning" disable-transitions
|
||||
v-if="scope.row.profiles == 'trial'">试用版</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="店铺类型">
|
||||
<template #default="scope">
|
||||
<div class="column">
|
||||
<div>{{shopTypeList.find(item => item.value == scope.row.shopType).label}}</div>
|
||||
<div v-if="scope.row.shopType == 'join' && scope.row.isHeadShop === 0">(主店:{{ scope.row.headShopName }})
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="money" label="可用余额">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.amount || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="addBlanceRef.show(scope.row, 1)">充值</el-button>
|
||||
<el-button link type="primary" @click="addBlanceRef.show(scope.row, 2)">扣减</el-button>
|
||||
<el-button link type="primary" @click="recordRef.show(scope.row)">查看记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
:page-sizes="[10, 20, 50, 100]" background layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
<addBlance ref="addBlanceRef" @success="getTableData" />
|
||||
<record ref="recordRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { shopInfoList } from '@/api/coupon'
|
||||
import addBlance from '../components/addBlance.vue'
|
||||
import record from '../components/record.vue'
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
|
||||
const addBlanceRef = ref(null)
|
||||
const recordRef = ref(null)
|
||||
|
||||
const searchValue = ref('')
|
||||
|
||||
function searchHandle() {
|
||||
tableData.page = 1
|
||||
getTableData()
|
||||
}
|
||||
|
||||
const shopTypeList = ref([
|
||||
{
|
||||
value: 'only',
|
||||
label: '单店'
|
||||
},
|
||||
{
|
||||
value: 'chain',
|
||||
label: '连锁店'
|
||||
},
|
||||
{
|
||||
value: 'join',
|
||||
label: '加盟店'
|
||||
},
|
||||
])
|
||||
|
||||
const tableData = reactive({
|
||||
loading: false,
|
||||
list: [],
|
||||
total: 0,
|
||||
page: 1,
|
||||
size: 10
|
||||
})
|
||||
|
||||
// 分页大小发生变化
|
||||
function handleSizeChange(e) {
|
||||
tableData.pageSize = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
// 分页发生变化
|
||||
function handleCurrentChange(e) {
|
||||
tableData.page = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
// 店铺列表
|
||||
async function getTableData() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
const res = await shopInfoList({
|
||||
page: tableData.page,
|
||||
size: tableData.size,
|
||||
shopName: searchValue.value
|
||||
})
|
||||
tableData.list = res.records
|
||||
tableData.total = +res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.gyq_container {
|
||||
padding: 14px;
|
||||
|
||||
.gyq_content {
|
||||
padding: 14px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.row {
|
||||
&.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.info {
|
||||
padding-left: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.name {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,241 @@
|
|||
<!-- 用户提现记录 -->
|
||||
<template>
|
||||
<div class="gyq_container">
|
||||
<div class="gyq_content">
|
||||
<div class="title">用户提现记录</div>
|
||||
<div class="row" style="margin-top: 34px;">
|
||||
<el-form inline>
|
||||
<el-form-item>
|
||||
<el-date-picker style="width: 300px" v-model="times" type="daterange" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD"
|
||||
@change="selectTimeChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<selectUser v-model="queryForm.userId" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" :loading="tableData.loading" @click="searchHandle">搜索</el-button>
|
||||
<el-button icon="Refresh" :loading="tableData.loading" @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="info_wrap">
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
<img class="img" src="@/assets/fenxiao/9.png">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div>提现中</div>
|
||||
<div>{{ multiplyAndFormat(pending || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
<img class="img" src="@/assets/fenxiao/10.png">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div>成功提现</div>
|
||||
<div>{{ multiplyAndFormat(finish || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading" height="48vh">
|
||||
<el-table-column label="用户" prop="nickName" width="200">
|
||||
<template #default="scope">
|
||||
<div class="column">
|
||||
<div>{{ scope.row.nickName }}</div>
|
||||
<div>{{ scope.row.phone }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提现金额(元)" prop="amount" width="200">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat((scope.row.amount + scope.row.serviceFee) || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手续费(元)" prop="serviceFee">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.serviceFee || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实际到账(元)" prop="amount">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.amount || 0) }}
|
||||
</template></el-table-column>
|
||||
<el-table-column label="提现时间" prop="createTime"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template #default="scope">
|
||||
<el-tag disable-transitions :type="statusList.find(item => item.value == scope.row.status).type">
|
||||
{{statusList.find(item => item.value == scope.row.status).label}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
:page-sizes="[10, 20, 50, 100, 500]" background layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from 'dayjs';
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import selectUser from '@/views/marketing_center/components/selectUser.vue';
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
import { distributionWithdrawFlow } from '@/api/coupon'
|
||||
|
||||
const pending = ref(0)
|
||||
const finish = ref(0)
|
||||
const statusList = ref([
|
||||
{
|
||||
value: 'pending',
|
||||
label: '提现中',
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
value: 'success',
|
||||
label: '可提现',
|
||||
type: 'success'
|
||||
},
|
||||
{
|
||||
value: 'finish',
|
||||
label: '已完成',
|
||||
type: 'info'
|
||||
}
|
||||
])
|
||||
|
||||
const queryForm = ref({
|
||||
userId: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
})
|
||||
|
||||
function searchHandle() {
|
||||
tableData.page = 1;
|
||||
getTableData()
|
||||
}
|
||||
|
||||
function resetHandle() {
|
||||
queryForm.value.userId = ''
|
||||
queryForm.value.startTime = ''
|
||||
queryForm.value.endTime = ''
|
||||
times.value = []
|
||||
searchHandle()
|
||||
}
|
||||
|
||||
const tableData = reactive({
|
||||
loading: false,
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
list: []
|
||||
})
|
||||
|
||||
// 选择日期
|
||||
const times = ref([])
|
||||
function selectTimeChange(e) {
|
||||
queryForm.value.startTime = dayjs(e[0]).format('YYYY-MM-DD 00:00:00')
|
||||
queryForm.value.endTime = dayjs(e[1]).format('YYYY-MM-DD 23:59:59')
|
||||
}
|
||||
|
||||
// 分页大小发生变化
|
||||
function handleSizeChange(e) {
|
||||
tableData.size = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
// 分页发生变化
|
||||
function handleCurrentChange(e) {
|
||||
tableData.page = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
async function getTableData() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
const res = await distributionWithdrawFlow({
|
||||
...queryForm.value,
|
||||
page: tableData.page,
|
||||
size: tableData.size
|
||||
})
|
||||
tableData.list = res.records
|
||||
tableData.total = res.totalRow
|
||||
pending.value = res.pending
|
||||
finish.value = res.finish
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.title {
|
||||
padding: 10px 0 20px 0;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #ececec;
|
||||
}
|
||||
|
||||
.gyq_container {
|
||||
padding: 14px;
|
||||
|
||||
.gyq_content {
|
||||
padding: 14px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
&.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.info_wrap {
|
||||
display: flex;
|
||||
gap: 48px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #D9D9D9;
|
||||
border-radius: 8px;
|
||||
padding: 0 10px;
|
||||
|
||||
.icon {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!-- 下拉选择用户,可远程搜索 -->
|
||||
<template>
|
||||
<el-select :model-value="modelValue" placeholder="用户昵称/用户ID/用户手机" filterable remote reserve-keyword
|
||||
:remote-method="remoteMethod" :loading="loading" @change="$emit('update:modelValue', $event)">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.nickName" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import _ from "lodash";
|
||||
import { ref } from 'vue'
|
||||
import { getShopUserList } from '@/api/coupon'
|
||||
|
||||
const loading = ref(false);
|
||||
const options = ref([]);
|
||||
|
||||
const emits = defineEmits(['update:modelValue'])
|
||||
|
||||
const userId = defineModel('modelValue', {
|
||||
type: [String, Number],
|
||||
required: false
|
||||
})
|
||||
|
||||
// 远程搜索用户列表
|
||||
const remoteMethod = _.debounce(async function (query) {
|
||||
try {
|
||||
if (query) {
|
||||
loading.value = true;
|
||||
const res = await getShopUserList({
|
||||
key: query,
|
||||
page: 1,
|
||||
size: 100,
|
||||
});
|
||||
options.value = res.records;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
loading.value = false;
|
||||
}, 200);
|
||||
</script>
|
||||
|
|
@ -22,7 +22,7 @@ const props = defineProps({
|
|||
}
|
||||
})
|
||||
|
||||
const emits = defineEmits(['update:modelValue'])
|
||||
const emits = defineEmits(['update:modelValue', 'change'])
|
||||
|
||||
const modelValue = defineModel('modelValue', {
|
||||
type: [String, Number],
|
||||
|
|
@ -40,6 +40,8 @@ function changeHandle(index) {
|
|||
}
|
||||
})
|
||||
leftValue.value = left + gap.value * index
|
||||
|
||||
emits('change', index)
|
||||
}
|
||||
|
||||
const itemRefs = ref([])
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
<div class="info">
|
||||
<div>支付开通人数</div>
|
||||
<div>90000</div>
|
||||
<div>{{ multiplyAndFormat(totalCount || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
<div class="info">
|
||||
<div>已支付金额(元)</div>
|
||||
<div>99.99</div>
|
||||
<div>{{ multiplyAndFormat(totalAmount || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -31,20 +31,27 @@
|
|||
@change="selectTimeChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input placeholder="请输入用户ID/昵称" style="width: 200px;"></el-input>
|
||||
<selectUser v-model="queryForm.key" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="searchHandle">搜索</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button type="primary" icon="Search" :loading="tableData.loading" @click="searchHandle">搜索</el-button>
|
||||
<el-button icon="Refresh" :loading="tableData.loading" @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading">
|
||||
<el-table-column label="订单号" prop="id" width="200"></el-table-column>
|
||||
<el-table-column label="用户" prop="nickName" width="200"></el-table-column>
|
||||
<el-table-column label="支付金额" prop="nickName"></el-table-column>
|
||||
<el-table-column label="支付时间" prop="nickName"></el-table-column>
|
||||
<el-table-column label="订单号" prop="orderNo" width="200"></el-table-column>
|
||||
<el-table-column label="用户" prop="nickName" width="200">
|
||||
<template #default="scope">
|
||||
<div class="column">
|
||||
<div>{{ scope.row.nickName }}</div>
|
||||
<div>{{ scope.row.opAccount }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付金额" prop="amount"></el-table-column>
|
||||
<el-table-column label="支付时间" prop="createTime"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
|
|
@ -57,9 +64,15 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { distributionOpenFlow } from '@/api/coupon'
|
||||
import selectUser from '../../components/selectUser.vue';
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
|
||||
const totalCount = ref(0)
|
||||
const totalAmount = ref(0)
|
||||
|
||||
const queryForm = ref({
|
||||
user: '',
|
||||
key: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
})
|
||||
|
|
@ -70,11 +83,10 @@ function searchHandle() {
|
|||
}
|
||||
|
||||
function resetHandle() {
|
||||
queryForm.value.user = ''
|
||||
queryForm.value.key = ''
|
||||
queryForm.value.startTime = ''
|
||||
queryForm.value.startTime = ''
|
||||
times.value = []
|
||||
|
||||
searchHandle()
|
||||
}
|
||||
|
||||
|
|
@ -107,10 +119,20 @@ function handleCurrentChange(e) {
|
|||
|
||||
async function getTableData() {
|
||||
try {
|
||||
|
||||
tableData.loading = true
|
||||
const res = await distributionOpenFlow({
|
||||
...queryForm.value,
|
||||
page: tableData.page,
|
||||
size: tableData.size
|
||||
})
|
||||
tableData.list = res.records
|
||||
tableData.total = res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -152,4 +174,9 @@ onMounted(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
<!-- 添加分销员 -->
|
||||
<template>
|
||||
<el-dialog title="添加分销员" width="1000px" v-model="visible" @closed="resetHandle">
|
||||
<div class="row">
|
||||
<el-form inline :model="queryForm">
|
||||
<el-form-item>
|
||||
<el-select v-model="queryForm.isVip" style="width: 200px;">
|
||||
<el-option v-for="item in vipList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="queryForm.key" placeholder="请输入昵称/手机号" style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" :loading="tableData.loading" @click="searchHandle">搜索</el-button>
|
||||
<el-button icon="Refresh" :loading="tableData.loading" @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading" height="400px" @select="tabSelect">
|
||||
<!-- <el-table-column type="selection"></el-table-column> -->
|
||||
<el-table-column label="ID" prop="id"></el-table-column>
|
||||
<el-table-column label="用户" prop="nickName" width="200">
|
||||
<template #default=scope>
|
||||
<div class="center">
|
||||
<el-avatar :src="scope.row.headImg" :size="40"></el-avatar>
|
||||
<span>{{ scope.row.nickName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" prop="sex">
|
||||
<template #default="scope">
|
||||
<el-tag disable-transitions type="primary" v-if="scope.row.sex == 1">男</el-tag>
|
||||
<el-tag disable-transitions type="warning" v-if="scope.row.sex == 0">女</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员" prop="memberName"></el-table-column>
|
||||
<el-table-column label="分销员" prop="distributionShops"></el-table-column>
|
||||
<el-table-column label="手机号" prop="phone" width="150"></el-table-column>
|
||||
<el-table-column label="余额" prop="amount"></el-table-column>
|
||||
<el-table-column label="积分" prop="accountPoints"></el-table-column>
|
||||
<el-table-column label="消费累计" prop="consumeAmount" width="150"></el-table-column>
|
||||
<el-table-column label="消费次数累计" prop="consumeCount" width="150"></el-table-column>
|
||||
<el-table-column label="注册时间" prop="createTime" width="200"></el-table-column>
|
||||
<el-table-column label="操作" width="100" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" :disabled="!!scope.row.isDistribution"
|
||||
@click="selectHandle(scope.row)">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
:page-sizes="[10, 30, 50, 100]" background layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
<!-- <template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitHandle" :loading="confirmLoading">确 定</el-button>
|
||||
</div>
|
||||
</template> -->
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { getShopUserList, distributionUser } from '@/api/coupon'
|
||||
|
||||
const visible = ref(false)
|
||||
const queryForm = reactive({
|
||||
isVip: '',
|
||||
key: ''
|
||||
})
|
||||
|
||||
const vipList = ref([
|
||||
{
|
||||
label: '非会员',
|
||||
value: 0,
|
||||
type: 'info'
|
||||
},
|
||||
{
|
||||
label: '会员',
|
||||
value: 1,
|
||||
type: 'success'
|
||||
}
|
||||
])
|
||||
|
||||
function resetHandle() {
|
||||
queryForm.isVip = ''
|
||||
queryForm.key = ''
|
||||
searchHandle()
|
||||
}
|
||||
|
||||
function searchHandle() {
|
||||
tableData.page = 1
|
||||
getShopUserListAjax()
|
||||
}
|
||||
|
||||
const tableData = reactive({
|
||||
loading: false,
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
list: []
|
||||
})
|
||||
|
||||
const confirmLoading = ref(false)
|
||||
function submitHandle() {
|
||||
|
||||
}
|
||||
|
||||
const selectUser = ref([])
|
||||
function tabSelect(e) {
|
||||
selectUser.value = e
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
async function selectHandle(row) {
|
||||
try {
|
||||
await distributionUser({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
id: row.id,
|
||||
userId: row.userId,
|
||||
openingMethod: '手动添加'
|
||||
})
|
||||
visible.value = false
|
||||
emit('success')
|
||||
ElNotification({
|
||||
title: '注意',
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 分页大小发生变化
|
||||
function handleSizeChange(e) {
|
||||
tableData.pageSize = e;
|
||||
getShopUserListAjax();
|
||||
}
|
||||
|
||||
// 分页发生变化
|
||||
function handleCurrentChange(e) {
|
||||
tableData.page = e;
|
||||
getShopUserListAjax();
|
||||
}
|
||||
|
||||
// 获取店铺用户列表
|
||||
async function getShopUserListAjax() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
const res = await getShopUserList({ ...queryForm, page: tableData.page, size: tableData.size })
|
||||
tableData.list = res.records
|
||||
tableData.total = res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function show() {
|
||||
visible.value = true
|
||||
getShopUserListAjax()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
<!-- 分销员明细 -->
|
||||
<template>
|
||||
<el-dialog title="分销员明细" width="1200px" v-model="visible">
|
||||
<div class="top_info">
|
||||
<div class="user_info">
|
||||
<el-avatar :src="rowInfo.headImg" :size="80" shape="square"></el-avatar>
|
||||
<div class="info">
|
||||
<div class="name">{{ rowInfo.shopUserName }}</div>
|
||||
<div class="phone">{{ rowInfo.shopUserPhone }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info_wrap">
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
<img class="img" src="@/assets/fenxiao/6.png">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div>总收益</div>
|
||||
<div>¥{{ multiplyAndFormat(rowInfo.totalIncome || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
<img class="img" src="@/assets/fenxiao/7.png">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div>待入账</div>
|
||||
<div>¥{{ multiplyAndFormat(rowInfo.pendingIncome || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
<img class="img" src="@/assets/fenxiao/8.png">
|
||||
</div>
|
||||
<div class="info">
|
||||
<div>已入账</div>
|
||||
<div>¥{{ multiplyAndFormat(rowInfo.receivedIncome || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<tabHeader v-model="tabIndex" :list="[{ label: '我的邀请', value: 0 }, { label: '收入明细', value: 1 }]"
|
||||
@change="tabChange" />
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-form :model="querForm" inline>
|
||||
<el-form-item>
|
||||
<selectUser v-model="querForm.userId" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="querForm.distributionLevelId" placeholder="请选择等级" style="width: 200px;">
|
||||
<el-option v-for="item in distributionLevelIdList" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="searchHandle" :loading="tableData.loading" icon="Search">搜索</el-button>
|
||||
<el-button @click="resetHandle" :loading="tableData.loading" icon="Refresh">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading">
|
||||
<el-table-column label="ID" prop="id" v-if="tabIndex == 0" width="80"></el-table-column>
|
||||
<el-table-column label="用户" prop="id">
|
||||
<template #default="scope">
|
||||
<div class="column">
|
||||
<div>{{ scope.row.shopUserName }}</div>
|
||||
<div>{{ scope.row.shopUserPhone }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="等级" prop="distributionLevelName" v-if="tabIndex == 0"></el-table-column>
|
||||
<!-- <el-table-column label="总消费金额(元)" prop="id"></el-table-column> -->
|
||||
<el-table-column label="累计收益(元)" prop="totalIncome" v-if="tabIndex == 0"></el-table-column>
|
||||
<el-table-column label="邀请时间" prop="createTime" v-if="tabIndex == 0"></el-table-column>
|
||||
<el-table-column label="状态" prop="distributionLevelName" v-if="tabIndex == 1"></el-table-column>
|
||||
<el-table-column label="关联订单号" prop="distributionLevelName" v-if="tabIndex == 1"></el-table-column>
|
||||
<el-table-column label="收益(元)" prop="distributionLevelName" v-if="tabIndex == 1"></el-table-column>
|
||||
<el-table-column label="创建时间)" prop="distributionLevelName" v-if="tabIndex == 1"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 14px;">
|
||||
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
:page-sizes="[10, 30, 50, 100]" background layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import tabHeader from '../../components/tabHeader.vue'
|
||||
import selectUser from '../../components/selectUser.vue'
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
import { distributionUserPage, distributionFlowGet, distributionGet } from '@/api/coupon'
|
||||
|
||||
const tabIndex = ref(0)
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
const rowInfo = ref('')
|
||||
|
||||
const querForm = ref({
|
||||
userId: '',
|
||||
distributionLevelId: ''
|
||||
})
|
||||
|
||||
const distributionLevelIdList = ref([])
|
||||
|
||||
function resetHandle() {
|
||||
querForm.value.userId = ''
|
||||
querForm.value.distributionLevelId = ''
|
||||
searchHandle()
|
||||
}
|
||||
|
||||
function searchHandle() {
|
||||
tableData.page = 1
|
||||
getTableData()
|
||||
}
|
||||
|
||||
const tableData = reactive({
|
||||
loading: false,
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
list: []
|
||||
})
|
||||
|
||||
// 分页大小发生变化
|
||||
function handleSizeChange(e) {
|
||||
tableData.size = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
// 分页发生变化
|
||||
function handleCurrentChange(e) {
|
||||
tableData.page = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
function tabChange(e) {
|
||||
getTableData()
|
||||
}
|
||||
|
||||
// 获取表格数据
|
||||
async function getTableData() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
|
||||
let res = ''
|
||||
|
||||
if (tabIndex.value == 0) {
|
||||
res = await distributionUserPage({
|
||||
id: rowInfo.value.id,
|
||||
parentId: rowInfo.value.id,
|
||||
page: tableData.page,
|
||||
size: tableData.size,
|
||||
shopUserId: querForm.value.userId,
|
||||
distributionLevelId: querForm.value.distributionLevelId
|
||||
})
|
||||
} else {
|
||||
res = await distributionFlowGet({
|
||||
id: rowInfo.value.id,
|
||||
parentId: rowInfo.value.id,
|
||||
shopUserId: querForm.value.userId,
|
||||
distributionLevelId: querForm.value.distributionLevelId
|
||||
})
|
||||
}
|
||||
|
||||
tableData.list = res.records
|
||||
tableData.total = res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// 获取等级配置
|
||||
async function distributionGetAjax() {
|
||||
try {
|
||||
const res = await distributionGet()
|
||||
distributionLevelIdList.value = res.levelConfigList
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function show(row) {
|
||||
rowInfo.value = { ...row }
|
||||
visible.value = true
|
||||
getTableData()
|
||||
distributionGetAjax()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.mt14 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.top_info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.user_info {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
.name {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info_wrap {
|
||||
display: flex;
|
||||
gap: 48px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #D9D9D9;
|
||||
border-radius: 8px;
|
||||
padding: 0 10px;
|
||||
|
||||
.icon {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
<div class="info">
|
||||
<div>已入账金额(元)</div>
|
||||
<div>90000</div>
|
||||
<div>{{ multiplyAndFormat(infoObj.balanceAmount || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
<div class="info">
|
||||
<div>待入账金额(元)</div>
|
||||
<div>99.99</div>
|
||||
<div>{{ multiplyAndFormat(infoObj.pendingAmount || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
</div>
|
||||
<div class="info">
|
||||
<div>运营余额(元)</div>
|
||||
<div>99.99</div>
|
||||
<div>{{ multiplyAndFormat(infoObj.successAmount || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -40,17 +40,17 @@
|
|||
@change="selectTimeChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input placeholder="请输入用户ID/昵称" style="width: 200px;"></el-input>
|
||||
<selectUser v-model="queryForm.key" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div class="between">
|
||||
<div class="center">
|
||||
<el-button type="primary" @click="searchHandle">搜索</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button type="primary" icon="Search" :loading="tableData.loading" @click="searchHandle">搜索</el-button>
|
||||
<el-button icon="Refresh" :loading="tableData.loading" @click="resetHandle">重置</el-button>
|
||||
</div>
|
||||
<div class="center">
|
||||
<el-button type="primary" @click="rechargeDialogRef.show()">充值</el-button>
|
||||
<el-button type="primary" plain>查看记录</el-button>
|
||||
<el-button type="primary" plain @click="rechargeRecordDialogRef.show()">查看记录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
|
@ -58,13 +58,13 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading">
|
||||
<el-table-column label="分销员" prop="id" width="200"></el-table-column>
|
||||
<el-table-column label="用户" prop="nickName" width="200"></el-table-column>
|
||||
<el-table-column label="等级" prop="nickName"></el-table-column>
|
||||
<el-table-column label="状态" prop="nickName"></el-table-column>
|
||||
<el-table-column label="关联订单号" prop="nickName"></el-table-column>
|
||||
<el-table-column label="总收益(元)" prop="nickName"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="nickName"></el-table-column>
|
||||
<el-table-column label="分销员" prop="nickName" width="200"></el-table-column>
|
||||
<el-table-column label="用户" prop="sourceNickName" width="200"></el-table-column>
|
||||
<el-table-column label="等级" prop="level"></el-table-column>
|
||||
<el-table-column label="状态" prop="status"></el-table-column>
|
||||
<el-table-column label="关联订单号" prop="orderNo"></el-table-column>
|
||||
<el-table-column label="总收益(元)" prop="amount"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
|
|
@ -78,17 +78,25 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from 'dayjs'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { distributionFlow } from '@/api/coupon'
|
||||
import recharge_dialog from './recharge_dialog.vue'
|
||||
import recharge_record_dialog from './recharge_record_dialog.vue'
|
||||
import selectUser from '../../components/selectUser.vue'
|
||||
import { distributionFlowGet } from '@/api/coupon'
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
|
||||
const rechargeDialogRef = ref(null)
|
||||
const rechargeRecordDialogRef = ref(null)
|
||||
|
||||
const infoObj = ref({
|
||||
balanceAmount: 0,
|
||||
pendingAmount: 0,
|
||||
successAmount: 0
|
||||
})
|
||||
|
||||
const queryForm = ref({
|
||||
type: '',
|
||||
user: '',
|
||||
key: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
})
|
||||
|
|
@ -99,7 +107,7 @@ function searchHandle() {
|
|||
}
|
||||
|
||||
function resetHandle() {
|
||||
queryForm.value.user = ''
|
||||
queryForm.value.key = ''
|
||||
queryForm.value.startTime = ''
|
||||
queryForm.value.startTime = ''
|
||||
times.value = []
|
||||
|
|
@ -136,15 +144,19 @@ function handleCurrentChange(e) {
|
|||
|
||||
async function getTableData() {
|
||||
try {
|
||||
const res = await distributionFlow({
|
||||
tableData.loading = true
|
||||
const res = await distributionFlowGet({
|
||||
page: tableData.page,
|
||||
size: tableData.size,
|
||||
type: '',
|
||||
key: ''
|
||||
})
|
||||
tableData.list = res.records
|
||||
tableData.total = res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div>
|
||||
<el-form inline>
|
||||
<el-form-item>
|
||||
<el-select placeholder="全部用户" style="width: 200px;"></el-select>
|
||||
<selectUser v-model="queryForm.user" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker style="width: 300px" v-model="times" type="daterange" range-separator="至"
|
||||
|
|
@ -11,28 +11,44 @@
|
|||
@change="selectTimeChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input placeholder="请输入用户ID/昵称" style="width: 200px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="searchHandle">搜索</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button type="primary" plain>添加分销员</el-button>
|
||||
<el-button type="primary" @click="searchHandle" icon="Search" :loading="tableData.loading">搜索</el-button>
|
||||
<el-button @click="resetHandle" icon="Refresh" :loading="tableData.loading">重置</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="addUserDialogRef.show()">添加分销员</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="row">
|
||||
<el-table :data="tableData.list" stripe border v-loading="tableData.loading">
|
||||
<el-table-column label="ID" prop="id" width="80"></el-table-column>
|
||||
<el-table-column label="用户" prop="nickName" width="200"></el-table-column>
|
||||
<el-table-column label="总收益(元)" prop="nickName" width="100"></el-table-column>
|
||||
<el-table-column label="待入账金额(元)" prop="nickName" width="100"></el-table-column>
|
||||
<el-table-column label="已入账金额(元)" prop="nickName" width="100"></el-table-column>
|
||||
<el-table-column label="开通方式" prop="nickName" width="100"></el-table-column>
|
||||
<el-table-column label="开通时间" prop="nickName" width="100"></el-table-column>
|
||||
<el-table-column label="用户" prop="nickName">
|
||||
<template #default="scope">
|
||||
<div class="column">
|
||||
<div>{{ scope.row.shopUserName }}</div>
|
||||
<div>{{ scope.row.shopUserPhone }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总收益(元)" prop="totalIncome" width="100">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.totalIncome || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="待入账金额(元)" prop="pendingIncome" width="120">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.pendingIncome || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已入账金额(元)" prop="receivedIncome" width="120">
|
||||
<template #default="scope">
|
||||
{{ multiplyAndFormat(scope.row.receivedIncome || 0) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开通方式" prop="openingMethod" width="100"></el-table-column>
|
||||
<el-table-column label="开通时间" prop="createTime"></el-table-column>
|
||||
<el-table-column label="操作" width="300" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary">更改分销组</el-button>
|
||||
<el-button link type="primary">取消分销员</el-button>
|
||||
<el-button link type="primary">分销详情</el-button>
|
||||
<el-button link type="primary" @click="editorUserDialogRef.show(1, scope.row)">更改分销组</el-button>
|
||||
<el-button link type="primary" @click="editorUserDialogRef.show(2, scope.row)">取消分销员</el-button>
|
||||
<el-button link type="primary" @click="distributionUserDetailRef.show(scope.row)">分销详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -42,11 +58,25 @@
|
|||
:page-sizes="[10, 20, 50, 100, 500]" background layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
<addUserDialog ref="addUserDialogRef" @success="getTableData" />
|
||||
<editorUserDialog ref="editorUserDialogRef" @success="getTableData" />
|
||||
<distributionUserDetail ref="distributionUserDetailRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from 'dayjs';
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import addUserDialog from './addUserDialog.vue';
|
||||
import editorUserDialog from './editorUserDialog.vue';
|
||||
import distributionUserDetail from './distributionUserDetail.vue';
|
||||
import selectUser from '../../components/selectUser.vue';
|
||||
import { distributionUserPage } from '@/api/coupon'
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
|
||||
const addUserDialogRef = ref(null)
|
||||
const editorUserDialogRef = ref(null)
|
||||
const distributionUserDetailRef = ref(null)
|
||||
|
||||
const queryForm = ref({
|
||||
user: '',
|
||||
|
|
@ -97,10 +127,20 @@ function handleCurrentChange(e) {
|
|||
|
||||
async function getTableData() {
|
||||
try {
|
||||
|
||||
tableData.loading = true
|
||||
const res = await distributionUserPage({
|
||||
page: tableData.page,
|
||||
size: tableData.size,
|
||||
...queryForm.value
|
||||
})
|
||||
tableData.list = res.records
|
||||
tableData.total = res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -114,4 +154,9 @@ onMounted(() => {
|
|||
margin-top: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<template>
|
||||
<el-dialog :title="titleOptions[type]" v-model="visible" width="400px">
|
||||
<div v-if="type == 1">
|
||||
<el-form :model="form">
|
||||
<el-form-item label="分销组">
|
||||
<el-radio-group v-model="form.distributionLevelId">
|
||||
<el-radio v-for="item in levelConfigList" :key="item.id" :label="item.name" :value="item.id"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-else-if="type == 2">
|
||||
<div class="center">
|
||||
<el-icon color="red" size="24">
|
||||
<Warning />
|
||||
</el-icon>
|
||||
<span>是否确认取消分销员</span>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitHandle" :loading="confirmLoading">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { distributionUser, distributionGet } from '@/api/coupon'
|
||||
|
||||
const visible = ref(false)
|
||||
const rowInfo = ref('')
|
||||
const type = ref(1)
|
||||
const titleOptions = ref({
|
||||
1: '更改分销组',
|
||||
2: '取消分销员',
|
||||
3: '重置分销组'
|
||||
})
|
||||
|
||||
const confirmLoading = ref(false)
|
||||
const form = ref({
|
||||
distributionLevelName: '',
|
||||
distributionLevelId: ''
|
||||
})
|
||||
|
||||
// 提交修改
|
||||
const emit = defineEmits(['success'])
|
||||
async function submitHandle() {
|
||||
try {
|
||||
let data = {}
|
||||
data.id = rowInfo.value.id
|
||||
if (type.value == 1) {
|
||||
data.distributionLevelId = form.value.distributionLevelId
|
||||
data.distributionLevelName = levelConfigList.value.find(item => item.id == form.value.distributionLevelId).name
|
||||
} else if (type.value == 2) {
|
||||
data.status = 9
|
||||
}
|
||||
confirmLoading.value = true
|
||||
await distributionUser(data, 'put')
|
||||
ElNotification({
|
||||
title: '注意',
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
})
|
||||
visible.value = false
|
||||
emit('success')
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
confirmLoading.value = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// 获取配置详情
|
||||
const levelConfigList = ref([])
|
||||
async function distributionGetAjax() {
|
||||
try {
|
||||
const res = await distributionGet()
|
||||
if (res.levelConfigList.length > 0) {
|
||||
levelConfigList.value = res.levelConfigList
|
||||
// form.value.distributionLevelId = levelConfigList.value[0].id
|
||||
// form.value.distributionLevelName = levelConfigList.value[0].distributionLevelName
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function show(t, row) {
|
||||
console.log('show.t', t);
|
||||
console.log('show.row', row);
|
||||
|
||||
form.value.distributionLevelId = row.distributionLevelId
|
||||
|
||||
rowInfo.value = { ...row }
|
||||
type.value = t
|
||||
visible.value = true
|
||||
distributionGetAjax()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -26,12 +26,16 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog title="请使用微信扫码充值" width="400px" v-model="showCodeDialog">
|
||||
<el-image :src="codeUrl" style="width: 100%; height: auto"></el-image>
|
||||
<div class="amount_wrap">充值¥{{ multiplyAndFormat(form.amount || 0) }}</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { filterNumberInput } from '@/utils'
|
||||
import { distributionCashPay } from "@/api/coupon";
|
||||
import { filterNumberInput, multiplyAndFormat } from '@/utils'
|
||||
import { distributionRechargeQrCode } from "@/api/coupon";
|
||||
|
||||
const visible = ref(false)
|
||||
const numList = ref([
|
||||
|
|
@ -76,14 +80,16 @@ function amountInput(e) {
|
|||
// 提交
|
||||
const formRef = ref(null)
|
||||
const confirmLoading = ref(false)
|
||||
const showCodeDialog = ref(false)
|
||||
const codeUrl = ref('')
|
||||
function submitHandle() {
|
||||
formRef.value.validate(async vaild => {
|
||||
try {
|
||||
if (vaild) {
|
||||
confirmLoading.value = true
|
||||
const data = { ...form.value }
|
||||
data.shopId = localStorage.getItem('shopId')
|
||||
await distributionCashPay(data)
|
||||
const res = await distributionRechargeQrCode(form.value)
|
||||
showCodeDialog.value = true
|
||||
codeUrl.value = res
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
|
@ -120,4 +126,11 @@ defineExpose({
|
|||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.amount_wrap {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -11,8 +11,8 @@
|
|||
<el-input v-model="queryForm.key" placeholder="请输入用户ID/昵称" style="width: 200px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="searchHandle">搜索</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button type="primary" @click="searchHandle" icon="Search" :loading="tableData.loading">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetHandle" :loading="tableData.loading">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
</div>
|
||||
<div class="info">
|
||||
<div>已充值金额(元)</div>
|
||||
<div>90000</div>
|
||||
<div>{{ multiplyAndFormat(info.totalRecharge || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
|
|
@ -33,23 +33,44 @@
|
|||
</div>
|
||||
<div class="info">
|
||||
<div>已扣减金额(元)</div>
|
||||
<div>99.99</div>
|
||||
<div>{{ multiplyAndFormat(info.totalSub || 0) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-table :data="tableData.list"></el-table>
|
||||
<div class="row mt14">
|
||||
<el-table :data="tableData.list" border stripe height="400" v-loading="tableData.loading">
|
||||
<el-table-column label="类型" prop="type">
|
||||
<template #default="scope">
|
||||
{{statusList.find(item => item.value == scope.row.type).label}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变动金额(元)" prop="amount"></el-table-column>
|
||||
<el-table-column label="变动后金额(元)" prop="changeAmount"></el-table-column>
|
||||
<el-table-column label="变动原因" prop="remark"></el-table-column>
|
||||
<el-table-column label="关联订单" prop="19107220837"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<el-pagination v-model:current-page="tableData.page" v-model:page-size="tableData.size"
|
||||
:page-sizes="[10, 30, 50, 100]" background layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { multiplyAndFormat } from '@/utils'
|
||||
import { distributionFlow } from '@/api/coupon'
|
||||
|
||||
const visible = ref(true)
|
||||
const visible = ref(false)
|
||||
|
||||
const info = ref({
|
||||
totalRecharge: 0,
|
||||
totalSub: 0
|
||||
})
|
||||
|
||||
const statusList = ref([
|
||||
{
|
||||
|
|
@ -80,11 +101,17 @@ const queryForm = ref({
|
|||
})
|
||||
|
||||
function resetHandle() {
|
||||
queryForm.value.type = ''
|
||||
queryForm.value.key = ''
|
||||
tableData.size = 10
|
||||
|
||||
searchHandle()
|
||||
}
|
||||
|
||||
function searchHandle() { }
|
||||
|
||||
function searchHandle() {
|
||||
tableData.page = 1
|
||||
getTableData()
|
||||
}
|
||||
|
||||
const tableData = reactive({
|
||||
loading: false,
|
||||
|
|
@ -94,8 +121,43 @@ const tableData = reactive({
|
|||
list: []
|
||||
})
|
||||
|
||||
// 分页大小发生变化
|
||||
function handleSizeChange(e) {
|
||||
tableData.pageSize = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
// 分页发生变化
|
||||
function handleCurrentChange(e) {
|
||||
tableData.page = e;
|
||||
getTableData();
|
||||
}
|
||||
|
||||
async function getTableData() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
const res = await distributionFlow({ ...queryForm.value, page: tableData.page, size: tableData.size })
|
||||
tableData.list = res.records
|
||||
tableData.total = res.totalRow
|
||||
|
||||
info.value.totalRecharge = res.totalRecharge
|
||||
info.value.totalSub = res.totalSub
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
setTimeout(() => {
|
||||
tableData.loading = false
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function show() {
|
||||
visible.value = true
|
||||
getTableData()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
|||
|
|
@ -68,9 +68,6 @@
|
|||
<el-radio label="消费金额(不含退款)" value="cost"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="form.levelConfigList.push({ ...levelConfigListObj })">添加等级</el-button>
|
||||
</el-form-item>
|
||||
<div class="err_wrap">
|
||||
<el-form-item label-width="0" prop="levelConfigList">
|
||||
<div class="level_wrap">
|
||||
|
|
@ -131,34 +128,37 @@
|
|||
<div class="column">
|
||||
<div class="center">
|
||||
<div class="label">
|
||||
<span class="required">*</span>订单一级分成
|
||||
<span class="required">*</span>分成比例
|
||||
</div>
|
||||
<div class="ipt">
|
||||
<el-input v-model="item.levelOneCommission" placeholder="请输入" :maxlength="2"
|
||||
style="width: 200px;" @input="e => item.levelOneCommission = filterNumberInput(e, 1)">
|
||||
<el-input v-model="item.levelOneCommission" placeholder="请输入" :maxlength="5"
|
||||
style="width: 200px;" @input="e => item.levelOneCommission = filterNumberInput(e)">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<!-- <div class="column">
|
||||
<div class="center">
|
||||
<div class="label">订单二级分成</div>
|
||||
<div class="ipt">
|
||||
<el-input v-model="item.levelTwoCommission" placeholder="请输入" :maxlength="2"
|
||||
style="width: 200px;" @input="e => item.levelTwoCommission = filterNumberInput(e, 1)">
|
||||
<el-input v-model="item.levelTwoCommission" placeholder="请输入" :maxlength="5"
|
||||
style="width: 200px;" @input="e => item.levelTwoCommission = filterNumberInput(e)">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tips">二级分成不填或为0时,则不进行二级分成</div>
|
||||
</div>
|
||||
<div class="tips">二级分成不填,则不进行二级分成</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item style="margin-top: 24px;">
|
||||
<el-button type="primary" @click="form.levelConfigList.push({ ...levelConfigListObj })">添加等级</el-button>
|
||||
</el-form-item>
|
||||
<div class="title_row mt14">未开通页面营销</div>
|
||||
<el-form-item :label-width="0" style="margin-top: 14px;">
|
||||
<WangEditor v-model="form.notActivatedPage" />
|
||||
|
|
@ -248,8 +248,8 @@ const rules = ref({
|
|||
{
|
||||
trigger: 'change',
|
||||
validator: (rule, value, callback) => {
|
||||
if ((form.value.upgradeType == 'invite' || form.value.upgradeType == 'cost') && form.value.levelConfigList.length == 0) {
|
||||
callback(new Error('请至少添加一个等级'))
|
||||
if (form.value.levelConfigList.length == 0) {
|
||||
callback(new Error('至少添加一个等级'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
|
|
@ -277,11 +277,16 @@ const rules = ref({
|
|||
callback(new Error(tips))
|
||||
return
|
||||
}
|
||||
if (item.levelOneCommission === '') {
|
||||
if (item.levelOneCommission === '' || item.levelOneCommission == 0) {
|
||||
tips = `请输入${index + 1}级的订单一级分成`
|
||||
callback(new Error(tips))
|
||||
return
|
||||
}
|
||||
// if (item.levelTwoCommission !== '' && item.levelTwoCommission <= 0 && item.levelTwoCommission !== null) {
|
||||
// tips = `请输入有效的${index + 1}级订单二级分成`
|
||||
// callback(new Error(tips))
|
||||
// return
|
||||
// }
|
||||
})
|
||||
callback()
|
||||
}
|
||||
|
|
@ -374,7 +379,10 @@ onMounted(async () => {
|
|||
.level_wrap {
|
||||
.level_wrap_row {
|
||||
display: flex;
|
||||
margin-bottom: 24px;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
|
|
@ -407,7 +415,6 @@ onMounted(async () => {
|
|||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: repeat(2, auto);
|
||||
grid-column-gap: 34px;
|
||||
grid-row-gap: 14px;
|
||||
|
||||
.label {
|
||||
width: 120px;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
:showSwitch="shopInfo.isHeadShop == 1 || shopInfo.shopType == 'only'" v-model:isOpen="form.isEnable">
|
||||
</HeaderCard>
|
||||
<div class="row mt14">
|
||||
<tabHeader v-model="tabActiveIndex" :list="tabList" @change="tabChange" />
|
||||
<tabHeader v-model="tabActiveIndex" :list="tabList" />
|
||||
</div>
|
||||
<div class="row mt14">
|
||||
<!-- 基础设置 -->
|
||||
|
|
@ -53,11 +53,6 @@ const tabList = ref([
|
|||
},
|
||||
])
|
||||
|
||||
// 菜单切换
|
||||
function tabChange(e) {
|
||||
tabActive.value = e.item.value
|
||||
}
|
||||
|
||||
const form = ref({
|
||||
isEnable: 1
|
||||
})
|
||||
|
|
|
|||
|
|
@ -89,10 +89,10 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="享受会员价">
|
||||
<el-radio-group v-model="basicForm.isMemberPrice">
|
||||
<el-radio :value="1">是</el-radio>
|
||||
<el-radio :value="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
<div class="center">
|
||||
<el-switch v-model="basicForm.isMemberPrice" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<div class="tips">开启时,会员价与会员折扣同时享用</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="规则说明">
|
||||
<el-input v-model="basicForm.remark" style="width: 400px" :autosize="{ minRows: 4, maxRows: 5 }"
|
||||
|
|
@ -594,4 +594,13 @@ function levelTabChange(index) { }
|
|||
:deep(.el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active) {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
|
||||
.tips {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue