feat(shop): 新增客户跟进记录功能
- 在经销商申请模块中添加客户跟进记录的增删改查接口 - 新增 ShopDealerRecord 数据模型定义 - 更新经销商申请编辑页面,支持客户信息和报备人信息的录入- 添加收益基数字段 rate,用于设置分销比例 - 修改审核状态为跟进状态,包括跟进中、已签约、已取消三种状态 - 增加跟进情况列表展示和编辑功能,支持添加最多10条跟进记录 - 调整页面字段标签和提示文案,使表述更准确 -优化表单验证规则,适配新的业务逻辑 -修复时间格式化问题,统一使用 YYYY-MM-DD HH:mm:ss 格式- 移除旧的审核时间和驳回原因字段,替换为取消原因 - 更新
This commit is contained in:
@@ -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;
|
||||
// 申请时间
|
||||
|
||||
106
src/api/shop/shopDealerRecord/index.ts
Normal file
106
src/api/shop/shopDealerRecord/index.ts
Normal file
@@ -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<ApiResult<PageResult<ShopDealerRecord>>>(
|
||||
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<ApiResult<ShopDealerRecord[]>>(
|
||||
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<ApiResult<unknown>>(
|
||||
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<ApiResult<unknown>>(
|
||||
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<ApiResult<unknown>>(
|
||||
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<ApiResult<unknown>>(
|
||||
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<ApiResult<ShopDealerRecord>>(
|
||||
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));
|
||||
}
|
||||
39
src/api/shop/shopDealerRecord/model/index.ts
Normal file
39
src/api/shop/shopDealerRecord/model/index.ts
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user