|
|
@@ -1,105 +1,164 @@
|
|
|
<template>
|
|
|
- <ele-page flex-table>
|
|
|
- <page-search @search="reload"></page-search>
|
|
|
-
|
|
|
- <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
|
|
|
- <template #toolbar>
|
|
|
- <div class="flex items-center mb-4">
|
|
|
- <el-statistic
|
|
|
- :value="693700"
|
|
|
- title="累计佣金金额"
|
|
|
- value-style="font-size:30px"
|
|
|
- class="mr-10"
|
|
|
- ></el-statistic>
|
|
|
- <el-statistic
|
|
|
- :value="693700"
|
|
|
- title="待结算佣金"
|
|
|
- value-style="font-size:30px"
|
|
|
- class="mr-10"
|
|
|
- ></el-statistic>
|
|
|
- <el-statistic
|
|
|
- :value="693700"
|
|
|
- title="已结算佣金"
|
|
|
- value-style="font-size:30px"
|
|
|
- class="mr-10"
|
|
|
- ></el-statistic>
|
|
|
- <el-statistic
|
|
|
- :value="693700"
|
|
|
- title="已失效佣金"
|
|
|
- value-style="font-size:30px"
|
|
|
- class="mr-10"
|
|
|
- ></el-statistic>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="common-title mb-4">交易记录</div>
|
|
|
-
|
|
|
- <el-radio-group @change="handleStatusChange" v-model="useStatus">
|
|
|
- <el-radio-button label="全部" value="1" />
|
|
|
- <el-radio-button label="待结算" value="2" />
|
|
|
- <el-radio-button label="已结算" value="3" />
|
|
|
- </el-radio-group>
|
|
|
- </template>
|
|
|
- </common-table>
|
|
|
- </ele-page>
|
|
|
+ <ele-page flex-table>
|
|
|
+ <page-search @search="reload" :status="useStatus"></page-search>
|
|
|
+
|
|
|
+ <common-table ref="pageRef" :pageConfig="pageConfig" :columns="columns">
|
|
|
+ <template #toolbar>
|
|
|
+ <div class="flex items-center mb-4">
|
|
|
+ <el-statistic
|
|
|
+ :value="statistics.totalMoney"
|
|
|
+ title="累计佣金金额"
|
|
|
+ :precision="2"
|
|
|
+ value-style="font-size:30px"
|
|
|
+ class="mr-20"
|
|
|
+ ></el-statistic>
|
|
|
+ <el-statistic
|
|
|
+ :value="statistics.waitSettlementMoney"
|
|
|
+ title="待结算佣金"
|
|
|
+ :precision="2"
|
|
|
+ value-style="font-size:30px"
|
|
|
+ class="mr-20"
|
|
|
+ ></el-statistic>
|
|
|
+ <el-statistic
|
|
|
+ :value="statistics.settlementMoney"
|
|
|
+ title="已结算佣金"
|
|
|
+ :precision="2"
|
|
|
+ value-style="font-size:30px"
|
|
|
+ class="mr-20"
|
|
|
+ ></el-statistic>
|
|
|
+ <el-statistic
|
|
|
+ :value="statistics.arrivedMoney"
|
|
|
+ title="已到账佣金"
|
|
|
+ :precision="2"
|
|
|
+ value-style="font-size:30px"
|
|
|
+ class="mr-20"
|
|
|
+ ></el-statistic>
|
|
|
+ <el-statistic
|
|
|
+ :value="statistics.invalidMoney"
|
|
|
+ title="已失效佣金"
|
|
|
+ :precision="2"
|
|
|
+ value-style="font-size:30px"
|
|
|
+ class="mr-20"
|
|
|
+ ></el-statistic>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="common-title mb-4">交易记录</div>
|
|
|
+
|
|
|
+ <el-radio-group
|
|
|
+ @change="handleStatusChange"
|
|
|
+ v-model="useStatus"
|
|
|
+ >
|
|
|
+ <el-radio-button label="全部" value="" />
|
|
|
+ <el-radio-button label="待结算" value="1" />
|
|
|
+ <el-radio-button label="已结算" value="2" />
|
|
|
+ <el-radio-button label="已到账" value="3" />
|
|
|
+ <el-radio-button label="已作废" value="4" />
|
|
|
+ </el-radio-group>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #status="{ row }">
|
|
|
+ {{ settlementStatus.find((d) => d.value == row.status)?.label }}
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #orderId="{ row }">
|
|
|
+ <el-button type="primary" link @click="handleOrderId(row)">{{
|
|
|
+ row.beInviteOrderId
|
|
|
+ }}</el-button>
|
|
|
+ </template>
|
|
|
+ </common-table>
|
|
|
+
|
|
|
+ <commissionDetail v-model="commissionDetailVisible" :rowData="currentRowData" />
|
|
|
+ </ele-page>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { ref, reactive } from 'vue';
|
|
|
- import CommonTable from '@/components/CommonPage/CommonTable.vue';
|
|
|
- import pageSearch from '@/views/finance/withdrawal/components/page-search.vue';
|
|
|
- import { useDictData } from '@/utils/use-dict-data';
|
|
|
-
|
|
|
- defineOptions({ name: 'withdrawal' });
|
|
|
- const [useStatusDicts] = useDictData(['use_status']);
|
|
|
-
|
|
|
- const useStatus = ref('1');
|
|
|
- function handleStatusChange(value) {
|
|
|
- pageRef.value.reload({ useStatus: value });
|
|
|
- }
|
|
|
-
|
|
|
- /** 表格列配置 */
|
|
|
- const columns = ref([
|
|
|
- { label: '交易时间', prop: 'createTime', align: 'center', width: 180 },
|
|
|
- { label: '用户UID', prop: 'uid', align: 'center', minWidth: 140 },
|
|
|
- {
|
|
|
- label: '支付单号/流水号',
|
|
|
- prop: 'paymentCode',
|
|
|
- align: 'center',
|
|
|
- minWidth: 160
|
|
|
- },
|
|
|
- { label: '对方账户', prop: 'addressDetail', align: 'center' },
|
|
|
- { label: '结算金额', prop: 'money', align: 'center' },
|
|
|
- {
|
|
|
- label: '交易状态',
|
|
|
- prop: 'useStatus',
|
|
|
- align: 'center',
|
|
|
- formatter: (row) =>
|
|
|
- useStatusDicts.value.find((d) => d.dictValue == row.useStatus)
|
|
|
- ?.dictLabel
|
|
|
- },
|
|
|
+import { ref, reactive, onMounted, nextTick } from "vue";
|
|
|
+import CommonTable from "@/components/CommonPage/CommonTable.vue";
|
|
|
+import pageSearch from "./page-search.vue";
|
|
|
+import request from "@/utils/request";
|
|
|
+import CommissionDetail from "./commission-detail.vue";
|
|
|
+
|
|
|
+defineOptions({ name: "commission" });
|
|
|
+
|
|
|
+// 添加统计数据的响应式对象
|
|
|
+const statistics = reactive({
|
|
|
+ totalMoney: 0,
|
|
|
+ waitSettlementMoney: 0,
|
|
|
+ settlementMoney: 0,
|
|
|
+ arrivedMoney: 0,
|
|
|
+ invalidMoney: 0,
|
|
|
+});
|
|
|
+
|
|
|
+// 获取统计数据
|
|
|
+async function fetchStatistics() {
|
|
|
+ try {
|
|
|
+ const res = await request.get("/user/userInviteLog/sum");
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ Object.assign(statistics, res.data.data);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取统计数据失败:", error);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const commissionDetailVisible = ref(false);
|
|
|
+const currentRowData = ref(null);
|
|
|
+const handleOrderId = (row) => {
|
|
|
+ currentRowData.value = row;
|
|
|
+ commissionDetailVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ fetchStatistics();
|
|
|
+});
|
|
|
+
|
|
|
+const useStatus = ref("");
|
|
|
+function handleStatusChange(value) {
|
|
|
+ pageRef.value.reload({ status: value });
|
|
|
+}
|
|
|
+
|
|
|
+//结算状态数组
|
|
|
+const settlementStatus = ref([
|
|
|
+ { label: "待结算", value: 1 },
|
|
|
+ { label: "已结算", value: 2 },
|
|
|
+ { label: "已到账", value: 3 },
|
|
|
+ { label: "已作废", value: 4 },
|
|
|
+]);
|
|
|
+
|
|
|
+/** 表格列配置 */
|
|
|
+const columns = ref([
|
|
|
+ { label: "交易时间", prop: "settlementTime", align: "center", width: 180 },
|
|
|
+ { label: "合伙人姓名", prop: "partnerName", align: "center" },
|
|
|
+ { label: "合伙人手机号", prop: "partnerMobile", align: "center" },
|
|
|
+ { label: "下单人姓名", prop: "orderName", align: "center" },
|
|
|
+ { label: "下单人手机号", prop: "orderMobile", align: "center" },
|
|
|
+ { label: "订单金额", prop: "orderExpectMoney", align: "center" },
|
|
|
+ { label: "结算金额", prop: "orderFinalMoney", align: "center" },
|
|
|
+ { label: "预估收入", prop: "expectSettlementMoney", align: "center" },
|
|
|
+ { label: "结算收入", prop: "settlementMoney", align: "center" },
|
|
|
+ { label: "交易状态", prop: "status", align: "center", slot: "status" },
|
|
|
{
|
|
|
- label: '交易类型',
|
|
|
- prop: 'paymentType',
|
|
|
- align: 'center',
|
|
|
- formatter: (row) =>
|
|
|
- useStatusDicts.value.find((d) => d.dictValue == row.useStatus)
|
|
|
- ?.dictLabel
|
|
|
+ label: "订单编号",
|
|
|
+ prop: "beInviteOrderId",
|
|
|
+ align: "center",
|
|
|
+ slot: "orderId",
|
|
|
},
|
|
|
- { label: '订单编号', prop: 'code', align: 'center' }
|
|
|
- ]);
|
|
|
+]);
|
|
|
|
|
|
- /** 页面组件实例 */
|
|
|
- const pageRef = ref(null);
|
|
|
+/** 页面组件实例 */
|
|
|
+const pageRef = ref(null);
|
|
|
|
|
|
- const pageConfig = reactive({
|
|
|
- pageUrl: '/baseinfo/godown/pagelist',
|
|
|
- exportUrl: '/baseinfo/godown/export',
|
|
|
- fileName: '佣金记录',
|
|
|
- cacheKey: 'commissionTable'
|
|
|
- });
|
|
|
+const pageConfig = reactive({
|
|
|
+ pageUrl: "/user/userInviteLog/pageList",
|
|
|
+ fileName: "佣金记录",
|
|
|
+ cacheKey: "commissionTable",
|
|
|
+ params: {
|
|
|
+ status: useStatus.value,
|
|
|
+ },
|
|
|
+});
|
|
|
|
|
|
- //刷新表格
|
|
|
- function reload(where) {
|
|
|
+//刷新表格
|
|
|
+function reload(where) {
|
|
|
pageRef.value?.reload(where);
|
|
|
- }
|
|
|
+}
|
|
|
</script>
|