1、spu管理功能 分类、品牌具体查询实现

pull/254/head
xjs 4 years ago
parent 612122d086
commit 0a234db339

@ -1,5 +1,5 @@
<template> <template>
<div class="mod-config"> <div class="app-container">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form :inline="true" :model="dataForm"> <el-form :inline="true" :model="dataForm">
<el-form-item label="分类"> <el-form-item label="分类">
@ -91,8 +91,8 @@
</template> </template>
<script> <script>
import CategoryCascader from "../common/category-cascader"; import CategoryCascader from '../../../components/mall/category-cascader'
import BrandSelect from "../common/brand-select"; import BrandSelect from "../../../components/mall/brand-select";
export default { export default {
data() { data() {
return { return {
@ -127,15 +127,15 @@ export default {
methods: { methods: {
getSkuDetails(row, expand) { getSkuDetails(row, expand) {
//sku //sku
console.log("展开某行...", row, expand);
}, },
// //
handleCommand(row, command) { handleCommand(row, command) {
console.log("~~~~~", row, command); if ("stockSettings" === command) {
if ("stockSettings" == command) {
this.$router.push({ path: "/ware-sku", query: { skuId: row.skuId } }); this.$router.push({ path: "/ware-sku", query: { skuId: row.skuId } });
} }
}, },
searchSkuInfo() { searchSkuInfo() {
this.getDataList(); this.getDataList();
}, },
@ -192,6 +192,6 @@ export default {
beforeDestroy() { beforeDestroy() {
PubSub.unsubscribe(this.catPathSub); PubSub.unsubscribe(this.catPathSub);
PubSub.unsubscribe(this.brandIdSub); PubSub.unsubscribe(this.brandIdSub);
} // -  }
}; };
</script> </script>

@ -10,8 +10,8 @@
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="spuName" header-align="center" align="center" label="名称" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="spuName" header-align="center" align="center" label="名称" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="spuDescription" header-align="center" align="center" label="描述" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="spuDescription" header-align="center" align="center" label="描述" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="catalogId" header-align="center" align="center" label="分类" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="catalogName" header-align="center" align="center" label="分类" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="brandId" header-align="center" align="center" label="品牌" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="brandName" header-align="center" align="center" label="品牌" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="weight" header-align="center" align="center" width="80px" label="重量(kg)" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="weight" header-align="center" align="center" width="80px" label="重量(kg)" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="publishStatus" header-align="center" width="80px" align="center" label="上架状态" :show-overflow-tooltip="true"> <el-table-column prop="publishStatus" header-align="center" width="80px" align="center" label="上架状态" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">

@ -45,6 +45,10 @@ public class SpuInfoServiceImpl extends ServiceImpl<SpuInfoDao, SpuInfoEntity> i
private SkuSaleAttrValueService skuSaleAttrValueService; private SkuSaleAttrValueService skuSaleAttrValueService;
@Resource @Resource
private RemoteCouponFeign remoteCouponFeign; private RemoteCouponFeign remoteCouponFeign;
@Autowired
private CategoryService categoryService;
@Autowired
private BrandService brandService;
@Override @Override
@ -169,12 +173,28 @@ public class SpuInfoServiceImpl extends ServiceImpl<SpuInfoDao, SpuInfoEntity> i
.eq(StringUtils.isNotEmpty(catelogId), SpuInfoEntity::getCatalogId, catelogId); .eq(StringUtils.isNotEmpty(catelogId), SpuInfoEntity::getCatalogId, catelogId);
wrapper.orderByDesc(SpuInfoEntity::getCreateTime); wrapper.orderByDesc(SpuInfoEntity::getCreateTime);
IPage<SpuInfoEntity> page = this.page( IPage<SpuInfoEntity> page = this.page(new Query<SpuInfoEntity>().getPage(params), wrapper);
new Query<SpuInfoEntity>().getPage(params),
wrapper List<SpuInfoEntity> spuInfoEntities = page.getRecords();
); List<SpuInfoVo> collect = spuInfoEntities.stream().map(spuInfoEntity -> {
SpuInfoVo spuInfoVo = new SpuInfoVo();
BeanUtils.copyProperties(spuInfoEntity, spuInfoVo);
//获取分类信息
CategoryEntity categoryEntity = categoryService.getById(spuInfoEntity.getCatalogId());
spuInfoVo.setCatalogName(categoryEntity.getName());
//获取品牌信息
BrandEntity brandEntity = brandService.getById(spuInfoEntity.getBrandId());
spuInfoVo.setBrandName(brandEntity.getName());
return spuInfoVo;
}).collect(Collectors.toList());
PageUtils pageUtils = new PageUtils(page);
pageUtils.setList(collect);
return new PageUtils(page); return pageUtils;
} }

@ -0,0 +1,58 @@
package com.xjs.mall.product.vo.spu;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* spuvo
* @author xiejs
* @since 2022-03-21
*/
@Data
public class SpuInfoVo {
private Long id;
/**
*
*/
private String spuName;
/**
*
*/
private String spuDescription;
/**
* id
*/
private Long catalogId;
/**
* id
*/
private Long brandId;
/**
*
*/
private BigDecimal weight;
/**
* [0 - 1 - ]
*/
private Integer publishStatus;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private String catalogName;
/**
*
*/
private String brandName;
}
Loading…
Cancel
Save