| | |
| | | * 跳转区域页面 |
| | | */ |
| | | @RequestMapping("/areaDetail") |
| | | public String areaDetail(Model model) { |
| | | public String areaDetail(String area,String areaId,Model model) { |
| | | String[] split1 = areaId.split("/"); |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("province",tRegions); |
| | | List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | // 查询市 |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); |
| | | model.addAttribute("cityList",tRegions1); |
| | | if(StringUtils.hasLength(area) && StringUtils.hasLength(areaId)){ |
| | | String[] split = area.split("/"); |
| | | model.addAttribute("provinceName",split[0]); |
| | | model.addAttribute("cityName",split[1]); |
| | | |
| | | model.addAttribute("provinceId",split1[0]); |
| | | model.addAttribute("cityId",split1[1]); |
| | | }else { |
| | | model.addAttribute("provinceName",""); |
| | | model.addAttribute("cityName",""); |
| | | |
| | | model.addAttribute("provinceId",""); |
| | | model.addAttribute("cityId",""); |
| | | } |
| | | return PREFIX + "tAgentArea.html"; |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public Object add(TAgent tAgent) { |
| | | |
| | | int count = tAgentService.selectCount(new EntityWrapper<TAgent>().eq("principalPhone", tAgent.getPrincipalPhone())); |
| | | String[] split1 = tAgent.getArea().split("/"); |
| | | |
| | | int count = tAgentService.selectCount(new EntityWrapper<TAgent>().eq("provinceName", split1[0]).eq("cityName",split1[1])); |
| | | if(count>0){ |
| | | return new SuccessTip(500,"该代理商已存在!"); |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | * 跳转区域页面新增 |
| | | */ |
| | | @RequestMapping("/areaPageAdd") |
| | | public String areaPageAdd(Model model) { |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | return PREFIX + "tBranchOfficeAreaAdd.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转区域页面编辑 |
| | | */ |
| | | @RequestMapping("/areaPageUpdate") |
| | | public String areaPageUpdate(String area,String areaId,Model model) { |
| | | public String areaPageAdd(String area,String areaId,Model model) { |
| | | String[] split1 = areaId.split("/"); |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | // 查询市 |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", provinceIds)); |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); |
| | | model.addAttribute("cityList",tRegions1); |
| | | |
| | | // 查询区 |
| | |
| | | model.addAttribute("districtName",""); |
| | | } |
| | | |
| | | String[] split1 = areaId.split("/"); |
| | | model.addAttribute("provinceId",split1[0]); |
| | | model.addAttribute("cityId",split1[1]); |
| | | if(split1.length>2) { |
| | |
| | | }else { |
| | | model.addAttribute("districtId", ""); |
| | | } |
| | | }else { |
| | | model.addAttribute("provinceName",""); |
| | | model.addAttribute("cityName","split[1]"); |
| | | model.addAttribute("districtName",""); |
| | | |
| | | model.addAttribute("provinceId",""); |
| | | model.addAttribute("cityId","split1[1]"); |
| | | model.addAttribute("districtId", ""); |
| | | } |
| | | return PREFIX + "tBranchOfficeAreaAdd.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转区域页面编辑 |
| | | */ |
| | | @RequestMapping("/areaPageUpdate") |
| | | public String areaPageUpdate(String area,String areaId,Model model) { |
| | | |
| | | String[] split = area.split("/"); |
| | | model.addAttribute("provinceName",split[0]); |
| | | model.addAttribute("cityName",split[1]); |
| | | if(split.length>2){ |
| | | model.addAttribute("districtName",split[2]); |
| | | }else { |
| | | model.addAttribute("districtName",""); |
| | | } |
| | | |
| | | String[] split1 = areaId.split("/"); |
| | | String provinceId = split1[0]; |
| | | model.addAttribute("provinceId",split1[0]); |
| | | model.addAttribute("cityId",split1[1]); |
| | | if(split1.length>2) { |
| | | model.addAttribute("districtId", split1[2]); |
| | | }else { |
| | | model.addAttribute("districtId", ""); |
| | | } |
| | | |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | // List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | // 查询市 |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", provinceId)); |
| | | model.addAttribute("cityList",tRegions1); |
| | | |
| | | // 查询区 |
| | | List<Integer> cityIds = tRegions1.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | List<TRegion> tRegions2 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", cityIds)); |
| | | model.addAttribute("districtList",tRegions2); |
| | | |
| | | return PREFIX + "tBranchOfficeAreaUpdate.html"; |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public Object areaCity(Integer parentId,Model model) { |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", parentId)); |
| | | /*if(CollectionUtils.isEmpty(tRegions) && StringUtils.hasLength(parentName)){ |
| | | TRegion parent = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("name", parentName)); |
| | | tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", parentId)); |
| | | }*/ |
| | | model.addAttribute("list",tRegions); |
| | | return tRegions; |
| | | } |
| | |
| | | */ |
| | | @RequestMapping("/areaPageUpdate") |
| | | public String areaPageUpdate(String area,String areaId,Model model) { |
| | | |
| | | String[] split = area.split("/"); |
| | | model.addAttribute("provinceName",split[0]); |
| | | model.addAttribute("cityName",split[1]); |
| | | model.addAttribute("districtName",split[2]); |
| | | |
| | | String[] split1 = areaId.split("/"); |
| | | model.addAttribute("provinceId",split1[0]); |
| | | model.addAttribute("cityId",split1[1]); |
| | | model.addAttribute("districtId",split1[2]); |
| | | |
| | | |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | |
| | | |
| | | // 查询市 |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); |
| | | model.addAttribute("cityList",tRegions1); |
| | | |
| | | // 查询区 |
| | | List<Integer> cityIds = tRegions1.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | List<TRegion> tRegions2 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", cityIds)); |
| | | model.addAttribute("districtList",tRegions2); |
| | | |
| | | return PREFIX + "tDriverAreaUpdate.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转区域页面新增 |
| | | */ |
| | | @RequestMapping("/areaPageAdd") |
| | | public String areaPageAdd(String area,String areaId,Model model) { |
| | | String[] split1 = areaId.split("/"); |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | // 查询市 |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", provinceIds)); |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", split1[0])); |
| | | model.addAttribute("cityList",tRegions1); |
| | | |
| | | // 查询区 |
| | |
| | | String[] split = area.split("/"); |
| | | model.addAttribute("provinceName",split[0]); |
| | | model.addAttribute("cityName",split[1]); |
| | | if(split.length>2){ |
| | | model.addAttribute("districtName",split[2]); |
| | | }else { |
| | | model.addAttribute("districtName",""); |
| | | } |
| | | |
| | | String[] split1 = areaId.split("/"); |
| | | model.addAttribute("provinceId",split1[0]); |
| | | model.addAttribute("cityId",split1[1]); |
| | | if(split1.length>2) { |
| | | model.addAttribute("districtId",split1[2]); |
| | | }else { |
| | | model.addAttribute("districtId", ""); |
| | | } |
| | | return PREFIX + "tDriverAreaUpdate.html"; |
| | | } |
| | | }else { |
| | | model.addAttribute("provinceName",""); |
| | | model.addAttribute("cityName","split[1]"); |
| | | model.addAttribute("districtName",""); |
| | | |
| | | /** |
| | | * 跳转区域页面新增 |
| | | */ |
| | | @RequestMapping("/areaPageAdd") |
| | | public String areaPageAdd(Model model) { |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | model.addAttribute("provinceId",""); |
| | | model.addAttribute("cityId","split1[1]"); |
| | | model.addAttribute("districtId", ""); |
| | | } |
| | | return PREFIX + "tDriverAreaAdd.html"; |
| | | } |
| | | |
| | |
| | | } |
| | | tBranchOffice.setDistrictName(area.getName()); |
| | | tBranchOffice.setDistrictCode(area.getCode()); |
| | | }else { |
| | | tBranchOffice.setDistrictName(""); |
| | | tBranchOffice.setDistrictCode(""); |
| | | } |
| | | |
| | | // 通过省市查询代理商 |
| | |
| | | TDriverResp tDriverResp = new TDriverResp(); |
| | | BeanUtils.copyProperties(tDriver,tDriverResp); |
| | | |
| | | if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance())){ |
| | | // 设置余额 |
| | | tDriverResp.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance())); |
| | | } |
| | | |
| | | // 所属代理商 |
| | | TAgent tAgent = tAgentMapper.selectById(tDriver.getAgentId()); |
| | |
| | | <div class="col-sm-6 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">省:</label> |
| | | <select class="input-group col-sm-2 " onclick="TAgent.areaProvince()" id="province" style="width: 200px;height: 33px" name="province"> |
| | | <option value="">请选择省</option> |
| | | <option value="">请选择</option> |
| | | @for(i in province){ |
| | | <option id="${i.id}" value="${i.name}">${i.name}</option> |
| | | <option id="${i.id}" value="${i.name}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-6 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">市:</label> |
| | | <select class="input-group col-sm-2" id="city" style="width: 200px;height: 33px" name="city"> |
| | | <option value="">请选择</option> |
| | | @for(city in cityList){ |
| | | <option id="${city.id}" value="${city.name}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row" > |
| | | <div class="row" id="tAgentInfoForm"> |
| | | <div class="col-sm-12" style="text-align: center"> |
| | | <input hidden id="areaId" value="areaId"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="text-align: center"> |
| | |
| | | <input id="principal" name="principal" type="text" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | <!--<div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <span style="color:red">*</span> |
| | | <label class="col-sm-3 control-label">负责人姓名:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="principal" name="principal" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div>--> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <label class="control-label" >邮箱:</label> |
| | | <input id="email" name="email" type="email" style="height: 30px" required> |
| | | <input id="email" name="email" type="email" style="height: 30px"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >代理区域:</label> |
| | | <input id="area" onclick="TAgent.area()" name="area" placeholder="请选择" style="height: 30px" readonly> |
| | | <input id="area" onclick="TAgent.area()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <span style="color:red">*</span> |
| | | <label class="col-sm-3 control-label">代理区域:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="area" onclick="TAgent.area()" name="area" type="text" placeholder="请选择"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div>--> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <label class="control-label" >开户银行:</label> |
| | | <input id="bankDeposit" name="bankDeposit" type="text" style="height: 30px" required> |
| | | <input id="bankDeposit" name="bankDeposit" type="text" style="height: 30px"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <label class="control-label" >银行账户:</label> |
| | | <input id="bankAccount" name="bankAccount" type="number" style="height: 30px" required> |
| | | <input id="bankAccount" name="bankAccount" type="number" style="height: 30px"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <select class="input-group col-sm-2 " onclick="TBranchOffice.areaCity()" id="province" style="width: 200px;height: 33px" name="province"> |
| | | <option value="">请选择</option> |
| | | @for(i in provinceList){ |
| | | <option id="${i.id}" value="${i.name}"}>${i.name}</option> |
| | | <option id="${i.id}" value="${i.name}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <label class="col-sm-1" style="width: 20px;">市:</label> |
| | | <select class="input-group col-sm-2" onclick="TBranchOffice.areaDistrict()" id="city" style="width: 200px;height: 33px" name="city"> |
| | | <option value="">请选择</option> |
| | | @for(city in cityList){ |
| | | <option id="${city.id}" value="${city.name}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">区:</label> |
| | | <select class="input-group col-sm-2" id="district" style="width: 200px;height: 33px" name="district"> |
| | | <option value="">请选择</option> |
| | | @for(district in districtList){ |
| | | <option id="${district.id}" value="${district.name}"${district.name == districtName ? 'selected=selected' : ''}>${district.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">省:</label> |
| | | <select class="input-group col-sm-2 " onclick="TBranchOffice.areaCity()" id="province" style="width: 200px;height: 33px" name="province"> |
| | | <option value="">请选择省</option> |
| | | <option value="">请选择</option> |
| | | @for(i in provinceList){ |
| | | <option id="${i.id}" value="${i.name}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> |
| | | @} |
| | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">市:</label> |
| | | <select class="input-group col-sm-2" onclick="TBranchOffice.areaDistrict()" id="city" style="width: 200px;height: 33px" name="city"> |
| | | <option>请选择市</option> |
| | | <option>请选择</option> |
| | | @for(city in cityList){ |
| | | <option id="${city.id}" value="${city.name}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> |
| | | @} |
| | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">区:</label> |
| | | <select class="input-group col-sm-2" id="district" style="width: 200px;height: 33px" name="district"> |
| | | <option>请选择区</option> |
| | | <option>请选择</option> |
| | | @for(district in districtList){ |
| | | <option id="${district.id}" value="${district.name}"${district.name == districtName ? 'selected=selected' : ''}>${district.name}</option> |
| | | @} |
| | |
| | | <div class="ibox-content" id="branchOfficeInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="areaId"> |
| | | <input hidden id="areaId" value="areaId"> |
| | | |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: right;"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="couponInfoForm"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">优惠券名称:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="couponName" name="couponName" type="text" required> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>添加</h5> |
| | | </div> |
| | | <div class="ibox-content" id="couponInfoForm"> |
| | | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: right;"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >优惠券名称:</label> |
| | | <input id="couponName" name="couponName" type="text" style="height: 30px" required="required"> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">优惠券类型:</label> |
| | | <select class="input-group col-sm-6" id="couponType" name="couponType" required> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >优惠券类型:</label> |
| | | <select id="couponType" name="couponType" onclick="TCoupon.changeCouponType()" style="height: 30px" required> |
| | | <option value="">请选择优惠券类型</option> |
| | | <option value="1">活动券</option> |
| | | <option value="2">新人券</option> |
| | | </select> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">服务类类型:</label> |
| | | <select class="input-group col-sm-6" id="couponServiceType" name="couponServiceType" required> |
| | | <option value="">请选择服务类型</option> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class=" control-label">服务类类型:</label> |
| | | <select id="couponServiceType" name="couponServiceType" style="height: 30px" required> |
| | | <option value="">请选择服务类类型</option> |
| | | <option value="1">通用型</option> |
| | | </select> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">优惠券限制数量:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="couponCount" name="couponCount" type="number" required> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">优惠券限制数量:</label> |
| | | <input id="couponCount" name="couponCount" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">条件金额:订单满</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="couponConditionalAmount" name="couponConditionalAmount" type="number" required> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">条件金额:订单满</label> |
| | | <input id="couponConditionalAmount" name="couponConditionalAmount" type="number" style="height: 30px" required> |
| | | </div> |
| | | <label class="col-sm-2 control-label">可使用</label> |
| | | <div class="initialLevel col-sm-3 control-label form-group" style="text-align: left" > |
| | | <label>可使用</label> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">优惠金额:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="couponPreferentialAmount" name="couponPreferentialAmount" type="number" required> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">优惠金额:</label> |
| | | <input id="couponPreferentialAmount" name="couponPreferentialAmount" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">有效期:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="couponValidity" name="couponValidity" type="number" required> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">有效期:</label> |
| | | <input id="couponValidity" name="couponValidity" type="number" style="height: 30px" required> |
| | | </div> |
| | | <label class="col-sm-1 control-label">天</label> |
| | | <div class="initialLevel col-sm-3 control-label form-group" style="text-align: left" > |
| | | <label>天</label> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">优惠券总量:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="remainingQuantity" name="remainingQuantity" type="number" required> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">优惠券总量:</label> |
| | | <input id="remainingQuantity" name="remainingQuantity" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">赠送数量:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="couponSendQuantity" name="couponSendQuantity" type="number"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" hidden id="changeCouponSendQuantity" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">赠送数量:</label> |
| | | <input id="couponSendQuantity" name="couponSendQuantity" type="number" style="height: 30px" required> |
| | | </div> |
| | | <label class="col-sm-1 control-label">张</label> |
| | | <div class="initialLevel col-sm-3 control-label form-group" style="text-align: left" > |
| | | <label>张</label> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon.js"></script> |
| | | <script type="text/javascript"> |
| | | </script> |
| | | @} |
| | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">省:</label> |
| | | <select class="input-group col-sm-2 " onclick="TDriver.areaCity()" id="province" style="width: 200px;height: 33px" name="province"> |
| | | <option value="">请选择省</option> |
| | | <option value="">请选择</option> |
| | | @for(i in provinceList){ |
| | | <option id="${i.id}" value="${i.name}"}>${i.name}</option> |
| | | <option id="${i.id}" value="${i.name}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">市:</label> |
| | | <select class="input-group col-sm-2" onclick="TDriver.areaDistrict()" id="city" style="width: 200px;height: 33px" name="city"> |
| | | <option>请选择市</option> |
| | | <option>请选择</option> |
| | | @for(city in cityList){ |
| | | <option id="${city.id}" value="${city.name}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">区:</label> |
| | | <select class="input-group col-sm-2" id="district" style="width: 200px;height: 33px" name="district"> |
| | | <option>请选择区</option> |
| | | <option>请选择</option> |
| | | @for(district in districtList){ |
| | | <option id="${district.id}" value="${district.name}"${district.name == districtName ? 'selected=selected' : ''}>${district.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12" style="height: 100px;"> |
| | | <input hidden id="provinceName" value="${provinceName}"> |
| | | <!--<input hidden id="provinceName" value="${provinceName}"> |
| | | <input hidden id="cityName" value="${cityName}"> |
| | | <input hidden id="districtName" value="${districtName}"> |
| | | <input hidden id="provinceId" value="${provinceId}"> |
| | | <input hidden id="cityId" value="${cityId}"> |
| | | <input hidden id="districtId" value="${districtId}"> |
| | | <input hidden id="districtId" value="${districtId}">--> |
| | | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">省:</label> |
| | | <select class="input-group col-sm-2 " onclick="TDriver.areaCity()" id="province" style="width: 200px;height: 33px" name="province"> |
| | | <option value="">请选择省</option> |
| | | <option value="">请选择</option> |
| | | @for(i in provinceList){ |
| | | <option id="${i.id}" value="${i.name}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> |
| | | @} |
| | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">市:</label> |
| | | <select class="input-group col-sm-2" onclick="TDriver.areaDistrict()" id="city" style="width: 200px;height: 33px" name="city"> |
| | | <option>请选择市</option> |
| | | <option>请选择</option> |
| | | @for(city in cityList){ |
| | | <option id="${city.id}" value="${city.name}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> |
| | | @} |
| | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">区:</label> |
| | | <select class="input-group col-sm-2" id="district" style="width: 200px;height: 33px" name="district"> |
| | | <option>请选择区</option> |
| | | <option>请选择</option> |
| | | @for(district in districtList){ |
| | | <option id="${district.id}" value="${district.name}"${district.name == districtName ? 'selected=selected' : ''}>${district.name}</option> |
| | | @} |
| | |
| | | * 打开区域选择页面 |
| | | */ |
| | | TAgent.area = function () { |
| | | |
| | | var area = $('#area').val(); |
| | | var areaId = $('#areaId').val(); |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '区域选择', |
| | | area: ['800px', '270px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tAgent/areaDetail' |
| | | content: Feng.ctxPath + '/tAgent/areaDetail?area='+area+"&areaId="+areaId |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | * 查询市区 |
| | | */ |
| | | TAgent.areaProvince = function () { |
| | | |
| | | //监听第一个下拉菜单的变动操作 |
| | | $("#province").change(function(){ |
| | | //当第一级下拉列表没选择值时,将二级下拉列表和三级同时设置为空 |
| | | if(this.value==""){ |
| | | $("#city").empty();//二级联动设为空设为空 |
| | | $("#city").append('<option value="">请选择</option>'); |
| | | } |
| | | if(this.value!=""){//第一级下拉菜单选择了值 |
| | | $("#city").empty();//先行置空,防止上次选择留下的元素影响效果 |
| | | $("#city").append('<option value="">请选择</option>')//设置初始选项 |
| | | var province = document.getElementById('province'); |
| | | var index= province.selectedIndex ; |
| | | var id = province.options[index].id; |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/areaCity?parentId="+id, function (data) { |
| | | for(var i=0,n=data.length;i<n;i++){//遍历 |
| | | $("#city").append('<option value="'+data[i].id+'">'+data[i].name+'</option>');//创造元素 |
| | | } |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | }); |
| | | |
| | | /*var province = document.getElementById('province'); |
| | | var index= province.selectedIndex ; |
| | | var id = province.options[index].id; |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/areaCity?parentId="+id, function (data) { |
| | |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | ajax.start();*/ |
| | | } |
| | | /** |
| | | * 选择省市 |
| | |
| | | var provinceIndex= province.selectedIndex ; |
| | | var provinceName = province.options[provinceIndex].value; |
| | | var provinceId = province.options[provinceIndex].id; |
| | | |
| | | if(provinceName == null || provinceName == ''){ |
| | | Feng.error("请选择省份!") |
| | | return; |
| | | } |
| | | |
| | | var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | var cityId = city.options[cityIndex].value; |
| | | var cityName = city.options[cityIndex].innerText; |
| | | |
| | | if(cityName == null || cityName == '' || cityName =='请选择'){ |
| | | Feng.error("请选择市区!") |
| | | return; |
| | | } |
| | | |
| | | parent.$("#area").val(provinceName+'/'+cityName) |
| | | parent.$("#areaId").val(provinceId+'/'+cityId) |
| | | TAgentInfoDlg.close(); |
| | |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TAgentInfoDlg = { |
| | | tAgentInfoData : {} |
| | | tAgentInfoData : {}, |
| | | validateFields: { |
| | | principal: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '负责人姓名不能为空' |
| | | } |
| | | } |
| | | }, |
| | | principalPhone: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '联系电话不能为空' |
| | | } |
| | | } |
| | | }, |
| | | area: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择代理区域' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TAgentInfoDlg.validate = function () { |
| | | $('#tAgentInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#tAgentInfoForm').bootstrapValidator('validate'); |
| | | return $("#tAgentInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/add", function(data){ |
| | | if(data.code == 500){ |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | Feng.initValidator("tAgentInfoForm", TAgentInfoDlg.validateFields); |
| | | }); |
| | |
| | | * 打开区域选择页面新增 |
| | | */ |
| | | TBranchOffice.areaAdd = function () { |
| | | |
| | | var area = $("#area").val(); |
| | | var areaId = $("#areaId").val(); |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '区域选择', |
| | | area: ['1000px', '270px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tBranchOffice/areaPageAdd' |
| | | content: Feng.ctxPath + '/tBranchOffice/areaPageAdd?area='+area+'&areaId='+areaId |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | |
| | | var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | var id = city.options[cityIndex].value; |
| | | var id = city.options[cityIndex].id; |
| | | if(id == ""){ |
| | | id = city.options[cityIndex].value; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/areaCity?parentId="+id, function (data) { |
| | | for(var i=0,n=data.length;i<n;i++){//对区数据进行遍历,动态生成 |
| | | $("#district").append('<option value="'+data[i].id+'">'+data[i].name+'</option>'); |
| | |
| | | parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) |
| | | parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) |
| | | } |
| | | console.log() |
| | | TBranchOfficeInfoDlg.close(); |
| | | } |
| | | |
| | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCoupon/tCoupon_add' |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 选择新人券或者活动券时 |
| | | */ |
| | | TCoupon.changeCouponType = function (id,couponState) { |
| | | |
| | | //监听下拉菜单的变动操作 |
| | | $("#couponType").change(function(){ |
| | | // 如果选择活动券,将赠送数量隐藏 |
| | | if(this.value == 1){ |
| | | $("#changeCouponSendQuantity").hide() |
| | | } |
| | | if(this.value == ""){ |
| | | $("#changeCouponSendQuantity").hide() |
| | | } |
| | | if(this.value == 2){ |
| | | $("#changeCouponSendQuantity").show() |
| | | } |
| | | |
| | | }) |
| | | |
| | | }; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TCoupon.search = function () { |
| | |
| | | couponType: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '优惠券类型不能为空' |
| | | message: '请选择优惠券类型' |
| | | } |
| | | } |
| | | }, |
| | | couponServiceType: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '服务类类型不能为空' |
| | | message: '请选择服务类类型' |
| | | } |
| | | } |
| | | }, |
| | |
| | | * 打开区域选择页面新增 |
| | | */ |
| | | TDriver.areaAdd = function () { |
| | | |
| | | var area = $("#area").val(); |
| | | var areaId = $("#areaId").val(); |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '区域选择', |
| | | area: ['1000px', '270px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/areaPageAdd' |
| | | content: Feng.ctxPath + '/tDriver/areaPageAdd?area='+area+'&areaId='+areaId |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | * 查询市 |
| | | */ |
| | | TDriver.areaCity = function () { |
| | | //监听第一个下拉菜单的变动操作 |
| | | $("#province").change(function(){ |
| | | //当第一级下拉列表没选择值时,将二级下拉列表和三级同时设置为空 |
| | | if(this.value==""){ |
| | | $("#city").empty();//二级联动设为空设为空 |
| | | $("#city").append('<option value="">请选择</option>'); |
| | | //region |
| | | $("#district").empty();//三级联动设为空设为空 |
| | | $("#district").append('<option value="">请选择</option>'); |
| | | |
| | | } |
| | | if(this.value!=""){//第一级下拉菜单选择了值 |
| | | $("#city").empty();//先行置空,防止上次选择留下的元素影响效果 |
| | | $("#city").append('<option value="">请选择</option>')//设置初始选项 |
| | | $("#district").empty();//三级联动设为空设为空 |
| | | $("#district").append('<option value="">请选择</option>'); |
| | | var province = document.getElementById('province'); |
| | | var index= province.selectedIndex ; |
| | | var id = province.options[index].id; |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) { |
| | | for(var i=0,n=data.length;i<n;i++){//遍历 |
| | | $("#city").append('<option value="'+data[i].id+'">'+data[i].name+'</option>');//创造元素 |
| | | } |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | }); |
| | | /*var province = document.getElementById('province'); |
| | | var index= province.selectedIndex ; |
| | | var id = province.options[index].id; |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) { |
| | |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | ajax.start();*/ |
| | | } |
| | | |
| | | /** |
| | | * 查询区 |
| | | */ |
| | | TDriver.areaDistrict = function () { |
| | | |
| | | //监听第二个下拉菜单的变动操作 |
| | | $("#city").change(function(){ |
| | | if(this.value==""){//第二级菜单为空,则将第三级菜单也置为空 |
| | | $("#district").empty(); |
| | | $("#district").append('<option value="">请选择</option>'); |
| | | } |
| | | if(this.value!=""){//第二级菜单不为空,则将第三级菜单动态生成 |
| | | $("#district").empty(); |
| | | $("#district").append('<option value="">请选择</option>'); |
| | | |
| | | var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | var id = city.options[cityIndex].id; |
| | | if(id == ""){ |
| | | id = city.options[cityIndex].value; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) { |
| | | for(var i=0,n=data.length;i<n;i++){//对区数据进行遍历,动态生成 |
| | | $("#district").append('<option value="'+data[i].id+'">'+data[i].name+'</option>'); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | }) |
| | | |
| | | /*var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | var id = city.options[cityIndex].value; |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) { |
| | |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | ajax.start();*/ |
| | | } |
| | | |
| | | /** |
| | |
| | | var provinceName = province.options[provinceIndex].value; |
| | | var provinceId = province.options[provinceIndex].id; |
| | | |
| | | if(provinceName == null || provinceName == ''){ |
| | | Feng.error("请选择省份!") |
| | | return; |
| | | } |
| | | |
| | | var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | var cityId = city.options[cityIndex].value; |
| | | var cityName = city.options[cityIndex].innerText; |
| | | |
| | | if(cityName == null || cityName == '' || cityName =='请选择'){ |
| | | Feng.error("请选择市区!") |
| | | return; |
| | | } |
| | | |
| | | var district = document.getElementById('district'); |
| | | var districtIndex= district.selectedIndex ; |
| | | var districtId = district.options[districtIndex].value; |
| | | var districtName = district.options[districtIndex].innerText; |
| | | |
| | | if(districtName == null || districtName == '' || districtName =='请选择'){ |
| | | Feng.error("请选择区县!") |
| | | return; |
| | | } |
| | | |
| | | parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) |
| | | parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) |
| | | console.log() |
| | | TDriverInfoDlg.close(); |
| | | } |
| | | |