mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:59:19 +08:00
feat: 推广费管理表商品列显示商品名称和编码
- PromotionFeeVO 新增 productName、productCode 字段 - 后端 convertToVO 填充商品基础信息 - 前端表格商品列显示商品名称和编码,副标题显示编码 - 店铺名称列改名为"店铺",调整列顺序 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+12
@@ -56,6 +56,18 @@ public class PromotionFeeVO {
|
||||
@Schema(description = "商品ID(可选)", example = "1")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description = "商品名称", example = "iPhone 15 Pro")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
@Schema(description = "商品编码", example = "IPHONE15PRO001")
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 推广活动名称
|
||||
*/
|
||||
|
||||
+15
@@ -19,6 +19,8 @@ import top.xyquan.ecomdmbbackend.modules.ecom.promotion.model.vo.PromotionFeeVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.promotion.service.PromotionFeeService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.promotion.service.PromotionFeeTypeService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.platform.service.PlatformService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.product.model.po.ProductPO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.product.service.ProductService;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.shop.service.ShopService;
|
||||
import top.xyquan.ecomdmbbackend.utils.CurrentUserContext;
|
||||
|
||||
@@ -36,6 +38,7 @@ public class PromotionFeeServiceImpl implements PromotionFeeService {
|
||||
private final CurrentUserContext currentUserContext;
|
||||
private final ShopService shopService;
|
||||
private final PromotionFeeTypeService promotionFeeTypeService;
|
||||
private final ProductService productService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -179,6 +182,18 @@ public class PromotionFeeServiceImpl implements PromotionFeeService {
|
||||
}
|
||||
}
|
||||
|
||||
// 填充商品名称和编码
|
||||
if (po.getProductId() != null) {
|
||||
try {
|
||||
ProductPO product = productService.getById(po.getProductId());
|
||||
if (product != null) {
|
||||
vo.setProductName(product.getName());
|
||||
vo.setProductCode(product.getProductCode());
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,10 @@ export namespace PromotionFeeVO {
|
||||
feeTypeName?: string;
|
||||
/** 商品ID(可选) */
|
||||
productId?: number;
|
||||
/** 商品名称 */
|
||||
productName?: string;
|
||||
/** 商品编码 */
|
||||
productCode?: string;
|
||||
/** 推广活动名称 */
|
||||
campaignName?: string;
|
||||
/** 推广费金额 */
|
||||
|
||||
@@ -92,16 +92,17 @@ const gridOptions: VxeGridProps<any> = {
|
||||
title: '序号',
|
||||
},
|
||||
{
|
||||
field: 'productId',
|
||||
title: '商品ID',
|
||||
field: 'shopName',
|
||||
title: '店铺',
|
||||
minWidth: 'auto',
|
||||
showOverflow: 'tooltip' as const,
|
||||
},
|
||||
{
|
||||
field: 'shopName',
|
||||
title: '店铺名称',
|
||||
minWidth: 'auto',
|
||||
field: 'productName',
|
||||
title: '商品',
|
||||
minWidth: 180,
|
||||
showOverflow: 'tooltip' as const,
|
||||
slots: { default: 'product' },
|
||||
},
|
||||
{
|
||||
field: 'feeTypeName',
|
||||
@@ -333,6 +334,15 @@ const formatAmount = (amount: number) => `¥${amount.toFixed(2)}`;
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #product="{ row }: { row: any }">
|
||||
<div>
|
||||
<div>{{ row.productName || '-' }}</div>
|
||||
<div v-if="row.productCode" class="text-gray-400 text-xs">
|
||||
{{ row.productCode }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #action="{ row }: { row: any }">
|
||||
<Space>
|
||||
<Button size="small" @click="handleEdit(row)"> 编辑 </Button>
|
||||
|
||||
Reference in New Issue
Block a user