采购单优化
This commit is contained in:
@@ -5,6 +5,8 @@ import type {
|
||||
IPurchaseCell,
|
||||
IPurchaseDetail,
|
||||
IPurchaseStoreSummary,
|
||||
PurchaseStoreItemAddParams,
|
||||
PurchaseStoreItemUpdateParams,
|
||||
} from '@/domain/iPurchaseOrder.ts';
|
||||
|
||||
/** 订单商品参数修改 */
|
||||
@@ -102,11 +104,60 @@ export async function generateBill(purchaseId: number, stores: BillGenerateStore
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出采购单(Excel 表格,全品类) */
|
||||
export async function exportPurchase(id: number) {
|
||||
/** 门店购买详情:新增单品(挂靠该门店在采购单中的最新一笔订单) */
|
||||
export async function addPurchaseStoreItem(purchaseId: number, storeId: number, data: PurchaseStoreItemAddParams) {
|
||||
return createAxios<{ id: number }>({
|
||||
url: `/purchase/order/${purchaseId}/store/${storeId}/item`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/** 门店购买详情:修改单品(数量/称重/单价;同商品多笔订单明细时合并到最早一条) */
|
||||
export async function updatePurchaseStoreItem(
|
||||
purchaseId: number,
|
||||
storeId: number,
|
||||
productId: number,
|
||||
data: PurchaseStoreItemUpdateParams,
|
||||
) {
|
||||
return createAxios({
|
||||
url: `/purchase/order/${purchaseId}/store/${storeId}/item/${productId}`,
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/** 门店购买详情:移除单品 */
|
||||
export async function removePurchaseStoreItem(purchaseId: number, storeId: number, productId: number) {
|
||||
return createAxios({
|
||||
url: `/purchase/order/${purchaseId}/store/${storeId}/item/${productId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出采购单商品明细(系统全部商品行,支持按供应商筛选) */
|
||||
export async function exportPurchase(id: number, supplierId?: number) {
|
||||
return downloadBlob(
|
||||
`/purchase/order/${id}/export`,
|
||||
{},
|
||||
supplierId ? { supplier_id: supplierId } : {},
|
||||
`采购单_${id}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出门店购买详情(多工作表;storeId 单门店导出) */
|
||||
export async function exportPurchaseStores(id: number, storeId?: number) {
|
||||
return downloadBlob(
|
||||
`/purchase/order/${id}/exportStores`,
|
||||
storeId ? { store_id: storeId } : {},
|
||||
`门店购买详情_${id}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出供应商采购明细(多工作表;supplierId 单供应商导出) */
|
||||
export async function exportPurchaseSuppliers(id: number, supplierId?: number) {
|
||||
return downloadBlob(
|
||||
`/purchase/order/${id}/exportSuppliers`,
|
||||
supplierId ? { supplier_id: supplierId } : {},
|
||||
`供应商采购明细_${id}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user