api.ts
1.57 KB
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
import { http } from "@/typing/http";
import request from "@/utils/request";
import { FINANCE2_HOST } from "@/utils/host";
type PrRes<T> = http.PromiseResp<T>;
export interface CompanyRelationParams {
dealerId: number;
compCategory: number;
keywords?: string;
current?: number;
pageSize?: number;
companyType?: number;
}
export interface CompanyRelationListVO {
compId?: number;
compName?: string;
compShortName?: string; //简称
compType?: number[]; //类型
compTypeName?: number; //类型
beforeReimburse?: boolean; //是否报销前提供发票
billAmountRatio?: number; //发票要求金额比例(已扩大100倍,前端直接拼接百分号展示)
settleMethodNames?: string; // 支持结算方式
accountCheckPeriod?: number; //对账周期,每月多少号
}
/**
* 查询往来单位关系列表
*/
export function getCompanyByDealerApi(params: CompanyRelationParams): PrRes<CompanyRelationListVO[]> {
return request.get(`${FINANCE2_HOST}/trade/company/relation/list`, { params });
}
interface SaveParams {
compIdList: number[]; //单位id集合
dealerId: number; //商家id,必填
compCategory: number; //单位类别,必填
}
/**
* 新增往来单位关系
*/
export function saveCompanyRelationApi(params: SaveParams): PrRes<void> {
return request.post(`${FINANCE2_HOST}/trade/company/relation/save`, params);
}
/**
* 删除往来单位关系
/trade/company/relation/delete
*/
export function deleteCompanyRelationApi(params: SaveParams): PrRes<void> {
return request.post(`${FINANCE2_HOST}/trade/company/relation/delete`, params);
}