| | |
| | | import com.dsh.account.service.IVipPaymentService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TCourseInfoRecordService; |
| | | import com.dsh.account.util.PayMoneyUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import com.dsh.account.util.*; |
| | | import com.dsh.account.vo.GroupCityInfoVO; |
| | | import com.dsh.account.vo.UserInfoQueryVO; |
| | | import com.dsh.account.vo.entity.DayData; |
| | |
| | | |
| | | @Autowired |
| | | private TCourseInfoRecordService courseInfoRecordService; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | /** |
| | | * 获取所有用户 |
| | |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/api/appUser/bind") |
| | | @PostMapping("/base/appUser/bind") |
| | | @ApiOperation(value = "微信登录--绑定手机号", tags = {"APP-登录注册"}) |
| | | @ApiImplicitParams({ |
| | | }) |
| | | public ResultUtil<String> bind(String phone){ |
| | | public ResultUtil<String> bind(String phone,String openId,String code){ |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | String value = redisUtil.getValue(phone); |
| | | if(!code.equals(value)){ |
| | | return ResultUtil.error("验证码无效", ""); |
| | | } |
| | | TAppUser byId = appUserService.getById(uid); |
| | | byId.setPhone(phone); |
| | | appUserService.updateById(byId); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getOpenid, openId)); |
| | | TAppUser tAppUser = list.get(0); |
| | | tAppUser.setPhone(phone); |
| | | appUserService.updateById(tAppUser); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/student/getUserPtVip") |
| | | public List<Integer> getUserPtVip(){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserStore") |
| | | @ResponseBody |
| | | public List<Integer> getUserStore(@RequestBody Integer id){ |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/userAndVipPt") |
| | | public HashMap<String, Object> userAndVipPt(@RequestBody Integer type){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 所有的 |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); |
| | | map.put("allUser",list.size()); |
| | | List<TAppUser> list1 = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1)); |
| | | map.put("allVip",list1.size()); |
| | | |
| | | |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | // 年 |
| | | ArrayList<Long> years = new ArrayList<>(); |
| | | ArrayList<Long> yearsVip = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | String s = o.toString(); |
| | | long count = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | long count1 = list1.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | years.add(count); |
| | | yearsVip.add(count1); |
| | | } |
| | | map.put("yearData",years); |
| | | map.put("yearsVip",yearsVip); |
| | | |
| | | ArrayList<Long> months = new ArrayList<>(); |
| | | ArrayList<Long> monthsVip = new ArrayList<>(); |
| | | // 月 |
| | | for (int i = 1; i <= 12; i++) { |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | long count = list.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | long count1 = list1.stream().filter(e -> e.getInsertTime().toString().contains(s)).count(); |
| | | months.add(count); |
| | | monthsVip.add(count1); |
| | | } |
| | | map.put("monthData",months); |
| | | map.put("monthsVip",monthsVip); |
| | | |
| | | // 周 |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | String s1 = minNow.minusDays(6).toString(); |
| | | String s2 = maxNow.toString(); |
| | | |
| | | String s3 = minNow.minusDays(13).toString(); |
| | | String s4 = maxNow.minusDays(6).toString(); |
| | | |
| | | |
| | | String s5 = minNow.minusDays(20).toString(); |
| | | String s6 = maxNow.minusDays(13).toString(); |
| | | |
| | | String s7 = minNow.minusDays(27).toString(); |
| | | String s8 = maxNow.minusDays(20).toString(); |
| | | |
| | | |
| | | int count = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime, s7, s8)); |
| | | int countVip = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s7, s8)); |
| | | |
| | | int count1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s5,s6)); |
| | | int countVip1 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s5,s6)); |
| | | |
| | | int count2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s3,s4)); |
| | | int countVip2 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s3,s4)); |
| | | |
| | | int count3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s1,s2)); |
| | | int countVip3 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s1,s2)); |
| | | map.put("count",count); |
| | | map.put("count1",count1); |
| | | map.put("count2",count2); |
| | | map.put("count3",count3); |
| | | map.put("countVip",countVip); |
| | | map.put("countVip1",countVip1); |
| | | map.put("countVip2",countVip2); |
| | | map.put("countVip3",countVip3); |
| | | |
| | | |
| | | // 日 |
| | | ArrayList<Integer> days = new ArrayList<>(); |
| | | ArrayList<Integer> daysVip = new ArrayList<>(); |
| | | for (int i = 6; i >= 0; i--) { |
| | | String s = minNow.minusDays(i).toString(); |
| | | String s9 = maxNow.minusDays(i).toString(); |
| | | int count4 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).between(TAppUser::getInsertTime,s,s9)); |
| | | int countVip5 = appUserService.count(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1).between(TAppUser::getInsertTime, s,s9)); |
| | | days.add(count4); |
| | | daysVip.add(countVip5); |
| | | } |
| | | map.put("dayData",days); |
| | | map.put("daysVip",daysVip); |
| | | |
| | | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/student/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | return ResultUtil.error("请先注册", ""); |
| | | } |
| | | if(tAppUser.getState() == 2){ |
| | | return ResultUtil.error("您的账号已被冻结", ""); |
| | | return ResultUtil.errorCode("您的账号已被冻结", ""); |
| | | } |
| | | // password = Md5Util.MD5Encode(password, null); |
| | | if(!tAppUser.getPassword().equals(password)){ |
| | |
| | | if(tAppUser.getState() == 2){ |
| | | return ResultUtil.error("您的账号已被冻结", ""); |
| | | } |
| | | tAppUser.setPassword(Md5Util.MD5Encode(password, null)); |
| | | tAppUser.setPassword(password); |
| | | this.updateById(tAppUser); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | public static <T> ResultUtil <T> error(String mag, T obj){ |
| | | return ResultUtil.getResult(ResultUtil.ERROR, mag, obj); |
| | | } |
| | | public static <T> ResultUtil <T> errorCode(String mag, T obj){ |
| | | return ResultUtil.getResult(501, mag, obj); |
| | | } |
| | | |
| | | /** |
| | | * token失效 |
| | |
| | | package com.dsh.competition.controller; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | return sum; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/actPt") |
| | | public HashMap<String, Object> actPt(@RequestBody List<Integer> ids){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | int year = DateUtil.year(new Date()); |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | // 年 |
| | | ArrayList<Integer> years = new ArrayList<>(); |
| | | ArrayList<Integer> yearsUser = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | String s = o.toString(); |
| | | int count = cttService.count(new LambdaQueryWrapper<Competition>().like(Competition::getInsertTime, s)); |
| | | int count1 = ucttService.count(new LambdaQueryWrapper<UserCompetition>().in(UserCompetition::getAppUserId, ids).like(UserCompetition::getInsertTime,s)); |
| | | years.add(count); |
| | | yearsUser.add(count1); |
| | | } |
| | | map.put("yearData",years); |
| | | map.put("yearsUser",yearsUser); |
| | | // 月 |
| | | ArrayList<Integer> months = new ArrayList<>(); |
| | | ArrayList<Integer> monthsUser = new ArrayList<>(); |
| | | for (int i = 1; i <= 12; i++) { |
| | | double sum=0.0; |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | int count = cttService.count(new LambdaQueryWrapper<Competition>().like(Competition::getInsertTime, s)); |
| | | int count1 = ucttService.count(new LambdaQueryWrapper<UserCompetition>().in(UserCompetition::getAppUserId, ids).like(UserCompetition::getInsertTime,s)); |
| | | months.add(count); |
| | | monthsUser.add(count1); |
| | | } |
| | | map.put("monthData",months); |
| | | map.put("monthsUser",monthsUser); |
| | | |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.TCourse; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.entity.TCoursePackageType; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.model.ExerciseVideo; |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.model.dto.CourseChangeStateDTO; |
| | | import com.dsh.course.model.dto.TQueryBenefitsVideosDTO; |
| | | import com.dsh.course.model.vo.TQueryBenefitsVideosVO; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.service.TCoursePackageTypeService; |
| | | import com.dsh.course.service.TCourseService; |
| | | import com.dsh.course.service.*; |
| | | import com.dsh.course.util.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService coursePackagePaymentService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | |
| | | /** |
| | | * 上/下架 1为上架 2为下架 3为删除 |
| | |
| | | return coursePackageService.getHours(coursePackageId1); |
| | | } |
| | | |
| | | @PostMapping("/course/queryByDiscountId") |
| | | public TCoursePackage queryByDiscountId(@RequestBody Integer id){ |
| | | TCoursePackageDiscount byId = discountService.getById(id); |
| | | TCoursePackage byId1 = coursePackageService.getById(byId.getCoursePackageId()); |
| | | return byId1; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/queryDiscountById") |
| | | public Integer queryDiscountById(@RequestBody Integer id){ |
| | | TCoursePackageDiscount byId = discountService.getById(id); |
| | | return byId.getAuditStatus(); |
| | | } |
| | | @PostMapping("/course/queryDiscountList") |
| | | public List<DiscountList> queryDiscountList(@RequestBody QueryDiscountList queryDiscountList){ |
| | | return discountService.queryDiscountList(queryDiscountList); |
| | | } |
| | | |
| | | @PostMapping("/course/queryDiscountListAudit") |
| | | public List<DiscountList> queryDiscountListAudit(@RequestBody QueryDiscountList queryDiscountList){ |
| | | return discountService.queryDiscountListAudit(queryDiscountList); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/updateState") |
| | | public Boolean updateState( @RequestBody DiscountUpdateState discountUpdateState){ |
| | | TCoursePackageDiscount byId = discountService.getById(discountUpdateState.getId()); |
| | | List<TCoursePackageDiscount> list = discountService.list(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, byId.getCoursePackageId())); |
| | | list.forEach(e->e.setStatus(discountUpdateState.getStatus())); |
| | | return discountService.updateBatchById(list); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/course/auditDiscount") |
| | | public Boolean auditDiscount( @RequestBody AuditDiscount auditDiscount){ |
| | | TCoursePackageDiscount byId = discountService.getById(auditDiscount.getId()); |
| | | List<TCoursePackageDiscount> list = discountService.list(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, byId.getCoursePackageId())); |
| | | for (TCoursePackageDiscount tCoursePackageDiscount : list) { |
| | | tCoursePackageDiscount.setAuditStatus(auditDiscount.getType()); |
| | | tCoursePackageDiscount.setAuditRemark(auditDiscount.getText()); |
| | | } |
| | | |
| | | return discountService.updateBatchById(list); |
| | | } |
| | | |
| | | @PostMapping("/course/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/coursePackageDiscount/queryCoursePackageDiscountOne") |
| | | public List<TCoursePackageDiscount> queryCoursePackageDiscountOne(@RequestBody Integer id){ |
| | | return coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", id) |
| | | .ne("auditStatus", 2)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.TCoursePackageDiscount; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.model.DiscountList; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCoursePackageDiscountMapper extends BaseMapper<TCoursePackageDiscount> { |
| | | |
| | | List<DiscountList> queryDiscountList(@Param("discountListPage") Page<DiscountList> discountListPage, @Param("pCode") String pCode, @Param("cCode") String cCode, @Param("name") String name, @Param("type") Integer type, @Param("ids") List<Integer> ids); |
| | | |
| | | List<DiscountList> queryDiscountListAudit(@Param("discountListPage") Page<DiscountList> discountListPage, @Param("pCode") String pCode, @Param("cCode") String cCode, @Param("name") String name, @Param("type") Integer type, @Param("ids") List<Integer> ids); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class AuditDiscount { |
| | | private Integer id; |
| | | |
| | | private Integer type; |
| | | |
| | | private String text; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DiscountList { |
| | | private Integer id; |
| | | |
| | | private String pName; |
| | | |
| | | private String cName; |
| | | |
| | | private String shopName; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private Integer status; |
| | | |
| | | private Integer storeId; |
| | | private Integer courseId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DiscountUpdateState { |
| | | private Integer id; |
| | | |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDiscountList { |
| | | private long offset; |
| | | private long limit; |
| | | |
| | | private String pCode; |
| | | |
| | | private String cCode; |
| | | |
| | | private String name; |
| | | |
| | | private Integer type; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.TCoursePackageDiscount; |
| | | import com.dsh.course.model.DiscountList; |
| | | import com.dsh.course.model.QueryDiscountList; |
| | | import com.dsh.course.model.vo.response.Details; |
| | | import com.dsh.course.model.vo.response.ExchangeCoursePackageResponse; |
| | | |
| | |
| | | |
| | | ExchangeCoursePackageResponse getWeekFreeCourseDetails(Integer coursePackageDiscountId,String lat,String lon); |
| | | |
| | | List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList); |
| | | |
| | | List<DiscountList> queryDiscountListAudit(QueryDiscountList queryDiscountList); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackagePaymentConfig; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | |
| | | import com.dsh.course.mapper.TCoursePackageDiscountMapper; |
| | | import com.dsh.course.mapper.TCoursePackageMapper; |
| | | import com.dsh.course.mapper.TCoursePackagePaymentMapper; |
| | | import com.dsh.course.model.DiscountList; |
| | | import com.dsh.course.model.QueryDiscountList; |
| | | import com.dsh.course.model.vo.response.Details; |
| | | import com.dsh.course.model.vo.response.ExchangeCoursePackageResponse; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | |
| | | |
| | | return packageResponse; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DiscountList> queryDiscountListAudit(QueryDiscountList queryDiscountList) { |
| | | Page<DiscountList> discountListPage = new Page<>(queryDiscountList.getOffset(), queryDiscountList.getLimit()); |
| | | List<DiscountList> discountLists = this.baseMapper.queryDiscountListAudit(discountListPage, queryDiscountList.getPCode(), queryDiscountList.getCCode(), queryDiscountList.getName(), queryDiscountList.getType(), queryDiscountList.getIds()); |
| | | for (DiscountList discountList : discountLists) { |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = this.baseMapper.selectList(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, discountList.getCourseId()).ne(TCoursePackageDiscount::getAuditStatus,2).orderByAsc(TCoursePackageDiscount::getType)); |
| | | long count = tCoursePackageDiscounts.stream().filter(e -> e.getAuditStatus().equals(2)).count(); |
| | | if(count>0){ |
| | | discountList.setStatus(2); |
| | | }else { |
| | | discountList.setStatus(1); |
| | | } |
| | | String type=""; |
| | | for (int i = 0; i < tCoursePackageDiscounts.size(); i++) { |
| | | if(tCoursePackageDiscounts.get(i).getType()==1){ |
| | | type += "会员折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==3){ |
| | | type += "限时折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==4){ |
| | | type += "赠送课时、"; |
| | | } |
| | | } |
| | | if(type.length()>0){ |
| | | type = type.substring(0,type.length()-1); |
| | | } |
| | | discountList.setType(type); |
| | | } |
| | | return discountLists; |
| | | } |
| | | @Override |
| | | public List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList) { |
| | | Page<DiscountList> discountListPage = new Page<>(queryDiscountList.getOffset(), queryDiscountList.getLimit()); |
| | | List<DiscountList> discountLists = this.baseMapper.queryDiscountList(discountListPage, queryDiscountList.getPCode(), queryDiscountList.getCCode(), queryDiscountList.getName(), queryDiscountList.getType(), queryDiscountList.getIds()); |
| | | for (DiscountList discountList : discountLists) { |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = this.baseMapper.selectList(new LambdaQueryWrapper<TCoursePackageDiscount>().eq(TCoursePackageDiscount::getCoursePackageId, discountList.getCourseId()).eq(TCoursePackageDiscount::getAuditStatus,2).orderByAsc(TCoursePackageDiscount::getType)); |
| | | long count = tCoursePackageDiscounts.stream().filter(e -> e.getStatus().equals(2)).count(); |
| | | if(count>0){ |
| | | discountList.setStatus(2); |
| | | }else { |
| | | discountList.setStatus(1); |
| | | } |
| | | String type=""; |
| | | for (int i = 0; i < tCoursePackageDiscounts.size(); i++) { |
| | | if(tCoursePackageDiscounts.get(i).getType()==1){ |
| | | type += "会员折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==3){ |
| | | type += "限时折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==4){ |
| | | type += "赠送课时、"; |
| | | } |
| | | } |
| | | if(type.length()>0){ |
| | | type = type.substring(0,type.length()-1); |
| | | } |
| | | discountList.setType(type); |
| | | } |
| | | return discountLists; |
| | | } |
| | | |
| | | private static boolean isDateWithinRange(Date date, Date startTime, Date endTime) { |
| | | return date.after(startTime) && date.before(endTime); |
| | |
| | | <result column="insertTime" property="insertTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="queryDiscountList" resultType="com.dsh.course.model.DiscountList"> |
| | | select t1.id,t1.type,t1.status,t2.province pName,t2.city cName,t2.name,t2.storeId,t2.id courseId from t_course_package_discount t1 left join t_course_package t2 on t1.coursePackageId = t2.id |
| | | where t2.storeId in <foreach collection="ids" close=")" item="id" open="(" separator=","> |
| | | #{id} and t1.auditStatus =2 |
| | | </foreach> |
| | | <if test="pCode !=null and pCode !=''"> |
| | | and t2.provinceCode =#{pCode} |
| | | </if> |
| | | <if test="cCode !=null and cCode !=''"> |
| | | and t2.cityCode =#{cCode} |
| | | </if> |
| | | <if test="name !=null and name !=''"> |
| | | and t2.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="type !=null "> |
| | | and t1.type =#{type} |
| | | </if> |
| | | group by t1.coursePackageId |
| | | </select> |
| | | |
| | | |
| | | <select id="queryDiscountListAudit" resultType="com.dsh.course.model.DiscountList"> |
| | | select t1.id,t1.type,t1.auditStatus status,t2.province pName,t2.city cName,t2.name,t2.storeId,t2.id courseId from t_course_package_discount t1 left join t_course_package t2 on t1.coursePackageId = t2.id |
| | | where t2.storeId in <foreach collection="ids" close=")" item="id" open="(" separator=","> |
| | | #{id} and t1.auditStatus !=2 |
| | | </foreach> |
| | | <if test="pCode !=null and pCode !=''"> |
| | | and t2.provinceCode =#{pCode} |
| | | </if> |
| | | <if test="cCode !=null and cCode !=''"> |
| | | and t2.cityCode =#{cCode} |
| | | </if> |
| | | <if test="name !=null and name !=''"> |
| | | and t2.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="type !=null "> |
| | | and t1.type =#{type} |
| | | </if> |
| | | group by t1.coursePackageId |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | @PostMapping("/student/getUserStore") |
| | | List<Integer> getUserStore(Integer id); |
| | | @PostMapping("/student/getUserPtVip") |
| | | List<Integer> getUserPtVip(); |
| | | |
| | | @PostMapping("/student/userAndVipPt") |
| | | HashMap<String, Object> userAndVipPt(Integer type); |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @FeignClient("mb-cloud-competition") |
| | |
| | | @PostMapping("/base/competition/queryFee") |
| | | Double queryFee(QueryDataFee queryDataFee); |
| | | |
| | | @PostMapping("/base/competition/actPt") |
| | | HashMap<String, Object> actPt(List<Integer> ids); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.model.QueryDataFee; |
| | | import com.dsh.course.feignClient.course.model.CourseChangeStateDTO; |
| | | import com.dsh.course.feignClient.course.model.QueryCourseList; |
| | | import com.dsh.guns.modular.system.model.EditCourseState; |
| | | import com.dsh.guns.modular.system.model.TCourse; |
| | | import com.dsh.guns.modular.system.model.TQueryBenefitsVideosDTO; |
| | | import com.dsh.guns.modular.system.model.TQueryBenefitsVideosVO; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.model.AuditDiscount; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | HashMap<String, Object> queryFee(QueryDataFee queryDataFee); |
| | | |
| | | |
| | | @PostMapping("/course/queryByDiscountId") |
| | | TCoursePackage queryByDiscountId(Integer id); |
| | | |
| | | |
| | | @PostMapping("/course/queryDiscountById") |
| | | Integer queryDiscountById(Integer id); |
| | | |
| | | |
| | | @PostMapping("/course/queryDiscountList") |
| | | List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList); |
| | | |
| | | @PostMapping("/course/queryDiscountListAudit") |
| | | List<DiscountList> queryDiscountListAudit(QueryDiscountList queryDiscountList); |
| | | |
| | | @PostMapping("/course/updateState") |
| | | Boolean updateState(DiscountUpdateState discountUpdateState); |
| | | |
| | | @PostMapping("/course/auditDiscount") |
| | | Boolean auditDiscount(AuditDiscount auditDiscount); |
| | | } |
| | |
| | | @PostMapping("/coursePackageDiscount/setCoursePackageDiscount") |
| | | void setCoursePackageDiscount(List<TCoursePackageDiscount> list); |
| | | |
| | | |
| | | @PostMapping("/coursePackageDiscount/queryCoursePackageDiscountOne") |
| | | List<TCoursePackageDiscount> queryCoursePackageDiscountOne(Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DiscountList { |
| | | private Integer id; |
| | | |
| | | private String pName; |
| | | |
| | | private String cName; |
| | | |
| | | private String shopName; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private Integer status; |
| | | |
| | | private Integer storeId; |
| | | private Integer courseId; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDiscountList { |
| | | private long offset; |
| | | private long limit; |
| | | |
| | | private String pCode; |
| | | |
| | | private String cCode; |
| | | |
| | | private String name; |
| | | |
| | | private Integer type; |
| | | |
| | | private List<Integer> ids; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class AuditDiscount { |
| | | private Integer id; |
| | | |
| | | private Integer type; |
| | | |
| | | private String text; |
| | | } |
| | |
| | | |
| | | return map; |
| | | } |
| | | |
| | | @RequestMapping(value = "/backYys") |
| | | @ResponseBody |
| | | public Object backYys(Integer id) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> userPt = appUserClient.getUserYYs(id); |
| | | if(userPt.size()==0){ |
| | | userPt.add(-1); |
| | | } |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | List<TBackRecord> thisYear = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, year).in(TBackRecord::getUserId,userPt)); |
| | | double sum5 = thisYear.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisYear",sum5); |
| | | |
| | | List<TBackRecord> thisMonth = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, new SimpleDateFormat("yyyy-MM").format(new Date())).in(TBackRecord::getUserId,userPt)); |
| | | double sum6= thisMonth.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisMonth",sum6); |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | // 年 |
| | | ArrayList<Double> years = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | double sum=0.0; |
| | | String s = o.toString(); |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | years.add(sum); |
| | | } |
| | | ArrayList<Double> months = new ArrayList<>(); |
| | | // 月 |
| | | for (int i = 1; i <= 12; i++) { |
| | | double sum=0.0; |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | months.add(sum); |
| | | } |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | String s1 = minNow.minusDays(6).toString(); |
| | | String s2 = maxNow.toString(); |
| | | |
| | | String s3 = minNow.minusDays(13).toString(); |
| | | String s4 = maxNow.minusDays(6).toString(); |
| | | |
| | | |
| | | String s5 = minNow.minusDays(20).toString(); |
| | | String s6 = maxNow.minusDays(13).toString(); |
| | | |
| | | String s7 = minNow.minusDays(27).toString(); |
| | | String s8 = maxNow.minusDays(20).toString(); |
| | | |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s7,s8).in(TBackRecord::getUserId,userPt)); |
| | | double sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | List<TBackRecord> list1 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s5,s6).in(TBackRecord::getUserId,userPt)); |
| | | double sum1 = list1.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list2 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s3,s4).in(TBackRecord::getUserId,userPt)); |
| | | double sum2 = list2.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list3 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s1,s2).in(TBackRecord::getUserId,userPt)); |
| | | double sum3 = list3.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | map.put("thisWeek",sum3); |
| | | |
| | | ArrayList<Double> week = new ArrayList<>(); |
| | | week.add(sum); |
| | | week.add(sum1); |
| | | week.add(sum2); |
| | | week.add(sum3); |
| | | |
| | | // 日 |
| | | ArrayList<Double> days = new ArrayList<>(); |
| | | Double thisDay=0.0; |
| | | for (int i = 6; i >= 0; i--) { |
| | | String s = minNow.minusDays(i).toString(); |
| | | String s9 = maxNow.minusDays(i).toString(); |
| | | List<TBackRecord> day = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s,s9).in(TBackRecord::getUserId,userPt)); |
| | | double sum4 = day.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | days.add(sum4); |
| | | if(i==0){ |
| | | thisDay=sum4; |
| | | } |
| | | } |
| | | |
| | | map.put("thisDay",thisDay); |
| | | map.put("yearData",years); |
| | | map.put("monthData",months); |
| | | map.put("weekData",week); |
| | | map.put("dayData",days); |
| | | |
| | | return map; |
| | | } |
| | | @RequestMapping(value = "/backStore") |
| | | @ResponseBody |
| | | public Object backStore(Integer id) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<Integer> userPt = appUserClient.getUserStore(id); |
| | | if(userPt.size()==0){ |
| | | userPt.add(-1); |
| | | } |
| | | ArrayList<Object> integers = new ArrayList<>(); |
| | | int year = DateUtil.year(new Date()); |
| | | List<TBackRecord> thisYear = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, year).in(TBackRecord::getUserId,userPt)); |
| | | double sum5 = thisYear.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisYear",sum5); |
| | | |
| | | List<TBackRecord> thisMonth = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, new SimpleDateFormat("yyyy-MM").format(new Date())).in(TBackRecord::getUserId,userPt)); |
| | | double sum6= thisMonth.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | map.put("thisMonth",sum6); |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < 10; i++) { |
| | | integers.add(year-i); |
| | | } |
| | | List<Object> collect = integers.stream().sorted().collect(Collectors.toList()); |
| | | // 年 |
| | | ArrayList<Double> years = new ArrayList<>(); |
| | | for (Object o : collect) { |
| | | double sum=0.0; |
| | | String s = o.toString(); |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | years.add(sum); |
| | | } |
| | | ArrayList<Double> months = new ArrayList<>(); |
| | | // 月 |
| | | for (int i = 1; i <= 12; i++) { |
| | | double sum=0.0; |
| | | String m=i+""; |
| | | if(i<10){ |
| | | m="0"+i; |
| | | } |
| | | String s = year + "-" + m; |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().like(TBackRecord::getTime, s).in(TBackRecord::getUserId,userPt)); |
| | | sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | months.add(sum); |
| | | } |
| | | |
| | | // 获取最近四周 |
| | | LocalDateTime minNow = LocalDateTime.now().with(LocalTime.MIN); |
| | | LocalDateTime maxNow = LocalDateTime.now().with(LocalTime.MAX); |
| | | // 周度数据 |
| | | String s1 = minNow.minusDays(6).toString(); |
| | | String s2 = maxNow.toString(); |
| | | |
| | | String s3 = minNow.minusDays(13).toString(); |
| | | String s4 = maxNow.minusDays(6).toString(); |
| | | |
| | | |
| | | String s5 = minNow.minusDays(20).toString(); |
| | | String s6 = maxNow.minusDays(13).toString(); |
| | | |
| | | String s7 = minNow.minusDays(27).toString(); |
| | | String s8 = maxNow.minusDays(20).toString(); |
| | | |
| | | List<TBackRecord> list = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s7,s8).in(TBackRecord::getUserId,userPt)); |
| | | double sum = list.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | List<TBackRecord> list1 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s5,s6).in(TBackRecord::getUserId,userPt)); |
| | | double sum1 = list1.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list2 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s3,s4).in(TBackRecord::getUserId,userPt)); |
| | | double sum2 = list2.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | List<TBackRecord> list3 = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s1,s2).in(TBackRecord::getUserId,userPt)); |
| | | double sum3 = list3.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | |
| | | map.put("thisWeek",sum3); |
| | | |
| | | ArrayList<Double> week = new ArrayList<>(); |
| | | week.add(sum); |
| | | week.add(sum1); |
| | | week.add(sum2); |
| | | week.add(sum3); |
| | | |
| | | // 日 |
| | | ArrayList<Double> days = new ArrayList<>(); |
| | | Double thisDay=0.0; |
| | | for (int i = 6; i >= 0; i--) { |
| | | String s = minNow.minusDays(i).toString(); |
| | | String s9 = maxNow.minusDays(i).toString(); |
| | | List<TBackRecord> day = backRecordService.list(new LambdaQueryWrapper<TBackRecord>().between(TBackRecord::getTime, s,s9).in(TBackRecord::getUserId,userPt)); |
| | | double sum4 = day.stream().mapToDouble(TBackRecord::getMoney).sum(); |
| | | days.add(sum4); |
| | | if(i==0){ |
| | | thisDay=sum4; |
| | | } |
| | | } |
| | | |
| | | map.put("thisDay",thisDay); |
| | | map.put("yearData",years); |
| | | map.put("monthData",months); |
| | | map.put("weekData",week); |
| | | map.put("dayData",days); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/userAndVipPt") |
| | | @ResponseBody |
| | | public Object userAndVipPt(Integer type) { |
| | | HashMap<String, Object> map = appUserClient.userAndVipPt(type); |
| | | return map; |
| | | } |
| | | @RequestMapping(value = "/actPt") |
| | | @ResponseBody |
| | | public Object actPt(Integer type) { |
| | | List<Integer> userPt = appUserClient.getUserPt(Arrays.asList(1)); |
| | | HashMap<String, Object> map = competitionClient.actPt(userPt); |
| | | |
| | | List<TStore> list = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getOperatorId, 0)); |
| | | for (TStore tStore : list) { |
| | | long l = DateUtil.betweenDay(tStore.getCreateTime(), new Date(), true); |
| | | tStore.getStartTime(); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到运营商统计数据页面 |
| | | */ |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.CompetitionUser; |
| | | import com.dsh.course.feignClient.competition.model.GetPeopleQuery; |
| | | import com.dsh.course.feignClient.course.CourseClient; |
| | | import com.dsh.course.feignClient.course.CoursePackageDiscountClient; |
| | | import com.dsh.course.feignClient.course.CoursePackagePaymentConfigClient; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.course.model.AuditDiscount; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | 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; |
| | | import com.dsh.guns.modular.system.model.DiscountUpdateState; |
| | | import com.dsh.guns.modular.system.model.TCity; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tDiscount") |
| | | public class TDiscountController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tDiscount/"; |
| | | private String PREFIX1 = "/system/tDiscountAudit/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Autowired |
| | | private CourseClient courseClient; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TDiscount.html"; |
| | | } |
| | | @RequestMapping("/audit") |
| | | public String indexAudit(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX1 + "TDiscount.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_update/{id}") |
| | | public String tCarUpdate(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | |
| | | List<TStore> list2 = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode,competition.getCityCode())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_info/{id}") |
| | | public String tCarInfo(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | |
| | | List<TStore> list2 = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode,competition.getCityCode())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",2); |
| | | |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_user/{id}") |
| | | public String tCarUser(@PathVariable Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "TCompetitionUser.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private ICoursePackageService coursePackageService; |
| | | |
| | | @Resource |
| | | private CoursePackagePaymentConfigClient coursePackagePaymentConfigClient; |
| | | |
| | | @Resource |
| | | private CoursePackageDiscountClient coursePackageDiscountClient; |
| | | @RequestMapping("/info") |
| | | public String info( Integer id, Model model) { |
| | | TCoursePackage tCoursePackage1 = courseClient.queryByDiscountId(id); |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(tCoursePackage1.getId()); |
| | | model.addAttribute("item", tCoursePackage); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { |
| | | if(coursePackagePaymentConfig.getCashPayment() == 0){ |
| | | continue; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()); |
| | | map.put("classHours", coursePackagePaymentConfig.getClassHours()); |
| | | String payment = ""; |
| | | if(coursePackagePaymentConfig.getCashPayment() > 0){ |
| | | payment += "现金支付"; |
| | | } |
| | | if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){ |
| | | payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付"; |
| | | } |
| | | map.put("payment", payment); |
| | | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId()); |
| | | map.put("coursePackageDiscount", tCoursePackageDiscounts); |
| | | list.add(map); |
| | | } |
| | | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); |
| | | return PREFIX + "coursePackageDiscount.html"; |
| | | } |
| | | @RequestMapping("/infoOne") |
| | | public String infoOne( Integer id, Model model) { |
| | | Integer state = courseClient.queryDiscountById(id); |
| | | if(state==1){ |
| | | model.addAttribute("stateStr","待审核"); |
| | | model.addAttribute("state",1); |
| | | }else { |
| | | model.addAttribute("stateStr","未通过"); |
| | | model.addAttribute("state",3); |
| | | } |
| | | |
| | | TCoursePackage tCoursePackage1 = courseClient.queryByDiscountId(id); |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(tCoursePackage1.getId()); |
| | | model.addAttribute("item", tCoursePackage); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { |
| | | if(coursePackagePaymentConfig.getCashPayment() == 0){ |
| | | continue; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()); |
| | | map.put("classHours", coursePackagePaymentConfig.getClassHours()); |
| | | String payment = ""; |
| | | if(coursePackagePaymentConfig.getCashPayment() > 0){ |
| | | payment += "现金支付"; |
| | | } |
| | | if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){ |
| | | payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付"; |
| | | } |
| | | map.put("payment", payment); |
| | | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscountOne(coursePackagePaymentConfig.getId()); |
| | | map.put("coursePackageDiscount", tCoursePackageDiscounts); |
| | | list.add(map); |
| | | } |
| | | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); |
| | | return PREFIX1 + "coursePackageDiscount.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String provinceCode, String cityCode, String shopName, String name, Integer type) { |
| | | LambdaQueryWrapper<TStore> wrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | wrapper.like(TStore::getName, shopName); |
| | | } |
| | | List<TStore> list = storeService.list(wrapper); |
| | | Page<DiscountList> page = new PageFactory<DiscountList>().defaultPage(); |
| | | List<DiscountList> discountLists = courseClient.queryDiscountList(new QueryDiscountList(page.getCurrent(),page.getSize(),provinceCode,cityCode,name,type,list.stream().map(TStore::getId).collect(Collectors.toList()))); |
| | | for (DiscountList discountList : discountLists) { |
| | | for (TStore tStore : list) { |
| | | if(discountList.getStoreId().equals(tStore.getId())){ |
| | | discountList.setShopName(tStore.getName()); |
| | | } |
| | | } |
| | | } |
| | | page.setRecords(discountLists); |
| | | return super.packForBT(page); |
| | | } |
| | | @RequestMapping(value = "/listAudit") |
| | | @ResponseBody |
| | | public Object listAudit(String provinceCode, String cityCode, String shopName, String name, Integer type) { |
| | | LambdaQueryWrapper<TStore> wrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | wrapper.like(TStore::getName, shopName); |
| | | } |
| | | List<TStore> list = storeService.list(wrapper); |
| | | Page<DiscountList> page = new PageFactory<DiscountList>().defaultPage(); |
| | | List<DiscountList> discountLists = courseClient.queryDiscountListAudit(new QueryDiscountList(page.getCurrent(),page.getSize(),provinceCode,cityCode,name,type,list.stream().map(TStore::getId).collect(Collectors.toList()))); |
| | | for (DiscountList discountList : discountLists) { |
| | | for (TStore tStore : list) { |
| | | if(discountList.getStoreId().equals(tStore.getId())){ |
| | | discountList.setShopName(tStore.getName()); |
| | | } |
| | | } |
| | | } |
| | | page.setRecords(discountLists); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/updateState") |
| | | @ResponseBody |
| | | public Object updateState( Integer id,Integer status) { |
| | | try { |
| | | Boolean b = courseClient.updateState(new DiscountUpdateState(id,status)); |
| | | if(b){ |
| | | return new SuccessTip<>(); |
| | | } |
| | | return new ErrorTip(500,""); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/auditDiscount") |
| | | @ResponseBody |
| | | public Object auditDiscount(Integer id,Integer audit,String text) { |
| | | try { |
| | | Boolean b = courseClient.auditDiscount(new AuditDiscount(id,audit,text)); |
| | | if(b){ |
| | | return new SuccessTip<>(); |
| | | } |
| | | return new ErrorTip(500,""); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(Competition competition) { |
| | | try { |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | competition.setAuditStatus(1); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | competition.setStartTime(format.parse(competition.getSTime())); |
| | | competition.setEndTime(format.parse(competition.getETime())); |
| | | competition.setRegisterEndTime(format.parse(competition.getREndTime())); |
| | | competitionClient.add(competition); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(Competition competition) { |
| | | try { |
| | | Competition competition1 = competitionClient.queryById(competition.getId()); |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getCoverDrawing())){ |
| | | competition.setCoverDrawing(competition1.getCoverDrawing()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getRegistrationNotes())){ |
| | | competition.setRegistrationNotes(competition1.getRegistrationNotes()); |
| | | } |
| | | competitionClient.update(competition); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/cancel") |
| | | public Object cancel(Integer id) { |
| | | try { |
| | | competitionClient.cancel(id); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/getPeopleFromId") |
| | | public Object getPeopleFromId(Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(Integer oneId) { |
| | | try { |
| | | return storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode, oneId)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | |
| | | // TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | TOperatorCity one = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> one = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> ones = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); |
| | | |
| | | if(ones.size()>0){ |
| | | model.addAttribute("list",ones); |
| | | List<TOperatorCity> list3 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, one.getId()).eq(TOperatorCity::getType, 2)); |
| | | TOperatorCity one1 = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1).eq(TOperatorCity::getCode,byId.getProvinceCode())); |
| | | List<TOperatorCity> list3 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().in(TOperatorCity::getPid, one1.getId()).eq(TOperatorCity::getType, 2)); |
| | | model.addAttribute("list1",list3); |
| | | System.out.println("===list3======="+list3); |
| | | |
| | |
| | | tStore.setType(type); |
| | | tStore.setOperatorId(yyId); |
| | | tStore.setState(1); |
| | | tStore.setCreateTime(new Date()); |
| | | User user = new User(); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone)); |
| | | if(users.size()>0){ |
| | |
| | | @ResponseBody |
| | | public Object onChange2(Integer oneId) { |
| | | try { |
| | | List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, oneId).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getId, oneId).eq(TOperatorCity::getType, 1)); |
| | | List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, oneId).eq(TOperatorCity::getType, 2)); |
| | | |
| | | // 若是全国 为空 去找这个省下面的市 |
| | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name","测试场地"); |
| | | map.put("short_name","测试场地"); |
| | | map.put("location","成都"); |
| | | map.put("address","成都地址"); |
| | | map.put("telephone","17888888888"); |
| | | map.put("linkman","成都"); |
| | | map.put("business_time","[{\"start_time\":\"00:00\",\"close_time\":\"23:59\"}]"); |
| | | map.put("logo","https://we-park-life.oss-cn-beijing.aliyuncs.com/img/f325d449f2634855ad1fb0cc796465e8.png"); |
| | | map.put("remark","场地介绍"); |
| | | map.put("lat","30.670124"); |
| | | map.put("lng","103.929497"); |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | /** |
| | | * 编辑场地管理 |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DiscountUpdateState { |
| | | private Integer id; |
| | | |
| | | private Integer status; |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @TableName("t_store") |
| | | @Data |
| | |
| | | private Integer type; |
| | | @TableField("ids") |
| | | private String ids; |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | } |
| | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>本年退费额度:</span> |
| | | <span>本月退费额度:</span> |
| | | <span>本周退费额度:</span> |
| | | <span>本日退费额度:</span> |
| | | <span id="yearRefund">本年退费额度:<span id="back1"></span></span> |
| | | <span id="monthRefund">本月退费额度:<span id="back2"></span></span> |
| | | <span id="weekRefund">本周退费额度:<span id="back3"></span></span> |
| | | <span id="todayRefund">本日退费额度:<span id="back4"></span></span> |
| | | </br> |
| | | </br> |
| | | <div id="refund" style="width: 1280px;height:500px;"></div> |
| | |
| | | |
| | | if(cutType==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(cutType==2){ |
| | |
| | | getContent(1); |
| | | getContent1(1); |
| | | getContent2(1); |
| | | |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('income')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | tuifei() |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | }, |
| | | { |
| | | name: '日度营收', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | ] |
| | | }; |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度退费', '月度退费', '周度退费', '日度退费'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | |
| | | }; |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | | myChart4.setOption(option4); |
| | |
| | | |
| | | if(type==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | |
| | | function tuifei() { |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | let id = $("#cCode").val() |
| | | console.log(id) |
| | | if(id==''){ |
| | | Feng.info("请先选择运营商"); |
| | | return; |
| | | } |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backYys", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | | $("#back3").text(data.thisWeek); |
| | | $("#back4").text(data.thisDay); |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax3.set("id",id) |
| | | ajax3.start(); |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | | var options = myChart1.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | if (obj.name == '年度退费') { |
| | | options.xAxis[0].data = yearX |
| | | } else if (obj.name == '月度退费') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度退费') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度退费') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart1.setOption(options, true) |
| | | }) |
| | | myChart1.setOption(option1); |
| | | } |
| | | |
| | | function getContent1(type){ |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<3;i++){ |
| | |
| | | } |
| | | </script> |
| | | <script> |
| | | var ans = []; |
| | | var weekX = ["1周","2周","3周","4周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | | var yearX = []; |
| | | var timeX = []; |
| | | var dataX = []; |
| | | // 创建一个日期对象 |
| | | var currentDate = new Date(); |
| | | // 获取当前日期的号数 |
| | | let currentDay = currentDate.getDate(); |
| | | // 循环添加号数到数组 |
| | | for (let i = 0; i < 7; i++) { |
| | | dataX.push(currentDay - 6+i); |
| | | } |
| | | // 获取当前月份 |
| | | var currentMonth = currentDate.getMonth(); |
| | | // 获取当前年份 |
| | | var currentYear = currentDate.getFullYear(); |
| | | // 计算指定年份和月份的天数 |
| | | function getDaysInMonth(year, month) { |
| | | // month 参数范围是 0-11,所以需要加 1 |
| | | return new Date(year, month + 1, 0).getDate(); |
| | | } |
| | | // 获取当前月份的天数 |
| | | var daysInMonth = getDaysInMonth(currentYear, currentMonth); |
| | | // 将天数按字符串格式添加到 timeX 数组中 |
| | | for (var i = 1; i <= daysInMonth; i++) { |
| | | timeX.push(String(i)); |
| | | } |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
| | |
| | | </br> |
| | | </br> |
| | | <div style="height: 25px;box-sizing: border-box;background:#f3f3f4;line-height: 25px;border:1px solid;margin-bottom: 20px;width: 500px"> |
| | | <div id="d1" class='table2' onclick="getContent1(1)" style="border-right: 1px solid #333;background-color: rgb(26, 179, 148);color: white;">用户总数:0人</div> |
| | | <div id="d2" class='table2' onclick="getContent1(2)" style="border-right: 1px solid #333;">年费会员数量:0人</div> |
| | | <div id="d1" class='table2' onclick="getContent1(1)" style="border-right: 1px solid #333;background-color: rgb(26, 179, 148);color: white;">用户总数:<span id="userAll"></span>人</div> |
| | | <div id="d2" class='table2' onclick="getContent1(2)" style="border-right: 1px solid #333;">年费会员数量:<span id="userVipAll"></span>人</div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10"> |
| | |
| | | }); |
| | | ajax.set("type",1); |
| | | ajax.start(); |
| | | option2 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度用户数', '月度用户数','周度用户数','日度用户数'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度用户数: true, |
| | | 月度用户数: false, |
| | | 周度用户数: false, |
| | | 日度用户数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [100,50,60,10,12,13,54,156] |
| | | }, |
| | | { |
| | | name: '月度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [26,44,55,12,6,7,98,541,223] |
| | | }, |
| | | { |
| | | name: '周度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 33,22,11,12,61,17,23,33,41 |
| | | ] |
| | | }, |
| | | { |
| | | name: '日度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 12,11,17,26,23,111,23,45,41 |
| | | ] |
| | | } |
| | | ] |
| | | }; |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/getIncomeData", function(resp){ |
| | | option3 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度会员数', '月度会员数','周度会员数','日度会员数'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [100,50,60,10,12,13,54,156] |
| | | }, |
| | | { |
| | | name: '月度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [26,44,55,12,6,7,98,541,223] |
| | | }, |
| | | { |
| | | name: '周度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 33,22,11,12,61,17,23,33,41 |
| | | ] |
| | | }, |
| | | { |
| | | name: '日度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [ |
| | | 12,11,17,26,23,111,23,45,41 |
| | | ] |
| | | } |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("type",1); |
| | | ajax2.start(); |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('main')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | |
| | | |
| | | |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | |
| | |
| | | ajax3.start(); |
| | | |
| | | |
| | | option4 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度次数', '月度次数'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1532, 101, 1394, 980, 2380, 1680, 1190, 1410, 1330, 2110, 1330] |
| | | }, |
| | | { |
| | | name: '月度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1182, 2191, 3234, 1290, 1330, 2310, 2190, 2210, 1330, 2410, 1650] |
| | | } |
| | | |
| | | ] |
| | | }; |
| | | option5 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度次数', '月度次数'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 394, 980, 2380, 1680, 1190, 1410, 1330, 2110, 1330] |
| | | var ajax4 = new $ax(Feng.ctxPath + "/data/userAndVipPt", function(data){ |
| | | option1 = { |
| | | |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | { |
| | | name: '月度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 182, 211, 324, 120, 130, 310, 290, 220, 130, 240, 150] |
| | | } |
| | | ] |
| | | }; |
| | | legend: { |
| | | |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax4.start(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | option6 = { |
| | |
| | | } |
| | | myChart.setOption(options, true) |
| | | }) |
| | | |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | | var options = myChart1.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | |
| | | } else if (obj.name == '月度退费') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度退费') { |
| | | options.xAxis[0].data = ["1","2","上周","本周"] |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度退费') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart1.setOption(options, true) |
| | | }) |
| | | |
| | | |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | |
| | | myChart6.setOption(option6); |
| | | myChart7.setOption(option7); |
| | | }); |
| | | |
| | | function ptUser() { |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | myChart2.on('legendselectchanged', obj => { |
| | | var options = myChart2.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | |
| | | } else if (obj.name == '月度用户数') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度用户数') { |
| | | options.xAxis[0].data = weekX |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度用户数') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart2.setOption(options, true) |
| | | }); |
| | | |
| | | myChart3.on('legendselectchanged', obj => { |
| | | var options = myChart3.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | |
| | | } else if (obj.name == '月度会员数') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度会员数') { |
| | | options.xAxis[0].data = weekX |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度会员数') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart3.setOption(options, true) |
| | | }); |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/userAndVipPt", function(data){ |
| | | $("#userAll").text(data.allUser) |
| | | $("#userVipAll").text(data.allVip) |
| | | console.log(data) |
| | | option2 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度用户数', '月度用户数','周度用户数','日度用户数'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度用户数: true, |
| | | 月度用户数: false, |
| | | 周度用户数: false, |
| | | 日度用户数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [data.count,data.count1,data.count2,data.count3] |
| | | }, |
| | | { |
| | | name: '日度用户数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | }; |
| | | option3 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度会员数', '月度会员数','周度会员数','日度会员数'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearsVip |
| | | }, |
| | | { |
| | | name: '月度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthsVip |
| | | }, |
| | | { |
| | | name: '周度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data:[data.countVip,data.countVip1,data.countVip2,data.countVip3] |
| | | }, |
| | | { |
| | | name: '日度会员数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.daysVip |
| | | } |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("type",1) |
| | | ajax2.start() |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | | } |
| | | |
| | | function ptActivity() { |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | |
| | | var ajax2 = new $ax(Feng.ctxPath + "/data/actPt", function(data){ |
| | | console.log(data) |
| | | |
| | | option4 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度次数', '月度次数'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1532, 101, 1394, 980, 2380, 1680, 1190, 1410, 1330, 2110, 1330] |
| | | }, |
| | | { |
| | | name: '月度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [1220, 1182, 2191, 3234, 1290, 1330, 2310, 2190, 2210, 1330, 2410, 1650] |
| | | } |
| | | |
| | | ] |
| | | }; |
| | | option5 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度次数', '月度次数'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 394, 980, 2380, 1680, 1190, 1410, 1330, 2110, 1330] |
| | | }, |
| | | { |
| | | name: '月度次数', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 182, 211, 324, 120, 130, 310, 290, 220, 130, 240, 150] |
| | | } |
| | | ] |
| | | }; |
| | | }); |
| | | ajax2.set("type",1) |
| | | ajax2.start() |
| | | myChart4.setOption(option4); |
| | | myChart5.setOption(option5); |
| | | myChart6.setOption(option6); |
| | | myChart7.setOption(option7); |
| | | }); |
| | | } |
| | | |
| | | function getContent(type){ |
| | | //设置点击字体颜色效果 |
| | | for(var i=1;i<4;i++){ |
| | |
| | | |
| | | }); |
| | | ajax.start(); |
| | | |
| | | |
| | | ptUser() |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | }); |
| | | ajax.start(); |
| | | |
| | | ptActivity() |
| | | } |
| | | |
| | | |
| | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>本年退费额度:</span> |
| | | <span>本月退费额度:</span> |
| | | <span>本周退费额度:</span> |
| | | <span>本日退费额度:</span> |
| | | <span id="yearRefund">本年退费额度:<span id="back1"></span></span> |
| | | <span id="monthRefund">本月退费额度:<span id="back2"></span></span> |
| | | <span id="weekRefund">本周退费额度:<span id="back3"></span></span> |
| | | <span id="todayRefund">本日退费额度:<span id="back4"></span></span> |
| | | </br> |
| | | </br> |
| | | <div id="refund" style="width: 1280px;height:500px;"></div> |
| | |
| | | |
| | | if(cutType==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(cutType==2){ |
| | |
| | | ajax.start(); |
| | | |
| | | } |
| | | function tuifei() { |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | let id = $("#cCode").val() |
| | | console.log(id) |
| | | if(id==''){ |
| | | Feng.info("请先选择门店"); |
| | | return; |
| | | } |
| | | var ajax3 = new $ax(Feng.ctxPath + "/data/backStore", function(data){ |
| | | $("#back1").text(data.thisYear); |
| | | $("#back2").text(data.thisMonth); |
| | | $("#back3").text(data.thisWeek); |
| | | $("#back4").text(data.thisDay); |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | |
| | | data: ['年度退费', '月度退费','周度退费','日度退费'], |
| | | icon: 'stack', |
| | | selectedMode: 'single', // 单选 |
| | | selected: { |
| | | 年度会员数: true, |
| | | 月度会员数: false, |
| | | 周度会员数: false, |
| | | 日度会员数: false |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: yearX |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.yearData |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.monthData |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.weekData |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: data.dayData |
| | | } |
| | | ] |
| | | |
| | | }; |
| | | }); |
| | | ajax3.set("id",id) |
| | | ajax3.start(); |
| | | |
| | | myChart1.on('legendselectchanged', obj => { |
| | | var options = myChart1.getOption() |
| | | //这里是选择切换什么样的x轴,那么他会进行对Y值的切换 |
| | | if (obj.name == '年度退费') { |
| | | options.xAxis[0].data = yearX |
| | | } else if (obj.name == '月度退费') { |
| | | options.xAxis[0].data = monthX |
| | | } else if (obj.name == '周度退费') { |
| | | options.xAxis[0].data = ["1周","2周","3周","4周"] |
| | | } else if (obj.name == '日度退费') { |
| | | options.xAxis[0].data = dataX |
| | | } |
| | | myChart1.setOption(options, true) |
| | | }) |
| | | myChart1.setOption(option1); |
| | | } |
| | | |
| | | |
| | | laydate.render({ |
| | |
| | | getContent2(1); |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | var myChart = echarts.init(document.getElementById('income')); |
| | | var myChart1 = echarts.init(document.getElementById('refund')); |
| | | var myChart2 = echarts.init(document.getElementById('user')); |
| | | var myChart3 = echarts.init(document.getElementById('vip')); |
| | | var myChart4 = echarts.init(document.getElementById('activity')); |
| | | var myChart5 = echarts.init(document.getElementById('prepare')); |
| | | var myChart6 = echarts.init(document.getElementById('teach')); |
| | | var myChart7 = echarts.init(document.getElementById('courseData')); |
| | | tuifei() |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | }, |
| | | { |
| | | name: '日度营收', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | | } |
| | | ] |
| | | }; |
| | | option1 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | legend: { |
| | | data: ['年度退费', '月度退费', '周度退费', '日度退费'] |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | toolbox: { |
| | | feature: { |
| | | saveAsImage: {} |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '年度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [120, 132, 101, 134, 90, 230, 160, 190, 410, 330, 210, 330] |
| | | }, |
| | | { |
| | | name: '月度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [220, 182, 191, 234, 290, 330, 310, 190, 210, 330, 410, 160] |
| | | }, |
| | | { |
| | | name: '周度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [150, 232, 201, 154, 190, 330, 410, 160, 210, 195, 210, 188] |
| | | }, |
| | | { |
| | | name: '日度退费', |
| | | type: 'line', |
| | | stack: 'Total', |
| | | data: [320, 332, 301, 334, 390, 330, 320, 10, 195, 145, 188, 160] |
| | |
| | | }; |
| | | // 使用刚指定的配置项和数据显示图表。 |
| | | myChart.setOption(option); |
| | | myChart1.setOption(option1); |
| | | myChart2.setOption(option2); |
| | | myChart3.setOption(option3); |
| | | myChart4.setOption(option4); |
| | |
| | | |
| | | if(type==1){ |
| | | srtj() |
| | | tuifei() |
| | | } |
| | | |
| | | if(type==2){ |
| | |
| | | $("#nextB").hide(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | | <script> |
| | | var ans = []; |
| | | var weekX = ["1周","2周","3周","4周"]; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | | var yearX = []; |
| | | var timeX = []; |
| | | var dataX = []; |
| | | // 创建一个日期对象 |
| | | var currentDate = new Date(); |
| | | // 获取当前日期的号数 |
| | | let currentDay = currentDate.getDate(); |
| | | // 循环添加号数到数组 |
| | | for (let i = 0; i < 7; i++) { |
| | | dataX.push(currentDay - 6+i); |
| | | } |
| | | // 获取当前月份 |
| | | var currentMonth = currentDate.getMonth(); |
| | | // 获取当前年份 |
| | | var currentYear = currentDate.getFullYear(); |
| | | // 计算指定年份和月份的天数 |
| | | function getDaysInMonth(year, month) { |
| | | // month 参数范围是 0-11,所以需要加 1 |
| | | return new Date(year, month + 1, 0).getDate(); |
| | | } |
| | | // 获取当前月份的天数 |
| | | var daysInMonth = getDaysInMonth(currentYear, currentMonth); |
| | | // 将天数按字符串格式添加到 timeX 数组中 |
| | | for (var i = 1; i <= daysInMonth; i++) { |
| | | timeX.push(String(i)); |
| | | } |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="管理员姓名" type="text"/> |
| | | <#input id="phone" name="管理员手机号" type="text"/> |
| | | |
| | | |
| | | </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.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="发放数量" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="管理员手机号" type="text" value="${item.phone}"/> |
| | | |
| | | |
| | | </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> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | $(function() { |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == companyType){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == companyType){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | |
| | | TCarInfoDlg.zcServerClick(); |
| | | TCarInfoDlg.kcServerClick(); |
| | | |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <div class="ibox-title"> |
| | | <h5>折扣管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TCompetition.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="shopName" name="所属门店" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="课包名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="折扣类型" > |
| | | <option value="">全部</option> |
| | | <option value="1">会员折扣</option> |
| | | <option value="3">限时折扣</option> |
| | | <option value="4">赠送课时</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="上架" icon="fa-plus" clickFun="TCompetition.updateState(1)"/> |
| | | <#button name="下架" icon="fa-edit" clickFun="TCompetition.updateState(2)" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tDiscount/tDiscount.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <input type="hidden" id="coursePackagePaymentConfig" value='${coursePackagePaymentConfig}'> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">课包名称:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span>${item.name}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <div class="col-sm-2"> |
| | | </div> |
| | | <div class="col-sm-6" id="classHours" style="margin-top: 6px;"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="payment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">现金支付:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="cashPayment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">*折扣类型:</label> |
| | | <div class="col-sm-6" id="types" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="type" value="1"> 会员折扣 |
| | | <input type="checkbox" name="type" value="2"> 续课优惠 |
| | | <input type="checkbox" name="type" value="3"> 限时折扣 |
| | | <input type="checkbox" name="type" value="4"> 赠送课时 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="memberDiscount"> |
| | | |
| | | </div> |
| | | <div id="renewalOffer"> |
| | | |
| | | </div> |
| | | <div id="limitedTimeDiscount"> |
| | | |
| | | </div> |
| | | <div id="complimentaryClass"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackageDiscount.js"></script> |
| | | <script src="${ctxPath}/modular/system/tDiscount/tDiscount_info.js"></script> |
| | | |
| | | |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#classStartTime' |
| | | ,type: 'time' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="管理员姓名" type="text"/> |
| | | <#input id="phone" name="管理员手机号" type="text"/> |
| | | |
| | | |
| | | </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.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="发放数量" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="管理员手机号" type="text" value="${item.phone}"/> |
| | | |
| | | |
| | | </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> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | $(function() { |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == companyType){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == companyType){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | |
| | | TCarInfoDlg.zcServerClick(); |
| | | TCarInfoDlg.kcServerClick(); |
| | | |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <div class="ibox-title"> |
| | | <h5>折扣管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TCompetition.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="shopName" name="所属门店" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="课包名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="折扣类型" > |
| | | <option value="">全部</option> |
| | | <option value="1">会员折扣</option> |
| | | <option value="3">限时折扣</option> |
| | | <option value="4">赠送课时</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="审核" icon="fa-plus" clickFun="TCompetition.audit()"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tDiscountAudit/tDiscount.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <input type="hidden" id="coursePackagePaymentConfig" value='${coursePackagePaymentConfig}'> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">当前状态:</label> |
| | | @if(state==1){ |
| | | <div class="col-sm-4" style="margin-top: 6px;color: goldenrod"> |
| | | <span>${stateStr}</span> |
| | | </div> |
| | | @} |
| | | @if(state==3){ |
| | | <div class="col-sm-4" style="margin-top: 6px;color: red"> |
| | | <span>${stateStr}</span> |
| | | </div> |
| | | @} |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">课包名称:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span>${item.name}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <div class="col-sm-2"> |
| | | </div> |
| | | <div class="col-sm-6" id="classHours" style="margin-top: 6px;"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="payment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">现金支付:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span id="cashPayment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">*折扣类型:</label> |
| | | <div class="col-sm-6" id="types" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="type" value="1"> 会员折扣 |
| | | <input type="checkbox" name="type" value="2"> 续课优惠 |
| | | <input type="checkbox" name="type" value="3"> 限时折扣 |
| | | <input type="checkbox" name="type" value="4"> 赠送课时 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="memberDiscount"> |
| | | |
| | | </div> |
| | | <div id="renewalOffer"> |
| | | |
| | | </div> |
| | | <div id="limitedTimeDiscount"> |
| | | |
| | | </div> |
| | | <div id="complimentaryClass"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tDiscountAudit/coursePackageDiscount.js"></script> |
| | | <script src="${ctxPath}/modular/system/tDiscount/tDiscount_info.js"></script> |
| | | |
| | | |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#classStartTime' |
| | | ,type: 'time' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | elem: '#time' |
| | | ,type: 'time',format: "HH:mm" |
| | | ,range: true |
| | | }); |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode" > |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.id}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.id}" ${item.cityCode == obj.code ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/>v |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | elem: '#time' |
| | | ,type: 'time',format: "HH:mm" |
| | | ,range: true |
| | | }); |
| | | |
| | | let id = "${item.realPicture}" |
| | | let obj = [] |
| | | |
| | |
| | | |
| | | |
| | | window.onload = function(){ |
| | | |
| | | console.log("${item.operatorId}") |
| | | var OBJradio=document.getElementsByName("type") |
| | | if("${item.operatorId}"==0){ |
| | |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '所在省', field: 'pname', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '所在市', field: 'cname', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属门店', field: 'shopName', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '课包名称', field: 'name', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '折扣类型', field: 'type', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle' |
| | | ,formatter:function (data) { |
| | | return{1:"上架中",2:"下架中"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D + h + m + s; |
| | | return strDate |
| | | } |
| | | |
| | | function currentTime1(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D ; |
| | | return strDate |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAddTCompetition = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCity/tCity_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCity/tCity_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.updateState = function (e) { |
| | | if (this.check()) { |
| | | var id = TCompetition.seItem.id; |
| | | var ajax = new $ax(Feng.ctxPath + "/tDiscount/updateState", function (data) { |
| | | if(data.code==200){ |
| | | Feng.success("操作成功") |
| | | }else { |
| | | Feng.error("操作失败") |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("操作失败") |
| | | TCompetition.table.refresh(); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("status",e); |
| | | ajax.start(); |
| | | ; |
| | | } |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.unfreeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/unfreeze", function (data) { |
| | | Feng.success("解冻成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.reload = function () { |
| | | if (this.check()) { |
| | | let id = this.seItem.id |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/pwd", function (data) { |
| | | Feng.success("重置成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("重置失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | Feng.confirm("确认重置密码?重置后密码为:a123456", operation); |
| | | } |
| | | |
| | | }; |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '折扣详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDiscount/info?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | queryData['type'] = $("type").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#type").val(""); |
| | | $("#shopName").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tDiscount/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | | .set('companyId') |
| | | .set('franchiseeId') |
| | | .set('carColor') |
| | | .set('carModelId') |
| | | .set('carBrandId') |
| | | .set('carLicensePlate') |
| | | .set('carPhoto') |
| | | .set('drivingLicenseNumber') |
| | | .set('drivingLicensePhoto') |
| | | .set('annualInspectionTime') |
| | | .set('commercialInsuranceTime') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('addType') |
| | | .set('addObjectId') |
| | | .set('plateColor') |
| | | .set('vehicleType') |
| | | .set('ownerName') |
| | | .set('engineId') |
| | | .set('VIN') |
| | | .set('certifyDateA') |
| | | .set('fuelType') |
| | | .set('engineDisplace') |
| | | .set('certificate') |
| | | .set('transAgency') |
| | | .set('transArea') |
| | | .set('transDateStart') |
| | | .set('transDateStop') |
| | | .set('certifyDateB') |
| | | .set('fixState') |
| | | .set('nextFixDate') |
| | | .set('checkState') |
| | | .set('feePrintId') |
| | | .set('GPSBrand') |
| | | .set('GPSModel') |
| | | .set('GPSIMEI') |
| | | .set('GPSInstallDate') |
| | | .set('registerDate') |
| | | .set('commercialType'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 用户详情对话框(可用于添加和修改对话框) |
| | | */ |
| | | var CoursePackageDiscount = { |
| | | userInfoData: {}, |
| | | coursePackagePaymentConfig: {} |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | CoursePackageDiscount.close = function () { |
| | | parent.layer.close(window.parent.CoursePackage.layerIndex); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | CoursePackageDiscount.editSubmit = function () { |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/setCoursePackageDiscount", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("编辑成功!"); |
| | | CoursePackageDiscount.close(); |
| | | window.parent.CoursePackage.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("编辑失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('json', JSON.stringify(CoursePackageDiscount.coursePackagePaymentConfig)); |
| | | ajax.set('id', $('#id').val()); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function addPrice(type){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(type == 3){ |
| | | let ll = $('#limitedTimeDiscount .limitedTimeDiscount').length; |
| | | let htmlStr = |
| | | ' <div class="form-group limitedTimeDiscount" index="' + ll + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">折扣有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(3, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*折扣时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1" onclick="addPriceValue(3, this, \'weeks\')"/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2" onclick="addPriceValue(3, this, \'weeks\')"/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3" onclick="addPriceValue(3, this, \'weeks\')"/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4" onclick="addPriceValue(3, this, \'weeks\')"/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5" onclick="addPriceValue(3, this, \'weeks\')"/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6" onclick="addPriceValue(3, this, \'weeks\')"/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7" onclick="addPriceValue(3, this, \'weeks\')"/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" class="price" onblur="addPriceValue(3, this, \'cashPayment\')" min="0" placeholder="请输入折扣后支付价格" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | |
| | | $('#limitedTimeDiscount').append(htmlStr); |
| | | let arr = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | for(let k in arr){ |
| | | if(arr[k].type == 3){ |
| | | arr[k].content.push({}) |
| | | } |
| | | } |
| | | lay('.startAndEndDay').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startDate'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endDate'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | lay('.time').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'time' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startTime'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endTime'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | if(type == 4){ |
| | | let ll = $('#complimentaryClass .complimentaryClass').length; |
| | | let htmlStr = |
| | | ' <div class="form-group complimentaryClass" index="' + ll + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(4, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1" onclick="addPriceValue(4, this, \'weeks\')"/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2" onclick="addPriceValue(4, this, \'weeks\')"/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3" onclick="addPriceValue(4, this, \'weeks\')"/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4" onclick="addPriceValue(4, this, \'weeks\')"/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5" onclick="addPriceValue(4, this, \'weeks\')"/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6" onclick="addPriceValue(4, this, \'weeks\')"/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7" onclick="addPriceValue(4, this, \'weeks\')"/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送课时数:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" class="price" onblur="addPriceValue(4, this, \'hour\')" min="0" placeholder="请输入赠送课时数" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | $('#complimentaryClass').append(htmlStr); |
| | | let arr = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | for(let k in arr){ |
| | | if(arr[k].type == 4){ |
| | | arr[k].content.push({}) |
| | | } |
| | | } |
| | | lay('.startAndEndDay').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startDate'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endDate'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | lay('.time').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'time' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startTime'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endTime'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | function removePrice(type, e){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let object = $(e).parent('div').parent('div').parent('div').parent('div'); |
| | | let ii = object.attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | let arr = []; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | continue |
| | | } |
| | | arr.push(jsonArray[j]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = arr; |
| | | } |
| | | } |
| | | object.remove(); |
| | | } |
| | | |
| | | |
| | | function addPriceValue(type, e, name){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(type == 1){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let content = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | content = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | content = obj.coursePackageDiscount[i].content; |
| | | } |
| | | content[name] = parseFloat($(e).val()); |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = content; |
| | | } |
| | | } |
| | | } |
| | | if(type == 2){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let content = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | content = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | content = obj.coursePackageDiscount[i].content; |
| | | } |
| | | content[name] = parseFloat($(e).val()); |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = content; |
| | | } |
| | | } |
| | | } |
| | | if(type == 3){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | if('weeks' == name){ |
| | | let weeks = jsonArray[j].weeks; |
| | | let v = parseInt($(e).val()); |
| | | if(null != weeks && typeof weeks != "undefined"){ |
| | | if(e.checked){ |
| | | weeks.push(v); |
| | | }else{ |
| | | let arr = []; |
| | | for (let k = 0; k < weeks.length; k++) { |
| | | if(weeks[k] == v){ |
| | | continue |
| | | } |
| | | arr.push(weeks[k]); |
| | | } |
| | | weeks = arr; |
| | | } |
| | | }else{ |
| | | weeks = [v]; |
| | | } |
| | | jsonArray[j].weeks = weeks; |
| | | }else{ |
| | | jsonArray[j][name] = parseFloat($(e).val()); |
| | | } |
| | | } |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = jsonArray; |
| | | } |
| | | } |
| | | } |
| | | if(type == 4){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | if('weeks' == name){ |
| | | let weeks = jsonArray[j].weeks; |
| | | let v = parseInt($(e).val()); |
| | | if(null != weeks && typeof weeks != "undefined"){ |
| | | if(e.checked){ |
| | | weeks.push(v); |
| | | }else{ |
| | | let arr = []; |
| | | for (let k = 0; k < weeks.length; k++) { |
| | | if(weeks[k] == v){ |
| | | continue |
| | | } |
| | | arr.push(weeks[k]); |
| | | } |
| | | weeks = arr; |
| | | } |
| | | }else{ |
| | | weeks = [v]; |
| | | } |
| | | jsonArray[j].weeks = weeks; |
| | | }else{ |
| | | jsonArray[j][name] = parseFloat($(e).val()); |
| | | } |
| | | } |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = jsonArray; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function selectedPperiod(e){ |
| | | $('#classHours').find('button[checked]').attr('style', 'width: 60px;height: 30px;border: none;border-radius: 5px;'); |
| | | $('#classHours').find('button[checked]').removeAttr('checked'); |
| | | if(typeof e != "undefined"){ |
| | | $(e).attr('style', 'width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;'); |
| | | $(e).attr('checked', true); |
| | | }else{ |
| | | $($('#classHours').find('button')[0]).attr('style', 'width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;'); |
| | | $($('#classHours').find('button')[0]).attr('checked', true); |
| | | } |
| | | |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | $('#payment').text(obj.payment); |
| | | $('#cashPayment').text(obj.cashPayment); |
| | | |
| | | $('#memberDiscount').html(''); |
| | | $('#renewalOffer').html(''); |
| | | $('#limitedTimeDiscount').html(''); |
| | | $('#complimentaryClass').html(''); |
| | | let objv = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | $('input[name="type"]').each(function (i, e) { |
| | | e.checked = false; |
| | | let v = $(e).val(); |
| | | for (let i = 0; i < objv.coursePackageDiscount.length; i++) { |
| | | if(v == objv.coursePackageDiscount[i].type){ |
| | | $(e).click(); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | $(function () { |
| | | CoursePackageDiscount.coursePackagePaymentConfig = JSON.parse($('#coursePackagePaymentConfig').val()); |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < CoursePackageDiscount.coursePackagePaymentConfig.length; i++) { |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[i]; |
| | | if(i == 0){ |
| | | htmlStr += '<button checked onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;">' + obj.classHours + '课时</button> '; |
| | | }else{ |
| | | htmlStr += '<button onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;border: none;border-radius: 5px;">' + obj.classHours + '课时</button> '; |
| | | } |
| | | } |
| | | $('#classHours').html(htmlStr); |
| | | |
| | | $('input[name="type"]').click(function () { |
| | | let v = $(this).val(); |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(this.checked && v == '1'){ |
| | | let discountMember = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<h3>会员折扣</h3>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(v == obj.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obj.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.discountMember ? '' : jsonObject.discountMember); |
| | | discountMember = false; |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入会员支付价格" onblur="addPriceValue(1, this, \'discountMember\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>'; |
| | | |
| | | $('#memberDiscount').html(hh); |
| | | if(discountMember){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 1, |
| | | content:{ |
| | | discountMember: null |
| | | } |
| | | }); |
| | | } |
| | | }else if(!this.checked && v == '1'){ |
| | | $('#memberDiscount').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '2'){ |
| | | let continuingMember = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<h3>续课优惠</h3>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">会员续课:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' </div>\n' + |
| | | ' <label class="col-sm-2 control-label">用户续课:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(v == obj.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obj.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.continuingMember ? '' : jsonObject.continuingMember); |
| | | continuingMember = false; |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入会员支付价格" onblur="addPriceValue(2, this, \'continuingMember\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if(v == obje.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obje.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.continuingUser ? '' : jsonObject.continuingUser); |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入用户支付价格" onblur="addPriceValue(2, this, \'continuingUser\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>'; |
| | | $('#renewalOffer').html(hh); |
| | | if(continuingMember){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 2, |
| | | content: { |
| | | continuingMember: null, |
| | | continuingUser: null |
| | | } |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '2'){ |
| | | $('#renewalOffer').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '3'){ |
| | | let data_value = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<span style="font-size: 16px;font-weight: 500;">限时折扣</span> <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(3)"></i>\n'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if(v == obje.coursePackageDiscount[i].type){ |
| | | data_value = false |
| | | let jsonArray = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obje.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | hh += '' + |
| | | ' <div class="form-group limitedTimeDiscount" index="' + j + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">折扣有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" value="' + (jsonArray[j].startDate + " - " + jsonArray[j].endDate) + '" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(3, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*折扣时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" value="' + jsonArray[j].startTime + " - " + jsonArray[j].endTime + '" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 1){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 2){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 3){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 4){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 5){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 6){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 7){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" min="0" value="' + jsonArray[j].cashPayment + '" onblur="addPriceValue(3, this, \'cashPayment\')" placeholder="请输入折扣后支付价格" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | } |
| | | |
| | | } |
| | | } |
| | | $('#limitedTimeDiscount').html(hh); |
| | | if(data_value){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 3, |
| | | content: [] |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '3'){ |
| | | $('#limitedTimeDiscount').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '4'){ |
| | | let data_value = true; |
| | | let hh = |
| | | '<div class="hr-line-dashed"></div>' + |
| | | '<span style="font-size: 16px;font-weight: 500;">赠送课时</span> <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(4)"></i>\n'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if (v == obje.coursePackageDiscount[i].type) { |
| | | data_value = false; |
| | | let jsonArray = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obje.coursePackageDiscount[i].content; |
| | | } |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | hh += |
| | | ' <div class="form-group complimentaryClass" index="' + j + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" value="' + (jsonArray[j].startDate + " - " + jsonArray[j].endDate) + '" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(4, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" value="' + jsonArray[j].startTime + " - " + jsonArray[j].endTime + '" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 1){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 2){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 3){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 4){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 5){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 6){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 7){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送课时数:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" value="' + jsonArray[j].hour + '" onblur="addPriceValue(4, this, \'hour\')" min="0" placeholder="请输入赠送课时数" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | } |
| | | } |
| | | } |
| | | $('#complimentaryClass').html(hh); |
| | | if(data_value){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 4, |
| | | content: [] |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '4'){ |
| | | $('#complimentaryClass').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | }) |
| | | |
| | | |
| | | selectedPperiod(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | | .set('companyId') |
| | | .set('franchiseeId') |
| | | .set('carColor') |
| | | .set('carModelId') |
| | | .set('carBrandId') |
| | | .set('carLicensePlate') |
| | | .set('carPhoto') |
| | | .set('drivingLicenseNumber') |
| | | .set('drivingLicensePhoto') |
| | | .set('annualInspectionTime') |
| | | .set('commercialInsuranceTime') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('addType') |
| | | .set('addObjectId') |
| | | .set('plateColor') |
| | | .set('vehicleType') |
| | | .set('ownerName') |
| | | .set('engineId') |
| | | .set('VIN') |
| | | .set('certifyDateA') |
| | | .set('fuelType') |
| | | .set('engineDisplace') |
| | | .set('certificate') |
| | | .set('transAgency') |
| | | .set('transArea') |
| | | .set('transDateStart') |
| | | .set('transDateStop') |
| | | .set('certifyDateB') |
| | | .set('fixState') |
| | | .set('nextFixDate') |
| | | .set('checkState') |
| | | .set('feePrintId') |
| | | .set('GPSBrand') |
| | | .set('GPSModel') |
| | | .set('GPSIMEI') |
| | | .set('GPSInstallDate') |
| | | .set('registerDate') |
| | | .set('commercialType'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '所在省', field: 'pname', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '所在市', field: 'cname', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属门店', field: 'shopName', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '课包名称', field: 'name', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '折扣类型', field: 'type', visible: true, align: 'center', valign: 'middle' |
| | | ,formatter:function (data) { |
| | | return{1:"会员折扣",3:"限时折扣",4:"赠送课时"}[data] |
| | | } |
| | | }, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle' |
| | | ,formatter:function (data) { |
| | | return{1:"待审核",3:"未通过"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D + h + m + s; |
| | | return strDate |
| | | } |
| | | |
| | | function currentTime1(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D ; |
| | | return strDate |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAddTCompetition = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCity/tCity_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCity/tCity_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.updateState = function (e) { |
| | | if (this.check()) { |
| | | var id = TCompetition.seItem.id; |
| | | var ajax = new $ax(Feng.ctxPath + "/TDiscount/updateState", function (data) { |
| | | if(data.code==200){ |
| | | Feng.success("操作成功") |
| | | }else { |
| | | Feng.error("操作失败") |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("操作失败") |
| | | TCompetition.table.refresh(); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("status",e); |
| | | ajax.start(); |
| | | ; |
| | | } |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.audit = function () { |
| | | if (this.check()) { |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '折扣审核' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" >' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">审核状态:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input type="radio" name="r1" value="2" checked> 通过 <input type="radio" name="r1" value="3" > 拒绝 '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">拒绝理由:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <textarea id="text" style="width: 460px; height: 138px;"></textarea> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | let audit = document.querySelector('input[name="r1"]:checked').value; |
| | | let text = $("#text").val() |
| | | if(audit==3){ |
| | | if(text==''){ |
| | | Feng.info("请输入拒绝理由") |
| | | return false; |
| | | } |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tDiscount/auditDiscount", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", TCompetition.seItem.id); |
| | | ajax.set("audit", audit); |
| | | ajax.set("text", text); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.unfreeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/unfreeze", function (data) { |
| | | Feng.success("解冻成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | console.log(111) |
| | | if (this.check()) { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '折扣详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDiscount/infoOne?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.reload = function () { |
| | | if (this.check()) { |
| | | let id = this.seItem.id |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/pwd", function (data) { |
| | | Feng.success("重置成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("重置失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | Feng.confirm("确认重置密码?重置后密码为:a123456", operation); |
| | | } |
| | | |
| | | }; |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | queryData['type'] = $("type").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#type").val(""); |
| | | $("#shopName").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tDiscount/listAudit", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | | .set('companyId') |
| | | .set('franchiseeId') |
| | | .set('carColor') |
| | | .set('carModelId') |
| | | .set('carBrandId') |
| | | .set('carLicensePlate') |
| | | .set('carPhoto') |
| | | .set('drivingLicenseNumber') |
| | | .set('drivingLicensePhoto') |
| | | .set('annualInspectionTime') |
| | | .set('commercialInsuranceTime') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('addType') |
| | | .set('addObjectId') |
| | | .set('plateColor') |
| | | .set('vehicleType') |
| | | .set('ownerName') |
| | | .set('engineId') |
| | | .set('VIN') |
| | | .set('certifyDateA') |
| | | .set('fuelType') |
| | | .set('engineDisplace') |
| | | .set('certificate') |
| | | .set('transAgency') |
| | | .set('transArea') |
| | | .set('transDateStart') |
| | | .set('transDateStop') |
| | | .set('certifyDateB') |
| | | .set('fixState') |
| | | .set('nextFixDate') |
| | | .set('checkState') |
| | | .set('feePrintId') |
| | | .set('GPSBrand') |
| | | .set('GPSModel') |
| | | .set('GPSIMEI') |
| | | .set('GPSInstallDate') |
| | | .set('registerDate') |
| | | .set('commercialType'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
| | |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChange1Next = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/onChange1", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择省</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#pCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",e); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChange2 = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |