feat(sdy): 新增分销商订单管理功能

- 添加分销商订单模型定义及API接口- 实现分销商订单导入导出功能- 完善订单编辑页面字段展示和校验逻辑- 调整订单列表页展示字段及操作按钮- 移除三级分销相关字段和功能- 修改订单状态标签文案和样式
- 增加订单删除确认弹窗- 优化导入弹窗组件及上传逻辑
- 调整搜索组件布局并增加导入按钮
- 更新订单详情弹窗标题和结算按钮文案
- 移除订单详情查看功能及相关代码
- 调整表格列配置和数据渲染方式
- 修复未签约订单提示逻辑
- 移除语言参数传递逻辑- 增加新窗口打开链接工具函数引入
This commit is contained in:
2025-10-01 18:48:14 +08:00
parent 52bd53eb70
commit 320a1939b6
18 changed files with 676 additions and 539 deletions

View File

@@ -187,13 +187,11 @@ import {
QrcodeOutlined,
ShopOutlined,
ClockCircleOutlined,
SettingOutlined,
AccountBookOutlined,
FileTextOutlined,
ClearOutlined,
UngroupOutlined,
MoneyCollectOutlined,
ReloadOutlined
MoneyCollectOutlined
} from '@ant-design/icons-vue';
import {message} from 'ant-design-vue/es';
import {openNew} from "@/utils/common";

View File

