38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import createAxios from '@/utils/request';
|
||
import type IProduct from '@/domain/iProduct.ts';
|
||
import type { IBatchPriceUpdate, IPriceMatrix } from '@/domain/iProduct.ts';
|
||
|
||
export interface PriceMatrixParams {
|
||
category_id?: number;
|
||
keyword?: string;
|
||
page?: number;
|
||
pageSize?: number;
|
||
}
|
||
|
||
/** A2 价格矩阵:行=商品,列=启用等级,值=price(缺失 null) */
|
||
export async function getPriceMatrix(params?: PriceMatrixParams) {
|
||
return createAxios<IPriceMatrix>({
|
||
url: '/product/goods/priceMatrix',
|
||
method: 'get',
|
||
params,
|
||
});
|
||
}
|
||
|
||
/** A2 批量调价(提交后给受影响门店生成价格变更通知) */
|
||
export async function batchPrice(updates: IBatchPriceUpdate[]) {
|
||
return createAxios({
|
||
url: '/product/goods/batchPrice',
|
||
method: 'put',
|
||
data: { updates },
|
||
});
|
||
}
|
||
|
||
/** 商品下拉选项(仅上架) */
|
||
export async function getProductOptions(keyword?: string) {
|
||
return createAxios<IProduct[]>({
|
||
url: '/product/goods/options',
|
||
method: 'get',
|
||
params: keyword ? { keyword } : {},
|
||
});
|
||
}
|