From 645d987f3b92fac5fad258bbf0f449e62ba8c17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 2 Oct 2025 13:21:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(shop):=20=E6=96=B0=E5=A2=9E=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E8=B7=9F=E8=BF=9B=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在经销商申请模块中添加客户跟进记录的增删改查接口 - 新增 ShopDealerRecord 数据模型定义 - 更新经销商申请编辑页面,支持客户信息和报备人信息的录入- 添加收益基数字段 rate,用于设置分销比例 - 修改审核状态为跟进状态,包括跟进中、已签约、已取消三种状态 - 增加跟进情况列表展示和编辑功能,支持添加最多10条跟进记录 - 调整页面字段标签和提示文案,使表述更准确 -优化表单验证规则,适配新的业务逻辑 -修复时间格式化问题,统一使用 YYYY-MM-DD HH:mm:ss 格式- 移除旧的审核时间和驳回原因字段,替换为取消原因 - 更新 --- src/api/shop/shopDealerApply/model/index.ts | 6 + src/api/shop/shopDealerRecord/index.ts | 106 +++ src/api/shop/shopDealerRecord/model/index.ts | 39 + .../sdy/shopDealerApply/components/search.vue | 4 +- .../components/shopDealerApplyEdit.vue | 763 +++++++++++------- src/views/sdy/shopDealerApply/index.vue | 37 +- 6 files changed, 662 insertions(+), 293 deletions(-) create mode 100644 src/api/shop/shopDealerRecord/index.ts create mode 100644 src/api/shop/shopDealerRecord/model/index.ts diff --git a/src/api/shop/shopDealerApply/model/index.ts b/src/api/shop/shopDealerApply/model/index.ts index f3ce906..29d8627 100644 --- a/src/api/shop/shopDealerApply/model/index.ts +++ b/src/api/shop/shopDealerApply/model/index.ts @@ -10,14 +10,20 @@ export interface ShopDealerApply { type?: number; // 用户ID userId?: number; + // 昵称 + nickName?: string; // 姓名 realName?: string; // 经销商名称 dealerName?: string; // 手机号 mobile?: string; + // 分销比例 + rate?: number; // 推荐人用户ID refereeId?: number; + // 推荐人姓名 + refereeName?: string; // 申请方式(10需后台审核 20无需审核) applyType?: number; // 申请时间 diff --git a/src/api/shop/shopDealerRecord/index.ts b/src/api/shop/shopDealerRecord/index.ts new file mode 100644 index 0000000..3982d39 --- /dev/null +++ b/src/api/shop/shopDealerRecord/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { ShopDealerRecord, ShopDealerRecordParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询客户跟进情况 + */ +export async function pageShopDealerRecord(params: ShopDealerRecordParam) { + const res = await request.get>>( + MODULES_API_URL + '/shop/shop-dealer-record/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询客户跟进情况列表 + */ +export async function listShopDealerRecord(params?: ShopDealerRecordParam) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-dealer-record', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加客户跟进情况 + */ +export async function addShopDealerRecord(data: ShopDealerRecord) { + const res = await request.post>( + MODULES_API_URL + '/shop/shop-dealer-record', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改客户跟进情况 + */ +export async function updateShopDealerRecord(data: ShopDealerRecord) { + const res = await request.put>( + MODULES_API_URL + '/shop/shop-dealer-record', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除客户跟进情况 + */ +export async function removeShopDealerRecord(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-dealer-record/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除客户跟进情况 + */ +export async function removeBatchShopDealerRecord(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/shop/shop-dealer-record/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询客户跟进情况 + */ +export async function getShopDealerRecord(id: number) { + const res = await request.get>( + MODULES_API_URL + '/shop/shop-dealer-record/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/shop/shopDealerRecord/model/index.ts b/src/api/shop/shopDealerRecord/model/index.ts new file mode 100644 index 0000000..c32e9a7 --- /dev/null +++ b/src/api/shop/shopDealerRecord/model/index.ts @@ -0,0 +1,39 @@ +import type { PageParam } from '@/api'; + +/** + * 客户跟进情况 + */ +export interface ShopDealerRecord { + // ID + id?: number; + // 上级id, 0是顶级 + parentId?: number; + // 客户ID + dealerId?: number; + // 内容 + content?: string; + // 用户ID + userId?: number; + // 排序(数字越小越靠前) + sortNumber?: number; + // 备注 + comments?: string; + // 状态, 0待处理, 1已完成 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 客户跟进情况搜索条件 + */ +export interface ShopDealerRecordParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/views/sdy/shopDealerApply/components/search.vue b/src/views/sdy/shopDealerApply/components/search.vue index 58bd4f3..11d042a 100644 --- a/src/views/sdy/shopDealerApply/components/search.vue +++ b/src/views/sdy/shopDealerApply/components/search.vue @@ -17,10 +17,10 @@ /> - + diff --git a/src/views/sdy/shopDealerApply/components/shopDealerApplyEdit.vue b/src/views/sdy/shopDealerApply/components/shopDealerApplyEdit.vue index bad4d1f..f7b93f8 100644 --- a/src/views/sdy/shopDealerApply/components/shopDealerApplyEdit.vue +++ b/src/views/sdy/shopDealerApply/components/shopDealerApplyEdit.vue @@ -5,7 +5,7 @@ :visible="visible" :maskClosable="false" :maxable="maxable" - :title="isUpdate ? '编辑分销商申请' : '新增分销商申请'" + :title="isUpdate ? '编辑客户' : '新增客户'" :body-style="{ paddingBottom: '28px' }" @update:visible="updateVisible" @ok="save" @@ -17,17 +17,65 @@ :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" > - + + - 申请人信息 + 客户信息 - + + + + + + + + + + + + + + + + + + + + + + + + 报备人信息 + + + + + - - + - - - - - - - - @@ -66,11 +104,22 @@ /> + + + + + - 审核信息 + 审核状态 @@ -78,39 +127,25 @@ - 待审核 - 等待审核 + 跟进中 + 正在跟进中 - 审核通过 - 申请通过 + 已签约 + 客户已签约 - 审核驳回 - 申请驳回 + 已取消 + 客户已取消 - - - - - - - - - - - - - - - - + + + + + + 跟进情况 + + + +
+ + + + 新增 + + + 最多可添加10条跟进信息,当前已添加{{ followUpList.length }}条 + + + + +
+ + + +
+ +
+
+ + + 删除 + + +
+
+
+