43 lines
1.2 KiB
TypeScript
43 lines
1.2 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 价格矩阵:行=商品,列=启用等级,值=按等级上浮比例换算的售价(成本价未设置 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 } : {},
|
|
});
|
|
}
|