feat(dealer): 添加经销商申请管理功能

- 新增经销商申请页面,支持申请列表展示和分页查询
- 添加搜索组件,支持按客户名称、联系电话、审核状态等条件筛选
- 实现申请状态管理,包括跟进中、已签约、已取消三种状态
- 开发编辑弹窗功能,支持新增和修改申请信息
- 添加审核功能,支持批量通过和单个驳回操作
- 集成跟进记录管理,可查看历史记录并添加新的跟进内容
- 完善表单验证,包含必填字段校验和格式验证
- 优化模型定义,在相关实体中增加头像、昵称、真实姓名等字段
- 调整商品模型,将isShow字段从数字类型改为布尔类型
- 新增分销佣金相关字段,支持固定金额和百分比两种分佣类型
This commit is contained in:
2026-01-28 22:37:37 +08:00
parent b9d2648e6f
commit f96d4d8530
55 changed files with 11377 additions and 1383 deletions

View File

@@ -0,0 +1,144 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-input-search
allow-clear
placeholder="客户名称|订单编号"
style="width: 240px"
v-model:value="where.keywords"
@search="reload"
/>
<a-button type="dashed" @click="handleExport">导出xls</a-button>
</a-space>
</template>
<script lang="ts" setup>
import type { GradeParam } from '@/api/user/grade/model';
import {ref, watch} from 'vue';
import {utils, writeFile} from 'xlsx';
import {message} from 'ant-design-vue';
import {ShopDealerCapital} from "@/api/shop/shopDealerCapital/model";
import {getTenantId} from "@/utils/domain";
import useSearch from "@/utils/use-search";
import {ShopDealerOrder, ShopDealerOrderParam} from "@/api/sdy/sdyDealerOrder/model";
import {pageShopDealerOrder} from "@/api/shop/shopDealerOrder";
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
const reload = () => {
emit('search', where);
};
// 表单数据
const {where} = useSearch<ShopDealerOrderParam>({
keywords: '',
userId: undefined,
orderNo: undefined,
limit: 5000
});
const list = ref<ShopDealerCapital[]>([]);
// 导出
const handleExport = async () => {
const array: (string | number)[][] = [
[
'客户名称',
'业务员',
'订单编号',
'结算电量',
'换算成度',
'结算单价',
'结算金额',
'税费',
'实发金额',
'一级佣金30%',
'一级佣金收益',
'二级佣金10%',
'二级佣金收益',
'三级佣金60%',
'三级佣金收益',
'月份',
'创建时间',
'结算时间',
'租户ID'
]
];
// 按搜索结果导出
await pageShopDealerOrder(where)
.then((data) => {
list.value = data?.list || [];
list.value?.forEach((d: ShopDealerOrder) => {
array.push([
`${d.title}`,
`${d.nickname}(${d.userId})`,
`${d.orderNo}`,
`${d.orderPrice}`,
`${d.degreePrice}`,
`${d.price}`,
`${d.settledPrice}`,
`${d.rate}`,
`${d.payPrice}`,
`${d.firstNickname}(${d.firstUserId})`,
`${d.firstMoney}`,
`${d.secondNickname}(${d.secondUserId})`,
`${d.secondMoney}`,
`${d.thirdNickname}(${d.thirdUserId})`,
`${d.thirdMoney}`,
`${d.month}`,
`${d.createTime}`,
`${d.settleTime}`,
`${d.tenantId}`
]);
});
const sheetName = `bak_shop_dealer_order_${getTenantId()}`;
const workbook = {
SheetNames: [sheetName],
Sheets: {}
};
const sheet = utils.aoa_to_sheet(array);
workbook.Sheets[sheetName] = sheet;
// 设置列宽
sheet['!cols'] = [
{wch: 10},
{wch: 20},
{wch: 20},
{wch: 15},
{wch: 10},
{wch: 10},
{wch: 20}
];
message.loading('正在导出...');
setTimeout(() => {
writeFile(
workbook,
`${sheetName}.xlsx`
);
}, 1000);
})
.catch((msg) => {
message.error(msg);
})
.finally(() => {
});
};
watch(
() => props.selection,
() => {}
);
</script>