gaoluyang
2026-06-24 bfdc0e0e6d5e47aa501f9b6fadd143d9c97cf00a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import type { PageParam, PageResult } from '../../../../packages/effects/request/src';
 
import { requestClient } from '#/api/request';
 
export namespace CrmReceivablePlanApi {
  /** 回款计划信息 */
  export interface Plan {
    id: number;
    period: number;
    receivableId: number;
    price: number;
    returnTime: Date;
    remindDays: number;
    returnType: number;
    remindTime: Date;
    customerId: number;
    customerName?: string;
    contractId?: number;
    contractNo?: string;
    ownerUserId: number;
    ownerUserName?: string;
    remark: string;
    creator: string;
    creatorName?: string;
    createTime: Date;
    updateTime: Date;
    receivable?: {
      price: number;
      returnTime: Date;
    };
  }
  export interface PlanPageParam extends PageParam {
    customerId?: number;
    contractId?: number;
  }
}
 
/** 查询回款计划列表 */
export function getReceivablePlanPage(params: PageParam) {
  return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
    '/crm/receivable-plan/page',
    { params },
  );
}
 
/** 查询回款计划列表(按客户) */
export function getReceivablePlanPageByCustomer(params: PageParam) {
  return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
    '/crm/receivable-plan/page-by-customer',
    { params },
  );
}
 
/** 查询回款计划详情 */
export function getReceivablePlan(id: number) {
  return requestClient.get<CrmReceivablePlanApi.Plan>(
    '/crm/receivable-plan/get',
    { params: { id } },
  );
}
 
/** 查询回款计划下拉数据 */
export function getReceivablePlanSimpleList(
  customerId: number,
  contractId: number,
) {
  return requestClient.get<CrmReceivablePlanApi.Plan[]>(
    '/crm/receivable-plan/simple-list',
    {
      params: { customerId, contractId },
    },
  );
}
 
/** 新增回款计划 */
export function createReceivablePlan(data: CrmReceivablePlanApi.Plan) {
  return requestClient.post('/crm/receivable-plan/create', data);
}
 
/** 修改回款计划 */
export function updateReceivablePlan(data: CrmReceivablePlanApi.Plan) {
  return requestClient.put('/crm/receivable-plan/update', data);
}
 
/** 删除回款计划 */
export function deleteReceivablePlan(id: number) {
  return requestClient.delete('/crm/receivable-plan/delete', {
    params: { id },
  });
}
 
/** 导出回款计划 Excel */
export function exportReceivablePlan(params: any) {
  return requestClient.download('/crm/receivable-plan/export-excel', {
    params,
  });
}
 
/** 获得待回款提醒数量 */
export function getReceivablePlanRemindCount() {
  return requestClient.get<number>('/crm/receivable-plan/remind-count');
}