mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-29 18:51:53 +08:00
feature(uniapp商品): 商品加载
This commit is contained in:
parent
4a39f2d9f8
commit
4207b2b61d
@ -5,8 +5,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryListReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryRespVO;
|
||||
import cn.iocoder.yudao.module.product.convert.brand.ProductBrandConvert;
|
||||
import cn.iocoder.yudao.module.product.convert.category.ProductCategoryConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
|
||||
import cn.iocoder.yudao.module.product.service.brand.ProductBrandService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -19,6 +23,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -74,4 +79,14 @@ public class ProductBrandController {
|
||||
return success(ProductBrandConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得品牌列表")
|
||||
@PreAuthorize("@ss.hasPermission('product:brand:query')")
|
||||
public CommonResult<List<ProductBrandRespVO>> getProductCategoryList(@Valid ProductBrandListReqVO listVO) {
|
||||
List<ProductBrandDO> list = brandService.getBrandList(listVO);
|
||||
list.sort(Comparator.comparing(ProductBrandDO::getSort));
|
||||
return success(ProductBrandConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.product.controller.admin.brand.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel(value = "管理后台 - 商品品牌分页 Request VO")
|
||||
@Data
|
||||
public class ProductBrandListReqVO {
|
||||
|
||||
@ApiModelProperty(value = "品牌名称", example = "芋道")
|
||||
private String name;
|
||||
|
||||
}
|
@ -40,7 +40,7 @@ public class ProductSkuDO extends BaseDO {
|
||||
private String name;
|
||||
/**
|
||||
* SPU 编号
|
||||
*
|
||||
* <p>
|
||||
* 关联 {@link ProductSpuDO#getId()}
|
||||
*/
|
||||
private Long spuId;
|
||||
@ -71,7 +71,7 @@ public class ProductSkuDO extends BaseDO {
|
||||
private String picUrl;
|
||||
/**
|
||||
* SKU 状态
|
||||
*
|
||||
* <p>
|
||||
* 枚举 {@link CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
@ -100,13 +100,13 @@ public class ProductSkuDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 属性编号
|
||||
*
|
||||
* <p>
|
||||
* 关联 {@link ProductPropertyDO#getId()}
|
||||
*/
|
||||
private Long propertyId;
|
||||
/**
|
||||
* 属性值编号
|
||||
*
|
||||
* <p>
|
||||
* 关联 {@link ProductPropertyValueDO#getId()}
|
||||
*/
|
||||
private Long valueId;
|
||||
|
@ -3,10 +3,14 @@ package cn.iocoder.yudao.module.product.dal.mysql.brand;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandBaseVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandListReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandPageReqVO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ProductBrandMapper extends BaseMapperX<ProductBrandDO> {
|
||||
|
||||
@ -18,4 +22,9 @@ public interface ProductBrandMapper extends BaseMapperX<ProductBrandDO> {
|
||||
.orderByDesc(ProductBrandDO::getId));
|
||||
}
|
||||
|
||||
|
||||
default List<ProductBrandDO> selectList(ProductBrandListReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ProductBrandDO>()
|
||||
.likeIfPresent(ProductBrandDO::getName, reqVO.getName()));
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
package cn.iocoder.yudao.module.product.service.brand;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandCreateReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandPageReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@ -55,6 +53,20 @@ public interface ProductBrandService {
|
||||
*/
|
||||
List<ProductBrandDO> getBrandList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得品牌列表
|
||||
* @param listVo 请求参数
|
||||
* @return 品牌列表
|
||||
*/
|
||||
List<ProductBrandDO> getBrandList(ProductBrandListReqVO listVo);
|
||||
|
||||
/**
|
||||
* 验证选择的商品分类是否合法
|
||||
*
|
||||
* @param id 分类编号
|
||||
*/
|
||||
void validateProductBrand(Long id);
|
||||
|
||||
/**
|
||||
* 获得品牌分页
|
||||
*
|
||||
|
@ -1,12 +1,11 @@
|
||||
package cn.iocoder.yudao.module.product.service.brand;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandCreateReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandPageReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.ProductBrandUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*;
|
||||
import cn.iocoder.yudao.module.product.convert.brand.ProductBrandConvert;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
|
||||
import cn.iocoder.yudao.module.product.dal.mysql.brand.ProductBrandMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@ -16,6 +15,7 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PRODUCT_BRAND_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PRODUCT_CATEGORY_LEVEL;
|
||||
|
||||
/**
|
||||
* 品牌 Service 实现类
|
||||
@ -71,6 +71,18 @@ public class ProductBrandServiceImpl implements ProductBrandService {
|
||||
return brandMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductBrandDO> getBrandList(ProductBrandListReqVO listVo) {
|
||||
return brandMapper.selectList(listVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateProductBrand(Long id) {
|
||||
if(getBrand(id) == null){
|
||||
throw exception(PRODUCT_BRAND_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProductBrandDO> getBrandPage(ProductBrandPageReqVO pageReqVO) {
|
||||
return brandMapper.selectPage(pageReqVO);
|
||||
|
@ -140,7 +140,8 @@ public class ProductSkuServiceImpl implements ProductSkuService {
|
||||
|
||||
@Override
|
||||
public List<ProductSkuDO> getSkusBySpuId(Long spuId) {
|
||||
return productSkuMapper.selectBySpuIds(Collections.singletonList(spuId));
|
||||
List<ProductSkuDO> productSkuDOS = productSkuMapper.selectBySpuIds(Collections.singletonList(spuId));
|
||||
return productSkuDOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO;
|
||||
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
|
||||
import cn.iocoder.yudao.module.product.dal.mysql.spu.ProductSpuMapper;
|
||||
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuSpecTypeEnum;
|
||||
import cn.iocoder.yudao.module.product.service.brand.ProductBrandService;
|
||||
import cn.iocoder.yudao.module.product.service.category.ProductCategoryService;
|
||||
import cn.iocoder.yudao.module.product.service.property.ProductPropertyService;
|
||||
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
|
||||
@ -55,17 +56,19 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
@Resource
|
||||
private ProductPropertyService productPropertyService;
|
||||
|
||||
@Resource
|
||||
private ProductBrandService brandService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long createProductSpu(ProductSpuCreateReqVO createReqVO) {
|
||||
// 校验分类
|
||||
categoryService.validateProductCategory(createReqVO.getCategoryId());
|
||||
// TODO @:校验品牌
|
||||
|
||||
// 校验品牌
|
||||
brandService.validateProductBrand(createReqVO.getBrandId());
|
||||
// 校验SKU
|
||||
List<ProductSkuCreateOrUpdateReqVO> skuCreateReqList = createReqVO.getSkus();
|
||||
productSkuService.validateProductSkus(skuCreateReqList, createReqVO.getSpecType());
|
||||
|
||||
// 插入 SPU
|
||||
ProductSpuDO spu = ProductSpuConvert.INSTANCE.convert(createReqVO);
|
||||
spu.setMarketPrice(CollectionUtils.getMaxValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getMarketPrice));
|
||||
@ -73,7 +76,6 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
spu.setMinPrice(CollectionUtils.getMinValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getPrice));
|
||||
spu.setTotalStock(CollectionUtils.getSumValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getStock, Integer::sum));
|
||||
ProductSpuMapper.insert(spu);
|
||||
|
||||
// 插入 SKU
|
||||
productSkuService.createProductSkus(skuCreateReqList, spu.getId());
|
||||
// 返回
|
||||
@ -128,6 +130,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
spuVO.setSkus(skuReqs);
|
||||
List<ProductSkuRespVO.Property> properties = new ArrayList<>();
|
||||
// 组合 sku 规格属性
|
||||
if(spu.getSpecType().equals(ProductSpuSpecTypeEnum.DISABLE.getType())) {
|
||||
for (ProductSkuRespVO productSkuRespVO : skuReqs) {
|
||||
properties.addAll(productSkuRespVO.getProperties());
|
||||
}
|
||||
@ -149,6 +152,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
|
||||
productPropertyViews.add(productPropertyViewRespVO);
|
||||
});
|
||||
spuVO.setProductPropertyViews(productPropertyViews);
|
||||
}
|
||||
// 组合分类
|
||||
if (null != spuVO.getCategoryId()) {
|
||||
LinkedList<Long> categoryArray = new LinkedList<>();
|
||||
|
@ -34,6 +34,15 @@ export function getBrand(id) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得品牌list
|
||||
export function getBrandList() {
|
||||
return request({
|
||||
url: '/product/brand/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获得品牌分页
|
||||
export function getBrandPage(query) {
|
||||
return request({
|
||||
|
@ -179,7 +179,7 @@
|
||||
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body destroy-on-close :close-on-click-modal="false" >
|
||||
<save @closeDialog="open = false; getList()"/>
|
||||
<save @closeDialog="closeDialog" :type="dialogType" :obj="dialogObj" v-if="open" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -257,6 +257,10 @@ export default {
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 弹出层类型
|
||||
dialogType: "add",
|
||||
// 弹出层参数
|
||||
dialogObj:{},
|
||||
dateRangeCreateTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
@ -570,75 +574,25 @@ export default {
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.dialogType = "add";
|
||||
this.dialogObj={};
|
||||
this.open = true;
|
||||
this.title = "添加商品spu";
|
||||
this.getPropertyPageList();
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getSpu(id).then((response) => {
|
||||
let dataSpu = response.data;
|
||||
this.form = {
|
||||
id: dataSpu.id,
|
||||
name: dataSpu.name,
|
||||
sellPoint: dataSpu.sellPoint,
|
||||
description: dataSpu.sellPoint,
|
||||
categoryId: dataSpu.sellPoint,
|
||||
categoryIds: dataSpu.categoryIds,
|
||||
picUrls: dataSpu.picUrls,
|
||||
sort: dataSpu.sort,
|
||||
likeCount: dataSpu.likeCount,
|
||||
price: dataSpu.price,
|
||||
quantity: dataSpu.quantity,
|
||||
status: dataSpu.status,
|
||||
isShowTagInput: undefined,
|
||||
skus: [],
|
||||
skusList: dataSpu.skus,
|
||||
productPropertyViews: dataSpu.productPropertyViews,
|
||||
// skus:dataSpu.productSkuRespVOS,
|
||||
};
|
||||
this.getDataHandle();
|
||||
this.dialogType = "upd";
|
||||
this.dialogObj.id = row.id;
|
||||
this.open = true;
|
||||
console.log("修改")
|
||||
this.title = "修改商品spu";
|
||||
});
|
||||
},
|
||||
getDataHandle() {
|
||||
let that = this;
|
||||
let productPropertyViews = JSON.parse(
|
||||
JSON.stringify(this.form.productPropertyViews)
|
||||
);
|
||||
productPropertyViews = productPropertyViews.sort(
|
||||
(a, b) => a.propertyId - b.propertyId
|
||||
);
|
||||
productPropertyViews.forEach((item) => {
|
||||
item.propertyValues = item.propertyValues.sort((a, b) => a.v1 - b.v1);
|
||||
});
|
||||
let skuIds = [];
|
||||
for (let i = 0; i < productPropertyViews.length; i++) {
|
||||
let han = {
|
||||
name: productPropertyViews[i].name,
|
||||
propertyId: productPropertyViews[i].propertyId,
|
||||
selectValues: [],
|
||||
selectValueIds: [],
|
||||
};
|
||||
for (
|
||||
let j = 0;
|
||||
j < productPropertyViews[i].propertyValues.length;
|
||||
j++
|
||||
) {
|
||||
han.selectValues.push(productPropertyViews[i].propertyValues[j].v2);
|
||||
han.selectValueIds.push(productPropertyViews[i].propertyValues[j].v1);
|
||||
}
|
||||
skuIds.push(han);
|
||||
}
|
||||
this.skuTags = skuIds;
|
||||
this.unUseTags = this.allhistoryTags.filter((v) =>
|
||||
skuIds.every((val) => val.name != v.name)
|
||||
);
|
||||
this.getHandleTable();
|
||||
closeDialog(){
|
||||
console.log("关闭")
|
||||
this.dialogType = "add";
|
||||
this.dialogObj={};
|
||||
this.open = false;
|
||||
this.getList()
|
||||
},
|
||||
getHandleTable() {
|
||||
this.form.skus = [];
|
||||
@ -699,33 +653,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
this.form.picUrls = this.form.picUrls.split(",");
|
||||
this.form.categoryId =
|
||||
this.form.categoryIds[this.form.categoryIds.length - 1];
|
||||
this.form.status = Number(this.form.status);
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateSpu(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createSpu(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
|
@ -193,6 +193,16 @@
|
||||
<!-- 销售设置 -->
|
||||
<el-tab-pane label="销售设置" name="fourth">
|
||||
<el-form ref="fourth" :model="baseForm" :rules="rules" label-width="100px" style="width: 95%">
|
||||
<el-form-item label="所属品牌" prop="brandId">
|
||||
<el-select v-model="baseForm.brandId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in brandList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="虚拟销量" prop="virtualSalesCount">
|
||||
<el-input v-model="baseForm.virtualSalesCount" placeholder="请输入虚拟销量" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"/>
|
||||
</el-form-item>
|
||||
@ -221,8 +231,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getBrandList} from "@/api/mall/product/brand";
|
||||
import {getProductCategoryList} from "@/api/mall/product/category";
|
||||
import {createSpu,} from "@/api/mall/product/spu";
|
||||
import {createSpu, getSpu} from "@/api/mall/product/spu";
|
||||
import {getPropertyPage,} from "@/api/mall/product/property";
|
||||
import Editor from "@/components/Editor";
|
||||
import ImageUpload from "@/components/ImageUpload";
|
||||
@ -232,6 +244,13 @@ export default {
|
||||
Editor,
|
||||
ImageUpload
|
||||
},
|
||||
props:{//props列表
|
||||
type:{
|
||||
type:String,
|
||||
default:"add" //定义参数默认值
|
||||
},
|
||||
obj: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: "base",
|
||||
@ -251,6 +270,7 @@ export default {
|
||||
status: 0,
|
||||
virtualSalesCount: 0,
|
||||
showStock: true,
|
||||
brandId: null
|
||||
},
|
||||
categoryList: [],
|
||||
// 价格库存
|
||||
@ -270,6 +290,7 @@ export default {
|
||||
// },
|
||||
],
|
||||
propertyPageList: [],
|
||||
brandList: [],
|
||||
specValue: null,
|
||||
|
||||
// 表单校验
|
||||
@ -283,11 +304,13 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
this.getListBrand();
|
||||
this.getListCategory();
|
||||
this.getPropertyPageList();
|
||||
if(this.type == 'upd'){
|
||||
this.updateType(this.obj.id)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
removeSpec(index){
|
||||
@ -351,6 +374,13 @@ export default {
|
||||
getProductCategoryList().then((response) => {
|
||||
this.categoryList = this.handleTree(response.data, "id", "parentId");
|
||||
});
|
||||
},
|
||||
/** 查询品牌列表 */
|
||||
getListBrand() {
|
||||
// 执行查询
|
||||
getBrandList().then((response) => {
|
||||
this.brandList = response.data;
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.$emit("closeDialog");
|
||||
@ -366,7 +396,13 @@ export default {
|
||||
rates.forEach(r => {
|
||||
let properties = []
|
||||
Array.of(r.spec).forEach(s => {
|
||||
Array.of(s).forEach((v, i) => {
|
||||
let obj;
|
||||
if (s instanceof Array) {
|
||||
obj = s;
|
||||
}else{
|
||||
obj = Array.of(s);
|
||||
}
|
||||
obj.forEach((v, i) => {
|
||||
console.log(this.dynamicSpec, r, s, v, i)
|
||||
let specValue = this.dynamicSpec[i].specValue.find(o => o.name == v);
|
||||
console.log(specValue)
|
||||
@ -382,9 +418,6 @@ export default {
|
||||
rates[0].name = this.baseForm.name;
|
||||
rates[0].status = this.baseForm.status;
|
||||
}
|
||||
|
||||
console.log(rates)
|
||||
|
||||
let form = this.baseForm
|
||||
if(form.picUrls instanceof Array){
|
||||
form.picUrls = form.picUrls.flatMap(m=>m.split(','))
|
||||
@ -422,6 +455,24 @@ export default {
|
||||
spec.specValue = obj.propertyValueList;
|
||||
this.dynamicSpec = dynamicSpec;
|
||||
this.buildRatesFormRates();
|
||||
},
|
||||
updateType(id){
|
||||
getSpu(id).then((response) =>{
|
||||
console.log(response)
|
||||
let data = response.data;
|
||||
this.baseForm.name=data.name;
|
||||
this.baseForm.sellPoint=data.sellPoint;
|
||||
this.baseForm.categoryIds=data.categoryIds;
|
||||
this.baseForm.sort=data.sort;
|
||||
this.baseForm.description=data.description;
|
||||
this.baseForm.picUrls=data.picUrls;
|
||||
this.baseForm.status=data.status;
|
||||
this.baseForm.virtualSalesCount=data.virtualSalesCount;
|
||||
this.baseForm.showStock=data.showStock;
|
||||
this.baseForm.brandId=data.brandId;
|
||||
this.ratesForm.spec=data.specType;
|
||||
this.ratesForm.rates=data.skus
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user