管理后台:积分商品的购买详情,列表页面;todo核销操作
| | |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.activity.model.PointMerchandiseVo; |
| | | import com.dsh.activity.model.request.AppUserGoodResp; |
| | | import com.dsh.activity.model.request.CommodityRequest; |
| | | import com.dsh.activity.model.request.IntegralGoodsOfSearch; |
| | | import com.dsh.activity.model.request.*; |
| | | import com.dsh.activity.service.*; |
| | | import com.dsh.activity.util.GDMapGeocodingUtil; |
| | | import com.dsh.activity.util.StrUtils; |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | if (mapList.size() > 0){ |
| | | for (Map<String, Object> stringObjectMap : mapList) { |
| | | Integer o = (Integer) stringObjectMap.get("id"); |
| | | Object startTime = stringObjectMap.get("startTime"); |
| | | Object endTime = stringObjectMap.get("endTime"); |
| | | String startTime = (String) stringObjectMap.get("startTime"); |
| | | String endTime = (String) stringObjectMap.get("endTime"); |
| | | stringObjectMap.put("timeValue",startTime + "至"+endTime); |
| | | int count1 = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, o)); |
| | |
| | | .eq(UserPointsMerchandise::getStatus,2)); |
| | | stringObjectMap.put("hasExchangeQty",count1); |
| | | stringObjectMap.put("hasPickQty",count2); |
| | | |
| | | stringObjectMap.put("activeStatus",dealTimeStatus(startTime,endTime)); |
| | | } |
| | | if (ToolUtil.isNotEmpty(ofSearch.getActiveStatus())){ |
| | | mapList = dealTimeData(mapList,ofSearch.getActiveStatus()); |
| | | } |
| | | } |
| | | // TODO: 2023/8/14 state 活动状态 |
| | | System.out.println("mapList->"+mapList); |
| | | return mapList; |
| | | } |
| | | |
| | | public int dealTimeStatus(String startTime, String endTime){ |
| | | LocalDate now = LocalDate.now(); |
| | | LocalDate start = LocalDate.parse(startTime); |
| | | LocalDate end = LocalDate.parse(endTime); |
| | | if (now.isBefore(start)) { |
| | | return 1; // 未开始 |
| | | } else if (now.isAfter(end)) { |
| | | return 3; // 已结束 |
| | | } else { |
| | | return 2; // 已开始 |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryPointMerchaseDetailOfId") |
| | | public PointMercharsVo queryPointMerchaseDetailOfId(@RequestBody Integer pointMercharsId){ |
| | | PointMercharsVo vo = new PointMercharsVo(); |
| | | PointsMerchandise byId = pmdsService.getById(pointMercharsId); |
| | | if (ToolUtil.isNotEmpty(byId)){ |
| | | vo.setName(byId.getName()); |
| | | vo.setCover(byId.getCover()); |
| | | vo.setPics(byId.getProductImages()); |
| | | vo.setQuantityIssued(byId.getQuantityIssued()); |
| | | vo.setPickUpQuantity(byId.getPickUpQuantity()); |
| | | vo.setSort(byId.getSort()); |
| | | vo.setContent(byId.getRedemptionInstructions()); |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/updateGoodsGroudingStatus") |
| | | boolean updateGoodsGroudingStatus(@RequestBody Map<String,Integer> map){ |
| | | Integer id = map.get("id"); |
| | | Integer type = map.get("type"); |
| | | System.out.println(id); |
| | | System.out.println(type); |
| | | try { |
| | | PointsMerchandise byId = pmdsService.getById(id); |
| | | byId.setShelves(type); |
| | | pmdsService.updateById(byId); |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/queryUserPayedGoodsList") |
| | | public List<Map<String, Object>> queryUserPayedGoodsList(@RequestBody PointMercharsPayedVo pointMercharsPayedVo){ |
| | | System.out.println(pointMercharsPayedVo); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | LambdaQueryWrapper<UserPointsMerchandise> userPointsMerchandiseLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getPointsMerchandiseId,pointMercharsPayedVo.getId()); |
| | | if (ToolUtil.isNotEmpty(pointMercharsPayedVo.getStatus())){ |
| | | userPointsMerchandiseLambdaQueryWrapper.eq(UserPointsMerchandise::getStatus,pointMercharsPayedVo.getStatus()); |
| | | } |
| | | List<UserPointsMerchandise> list = upmseService.list(userPointsMerchandiseLambdaQueryWrapper); |
| | | System.out.println(list); |
| | | if (list.size() > 0 ){ |
| | | for (UserPointsMerchandise pointsMerchandise : list) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id",pointsMerchandise.getId()); |
| | | map.put("userId",pointsMerchandise.getUserId()); |
| | | map.put("status", pointsMerchandise.getStatus()); |
| | | mapList.add(map); |
| | | } |
| | | } |
| | | System.out.println(mapList); |
| | | return mapList; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
New file |
| | |
| | | package com.dsh.activity.model.request; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PointMercharsPayedVo { |
| | | |
| | | Integer id; |
| | | |
| | | String name; |
| | | |
| | | String phone; |
| | | |
| | | Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model.request; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PointMercharsVo { |
| | | |
| | | String name; |
| | | /** |
| | | * 封面图 |
| | | */ |
| | | String cover; |
| | | /** |
| | | * 图片 |
| | | */ |
| | | String pics; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | Integer pickUpQuantity; |
| | | /** |
| | | * 商品说明 |
| | | */ |
| | | String content; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | Integer sort; |
| | | } |
| | |
| | | import com.dsh.activity.feignclient.model.CouponExamineListSearch; |
| | | import com.dsh.activity.feignclient.model.CouponListOfSearch; |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.model.request.IntegralGoodsOfSearch; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | import com.dsh.activity.model.request.PointMercharsPayedVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | import com.dsh.activity.feignclient.model.CouponListOfSearch; |
| | | import com.dsh.activity.mapper.CouponMapper; |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.model.request.IntegralGoodsOfSearch; |
| | | import com.dsh.activity.service.ICouponService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | import com.dsh.activity.mapper.UserPointsMerchandiseMapper; |
| | | import com.dsh.activity.model.request.PointMercharsPayedVo; |
| | | import com.dsh.activity.service.UserPointsMerchandiseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 服务实现类 |
| | |
| | | package com.dsh.course.feignClient.activity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.activity.model.IntegralGoodsOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsPayedVo; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @PostMapping("/base/pointMerchars/queryGoodsListSearch") |
| | | List<Map<String,Object>> getIntegralGoodsListOfSearch(@RequestBody IntegralGoodsOfSearch ofSearch); |
| | | |
| | | @PostMapping("/base/pointMerchars/queryPointMerchaseDetailOfId") |
| | | PointMercharsVo queryPointMerchaseDetailOfId(@RequestBody Integer pointMercharsId); |
| | | |
| | | @PostMapping("/base/pointMerchars/updateGoodsGroudingStatus") |
| | | boolean updateGoodsGroudingStatus(@RequestBody Map<String,Integer> map); |
| | | |
| | | @PostMapping("/base/pointMerchars/queryUserPayedGoodsList") |
| | | List<Map<String, Object>> queryUserPayedGoodsList(@RequestBody PointMercharsPayedVo pointMercharsPayedVo); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.activity.model; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PointMercharsPayedVo { |
| | | |
| | | Integer id; |
| | | |
| | | String name; |
| | | |
| | | String phone; |
| | | |
| | | Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.activity.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PointMercharsVo { |
| | | |
| | | String name; |
| | | /** |
| | | * 封面图 |
| | | */ |
| | | String cover; |
| | | /** |
| | | * 图片 |
| | | */ |
| | | String pics; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | Integer pickUpQuantity; |
| | | /** |
| | | * 商品说明 |
| | | */ |
| | | String content; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | Integer sort; |
| | | } |
| | |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.PointMercharsClient; |
| | | import com.dsh.course.feignClient.activity.model.*; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.tips.ErrorTip; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | |
| | | return storeList; |
| | | } |
| | | |
| | | // /** |
| | | // * 获取 优惠券管理 |
| | | // */ |
| | | // @RequestMapping(value = "/list") |
| | | // @ResponseBody |
| | | // public Object listOfDatas(String name, Integer type, Integer distributionMethod , Integer userPopulation, Integer status, Integer state) { |
| | | // Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | // CouponListOfSearch ofSearch = new CouponListOfSearch(); |
| | | // ofSearch.setPage(page); |
| | | // ofSearch.setName(name); |
| | | // ofSearch.setType(type); |
| | | // ofSearch.setDistributionMethod(distributionMethod); |
| | | // ofSearch.setUserPopulation(userPopulation); |
| | | // ofSearch.setStatus(status); |
| | | // ofSearch.setState(state); |
| | | // return client.getCouponListOfSearch(ofSearch); |
| | | // } |
| | | @RequestMapping(value = "/listRecord") |
| | | @ResponseBody |
| | | public Object listRecord(Integer id,String name, Integer type, String phone) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tGoods_update/{id}") |
| | | public String tCityUpdate(@PathVariable Integer id, Model model) { |
| | | System.out.println("id:"+id); |
| | | PointMercharsVo pointMercharsVo = pointMercharsClient.queryPointMerchaseDetailOfId(id); |
| | | System.out.println("pointMercharsVo:"+pointMercharsVo); |
| | | String[] split = pointMercharsVo.getPics().split(","); |
| | | model.addAttribute("item",pointMercharsVo); |
| | | model.addAttribute("pictures",split); |
| | | return PREFIX + "TGoods_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 上下架处理操作 |
| | | * @param id 商品id |
| | | * @param type 1=上架操作 2=下架操作 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/grounding") |
| | | @ResponseBody |
| | | public Object updateGrounding(Integer id,Integer type) { |
| | | System.out.println(id); |
| | | System.out.println(type); |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | map.put("id",id); |
| | | map.put("type",type); |
| | | boolean b = pointMercharsClient.updateGoodsGroudingStatus(map); |
| | | System.out.println(b); |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 购买详情 |
| | | * @param id 商品id |
| | | * @return |
| | | */ |
| | | @RequestMapping("/tPay_detail/{id}") |
| | | public String payOfDetails(@PathVariable(value = "id") Integer id,Model model) { |
| | | System.out.println(id); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "TGoods_pay.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取 购买记录列表 |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/payList/{id}") |
| | | public Object payList(@PathVariable(value = "id") Integer id, String name, String phone, Integer status) { |
| | | PointMercharsPayedVo payedVo = new PointMercharsPayedVo(); |
| | | payedVo.setId(id); |
| | | payedVo.setName(name); |
| | | payedVo.setPhone(phone); |
| | | payedVo.setStatus(status); |
| | | List<Map<String,Object>> points = pointMercharsClient.queryUserPayedGoodsList(payedVo); |
| | | System.out.println(points); |
| | | if (points.size() > 0 ){ |
| | | for (Map<String, Object> point : points) { |
| | | Integer userId = (Integer) point.get("userId"); |
| | | TAppUser tAppUser = appUserClient.queryById(userId); |
| | | if (ToolUtil.isNotEmpty(tAppUser)){ |
| | | point.put("name",tAppUser.getName()); |
| | | point.put("phone",tAppUser.getPhone()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(name)){ |
| | | points = points.stream() |
| | | .filter(data -> { |
| | | String obtName = (String) data.get("name"); |
| | | return obtName != null && obtName.contains(name); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if (ToolUtil.isNotEmpty(phone)){ |
| | | points = points.stream() |
| | | .filter(data -> { |
| | | String obtPhone = (String) data.get("phone"); |
| | | return obtPhone != null && obtPhone.contains(phone); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | return points; |
| | | } |
| | | |
| | | /** |
| | | * 核销操作 |
| | | * @param id 商品id |
| | | * @return |
| | | */ |
| | | @RequestMapping("/write_off") |
| | | @ResponseBody |
| | | public Object GoodsWriteOff(Integer id){ |
| | | System.out.println(id); |
| | | // TODO: 2023/8/15 核销操作 |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409eff; |
| | | } |
| | | |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 110px; |
| | | margin-top: 40px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div id="b1"> |
| | | |
| | | <#input id="name" name="商品名称" type="text" value="${item.name}" readonly="true" /> |
| | | |
| | | <#avatar id="cover" name="商品封面:" avatarImg="${item.cover}" /> |
| | | |
| | | |
| | | <div class="row" id="app" style="margin-left: 225px;"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">商品图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%"> |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <!-- <img width="100%" :src="imageUrl1" alt="">--> |
| | | @for(im in pictures){ |
| | | <img width="100%" src="${im}"> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">发放数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="quantityIssued" name="quantityIssued" type="text" value="${item.quantityIssued}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">限领数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="pickUpQuantity" name="pickUpQuantity" type="text" value="${item.pickUpQuantity}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-1 control-label">兑换说明:</label> |
| | | <div class="col-sm-5"> |
| | | <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;">${item.content}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="sort" type="text" value="${item.sort}"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> |
| | | <script> |
| | | var vue2 = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TCarInfoDlg.goodsPicArray.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TCarInfoDlg.goodsPicArray = TCarInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <input id="id" value="${id}" hidden="hidden"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="姓名" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="phone" name="联系方式:" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="status" name="状态:"> |
| | | <option value="">全部</option> |
| | | <option value="1">未使用</option> |
| | | <option value="2">已使用</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TPayInfo.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TPayInfo.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TPayInfoTableToolbar" role="group"> |
| | | <#button name="核销" icon="fa-plus" clickFun="TPayInfo.WriteOff()"/> |
| | | </div> |
| | | <#table id="TPayInfoTable"/> |
| | | |
| | | <div style="margin-left: 40%"> |
| | | <button type="button" class="btn btn-info button-margin" onclick="TPayInfo.close()" |
| | | id="submit" style="width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> |
| | | <i class="fa fa-check"></i> 关闭 |
| | | </button> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tGoods/tPay_info.js"></script> |
| | | @} |
| | |
| | | }, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '活动状态', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | {title: '活动状态', field: 'activeStatus', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "未开始", 2: "已开始", 3: "已结束"}[value] |
| | | } |
| | | }, |
| | | {title: '可售状态', field: 'shelves', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | title:'购买详情', |
| | | area: ['70%', '70%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/tCity_update/' + TPointProducts.seItem.id |
| | | content: Feng.ctxPath + '/tGoods/tPay_detail/' + TPointProducts.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/tCity_update/' + TPointProducts.seItem.id |
| | | content: Feng.ctxPath + '/tGoods/tGoods_update/' + TPointProducts.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | */ |
| | | TPointProducts.grounding = function (m) { |
| | | console.log('m:',m); |
| | | // if (this.check()) { |
| | | // var ajax = new $ax(Feng.ctxPath + "/tGoods/freeze", function (data) { |
| | | // Feng.success("冻结成功!"); |
| | | // TPointProducts.table.refresh(); |
| | | // }, function (data) { |
| | | // Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | // }); |
| | | // ajax.set("id",this.seItem.id); |
| | | // ajax.start(); |
| | | // } |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/grounding", function (data) { |
| | | Feng.success("操作成功!"); |
| | | TPointProducts.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.set("type",m); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | parent.layer.close(window.parent.TPointProducts.layerIndex); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TPayInfo = { |
| | | id: "TPayInfoTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1, |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TPayInfo.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '选择', field: '', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '使用状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "未使用", 2: "待核销"}[value] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TPayInfo.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TPayInfo.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 核销操作 |
| | | * @constructor |
| | | */ |
| | | TPayInfo.WriteOff = function (){ |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/write_off", function (data) { |
| | | Feng.success("核销成功!"); |
| | | TPayInfo.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("核销失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TPayInfo.close = function() { |
| | | parent.layer.close(window.parent.TPointProducts.layerIndex); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TPayInfo.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | queryData['id'] = $("#id").val(); |
| | | TPayInfo.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 重置搜索 |
| | | */ |
| | | TPayInfo.resetSearch = function () { |
| | | $("#name").val(''); |
| | | $("#phone").val(''); |
| | | $("#status").val(''); |
| | | TPayInfo.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | let goodsId = $("#id").val(); |
| | | var defaultColunms = TPayInfo.initColumn(); |
| | | var table = new BSTable(TPayInfo.id, "/tGoods/payList/"+goodsId, defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TPayInfo.table = table.init(); |
| | | }); |