Files
xin-procurement/web/api/product/goods.ts
T
2026-08-05 22:02:32 +08:00

38 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 } : {},
});
}