import type { PageParam, PageResult } from '@vben/request';
|
|
import { requestClient } from '#/api/request';
|
|
export namespace CrmSaleQuotationApi {
|
/** 报价单信息 */
|
export interface SaleQuotation {
|
id: number;
|
name: string;
|
no: string;
|
customerId: number;
|
customerName?: string;
|
businessId?: number;
|
businessName?: string;
|
contactId?: number;
|
contactName?: string;
|
quotationTime: Date;
|
validUntil?: Date;
|
totalProductPrice: number;
|
discountPercent: number;
|
totalPrice: number;
|
taxRate?: number;
|
fileUrl?: string;
|
remark?: string;
|
status: number;
|
contractId?: number;
|
contractNo?: string;
|
ownerUserId: number;
|
ownerUserName?: string;
|
creator: string;
|
creatorName: string;
|
createTime?: Date;
|
updateTime?: Date;
|
items?: SaleQuotationItem[];
|
}
|
|
/** 报价单物料明细 */
|
export interface SaleQuotationItem {
|
id: number;
|
itemId: number;
|
itemName: string;
|
itemCode: string;
|
itemBarCode?: string;
|
itemSpecification?: string;
|
itemUnitName: string;
|
itemUnitName2?: string;
|
itemUnitName3?: string;
|
itemPrice: number;
|
quotationPrice: number;
|
count: number;
|
totalPrice: number;
|
taxPercent?: number;
|
taxPrice?: number;
|
remark?: string;
|
}
|
}
|
|
/** 查询报价单分页列表 */
|
export function getSaleQuotationPage(params: PageParam) {
|
return requestClient.get<PageResult<CrmSaleQuotationApi.SaleQuotation>>(
|
'/crm/sale-quotation/page',
|
{ params },
|
);
|
}
|
|
/** 查询报价单分页列表(基于客户) */
|
export function getSaleQuotationPageByCustomer(params: PageParam) {
|
return requestClient.get<PageResult<CrmSaleQuotationApi.SaleQuotation>>(
|
'/crm/sale-quotation/page-by-customer',
|
{ params },
|
);
|
}
|
|
/** 查询报价单分页列表(基于商机) */
|
export function getSaleQuotationPageByBusiness(params: PageParam) {
|
return requestClient.get<PageResult<CrmSaleQuotationApi.SaleQuotation>>(
|
'/crm/sale-quotation/page-by-business',
|
{ params },
|
);
|
}
|
|
/** 查询报价单详情 */
|
export function getSaleQuotation(id: number) {
|
return requestClient.get<CrmSaleQuotationApi.SaleQuotation>(
|
`/crm/sale-quotation/get?id=${id}`,
|
);
|
}
|
|
/** 新增报价单 */
|
export function createSaleQuotation(data: CrmSaleQuotationApi.SaleQuotation) {
|
return requestClient.post('/crm/sale-quotation/create', data);
|
}
|
|
/** 修改报价单 */
|
export function updateSaleQuotation(data: CrmSaleQuotationApi.SaleQuotation) {
|
return requestClient.put('/crm/sale-quotation/update', data);
|
}
|
|
/** 删除报价单 */
|
export function deleteSaleQuotation(id: number) {
|
return requestClient.delete(`/crm/sale-quotation/delete?id=${id}`);
|
}
|
|
/** 转为合同 */
|
export function convertSaleQuotationToContract(id: number) {
|
return requestClient.post<number>('/crm/sale-quotation/convert-contract', null, {
|
params: { id },
|
});
|
}
|