@@ -1,4 +1,3 @@
<!-- 搜索表单 -->
<template>
<div class="search-container">
<!-- 搜索表单 -->
@@ -70,7 +69,6 @@
<a-space>
<a-button
type="primary"
:disabled="!selection?.length"
@click="batchSettle"
class="ele-btn-icon"
>
@@ -79,29 +77,36 @@
</template>
批量结算
</a-button>
<a-button
:disabled="!selection?.length"
@click="exportData"
class="ele-btn-icon"
>
<a-button @click="exportData" class="ele-btn-icon">
<template #icon>
<ExportOutlined />
</template>
导出数据
</a-button>
<a-button @click="openImport" class="ele-btn-icon">
<template #icon>
<UploadOutlined />
</template>
导入数据
</a-button>
</a-space>
</div>
</div>
<!-- 导入弹窗 -->
<Import v-model:visible="showImport" @done="emit('importDone')" />
</template>
<script lang="ts" setup>
import { reactive } from 'vue';
import { reactive, ref } from 'vue';
import {
SearchOutlined,
DollarOutlined,
ExportOutlined
ExportOutlined,
UploadOutlined
} from '@ant-design/icons-vue';
import type { ShopDealerOrderParam } from '@/api/shop/shopDealerOrder/model';
import Import from './Import.vue';
const props = withDefaults(
defineProps<{
@@ -117,8 +122,12 @@
(e: 'search', where?: ShopDealerOrderParam): void;
(e: 'batchSettle'): void;
(e: 'export'): void;
(e: 'importDone'): void;
}>();
// 是否显示导入弹窗
const showImport = ref(false);
// 搜索表单
const searchForm = reactive<ShopDealerOrderParam>({
orderId: undefined,
@@ -157,6 +166,11 @@
const exportData = () => {
emit('export');
};
// 打开导入弹窗
const openImport = () => {
showImport.value = true;
};
</script>
<style lang="less" scoped>

View File

@@ -15,7 +15,8 @@
@search="reload"
:selection="selection"
@batchSettle="batchSettle"
@export="exportData"
@export="handleExport"
@importDone="reload"
/>
</template>
<template #bodyCell="{ column, record }">
@@ -106,7 +107,7 @@ import type {
import Search from './components/search.vue';
import {getPageTitle} from '@/utils/common';
import ShopDealerOrderEdit from './components/shopDealerOrderEdit.vue';
import {pageShopDealerOrder, removeShopDealerOrder, removeBatchShopDealerOrder} from '@/api/shop/shopDealerOrder';
import {pageShopDealerOrder, removeShopDealerOrder, removeBatchShopDealerOrder, exportShopDealerOrder} from '@/api/shop/shopDealerOrder';
import type {ShopDealerOrder, ShopDealerOrderParam} from '@/api/shop/shopDealerOrder/model';
// 表格实例
@@ -123,6 +124,9 @@ const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 当前搜索条件
const currentWhere = ref<ShopDealerOrderParam>({});
// 表格数据源
const datasource: DatasourceFunction = ({
page,
@@ -134,6 +138,8 @@ const datasource: DatasourceFunction = ({
if (filters) {
where.status = filters.status;
}
// 保存当前搜索条件用于导出
currentWhere.value = { ...where };
return pageShopDealerOrder({
...where,
...orders,
@@ -373,13 +379,9 @@ const batchSettle = () => {
};
/* 导出数据 */
const exportData = () => {
const hide = message.loading('正在导出数据...', 0);
// 这里调用导出API
setTimeout(() => {
hide();
message.success('数据导出成功');
}, 2000);
const handleExport = () => {
// 调用导出API传入当前搜索条件
exportShopDealerOrder(currentWhere.value);
};
/* 打开编辑弹窗 */
@@ -503,4 +505,4 @@ export default {
:deep(.ant-tag) {
margin: 2px 4px 2px 0;
}
</style>
</style>

View File

@@ -1,100 +0,0 @@
# 分销商用户管理模块
## 功能说明
本模块提供了完整的分销商用户管理功能,包括:
### 基础功能
- ✅ 用户列表查看
- ✅ 用户信息编辑
- ✅ 用户详情查看
- ✅ 用户删除(单个/批量)
- ✅ 关键词搜索
### 导入导出功能
- ✅ Excel 数据导出
- ✅ Excel 数据导入
- ✅ 导入数据验证
- ✅ 错误处理
## 导入导出使用说明
### 导出功能
1. 点击"导出xls"按钮
2. 系统会根据当前搜索条件导出数据
3. 导出的Excel文件包含以下字段
- 用户ID
- 姓名
- 手机号
- 可提现佣金
- 冻结佣金
- 累计提现
- 推荐人ID
- 一级成员数
- 二级成员数
- 三级成员数
- 专属二维码
- 状态
- 创建时间
- 更新时间
### 导入功能
1. 点击"导入xls"按钮
2. 拖拽或选择Excel文件支持.xls和.xlsx格式
3. 文件大小限制10MB以内
4. 导入格式要求:
- 必填字段用户ID、姓名、手机号
- 佣金字段请填写数字,不要包含货币符号
- 状态字段:正常 或 已删除
- 推荐人ID必须是已存在的用户ID
### 数据格式示例
| 用户ID | 姓名 | 手机号 | 可提现佣金 | 冻结佣金 | 累计提现 | 推荐人ID | 一级成员数 | 二级成员数 | 三级成员数 | 专属二维码 | 状态 |
|--------|------|--------|------------|----------|----------|----------|------------|------------|------------|------------|------|
| 1001 | 张三 | 13800138000 | 100.50 | 50.00 | 200.00 | 1000 | 5 | 3 | 2 | DEALER_1001_xxx | 正常 |
| 1002 | 李四 | 13900139000 | 200.00 | 0.00 | 150.00 | | 2 | 1 | 0 | | 正常 |
## 技术实现
### 文件结构
```
src/views/shop/shopDealerUser/
├── index.vue # 主页面
├── components/
│ ├── search.vue # 搜索组件(包含导入导出功能)
│ ├── Import.vue # 导入弹窗组件
│ └── shopDealerUserEdit.vue # 编辑弹窗组件
└── README.md # 说明文档
```
### API 接口
```typescript
// 导入接口
POST /shop/shop-dealer-user/import
Content-Type: multipart/form-data
// 导出接口
GET /shop/shop-dealer-user/export
Response-Type: blob
```
### 依赖库
- `xlsx`: Excel文件处理
- `dayjs`: 日期格式化
- `ant-design-vue`: UI组件库
## 注意事项
1. **数据安全**:导入功能会直接操作数据库,请确保导入的数据准确无误
2. **性能考虑**:大量数据导入时可能需要较长时间,请耐心等待
3. **错误处理**:导入失败时会显示具体错误信息,请根据提示修正数据
4. **权限控制**:确保用户有相应的导入导出权限
## 更新日志
### v1.0.0 (2024-12-19)
- ✅ 实现基础的导入导出功能
- ✅ 添加数据验证和错误处理
- ✅ 优化用户体验和界面交互
- ✅ 完善文档说明