实现价格折扣动态调整
This commit is contained in:
@@ -19,3 +19,49 @@ export async function getPageProductSku(params: {
|
||||
params,
|
||||
)
|
||||
}
|
||||
|
||||
export async function createProductSku(data: {
|
||||
product_id: number
|
||||
code: string
|
||||
name: string
|
||||
price: string
|
||||
discount_id?: number
|
||||
}) {
|
||||
return callByUser<ProductSku>("/api/admin/product/sku/create", {
|
||||
product_id: data.product_id,
|
||||
code: data.code,
|
||||
name: data.name,
|
||||
price: data.price,
|
||||
discount_id: data.discount_id,
|
||||
})
|
||||
}
|
||||
|
||||
export async function updateProductSku(data: {
|
||||
id: number
|
||||
code?: string
|
||||
name?: string
|
||||
price?: string
|
||||
discount_id?: number | null
|
||||
}) {
|
||||
return callByUser<ProductSku>("/api/admin/product/sku/update", {
|
||||
id: data.id,
|
||||
code: data.code,
|
||||
name: data.name,
|
||||
price: data.price,
|
||||
discount_id: data.discount_id,
|
||||
})
|
||||
}
|
||||
|
||||
export async function deleteProductSku(id: number) {
|
||||
return callByUser<ProductSku>("/api/admin/product/sku/remove", { id })
|
||||
}
|
||||
|
||||
export async function batchUpdateProductSkuDiscount(data: {
|
||||
product_id: number
|
||||
discount_id: number | null
|
||||
}) {
|
||||
return callByUser<void>("/api/admin/product/sku/update/discount/batch", {
|
||||
product_id: data.product_id,
|
||||
discount_id: data.discount_id,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user