+
- 三级分销商
+ 三级佣金60%
-
+ {{ form.thirdUserId }}
+
+
+ {{ form.thirdNickname }}
-
-
- 元
-
+
+ {{ '60%' }}
+
+
+ {{ form.thirdMoney }}
-
-
- 状态信息
-
-
-
-
-
-
- 有效
- 失效
-
-
-
-
-
-
- 未结算
- 已结算
-
-
-
-
-
-
+ {{ form.settleTime }}
+
\ No newline at end of file
diff --git a/src/views/shop/shopDealerReferee/components/search.vue b/src/views/shop/shopDealerReferee/components/search.vue
index b41c7a5..b848c3e 100644
--- a/src/views/shop/shopDealerReferee/components/search.vue
+++ b/src/views/shop/shopDealerReferee/components/search.vue
@@ -1,90 +1,81 @@
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
-
- 一级推荐
- 二级推荐
- 三级推荐
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
- 搜索
-
-
- 重置
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/shop/shopDealerUser/components/shopDealerApplyEdit.vue b/src/views/shop/shopDealerUser/components/shopDealerApplyEdit.vue
new file mode 100644
index 0000000..bad4d1f
--- /dev/null
+++ b/src/views/shop/shopDealerUser/components/shopDealerApplyEdit.vue
@@ -0,0 +1,407 @@
+
+
+
+
+
+
+ 申请人信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 审核信息
+
+
+
+
+
+
+
+ 待审核
+ 等待审核
+
+
+ 审核通过
+ 申请通过
+
+
+ 审核驳回
+ 申请驳回
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/shop/shopDealerUser/index.vue b/src/views/shop/shopDealerUser/index.vue
index 4cb4efa..2b1454a 100644
--- a/src/views/shop/shopDealerUser/index.vue
+++ b/src/views/shop/shopDealerUser/index.vue
@@ -3,7 +3,7 @@
-
- 已删除
- 正常
+
+ 待审核
+ 已通过
+ 已驳回
编辑
-
-
-
- 详情
-
-
-
-
-
- 删除
+
+
+
+
+ 通过
-
+
+
+
+ 驳回
+
+
+
+
+
+ 删除
+
+
+
-
+
@@ -61,33 +70,37 @@ import {createVNode, ref} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {
ExclamationCircleOutlined,
+ CheckOutlined,
+ CloseOutlined,
EditOutlined,
- EyeOutlined,
DeleteOutlined
} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
-import {toDateString} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
-import ShopDealerUserEdit from './components/shopDealerUserEdit.vue';
-import {pageShopDealerUser, removeShopDealerUser, removeBatchShopDealerUser} from '@/api/shop/shopDealerUser';
-import type {ShopDealerUser, ShopDealerUserParam} from '@/api/shop/shopDealerUser/model';
+import ShopDealerApplyEdit from './components/shopDealerApplyEdit.vue';
+import {
+ pageShopDealerApply,
+ removeShopDealerApply,
+ removeBatchShopDealerApply,
+ batchApproveShopDealerApply,
+ updateShopDealerApply
+} from '@/api/shop/shopDealerApply';
+import type {ShopDealerApply, ShopDealerApplyParam} from '@/api/shop/shopDealerApply/model';
// 表格实例
const tableRef = ref
| null>(null);
// 表格选中数据
-const selection = ref([]);
+const selection = ref([]);
// 当前编辑数据
-const current = ref(null);
+const current = ref(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
-// 是否显示批量移动弹窗
-const showMove = ref(false);
// 加载状态
const loading = ref(true);
@@ -102,7 +115,9 @@ const datasource: DatasourceFunction = ({
if (filters) {
where.status = filters.status;
}
- return pageShopDealerUser({
+ where.type = 4;
+ where.applyStatus = 20;
+ return pageShopDealerApply({
...where,
...orders,
page,
@@ -113,47 +128,43 @@ const datasource: DatasourceFunction = ({
// 表格列配置
const columns = ref([
{
- title: '用户ID',
- dataIndex: 'userId',
- key: 'userId',
+ title: 'ID',
+ dataIndex: 'applyId',
+ key: 'applyId',
align: 'center',
width: 80,
fixed: 'left'
},
{
- title: '用户信息',
- key: 'userInfo',
+ title: '申请人信息',
+ key: 'applicantInfo',
align: 'left',
- width: 200,
fixed: 'left',
customRender: ({record}) => {
- return `${record.realName || ''} (${record.mobile || ''})`;
+ return `${record.realName || '-'} (${record.mobile || '-'})`;
}
},
{
- title: '佣金统计',
- key: 'commissionStats',
+ title: '申请方式',
+ dataIndex: 'applyType',
+ key: 'applyType',
align: 'center',
- width: 180,
- customRender: ({record}) => {
- const available = parseFloat(record.money || '0').toFixed(2);
- const frozen = parseFloat(record.freezeMoney || '0').toFixed(2);
- const total = parseFloat(record.totalMoney || '0').toFixed(2);
- return `可提现: ¥${available} | 冻结: ¥${frozen} | 累计: ¥${total}`;
+ width: 120,
+ customRender: ({text}) => {
+ const typeMap = {
+ 10: {text: '需审核', color: 'orange'},
+ 20: {text: '免审核', color: 'green'}
+ };
+ const type = typeMap[text] || {text: '未知', color: 'default'};
+ return {type: 'tag', props: {color: type.color}, children: type.text};
}
},
{
- title: '团队统计',
- key: 'teamStats',
+ title: '审核状态',
+ dataIndex: 'applyStatus',
+ key: 'applyStatus',
align: 'center',
- width: 150,
- customRender: ({record}) => {
- const first = record.firstNum || 0;
- const second = record.secondNum || 0;
- const third = record.thirdNum || 0;
- const total = first + second + third;
- return `总计: ${total} (${first}/${second}/${third})`;
- }
+ width: 120
},
{
title: '推荐人',
@@ -163,111 +174,139 @@ const columns = ref([
width: 100,
customRender: ({text}) => text ? `ID: ${text}` : '无'
},
+ // {
+ // title: '申请时间',
+ // dataIndex: 'applyTime',
+ // key: 'applyTime',
+ // align: 'center',
+ // width: 120,
+ // customRender: ({ text }) => text ? toDateString(new Date(text), 'yyyy-MM-dd HH:mm') : '-'
+ // },
+ // {
+ // title: '审核时间',
+ // dataIndex: 'auditTime',
+ // key: 'auditTime',
+ // align: 'center',
+ // customRender: ({ text }) => text ? toDateString(new Date(text), 'yyyy-MM-dd HH:mm') : '-'
+ // },
{
- title: '专属二维码',
- dataIndex: 'qrcode',
- key: 'qrcode',
- align: 'center',
- width: 120,
- customRender: ({text}) => {
- return text ? '已生成' : '未生成';
- }
- },
- {
- title: '状态',
- key: 'userStatus',
- align: 'center',
- width: 100,
- customRender: ({record}) => {
- if (record.isDelete === 1) {
- return {type: 'tag', props: {color: 'red'}, children: '已删除'};
- }
- return {type: 'tag', props: {color: 'green'}, children: '正常'};
- }
+ title: '驳回原因',
+ dataIndex: 'rejectReason',
+ key: 'rejectReason',
+ align: 'left',
+ ellipsis: true,
+ customRender: ({text}) => text || '-'
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
- width: 120,
sorter: true,
- ellipsis: true,
- customRender: ({text}) => text ? toDateString(text, 'yyyy-MM-dd') : '-'
+ ellipsis: true
},
{
title: '操作',
key: 'action',
- width: 220,
fixed: 'right',
align: 'center',
+ width: 380,
hideInSetting: true
}
]);
/* 搜索 */
-const reload = (where?: ShopDealerUserParam) => {
+const reload = (where?: ShopDealerApplyParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
+/* 审核通过 */
+const approveApply = (row: ShopDealerApply) => {
+ Modal.confirm({
+ title: '审核通过确认',
+ content: `确定要通过 ${row.realName} 的经销商申请吗?`,
+ icon: createVNode(CheckOutlined),
+ okText: '确认通过',
+ okType: 'primary',
+ cancelText: '取消',
+ onOk: async () => {
+ const hide = message.loading('正在处理审核...', 0);
+ try {
+ await updateShopDealerApply({
+ ...row,
+ applyId: row.applyId,
+ applyStatus: 20
+ });
+ hide();
+ message.success('审核通过成功');
+ reload();
+ } catch (error: any) {
+ hide();
+ message.error(error.message || '审核失败,请重试');
+ }
+ }
+ });
+};
+
+/* 审核驳回 */
+const rejectApply = (row: ShopDealerApply) => {
+ let rejectReason = '';
+ Modal.confirm({
+ title: '审核驳回',
+ content: createVNode('div', null, [
+ createVNode('p', null, `申请人: ${row.realName} (${row.mobile})`),
+ createVNode('p', {style: 'margin-top: 12px;'}, '请输入驳回原因:'),
+ createVNode('textarea', {
+ placeholder: '请输入驳回原因...',
+ style: 'width: 100%; height: 80px; margin-top: 8px; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px;',
+ onInput: (e: any) => {
+ rejectReason = e.target.value;
+ }
+ })
+ ]),
+ icon: createVNode(CloseOutlined),
+ okText: '确认驳回',
+ okType: 'danger',
+ cancelText: '取消',
+ onOk: async () => {
+ if (!rejectReason.trim()) {
+ message.error('请输入驳回原因');
+ return Promise.reject();
+ }
+ const hide = message.loading('正在处理审核...', 0);
+ try {
+ await updateShopDealerApply({
+ ...row,
+ applyStatus: 30,
+ rejectReason: rejectReason.trim()
+ });
+ hide();
+ message.success('审核驳回成功');
+ reload();
+ } catch (error: any) {
+ hide();
+ message.error(error.message || '审核失败,请重试');
+ }
+ }
+ });
+};
+
/* 打开编辑弹窗 */
-const openEdit = (row?: ShopDealerUser) => {
+const openEdit = (row?: ShopDealerApply) => {
current.value = row ?? null;
showEdit.value = true;
};
-/* 查看详情 */
-const viewDetail = (row: ShopDealerUser) => {
- Modal.info({
- title: '分销商用户详情',
- width: 600,
- content: createVNode('div', {style: 'max-height: 400px; overflow-y: auto;'}, [
- createVNode('div', {class: 'detail-item'}, [
- createVNode('strong', null, '基本信息'),
- createVNode('p', null, `姓名: ${row.realName || '-'}`),
- createVNode('p', null, `手机号: ${row.mobile || '-'}`),
- createVNode('p', null, `用户ID: ${row.userId || '-'}`),
- createVNode('p', null, `推荐人ID: ${row.refereeId || '无'}`),
- ]),
- createVNode('div', {class: 'detail-item', style: 'margin-top: 16px;'}, [
- createVNode('strong', null, '佣金信息'),
- createVNode('p', null, `可提现佣金: ¥${parseFloat(row.money || '0').toFixed(2)}`),
- createVNode('p', null, `冻结佣金: ¥${parseFloat(row.freezeMoney || '0').toFixed(2)}`),
- createVNode('p', null, `累计提现: ¥${parseFloat(row.totalMoney || '0').toFixed(2)}`),
- ]),
- createVNode('div', {class: 'detail-item', style: 'margin-top: 16px;'}, [
- createVNode('strong', null, '团队信息'),
- createVNode('p', null, `一级成员: ${row.firstNum || 0} 人`),
- createVNode('p', null, `二级成员: ${row.secondNum || 0} 人`),
- createVNode('p', null, `三级成员: ${row.thirdNum || 0} 人`),
- createVNode('p', null, `团队总数: ${(row.firstNum || 0) + (row.secondNum || 0) + (row.thirdNum || 0)} 人`),
- ]),
- createVNode('div', {class: 'detail-item', style: 'margin-top: 16px;'}, [
- createVNode('strong', null, '其他信息'),
- createVNode('p', null, `专属二维码: ${row.qrcode ? '已生成' : '未生成'}`),
- createVNode('p', null, `创建时间: ${row.createTime ? toDateString(row.createTime, 'yyyy-MM-dd HH:mm:ss') : '-'}`),
- createVNode('p', null, `更新时间: ${row.updateTime ? toDateString(row.updateTime, 'yyyy-MM-dd HH:mm:ss') : '-'}`),
- ])
- ]),
- okText: '关闭'
- });
-};
-
-/* 打开批量移动弹窗 */
-const openMove = () => {
- showMove.value = true;
-};
-
/* 删除单个 */
-const remove = (row: ShopDealerUser) => {
- if (!row.id) {
+const remove = (row: ShopDealerApply) => {
+ if (!row.applyId) {
message.error('删除失败:缺少必要参数');
return;
}
- const hide = message.loading('正在删除分销商用户...', 0);
- removeShopDealerUser(row.id)
+ const hide = message.loading('正在删除申请记录...', 0);
+ removeShopDealerApply(row.applyId)
.then((msg) => {
hide();
message.success(msg || '删除成功');
@@ -286,7 +325,7 @@ const removeBatch = () => {
return;
}
- const validIds = selection.value.filter(d => d.id).map(d => d.id);
+ const validIds = selection.value.filter(d => d.applyId).map(d => d.applyId);
if (!validIds.length) {
message.error('选中的数据中没有有效的ID');
return;
@@ -294,7 +333,7 @@ const removeBatch = () => {
Modal.confirm({
title: '批量删除确认',
- content: `确定要删除选中的 ${validIds.length} 条分销商用户记录吗?此操作不可恢复。`,
+ content: `确定要删除选中的 ${validIds.length} 条申请记录吗?此操作不可恢复。`,
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
okText: '确认删除',
@@ -302,7 +341,7 @@ const removeBatch = () => {
cancelText: '取消',
onOk: () => {
const hide = message.loading(`正在删除 ${validIds.length} 条记录...`, 0);
- removeBatchShopDealerUser(validIds)
+ removeBatchShopDealerApply(validIds)
.then((msg) => {
hide();
message.success(msg || `成功删除 ${validIds.length} 条记录`);
@@ -317,13 +356,60 @@ const removeBatch = () => {
});
};
+/* 批量通过 */
+const batchApprove = () => {
+ if (!selection.value.length) {
+ message.error('请至少选择一条数据');
+ return;
+ }
+
+ const pendingApplies = selection.value.filter(item => item.applyStatus === 10);
+ if (!pendingApplies.length) {
+ message.error('所选申请中没有待审核的记录');
+ return;
+ }
+
+ Modal.confirm({
+ title: '批量通过确认',
+ content: `确定要通过选中的 ${pendingApplies.length} 个申请吗?`,
+ icon: createVNode(ExclamationCircleOutlined),
+ okText: '确认通过',
+ okType: 'primary',
+ cancelText: '取消',
+ onOk: async () => {
+ const hide = message.loading('正在批量通过...', 0);
+ try {
+ const ids = pendingApplies.map(item => item.applyId);
+ await batchApproveShopDealerApply(ids);
+ hide();
+ message.success(`成功通过 ${pendingApplies.length} 个申请`);
+ selection.value = [];
+ reload();
+ } catch (error: any) {
+ hide();
+ message.error(error.message || '批量审核失败,请重试');
+ }
+ }
+ });
+};
+
+/* 导出数据 */
+const exportData = () => {
+ const hide = message.loading('正在导出申请数据...', 0);
+ // 这里调用导出API
+ setTimeout(() => {
+ hide();
+ message.success('申请数据导出成功');
+ }, 2000);
+};
+
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
-const customRow = (record: ShopDealerUser) => {
+const customRow = (record: ShopDealerApply) => {
return {
// 行点击事件
onClick: () => {
@@ -340,7 +426,7 @@ query();
@@ -384,6 +470,22 @@ export default {
}
}
+.ele-text-success {
+ color: #52c41a;
+
+ &:hover {
+ color: #73d13d;
+ }
+}
+
+.ele-text-warning {
+ color: #faad14;
+
+ &:hover {
+ color: #ffc53d;
+ }
+}
+
.ele-text-danger {
color: #ff4d4f;
diff --git a/src/views/shop/shopDealerWithdraw/components/Import.vue b/src/views/shop/shopDealerWithdraw/components/Import.vue
new file mode 100644
index 0000000..d9b9e45
--- /dev/null
+++ b/src/views/shop/shopDealerWithdraw/components/Import.vue
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+ 将文件拖到此处,或点击上传
+
+
+
+
+
+
+
diff --git a/src/views/shop/shopDealerWithdraw/components/search.vue b/src/views/shop/shopDealerWithdraw/components/search.vue
index 82fea9d..7d7eb7a 100644
--- a/src/views/shop/shopDealerWithdraw/components/search.vue
+++ b/src/views/shop/shopDealerWithdraw/components/search.vue
@@ -1,42 +1,106 @@
-
-
-
-
-
-
- 添加
-
-
+
+
+
+
+
+
+
+
+
+ 批量删除
+
+
+
+
+
+
+
+
+ 重置
+
+
+
+
+
+
+
+
diff --git a/src/views/shop/shopDealerWithdraw/components/shopDealerWithdrawEdit.vue b/src/views/shop/shopDealerWithdraw/components/shopDealerWithdrawEdit.vue
index 72b26e0..f8f0076 100644
--- a/src/views/shop/shopDealerWithdraw/components/shopDealerWithdrawEdit.vue
+++ b/src/views/shop/shopDealerWithdraw/components/shopDealerWithdrawEdit.vue
@@ -21,77 +21,10 @@
基本信息
-
-
-
-
-
-
-
-
- 元
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 微信
-
-
- 支付宝
-
-
- 银行卡
-
-
+
+ {{ form.comments }}
@@ -138,6 +71,7 @@
@@ -146,6 +80,7 @@
@@ -165,28 +100,16 @@
-
+ {{ form.bankName }}
-
-
-
+ {{ form.bankAccount }}
+
+
+ {{ form.bankCard }}
-
-
-