61 lines
1.6 KiB
TypeScript
61 lines
1.6 KiB
TypeScript
import createAxios from '@/utils/request';
|
|
import type { IReconDiff } from '@/domain/iReconciliation.ts';
|
|
|
|
export interface ReconItemUpdateParams {
|
|
product_name?: string;
|
|
quantity?: number | string;
|
|
weight?: number | string;
|
|
publish_amount?: number | string;
|
|
actual_amount?: number | string;
|
|
}
|
|
|
|
/** 生成对账明细(按周期 + 品类 + 供应商拉取采购分摊数据) */
|
|
export async function buildRecon(id: number) {
|
|
return createAxios<{ count: number }>({
|
|
url: `/recon/list/${id}/build`,
|
|
method: 'post',
|
|
});
|
|
}
|
|
|
|
/** D4 修改对账明细(diff 与头汇总后端重算) */
|
|
export async function updateReconItem(id: number, data: ReconItemUpdateParams) {
|
|
return createAxios<{ diff_amount: string }>({
|
|
url: `/recon/item/${id}`,
|
|
method: 'put',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/** D8 对账状态标记翻转 */
|
|
export async function toggleReconItem(id: number) {
|
|
return createAxios<{ is_reconciled: number }>({
|
|
url: `/recon/item/${id}/toggle`,
|
|
method: 'put',
|
|
});
|
|
}
|
|
|
|
/** D6 单品级门店备注 */
|
|
export async function remarkReconItem(id: number, store_remark: string) {
|
|
return createAxios({
|
|
url: `/recon/item/${id}/remark`,
|
|
method: 'put',
|
|
data: { store_remark },
|
|
});
|
|
}
|
|
|
|
/** D5 差额对比视图(按门店 / 按商品 + 合计) */
|
|
export async function getReconDiff(id: number) {
|
|
return createAxios<IReconDiff>({
|
|
url: `/recon/list/${id}/diff`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
/** D9 生成结算表 */
|
|
export async function settleRecon(id: number) {
|
|
return createAxios<{ count: number }>({
|
|
url: `/recon/list/${id}/settle`,
|
|
method: 'post',
|
|
});
|
|
}
|