mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 04:29:20 +08:00
feat: 创建商品时同步提示新增规格的成本;优化成本同步弹框日期范围交互
- 新增 CreateProductResultDTO:创建商品响应含 specIdsCostChangedWithLinkedOrders - ProductService.createProduct:新增规格(编码非空、三项成本至少一项大于 0、且有关联订单)时纳入同步提示 - ProductService.updateProduct:合并成本变更规格与新增规格中有关联订单的 ID集合 - OrderService:新增 companyHasOrdersForSpec() 查询单个规格是否存在关联订单 - BatchSyncCostDTO:注释明确 startTime/endTime 为含边界的 LocalDateTime 字符串 - 前端成本同步弹窗:日期选择器改为纯日期格式(YYYY-MM-DD),提交时自动补 00:00:00 / 23:59:59 - ProductFormModal:创建商品后若有待同步规格则自动弹出成本同步确认框
This commit is contained in:
@@ -24,7 +24,10 @@ export async function getProductPageApi(
|
||||
* 创建商品
|
||||
*/
|
||||
export async function createProductApi(data: ProductDTO.Create) {
|
||||
return requestClient.post<ProductVO.Info>('/ec/product/create', data);
|
||||
return requestClient.post<ProductVO.CreateProductResult>(
|
||||
'/ec/product/create',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,13 +36,20 @@ export namespace ProductVO {
|
||||
/** 更新商品响应 */
|
||||
export interface UpdateProductResult {
|
||||
/**
|
||||
* 成本已变更且当前公司在库中存在关联订单的规格ID列表(用于提示同步成本到订单)
|
||||
* 需提示同步:成本已变更且有关联订单;或新增规格(编码非空、商品/运费/其他成本至少一项大于 0)且有关联订单
|
||||
*/
|
||||
specIdsCostChangedWithLinkedOrders: number[];
|
||||
/** 更新后的商品完整信息 */
|
||||
product: ProductVO.Info;
|
||||
}
|
||||
|
||||
/** 创建商品响应 */
|
||||
export interface CreateProductResult {
|
||||
/** 新增规格:编码非空、至少一项成本大于 0、且有关联订单的规格 ID */
|
||||
specIdsCostChangedWithLinkedOrders: number[];
|
||||
product: ProductVO.Info;
|
||||
}
|
||||
|
||||
/** 商品规格信息 */
|
||||
export interface SpecInfo {
|
||||
/** 规格ID */
|
||||
|
||||
Reference in New Issue
Block a user