Merge branch 'master' of http://120.27.238.55:7000/r/xc-mall
5 files added
33 files modified
| | |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.OssUtils; |
| | | import cc.mrbird.febs.mall.dto.AddMallGoodsDto; |
| | | import cc.mrbird.febs.mall.dto.MallGoodsUpdateDto; |
| | | import cc.mrbird.febs.mall.dto.UpMallGoodsDto; |
| | | import cc.mrbird.febs.mall.entity.MallGoods; |
| | | import cc.mrbird.febs.mall.entity.MallGoodsCategory; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 商品-编辑 |
| | | */ |
| | | @PostMapping("updateMallGoods") |
| | | @ControllerEndpoint(operation = "商品-编辑", exceptionMessage = "操作失败") |
| | | public FebsResponse updateMallGoods(@RequestBody @Valid MallGoodsUpdateDto mallGoodsUpdateDto) { |
| | | return adminMallGoodsService.updateMallGoods(mallGoodsUpdateDto); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.service.IAdminMallGoodsService; |
| | | import cc.mrbird.febs.mall.service.IAdminMallMemberService; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsDetailVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsUpdateVo; |
| | | import cc.mrbird.febs.mall.vo.MallMemberVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("goodsUpdate/{id}") |
| | | @RequiresPermissions("goodsUpdate:update") |
| | | @GetMapping("goodsUpdateNew/{id}") |
| | | @RequiresPermissions("goodsUpdateNew:update") |
| | | public String goodsUpdate(@PathVariable long id, Model model) { |
| | | AdminMailGoodsDetailVo data = mallGoodsService.getMallGoodsInfoById(id); |
| | | AdminMailGoodsUpdateVo data = mallGoodsService.getMallGoodsUpdateInfoById(id); |
| | | model.addAttribute("mailGoodsUpdate", data); |
| | | return FebsUtil.view("modules/goods/goodsUpdate"); |
| | | return FebsUtil.view("modules/goods/goodsUpdateNew"); |
| | | } |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "MailGoodsSkuDto", description = "参数接收类") |
| | | public class MailGoodsSkuDto { |
| | | |
| | | private Long id; |
| | | |
| | | private String styleName; |
| | | |
| | | private String skuName; |
| | | |
| | | private String skuImage; |
| | | |
| | | private Integer stock; |
| | | |
| | | private Integer skuVolume; |
| | | |
| | | private BigDecimal originalPrice; |
| | | |
| | | private BigDecimal presentPrice; |
| | | |
| | | private Long styleId; |
| | | |
| | | private Long goodsId; |
| | | |
| | | private String delLog; |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsSkuDetailVo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "MallGoodsUpdateDto", description = "参数接收类") |
| | | public class MallGoodsUpdateDto { |
| | | |
| | | private Long id; |
| | | |
| | | private String goodsNo; |
| | | |
| | | private String goodsName; |
| | | |
| | | private List<MailGoodsSkuDto> mailGoodsSkuDto; |
| | | |
| | | private String thumbs; |
| | | |
| | | private String goodsIntrodution; |
| | | |
| | | private String unit; |
| | | |
| | | private String thumb; |
| | | |
| | | private String goodsDetails; |
| | | |
| | | private Integer isSale; |
| | | |
| | | private String originalPrice; |
| | | |
| | | private String presentPrice; |
| | | |
| | | private Long categoryId; |
| | | |
| | | private Integer isHot; |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.MallGoodsImages; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsImagesVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | public interface MallGoodsImagesMapper extends BaseMapper<MallGoodsImages> { |
| | | |
| | | List<String> selectGoodsImagesByGoodsId(@Param("goodsId") Long goodsId); |
| | | |
| | | List<String> selectByGoodId(@Param("goodsId") long id); |
| | | |
| | | void deleteByGoodsId(@Param("goodsId")Long id); |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.dto.MallGoodsQueryDto; |
| | | import cc.mrbird.febs.mall.entity.MallGoods; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsDetailVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsUpdateVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallGoodsVo; |
| | | import cc.mrbird.febs.mall.vo.MallGoodsListVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | |
| | | Integer selectMallGoodsCountByGoodsName(@Param("goodsName")String goodsName); |
| | | |
| | | Integer selectMallGoodsCountByGoodsNameAndGoodId(@Param("goodsName")String goodsName,@Param("id")Long id); |
| | | |
| | | Integer selectMallGoodsCountByGoodsNo(@Param("goodsNo")String goodsNo); |
| | | |
| | | Integer selectMallGoodsCountByGoodsNoAndGoodId(@Param("goodsNo")String goodsNo,@Param("id")Long id); |
| | | |
| | | AdminMailGoodsDetailVo selectMallGoodsInfoById(@Param("id")long id); |
| | | |
| | | Map<String, BigDecimal> selectGoodsStockAndVolume(@Param("id") Long id); |
| | | |
| | | List<MallGoods> selectMallGoodsByCategaryId(@Param("categaryId")Long id); |
| | | |
| | | AdminMailGoodsUpdateVo getMallGoodsUpdateInfoById(@Param("id")long id); |
| | | } |
| | |
| | | MallShoppingCart selectCartGoodsBySkuId(@Param("skuId") Long skuId, @Param("memberId") Long memberId); |
| | | |
| | | int delBySkuId(@Param("skuId") Long skuId, @Param("memberId") Long memberId); |
| | | |
| | | void deleteByGoodsId(@Param("goodsId")Long id); |
| | | |
| | | void deleteByGoodsIdAndSkuId(@Param("skuId")Long id, @Param("goodsId")Long goodsId); |
| | | } |
| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.AddMallGoodsDto; |
| | | import cc.mrbird.febs.mall.dto.MallGoodsUpdateDto; |
| | | import cc.mrbird.febs.mall.dto.UpMallGoodsDto; |
| | | import cc.mrbird.febs.mall.entity.MallGoods; |
| | | import cc.mrbird.febs.mall.entity.MallGoodsCategory; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsDetailVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsUpdateVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallGoodsVo; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | |
| | | FebsResponse delMallGoods(Long id); |
| | | |
| | | AdminMailGoodsDetailVo getMallGoodsInfoById(long id); |
| | | |
| | | AdminMailGoodsUpdateVo getMallGoodsUpdateInfoById(long id); |
| | | |
| | | FebsResponse updateMallGoods(MallGoodsUpdateDto mallGoodsUpdateDto); |
| | | } |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional |
| | | public class AdminMallGoodsCategoryService extends ServiceImpl<MallGoodsCategoryMapper, MallGoodsCategory> implements IAdminMallGoodsCategoryService { |
| | | |
| | | private final MallGoodsCategoryMapper mallGoodsCategoryMapper; |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.AddMallGoodsDto; |
| | | import cc.mrbird.febs.mall.dto.AddMallGoodsSkuDto; |
| | | import cc.mrbird.febs.mall.dto.UpMallGoodsDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IAdminMallGoodsService; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsDetailVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMailGoodsSkuDetailVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallGoodsVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional |
| | | public class AdminMallGoodsService extends ServiceImpl<MallGoodsMapper, MallGoods> implements IAdminMallGoodsService { |
| | | |
| | | private final MallGoodsCategoryMapper mallGoodsCategoryMapper; |
| | |
| | | private final MallGoodsSkuMapper mallGoodsSkuMapper; |
| | | private final MallGoodsStyleMapper mallGoodsStyleMapper; |
| | | private final MallGoodsImagesMapper mallGoodsImagesMapper; |
| | | private final MallShoppingCartMapper mallShoppingCartMapper; |
| | | |
| | | @Override |
| | | public IPage<AdminMallGoodsVo> getCategoryListInPage(MallGoods mallGoods, QueryRequest request) { |
| | |
| | | String skuName = addSku.getSkuName(); |
| | | if(StrUtil.isEmpty(skuName)){ |
| | | return new FebsResponse().fail().message("商品规格名称不能为空"); |
| | | } |
| | | String skuImage = addSku.getSkuImage(); |
| | | if(StrUtil.isEmpty(skuImage)){ |
| | | return new FebsResponse().fail().message("商品规格图片不能为空"); |
| | | } |
| | | Integer skuVolume = addSku.getSkuVolume()==null?0: addSku.getSkuVolume(); |
| | | if(skuVolume < 0){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse delMallGoods(Long id) { |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(mallGoods)){ |
| | |
| | | mallGoodsStyleMapper.deleteByGoodsId(id); |
| | | mallGoodsSkuMapper.deleteByGoodsId(id); |
| | | mallGoodsMapper.deleteById(mallGoods); |
| | | mallShoppingCartMapper.deleteByGoodsId(id); |
| | | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | |
| | | return adminMailGoodsDetailVo; |
| | | } |
| | | |
| | | @Override |
| | | public AdminMailGoodsUpdateVo getMallGoodsUpdateInfoById(long id) { |
| | | AdminMailGoodsUpdateVo adminMailGoodsUpdateVo = mallGoodsMapper.getMallGoodsUpdateInfoById(id); |
| | | List<AdminMailGoodsSkuDetailVo> adminMailGoodsSkuDetailVos = mallGoodsSkuMapper.selectByGoodId(id); |
| | | if(CollUtil.isNotEmpty(adminMailGoodsSkuDetailVos)){ |
| | | adminMailGoodsUpdateVo.setMailGoodsSkuDetailVo(adminMailGoodsSkuDetailVos); |
| | | } |
| | | List<String> adminMailGoodsImagesVos = mallGoodsImagesMapper.selectByGoodId(id); |
| | | if(CollUtil.isNotEmpty(adminMailGoodsImagesVos)){ |
| | | adminMailGoodsUpdateVo.setMailGoodsImagesVo(adminMailGoodsImagesVos); |
| | | } |
| | | return adminMailGoodsUpdateVo; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse updateMallGoods(MallGoodsUpdateDto mallGoodsUpdateDto) { |
| | | String goodsName = mallGoodsUpdateDto.getGoodsName(); |
| | | if(StrUtil.isEmpty(goodsName)){ |
| | | return new FebsResponse().fail().message("商品名称不能为空"); |
| | | } |
| | | Integer mallGoodsByGoodsName = mallGoodsMapper.selectMallGoodsCountByGoodsNameAndGoodId(goodsName,mallGoodsUpdateDto.getId()); |
| | | if(mallGoodsByGoodsName > 0){ |
| | | return new FebsResponse().fail().message("商品名称不能重复"); |
| | | } |
| | | String goodsNo = mallGoodsUpdateDto.getGoodsNo(); |
| | | if(StrUtil.isEmpty(goodsNo)){ |
| | | return new FebsResponse().fail().message("商品编号不能为空"); |
| | | } |
| | | Integer mallGoodsByGoodsNo = mallGoodsMapper.selectMallGoodsCountByGoodsNoAndGoodId(goodsNo,mallGoodsUpdateDto.getId()); |
| | | if(mallGoodsByGoodsNo > 0){ |
| | | return new FebsResponse().fail().message("商品编号不能重复"); |
| | | } |
| | | Long categoryId = mallGoodsUpdateDto.getCategoryId(); |
| | | if(ObjectUtil.isEmpty(categoryId)){ |
| | | return new FebsResponse().fail().message("商品分类不能为空"); |
| | | } |
| | | List<MailGoodsSkuDto> addSkus = mallGoodsUpdateDto.getMailGoodsSkuDto(); |
| | | if(CollUtil.isEmpty(addSkus)){ |
| | | return new FebsResponse().fail().message("商品规格不能为空"); |
| | | } |
| | | for(MailGoodsSkuDto addSku : addSkus){ |
| | | String skuName = addSku.getSkuName(); |
| | | if(StrUtil.isEmpty(skuName)){ |
| | | return new FebsResponse().fail().message("商品规格名称不能为空"); |
| | | } |
| | | String skuImage = addSku.getSkuImage(); |
| | | if(StrUtil.isEmpty(skuImage)){ |
| | | return new FebsResponse().fail().message("商品规格图片不能为空"); |
| | | } |
| | | Integer skuVolume = addSku.getSkuVolume()==null?0: addSku.getSkuVolume(); |
| | | if(skuVolume < 0){ |
| | | return new FebsResponse().fail().message("商品规格销售数量不能小于0"); |
| | | } |
| | | Integer stock = addSku.getStock()==null?0: addSku.getStock(); |
| | | if(stock < 0){ |
| | | return new FebsResponse().fail().message("商品规格库存必须大于0"); |
| | | } |
| | | BigDecimal originalPrice = addSku.getOriginalPrice(); |
| | | if(originalPrice.compareTo(BigDecimal.ZERO) <= 0){ |
| | | return new FebsResponse().fail().message("商品规格原价不能小于0"); |
| | | } |
| | | BigDecimal presentPrice = addSku.getPresentPrice(); |
| | | if(presentPrice.compareTo(BigDecimal.ZERO) <= 0){ |
| | | return new FebsResponse().fail().message("商品规格现价不能小于0"); |
| | | } |
| | | |
| | | } |
| | | //新增商品 |
| | | MallGoods mallGoods = mallGoodsMapper.selectById(mallGoodsUpdateDto.getId()); |
| | | mallGoods.setGoodsNo(mallGoodsUpdateDto.getGoodsNo()); |
| | | mallGoods.setGoodsName(mallGoodsUpdateDto.getGoodsName()); |
| | | mallGoods.setGoodsIntrodution(mallGoodsUpdateDto.getGoodsIntrodution()); |
| | | mallGoods.setUnit(mallGoodsUpdateDto.getUnit()); |
| | | mallGoods.setThumb(mallGoodsUpdateDto.getThumb()); |
| | | mallGoods.setGoodsDetails(mallGoodsUpdateDto.getGoodsDetails()); |
| | | mallGoods.setOriginalPrice(mallGoodsUpdateDto.getOriginalPrice()); |
| | | mallGoods.setCategoryId(mallGoodsUpdateDto.getCategoryId()); |
| | | mallGoods.setPresentPrice(mallGoodsUpdateDto.getPresentPrice()); |
| | | mallGoods.setIsHot(mallGoodsUpdateDto.getIsHot()); |
| | | // mallGoods.setIsSale(MallGoods.ISSALE_STATUS_DISABLED); |
| | | mallGoodsMapper.updateById(mallGoods); |
| | | |
| | | mallGoodsImagesMapper.deleteByGoodsId(mallGoodsUpdateDto.getId()); |
| | | |
| | | String thumbs = mallGoodsUpdateDto.getThumbs(); |
| | | if(StrUtil.isNotEmpty(thumbs)){ |
| | | List<String> imgs = StrUtil.splitTrim(thumbs, ","); |
| | | if(CollUtil.isNotEmpty(imgs)){ |
| | | int i = 1; |
| | | for(String img : imgs){ |
| | | MallGoodsImages mallGoodsImages = new MallGoodsImages(); |
| | | mallGoodsImages.setGoodsId(mallGoods.getId()); |
| | | mallGoodsImages.setImageUrl(img); |
| | | mallGoodsImages.setSeq(i); |
| | | mallGoodsImagesMapper.insert(mallGoodsImages); |
| | | i++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<MailGoodsSkuDto> mailGoodsSkuDto = mallGoodsUpdateDto.getMailGoodsSkuDto(); |
| | | Set<String> styles = new HashSet<>(); |
| | | if(CollUtil.isNotEmpty(mailGoodsSkuDto)){ |
| | | for(MailGoodsSkuDto addStyleDto : mailGoodsSkuDto){ |
| | | if(ObjectUtil.isNotEmpty(addStyleDto.getDelLog())){ |
| | | mallGoodsSkuMapper.deleteById(addStyleDto.getId()); |
| | | |
| | | mallShoppingCartMapper.deleteByGoodsIdAndSkuId(addStyleDto.getId(),addStyleDto.getGoodsId()); |
| | | } |
| | | if(ObjectUtil.isEmpty(addStyleDto.getStyleId())){ |
| | | MallGoodsStyle mallGoodsStyleSku = mallGoodsStyleMapper.selectByStyleName(addStyleDto.getStyleName(),mallGoods.getId()); |
| | | if(ObjectUtil.isEmpty(mallGoodsStyleSku)){ |
| | | styles.add(addStyleDto.getStyleName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(CollUtil.isNotEmpty(styles)){ |
| | | for(String style : styles){ |
| | | //新增样式 |
| | | MallGoodsStyle mallGoodsStyle = new MallGoodsStyle(); |
| | | mallGoodsStyle.setName(style); |
| | | mallGoodsStyle.setGoodsId(mallGoods.getId()); |
| | | mallGoodsStyleMapper.insert(mallGoodsStyle); |
| | | } |
| | | } |
| | | |
| | | if(CollUtil.isNotEmpty(mailGoodsSkuDto)){ |
| | | for(MailGoodsSkuDto addMallGoodsSkuDto : mailGoodsSkuDto){ |
| | | if(StrUtil.isEmpty(addMallGoodsSkuDto.getDelLog())){ |
| | | if(ObjectUtil.isNotEmpty(addMallGoodsSkuDto.getId())){ |
| | | MallGoodsSku mallGoodsSku = mallGoodsSkuMapper.selectById(addMallGoodsSkuDto.getId()); |
| | | mallGoodsSku.setSkuName(addMallGoodsSkuDto.getSkuName()); |
| | | mallGoodsSku.setSkuImage(addMallGoodsSkuDto.getSkuImage()); |
| | | mallGoodsSku.setStock(addMallGoodsSkuDto.getStock()==null?0:addMallGoodsSkuDto.getStock()); |
| | | mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume()==null?0:addMallGoodsSkuDto.getSkuVolume()); |
| | | mallGoodsSku.setOriginalPrice(addMallGoodsSkuDto.getOriginalPrice()); |
| | | mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); |
| | | mallGoodsSku.setStyleId(addMallGoodsSkuDto.getStyleId()); |
| | | mallGoodsSku.setGoodsId(mallGoods.getId()); |
| | | mallGoodsSkuMapper.updateById(mallGoodsSku); |
| | | }else{ |
| | | //新增商品规格 |
| | | MallGoodsStyle mallGoodsStyleSku = mallGoodsStyleMapper.selectByStyleName(addMallGoodsSkuDto.getStyleName(),mallGoods.getId()); |
| | | MallGoodsSku mallGoodsSku = new MallGoodsSku(); |
| | | mallGoodsSku.setSkuName(addMallGoodsSkuDto.getSkuName()); |
| | | mallGoodsSku.setSkuImage(addMallGoodsSkuDto.getSkuImage()); |
| | | mallGoodsSku.setStock(addMallGoodsSkuDto.getStock()==null?0:addMallGoodsSkuDto.getStock()); |
| | | mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume()==null?0:addMallGoodsSkuDto.getSkuVolume()); |
| | | mallGoodsSku.setOriginalPrice(addMallGoodsSkuDto.getOriginalPrice()); |
| | | mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); |
| | | mallGoodsSku.setStyleId(mallGoodsStyleSku.getId()); |
| | | mallGoodsSku.setGoodsId(mallGoods.getId()); |
| | | mallGoodsSkuMapper.insert(mallGoodsSku); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional |
| | | public class AdminMallMemberServiceImpl extends ServiceImpl<MallMemberMapper, MallMember> implements IAdminMallMemberService { |
| | | |
| | | private final MallMemberMapper mallMemberMapper; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional |
| | | public class AdminMallOrderService extends ServiceImpl<MallOrderInfoMapper, MallOrderInfo> implements IAdminMallOrderService { |
| | | |
| | | private final MallOrderInfoMapper mallOrderInfoMapper; |
| | |
| | | |
| | | private String phone; |
| | | |
| | | private String bindPhone; |
| | | |
| | | private String level; |
| | | |
| | | private String levelName; |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminMailGoodsImagesVo", description = "信息返回类") |
| | | public class AdminMailGoodsImagesVo { |
| | | |
| | | private String imageUrl; |
| | | |
| | | private Integer seq; |
| | | |
| | | private Long goodsId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "sku图片") |
| | | private String skuImage; |
| | | |
| | | private String styleName; |
| | | |
| | | private Long styleId; |
| | | |
| | | @ApiModelProperty(value = "库存") |
| | | private Integer stock; |
| | | |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminMailGoodsUpdateVo", description = "信息返回类") |
| | | public class AdminMailGoodsUpdateVo { |
| | | |
| | | private Long id; |
| | | |
| | | private String goodsNo; |
| | | |
| | | private String goodsName; |
| | | |
| | | private List<AdminMailGoodsSkuDetailVo> mailGoodsSkuDetailVo; |
| | | |
| | | private List<String> mailGoodsImagesVo; |
| | | |
| | | private String goodsIntrodution; |
| | | |
| | | private String unit; |
| | | |
| | | private String thumb; |
| | | |
| | | private String goodsDetails; |
| | | |
| | | private Integer isSale; |
| | | |
| | | private String originalPrice; |
| | | |
| | | private String presentPrice; |
| | | |
| | | private Long categoryId; |
| | | |
| | | private Integer isHot; |
| | | } |
| | |
| | | |
| | | private String memberPhone; |
| | | |
| | | private String memberBindPhone; |
| | | |
| | | private String memberEmail; |
| | | } |
| | |
| | | |
| | | private String buyPhone; |
| | | |
| | | private String buyBindPhone; |
| | | |
| | | private String addressDetail; |
| | | |
| | | private Long orderId; |
| | |
| | | |
| | | private String phone; |
| | | |
| | | private String bindPhone; |
| | | |
| | | private Integer status; |
| | | } |
| | |
| | | |
| | | private String payMethod; |
| | | |
| | | private String bindPhone; |
| | | |
| | | } |
| | |
| | | <select id="selectGoodsImagesByGoodsId" resultType="java.lang.String"> |
| | | select image_url from mall_goods_images where goods_id=#{goodsId} |
| | | </select> |
| | | |
| | | <select id="selectByGoodId" resultType="java.lang.String"> |
| | | select image_url from mall_goods_images where goods_id = #{goodsId} |
| | | </select> |
| | | |
| | | <delete id="deleteByGoodsId"> |
| | | delete from mall_goods_images where goods_id = #{goodsId} |
| | | </delete> |
| | | </mapper> |
| | |
| | | select count(id) from mall_goods a where a.goods_name = #{goodsName} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectMallGoodsCountByGoodsNameAndGoodId" resultType="java.lang.Integer"> |
| | | select count(id) from mall_goods a where a.goods_name = #{goodsName} and a.id != #{id} |
| | | </select> |
| | | |
| | | <select id="selectMallGoodsCountByGoodsNo" resultType="java.lang.Integer"> |
| | | select count(id) from mall_goods a where a.goods_no = #{goodsNo} |
| | | </select> |
| | | |
| | | <select id="selectMallGoodsCountByGoodsNoAndGoodId" resultType="java.lang.Integer"> |
| | | select count(id) from mall_goods a where a.goods_no = #{goodsNo} and a.id != #{id} |
| | | </select> |
| | | |
| | | <select id="selectMallGoodsInfoById" resultType="cc.mrbird.febs.mall.vo.AdminMailGoodsDetailVo"> |
| | |
| | | <select id="selectMallGoodsByCategaryId" resultType="cc.mrbird.febs.mall.entity.MallGoods"> |
| | | select * from mall_goods a where a.category_id = #{categaryId} |
| | | </select> |
| | | |
| | | <select id="getMallGoodsUpdateInfoById" resultType="cc.mrbird.febs.mall.vo.AdminMailGoodsUpdateVo"> |
| | | select * from mall_goods a where a.id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="selectByGoodId" resultType="cc.mrbird.febs.mall.vo.AdminMailGoodsSkuDetailVo"> |
| | | select * from mall_goods_sku where goods_id = #{id} |
| | | select a.*,b.name styleName from mall_goods_sku a |
| | | left join mall_goods_style b on a.style_id=b.ID |
| | | where a.goods_id = #{id} |
| | | </select> |
| | | |
| | | |
| | |
| | | and ( |
| | | m.phone like concat('%', #{record.account},'%') |
| | | or m.email like concat('%', #{record.account},'%') |
| | | or m.bind_phone like concat('%', #{record.account},'%') |
| | | or m.invite_id like concat('%', #{record.account},'%') |
| | | ) |
| | | </if> |
| | |
| | | select |
| | | a.*, |
| | | b.name, |
| | | b.bind_phone bindPhone, |
| | | c.pay_method payMethod, |
| | | b.phone |
| | | from mall_money_flow a |
| | |
| | | select |
| | | a.*, |
| | | b.name, |
| | | b.bind_phone bindPhone, |
| | | b.phone |
| | | from mall_money_flow a |
| | | inner join mall_member b on a.member_id=b.id |
| | |
| | | </select> |
| | | |
| | | <select id="selectOrderListInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallOrderInfoVo"> |
| | | select *,b.name memberName,b.phone memberPhone |
| | | select *, |
| | | b.name memberName, |
| | | b.bind_phone memberBindPhone, |
| | | b.phone memberPhone |
| | | from mall_order_info a |
| | | left join mall_member b on a.member_id = b.id |
| | | <where> |
| | |
| | | </select> |
| | | |
| | | <select id="selectRefundListInPage" resultType="cc.mrbird.febs.mall.vo.AdminMallOrderRefundVo"> |
| | | select a.*,b.name buyName ,b.phone buyPhone,c.order_no,c.amount,CONCAT(a.name,a.phone,a.address) addressDetail |
| | | select a.*, |
| | | b.name buyName , |
| | | b.phone buyPhone, |
| | | b.bind_phone buyBindPhone, |
| | | c.order_no, |
| | | c.amount, |
| | | CONCAT(a.phone,a.bind_phone,a.address) addressDetail |
| | | |
| | | from mall_order_refund a |
| | | left join mall_member b on b.id = a.member_id |
| | |
| | | delete from mall_shopping_cart |
| | | where member_id=#{memberId} and sku_id=#{skuId} |
| | | </delete> |
| | | |
| | | <delete id="deleteByGoodsId"> |
| | | delete from mall_shopping_cart |
| | | where goods_id = #{goodsId} |
| | | </delete> |
| | | |
| | | <delete id="deleteByGoodsIdAndSkuId"> |
| | | delete from mall_shopping_cart |
| | | where goods_id = #{goodsId} and sku_id = #{skuId} |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | } |
| | | }); |
| | | |
| | | //多图片上传 |
| | | //图片上传 |
| | | upload.render({ |
| | | elem: '#test2' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | |
| | | }); |
| | | } |
| | | if (layEvent === 'goodsUpdate') { |
| | | febs.modal.open('编辑', 'modules/goods/goodsUpdate/' + data.id, { |
| | | febs.modal.open('编辑', 'modules/goods/goodsUpdateNew/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#goods-update').find('#submit').trigger('click'); |
| | | $('#goods-updatenew').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">商品名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="goodsName" class="layui-input" readonly> |
| | | <input type="text" name="goodsName" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">商品编号:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="goodsNo" class="layui-input" readonly> |
| | | <input type="text" name="goodsNo" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">所属分类:</label> |
| | | <div class="layui-input-block"> |
| | | <select name="parentId" class="categary-goods-update-category" id="categarySelect" readonly> |
| | | <select name="parentId" class="categary-goods-update-category" id="categarySelect" > |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | |
| | | <input type="text" name="goodsIntrodution" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-row layui-col-space10 layui-form-item">--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <label class="layui-form-label">规格:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input type="text" name="addMallGoodsSkuDtos" autocomplete="off" class="layui-input" id="attrName">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-col-lg6">--> |
| | | <!-- <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" id="test3" >添加</button>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">规格:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="addMallGoodsSkuDtos" autocomplete="off" class="layui-input" id="attrName"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" id="test3" >添加</button> |
| | | </div> |
| | | </div> |
| | | <div id="attrWrap"></div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">缩略图链接:</label> |
| | | <label class="layui-form-label febs-form-item-require">缩略图:</label> |
| | | <div class="layui-input-block"> |
| | | <img alt="缩略图" data-th-src="${mailGoodsUpdate.thumb}" style="width: 100px"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" id="test2">上传</button> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | <div class="layui-upload-list" id="demo2"></div> |
| | | </blockquote> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">缩略图链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="thumb" lay-verify="required" name="thumb" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">轮播图:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" id="thumbsBanner">上传</button> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | <div class="layui-upload-list" id="thumbsBanners"></div> |
| | | </blockquote> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">缩略图链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="thumbs" lay-verify="required" name="thumbs" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">缩略图链接:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <img alt="缩略图" data-th-src="${mailGoodsUpdate.thumb}" style="width: 100px">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">商品详情:</label> |
| | | <div class="layui-input-block"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="goods-update-form-submit" id="submit"></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree','layedit'], function () { |
| | | var $ = layui.$, |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree','dropdown', 'laydate','layedit','upload'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | mailGoodsUpdate = [[${mailGoodsUpdate}]], |
| | | $view = $('#goods-update'), |
| | | validate = layui.validate, |
| | | $view = $('#goods-add'), |
| | | layedit = layui.layedit, |
| | | _deptTree; |
| | | upload = layui.upload, |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | | |
| | |
| | | $("#categarySelect").val(mailGoodsUpdate.categoryId) |
| | | form.render(); |
| | | }); |
| | | }); |
| | | |
| | | //多图片上传 |
| | | upload.render({ |
| | | elem: '#thumbsBanner' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,multiple: true |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#thumbsBanners').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img" style="width: 100px">') |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | var thumbs = $("#thumbs").val(); |
| | | if(thumbs == ''){ |
| | | $("#thumbs").val(res.data.src); |
| | | }else{ |
| | | $("#thumbs").val(thumbs + ',' + res.data.src); |
| | | } |
| | | // alert($("#thumb").val()); |
| | | } |
| | | }); |
| | | |
| | | //图片上传 |
| | | upload.render({ |
| | | elem: '#test2' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,multiple: true |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img" style="width: 100px">') |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | // var thumbs = $("#thumb").val(); |
| | | // if(thumbs == ''){ |
| | | $("#thumb").val(res.data.src); |
| | | // }else{ |
| | | // $("#thumb").val(thumbs + ',' + res.data.src); |
| | | // } |
| | | // alert($("#thumb").val()); |
| | | } |
| | | }); |
| | | |
| | | layedit.set({ //设置图片接口 |
| | |
| | | <div class="layui-input-block layui-form-item item"> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" class="layui-input" value="` + attrNameVal + `" readonly > |
| | | <input type="text" class="layui-input" value="` + attrNameVal + `" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <img class="layui-upload-img" src="` + skuImage + `" style="width: 100px" readonly> |
| | | <img class="layui-upload-img" src="` + skuImage + `" style="width: 100px" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" value="` + stockVal + `" placeholder="库存" autocomplete="off" class="layui-input" readonly> |
| | | <input type="text" value="` + stockVal + `" placeholder="库存" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" value="` + skuVolume + `" placeholder="销售数量" autocomplete="off" class="layui-input" readonly> |
| | | <input type="text" value="` + skuVolume + `" placeholder="销售数量" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" value="` + originalPrice + `" placeholder="原价" autocomplete="off" class="layui-input" readonly> |
| | | <input type="text" value="` + originalPrice + `" placeholder="原价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" value="` + presentPrice + `" placeholder="现价" autocomplete="off" class="layui-input" readonly> |
| | | <input type="text" value="` + presentPrice + `" placeholder="现价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | for(var skuIndex = 0; skuIndex < skuLength; skuIndex++){ |
| | | appendSku(mailGoodsUpdate.mailGoodsSkuDetailVo[skuIndex],skuIndex); |
| | | } |
| | | //缩略图图片回显 |
| | | if(mailGoodsUpdate.thumb != null || mailGoodsUpdate.thumb != ''){ |
| | | $('#demo2').append('<img src="'+ mailGoodsUpdate.thumb +'" class="layui-upload-img" style="width: 100px">') |
| | | $("#thumb").val(mailGoodsUpdate.thumb); |
| | | } |
| | | var imagesInitIndex = 0; |
| | | let imagesInitIndexlength = mailGoodsUpdate.mailGoodsImagesVo.length; |
| | | for(var imagesInitIndex = 0; imagesInitIndex < imagesInitIndexlength; imagesInitIndex++){ |
| | | console.log(mailGoodsUpdate.mailGoodsImagesVo); |
| | | $('#thumbsBanners').append('<img src="'+ mailGoodsUpdate.mailGoodsImagesVo[imagesInitIndex] +'" class="layui-upload-img" style="width: 100px">') |
| | | $("#thumbs").val(mailGoodsUpdate.mailGoodsImagesVo[imagesInitIndex] + ','); |
| | | } |
| | | |
| | | form.val("goods-update-form", { |
| | | "id": mailGoodsUpdate.id, |
| | | "goodsNo": mailGoodsUpdate.goodsNo, |
| | | "categoryId": mailGoodsUpdate.categoryId, |
| | | "mailGoodsSkuDetailVo": mailGoodsUpdate.mailGoodsSkuDetailVo, |
| | | "mailGoodsImagesVo": mailGoodsUpdate.mailGoodsImagesVo, |
| | | "unit": mailGoodsUpdate.unit, |
| | | "originalPrice": mailGoodsUpdate.originalPrice, |
| | | "presentPrice": mailGoodsUpdate.presentPrice, |
| | |
| | | "thumb": mailGoodsUpdate.thumb, |
| | | "goodsDetails": mailGoodsUpdate.goodsDetails, |
| | | "isHot": mailGoodsUpdate.isHot, |
| | | "isHot": mailGoodsUpdate.isHot, |
| | | "goodsName": mailGoodsUpdate.goodsName |
| | | }); |
| | | } |
| | | |
| | | $('#test3').on('click', function (){ |
| | | var index = $("#attrWrap").children().length; |
| | | let attrNameVal = $('#attrName').val(); |
| | | if(attrNameVal==null || attrNameVal==""){ |
| | | febs.alert.warn('样式名称不能为空'); |
| | | return false; |
| | | } |
| | | $('#attrWrap').append(` |
| | | <div class="layui-form-item item"> |
| | | <div style="float:left" > |
| | | <input type="text" name="styleName` + index + `" value="` + $('#attrName').val() + `" autocomplete="off" class="layui-input" readonly > |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" name="skuName` + index +`" placeholder="规格名称" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <label class="layui-form-label">图片:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs sku-img" id="skuImg` + index + `">上传</button> |
| | | <img class="layui-upload-img" id="imageUrls` + index + `" style="width: 100px" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" class="febs-hide"> |
| | | <div> |
| | | <input type="text" id="skuImage` + index +`" name="skuImage` + index + `" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="stock` + index +`" placeholder="库存" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="skuVolume` + index +`" placeholder="销售数量" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="originalPrice` + index +`" placeholder="原价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="presentPrice` + index + `" placeholder="现价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <button type="button" class="layui-btn del-attr-btn" data-index="` + index +`">删除</button> |
| | | </div> |
| | | </div> |
| | | `) |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: '#skuImg' + index |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $('#imageUrls' + index).attr('src', res.data.src); |
| | | $('#skuImage'+ index).val(res.data.src); |
| | | } |
| | | }); |
| | | }); |
| | | upload.render({ |
| | | elem: '#skuImg'+index |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $('#imageUrls' + index).attr('src', res.data.src); |
| | | $('#skuImage'+ index).val(res.data.src); |
| | | } |
| | | }); |
| | | $("#attrWrap").on("click",".del-attr-btn",function(){ |
| | | var index = $(this).attr('data-index') |
| | | $($("#attrWrap").find(".item")[index].remove()); |
| | | }); |
| | | form.on('submit(goods-add-form-submit)', function (data) { |
| | | let skuArrs = []; |
| | | var skuArr = $("#attrWrap").find(".item"); |
| | | for(var i = 0;i < skuArr.length;i++){ |
| | | skuArrs.push({ |
| | | styleName: $("input[name='styleName" + i + "']").val(), |
| | | skuName: $("input[name='skuName" + i + "']").val(), |
| | | skuImage: $("input[name='skuImage" + i + "']").val(), |
| | | stock: $("input[name='stock" + i + "']").val(), |
| | | skuVolume: $("input[name='skuVolume" + i + "']").val(), |
| | | originalPrice:$("input[name='originalPrice" + i + "']").val(), |
| | | presentPrice: $("input[name='presentPrice" + i + "']").val() |
| | | }) |
| | | } |
| | | // if(skuArr.length < 0){ |
| | | // febs.alert.warn("请填写商品规格"); |
| | | // return false; |
| | | // } |
| | | // console.log(skuArrs) |
| | | data.field.addMallGoodsSkuDtos = skuArrs; |
| | | // console.log(data.field) |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/goods/addMallGoods', |
| | | 'type':'post', |
| | | 'dataType':'json', |
| | | 'headers' : {'Content-Type' : 'application/json;charset=utf-8'}, //接口json格式 |
| | | 'traditional': true,//ajax传递数组必须添加属性 |
| | | 'data':JSON.stringify(data.field), |
| | | 'success':function (data) { |
| | | if(data.code==0){ |
| | | febs.alert.success(data.message); |
| | | var index = parent.layer.getFrameIndex(window.name); |
| | | parent.layer.close(index); |
| | | }else{ |
| | | febs.alert.warn(data.message); |
| | | } |
| | | }, |
| | | 'error':function () { |
| | | febs.alert.warn('服务器繁忙'); |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
New file |
| | |
| | | <style> |
| | | #goods-updatenew { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #goods-updatenew .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #goods-updatenew #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #user-add .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="goods-updatenew"> |
| | | <form class="layui-form" action="" lay-filter="goods-updatenew-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">商品名称:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="goodsName" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">商品编号:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="goodsNo" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">所属分类:</label> |
| | | <div class="layui-input-block"> |
| | | <select name="categoryId" class="categary-goods-updatenew-category" id="goodsUpdateSelect" > |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">单位:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="unit" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">原价:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="originalPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">现价:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="presentPrice" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">商品介绍:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="goodsIntrodution" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">样式:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="addMallGoodsSkuDtos" autocomplete="off" class="layui-input" id="attrName"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" id="test3" >添加</button> |
| | | </div> |
| | | </div> |
| | | <div id="attrWrap"></div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">缩略图:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" id="test2">上传</button> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | <div class="layui-upload-list" id="demo2"></div> |
| | | </blockquote> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label">缩略图链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="thumb" lay-verify="required" name="thumb" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">轮播图:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" id="thumbsBanner">上传</button> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | <div class="layui-upload-list" id="thumbsBanners"></div> |
| | | </blockquote> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label">缩略图链接:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="thumbs" lay-verify="required" name="thumbs" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">商品详情:</label> |
| | | <div class="layui-input-block"> |
| | | <textarea id="lay_edit" lay-verify="goodsDetails" name = "goodsDetails" class="layui-textarea">[[${mailGoodsUpdate.goodsDetails}]]</textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label">是否热卖:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="radio" name="isHot" value="1" title="是" > |
| | | <input type="radio" name="isHot" value="2" title="否" checked=""> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="goods-update-form-submit" id="submit"></button> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <div class="layui-form-item" style="text-align:center">--> |
| | | <!-- <button class="layui-btn" lay-submit="" lay-filter="goods-update-form-submit" id="submit">保存</button>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree','dropdown', 'laydate','layedit','upload'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | eleTree = layui.eleTree, |
| | | mailGoodsUpdate = [[${mailGoodsUpdate}]], |
| | | $view = $('#goods-add'), |
| | | layedit = layui.layedit, |
| | | upload = layui.upload, |
| | | validate = layui.validate; |
| | | |
| | | form.render(); |
| | | |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/goodsCategory/categorys/allTree', function (data) { |
| | | for (var k in data) |
| | | { |
| | | $(".categary-goods-updatenew-category").append("<option value='" + data[k].parentId + "'>" + data[k].name + "</option>"); |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | | $("#goodsUpdateSelect").val(mailGoodsUpdate.categoryId) |
| | | form.render(); |
| | | }); |
| | | }); |
| | | |
| | | //多图片上传 |
| | | upload.render({ |
| | | elem: '#thumbsBanner' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,multiple: true |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#thumbsBanners').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img" style="width: 100px">') |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | var thumbs = $("#thumbs").val(); |
| | | if(thumbs == ''){ |
| | | $("#thumbs").val(res.data.src); |
| | | }else{ |
| | | $("#thumbs").val(thumbs + ',' + res.data.src); |
| | | } |
| | | // alert($("#thumb").val()); |
| | | } |
| | | }); |
| | | |
| | | //图片上传 |
| | | upload.render({ |
| | | elem: '#test2' |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,multiple: true |
| | | ,before: function(obj){ |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function(index, file, result){ |
| | | $('#demo2').append('<img src="'+ result +'" alt="'+ file.name +'" class="layui-upload-img" style="width: 100px">') |
| | | }); |
| | | } |
| | | ,done: function(res){ |
| | | // var thumbs = $("#thumb").val(); |
| | | // if(thumbs == ''){ |
| | | $("#thumb").val(res.data.src); |
| | | // }else{ |
| | | // $("#thumb").val(thumbs + ',' + res.data.src); |
| | | // } |
| | | // alert($("#thumb").val()); |
| | | } |
| | | }); |
| | | |
| | | layedit.set({ //设置图片接口 |
| | | uploadImage: { |
| | | url: 'admin/goods/uploadFileBase64', //接口url |
| | | type: 'post', |
| | | } |
| | | }); |
| | | //创建一个编辑器 |
| | | var index = layedit.build('lay_edit',{ |
| | | height: 300 |
| | | }); |
| | | //提交时把值同步到文本域中 |
| | | form.verify({ |
| | | //content富文本域中的lay-verify值 |
| | | goodsDetails: function(value) { |
| | | return layedit.sync(index); |
| | | } |
| | | }); |
| | | |
| | | initUserValue(); |
| | | |
| | | function appendSku(sku,skuIndex){ |
| | | var index = skuIndex; |
| | | let attrNameVal = sku.skuName; |
| | | let styleName = sku.styleName; |
| | | let styleId = sku.styleId; |
| | | let skuId = sku.id; |
| | | let stockVal = sku.stock; |
| | | let skuVolume = sku.skuVolume; |
| | | let originalPrice = sku.originalPrice; |
| | | let presentPrice = sku.presentPrice; |
| | | let skuImage = sku.skuImage; |
| | | $('#attrWrap').append(` |
| | | <div class="layui-form-item item"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id` + index + `" value="` + skuId + `"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="delLog` + index + `"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">styleId:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="styleId` + index +`" name="styleId` + index + `" value="` + styleId + `"> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <input type="text" name="styleName` + index + `" value="` + styleName + `" autocomplete="off" class="layui-input" readonly > |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" name="skuName` + index +`" value="` + attrNameVal + `" placeholder="规格名称" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <label class="layui-form-label">图片:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs sku-img" id="skuImg` + index + `">上传</button> |
| | | <img class="layui-upload-img" src="` + skuImage + `" id="imageUrls` + index + `" style="width: 100px" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" class="febs-hide"> |
| | | <div> |
| | | <input type="text" id="skuImage` + index +`" value="` + skuImage + `" name="skuImage` + index + `" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="stock` + index +`" value="` + stockVal + `" placeholder="库存" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="skuVolume` + index +`" value="` + skuVolume + `" placeholder="销售数量" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="originalPrice` + index +`" value="` + originalPrice + `" placeholder="原价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="presentPrice` + index + `" value="` + presentPrice + `" placeholder="现价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <button type="button" class="layui-btn del-attr-btn" data-index="` + index +`">删除</button> |
| | | </div> |
| | | </div> |
| | | `) |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: '#skuImg' + index |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $('#imageUrls' + index).attr('src', res.data.src); |
| | | $('#skuImage'+ index).val(res.data.src); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function initUserValue() { |
| | | var skuIndex = 0; |
| | | let skuLength = mailGoodsUpdate.mailGoodsSkuDetailVo.length; |
| | | for(var skuIndex = 0; skuIndex < skuLength; skuIndex++){ |
| | | appendSku(mailGoodsUpdate.mailGoodsSkuDetailVo[skuIndex],skuIndex); |
| | | } |
| | | //缩略图图片回显 |
| | | if(mailGoodsUpdate.thumb != null || mailGoodsUpdate.thumb != ''){ |
| | | $('#demo2').append('<img src="'+ mailGoodsUpdate.thumb +'" class="layui-upload-img" style="width: 100px">') |
| | | $("#thumb").val(mailGoodsUpdate.thumb); |
| | | } |
| | | var imagesInitIndex = 0; |
| | | let imagesInitIndexlength = mailGoodsUpdate.mailGoodsImagesVo.length; |
| | | for(var imagesInitIndex = 0; imagesInitIndex < imagesInitIndexlength; imagesInitIndex++){ |
| | | console.log(mailGoodsUpdate.mailGoodsImagesVo); |
| | | $('#thumbsBanners').append('<img src="'+ mailGoodsUpdate.mailGoodsImagesVo[imagesInitIndex] +'" class="layui-upload-img" style="width: 100px">') |
| | | $("#thumbs").val(mailGoodsUpdate.mailGoodsImagesVo[imagesInitIndex] + ','); |
| | | } |
| | | |
| | | form.val("goods-updatenew-form", { |
| | | "id": mailGoodsUpdate.id, |
| | | "goodsNo": mailGoodsUpdate.goodsNo, |
| | | "categoryId": mailGoodsUpdate.categoryId, |
| | | "mailGoodsSkuDetailVo": mailGoodsUpdate.mailGoodsSkuDetailVo, |
| | | "mailGoodsImagesVo": mailGoodsUpdate.mailGoodsImagesVo, |
| | | "unit": mailGoodsUpdate.unit, |
| | | "originalPrice": mailGoodsUpdate.originalPrice, |
| | | "presentPrice": mailGoodsUpdate.presentPrice, |
| | | "goodsIntrodution": mailGoodsUpdate.goodsIntrodution, |
| | | "thumb": mailGoodsUpdate.thumb, |
| | | "goodsDetails": mailGoodsUpdate.goodsDetails, |
| | | "isHot": mailGoodsUpdate.isHot, |
| | | "isHot": mailGoodsUpdate.isHot, |
| | | "goodsName": mailGoodsUpdate.goodsName |
| | | }); |
| | | } |
| | | |
| | | $('#test3').on('click', function (){ |
| | | var index = $("#attrWrap").children().length; |
| | | let attrNameVal = $('#attrName').val(); |
| | | if(attrNameVal==null || attrNameVal==""){ |
| | | febs.alert.warn('样式名称不能为空'); |
| | | return false; |
| | | } |
| | | $('#attrWrap').append(` |
| | | <div class="layui-form-item item"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id` + index + `"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">styleId:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" id="styleId` + index +`" name="styleId` + index + `"> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <input type="text" name="styleName` + index + `" value="` + $('#attrName').val() + `" autocomplete="off" class="layui-input" readonly > |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="text" name="skuName` + index +`" placeholder="规格名称" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <label class="layui-form-label">图片:</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-upload"> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-xs sku-img" id="skuImg` + index + `">上传</button> |
| | | <img class="layui-upload-img" id="imageUrls` + index + `" style="width: 100px" > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" class="febs-hide"> |
| | | <div> |
| | | <input type="text" id="skuImage` + index +`" name="skuImage` + index + `" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="stock` + index +`" placeholder="库存" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="skuVolume` + index +`" placeholder="销售数量" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="originalPrice` + index +`" placeholder="原价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <div> |
| | | <input type="number" name="presentPrice` + index + `" placeholder="现价" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div style="float:left" > |
| | | <button type="button" class="layui-btn del-attr-btn" data-index="` + index +`">删除</button> |
| | | </div> |
| | | </div> |
| | | `) |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: '#skuImg' + index |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $('#imageUrls' + index).attr('src', res.data.src); |
| | | $('#skuImage'+ index).val(res.data.src); |
| | | } |
| | | }); |
| | | }); |
| | | upload.render({ |
| | | elem: '#skuImg'+index |
| | | ,url: ctx + 'admin/goods/uploadFileBase64' //改成您自己的上传接口 |
| | | ,done: function(res){ |
| | | febs.alert.success(res.data.src); |
| | | $('#imageUrls' + index).attr('src', res.data.src); |
| | | $('#skuImage'+ index).val(res.data.src); |
| | | } |
| | | }); |
| | | $("#attrWrap").on("click",".del-attr-btn",function(){ |
| | | var index = $(this).attr('data-index') |
| | | if($("input[name='styleId" + index + "']").val() ==null || $("input[name='styleId" + index + "']").val() ==''){ |
| | | $($("#attrWrap").find(".item")[index].remove()); |
| | | }else{ |
| | | $("input[name='delLog" + index + "']").val("delLog"); |
| | | $($("#attrWrap").find(".item")[index].style.display = "none"); |
| | | } |
| | | }); |
| | | form.on('submit(goods-update-form-submit)', function (data) { |
| | | let skuArrs = []; |
| | | var skuArr = $("#attrWrap").find(".item"); |
| | | for(var i = 0;i < skuArr.length;i++){ |
| | | skuArrs.push({ |
| | | id: $("input[name='id" + i + "']").val(), |
| | | styleName: $("input[name='styleName" + i + "']").val(), |
| | | styleId: $("input[name='styleId" + i + "']").val(), |
| | | delLog: $("input[name='delLog" + i + "']").val(), |
| | | skuName: $("input[name='skuName" + i + "']").val(), |
| | | skuImage: $("input[name='skuImage" + i + "']").val(), |
| | | stock: $("input[name='stock" + i + "']").val(), |
| | | skuVolume: $("input[name='skuVolume" + i + "']").val(), |
| | | originalPrice:$("input[name='originalPrice" + i + "']").val(), |
| | | presentPrice: $("input[name='presentPrice" + i + "']").val() |
| | | }) |
| | | } |
| | | // if(skuArr.length < 0){ |
| | | // febs.alert.warn("请填写商品规格"); |
| | | // return false; |
| | | // } |
| | | // console.log(skuArrs) |
| | | data.field.mailGoodsSkuDto = skuArrs; |
| | | console.log(data.field) |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/goods/updateMallGoods', |
| | | 'type':'post', |
| | | 'dataType':'json', |
| | | 'headers' : {'Content-Type' : 'application/json;charset=utf-8'}, //接口json格式 |
| | | 'traditional': true,//ajax传递数组必须添加属性 |
| | | 'data':JSON.stringify(data.field), |
| | | 'success':function (data) { |
| | | if(data.code==0){ |
| | | layer.closeAll(); |
| | | febs.alert.success('操作成功'); |
| | | // var index = parent.layer.getFrameIndex(window.name); |
| | | // parent.layer.close(index); |
| | | // febs.alert.success('操作成功'); |
| | | $('#febs-goods').find('#reset').click(); |
| | | }else{ |
| | | febs.alert.warn(data.message); |
| | | } |
| | | }, |
| | | 'error':function () { |
| | | febs.alert.warn('服务器繁忙'); |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |
| | |
| | | id: 'userAgentTable', |
| | | url: ctx + 'admin/mallMember/getAgentList', |
| | | cols: [[ |
| | | {field: 'phone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, |
| | | {field: 'levelName', title: '代理层级', minWidth: 100,align:'left'}, |
| | |
| | | url: ctx + 'admin/mallMember/getMoneyChargeList', |
| | | cols: [[ |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {field: 'phone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, |
| | | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'amount', title: '金额', minWidth: 150,align:'left'}, |
| | | {field: 'status', title: '状态', |
| | | templet: function (d) { |
| | |
| | | id: 'userTable', |
| | | url: ctx + 'admin/mallMember/getMallMemberList', |
| | | cols: [[ |
| | | {field: 'phone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, |
| | | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, |
| | | // {field: 'email', title: '邮箱', minWidth: 150,align:'left'}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left'}, |
| | |
| | | url: ctx + 'admin/mallMember/getMoneyFlowList', |
| | | cols: [[ |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {field: 'phone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, |
| | | {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'amount', title: '金额', minWidth: 150,align:'left'}, |
| | | {field: 'type', title: '流水类型', |
| | | templet: function (d) { |
| | |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150,align:'left'}, |
| | | {field: 'createdTime', title: '创建时间', minWidth: 180,align:'center'} |
| | | ]] |
| | | }); |
| | |
| | | cols: [[ |
| | | {field: 'orderNo', title: '订单编号', minWidth: 200,align:'left'}, |
| | | {field: 'memberName', title: '购买人', minWidth: 120,align:'left'}, |
| | | {field: 'memberPhone', title: '联系方式', minWidth: 120,align:'left'}, |
| | | {field: 'memberPhone', title: '账号', minWidth: 120,align:'left'}, |
| | | {field: 'memberBindPhone', title: '联系方式', minWidth: 120,align:'left'}, |
| | | {field: 'amount', title: '订单金额', minWidth: 120,align:'left'}, |
| | | {field: 'orderTime', title: '下单时间', minWidth: 200,align:'left'}, |
| | | {field: 'payMethod', title: '支付方式', minWidth: 120,align:'left'}, |
| | |
| | | }, minWidth: 80,align:'center'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | if(d.payMethod === '支付宝支付' || d.payMethod === '微信支付'){ |
| | | if (d.status === 2) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cancelOrder" shiro:hasPermission="user:update">取消订单</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | } |
| | | }else{ |
| | | // if(d.payMethod === '支付宝支付' || d.payMethod === '微信支付'){ |
| | | // if (d.status === 2) { |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | // +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cancelOrder" shiro:hasPermission="user:update">取消订单</button>' |
| | | // +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | // }else{ |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | // } |
| | | // }else{ |
| | | if (d.status === 2) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | } |
| | | } |
| | | // } |
| | | },minWidth: 300,align:'center'} |
| | | ]] |
| | | }); |
| | |
| | | cols: [[ |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150,align:'left'}, |
| | | {field: 'buyName', title: '用户名', minWidth: 150,align:'left'}, |
| | | {field: 'buyPhone', title: '电话', minWidth: 150,align:'left'}, |
| | | {field: 'buyPhone', title: '账号', minWidth: 150,align:'left'}, |
| | | {field: 'buyBindPhone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'beforeStatus', title: '发货状态', |
| | | templet: function (d) { |
| | | if (d.status === 1) { |