修复生成商品sku列表的bug

This commit is contained in:
2024-07-26 11:54:51 +08:00
parent 049a6f7476
commit 904bd82e39
6 changed files with 303 additions and 66 deletions

View File

@@ -80,6 +80,8 @@ export interface Goods {
goodsSpecs?: GoodsSpec[];
// 商品sku列表
goodsSkus?: GoodsSku[];
// 单位名称
unitName?: string;
}
export interface BathSet {

View File

@@ -2,6 +2,18 @@ import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { GoodsSku, GoodsSkuParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
import { GoodsSpec } from '@/api/shop/goodsSpec/model';
export async function generateGoodsSku(data: GoodsSpec) {
const res = await request.post<ApiResult<GoodsSku[]>>(
MODULES_API_URL + '/shop/goods-sku/generateGoodsSku',
data
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 分页查询商品sku列表

View File

@@ -10,24 +10,24 @@ export interface GoodsSku {
goodsId?: number;
// 规格组ID
specId?: number;
// 规格值ID
specValueId?: number;
// 规格值0
specValue0?: string;
// 规格值1
specValue1?: string;
// 规格值2
specValue2?: string;
// 商品图片
image?: string;
// 商品价格
price?: string;
// 市场价格
salePrice?: string;
// 成本价
cost?: string;
// 库存
stock?: number;
// sku编码
skuNo?: string;
// 唯一值
unique?: string;
// 重量
weight?: string;
// 体积
volume?: string;
// 状态, 0正常, 1异常
status?: number;
// 备注
@@ -37,6 +37,7 @@ export interface GoodsSku {
// 创建时间
createTime?: string;
images?: any;
sku?: string;
}
/**
@@ -44,5 +45,6 @@ export interface GoodsSku {
*/
export interface GoodsSkuParam extends PageParam {
id?: number;
goodsId?: number;
keywords?: string;
}