30 lines
954 B
TypeScript
30 lines
954 B
TypeScript
import createAxios from '@/utils/request';
|
|
import { downloadBlob } from '@/api/common/download.ts';
|
|
import type { IBillDetail } from '@/domain/iBill.ts';
|
|
|
|
/** 账单详情(账单信息 + 合并商品明细 + 关联订单) */
|
|
export async function getBillDetail(id: number) {
|
|
return createAxios<IBillDetail>({
|
|
url: `/recon/bill/${id}`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
/** 确认收款:线下收款后手动登记付款信息,支付状态置为已支付 */
|
|
export async function payBill(id: number, data: { paid_at: string; pay_remark?: string }) {
|
|
return createAxios({
|
|
url: `/recon/bill/${id}/pay`,
|
|
method: 'put',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/** 合并导出账单:勾选账单跨账单按商品合并明细,可按一级分类过滤 */
|
|
export async function exportBills(ids: number[], categoryId: number) {
|
|
return downloadBlob(
|
|
'/recon/bill/export',
|
|
{ ids: ids.join(','), category_id: categoryId },
|
|
'门店账单.xlsx'
|
|
);
|
|
}
|