From 0dfd67611682ce6d3bd0004632ace784906358c7 Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期四, 10 八月 2023 18:26:07 +0800
Subject: [PATCH] 后台代码-- 优惠券、积分商品
---
cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js | 157 ++
cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral.html | 6
cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponInfo.html | 415 +++++++
cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponCity.java | 65 +
cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js | 384 ++++++
cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/AppUserClient.java | 1
cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponRecordQuery.java | 23
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java | 138 ++
cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html | 363 ++++++
cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/Coupon.java | 2
cloud-server-activity/src/main/java/com/dsh/activity/entity/CouponCity.java | 2
cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/CouponClient.java | 14
cloud-server-activity/src/main/java/com/dsh/activity/mapper/CouponMapper.java | 4
cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral_add.html | 27
cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js | 51
cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js | 447 +++++++
cloud-server-management/src/main/java/com/dsh/course/feignClient/account/IntegralClient.java | 3
cloud-server-activity/src/main/resources/mapper/CouponMapper.xml | 12
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntegralController.java | 9
cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java | 33
cloud-server-activity/src/main/java/com/dsh/activity/service/ICouponService.java | 4
cloud-server-activity/src/main/java/com/dsh/activity/service/impl/CouponServiceImpl.java | 11
cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCoupon.js | 124 +
cloud-server-activity/src/main/java/com/dsh/activity/model/CouponRecordQuery.java | 23
/dev/null | 181 ---
cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TCity_edit.html | 98 +
cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCoupon.html | 5
cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TStoreList.html | 58 +
cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js | 51
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java | 330 +++++
cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods.html | 56
cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponRecord.js | 264 ++++
cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponRecord.html | 45
33 files changed, 3,174 insertions(+), 232 deletions(-)
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
index e83e1c8..1d2982e 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
@@ -4,10 +4,12 @@
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.dsh.activity.entity.Coupon;
import com.dsh.activity.entity.CouponCity;
import com.dsh.activity.entity.CouponStore;
import com.dsh.activity.entity.UserCoupon;
+import com.dsh.activity.feignclient.account.AppUserClient;
import com.dsh.activity.feignclient.account.CityClient;
import com.dsh.activity.feignclient.account.StoreStaffClient;
import com.dsh.activity.feignclient.account.model.TCityManager;
@@ -19,6 +21,7 @@
import com.dsh.activity.feignclient.other.model.CityDataAndProvinceDataVo;
import com.dsh.activity.feignclient.other.model.Store;
import com.dsh.activity.model.CouponListVo;
+import com.dsh.activity.model.CouponRecordQuery;
import com.dsh.activity.model.request.CommodityRequest;
import com.dsh.activity.model.request.CouponDataVo;
import com.dsh.activity.model.request.CouponPackageReq;
@@ -82,6 +85,9 @@
@Resource
private CouponCityService cityService;
+
+ @Autowired
+ private AppUserClient appUserClient;
@@ -462,4 +468,31 @@
}
}
+ @ResponseBody
+ @PostMapping("/base/coupon/queryCity")
+ public List<CouponCity> queryCity(@RequestBody Integer id){
+ List<CouponCity> list = cityService.list(new LambdaQueryWrapper<CouponCity>().eq(CouponCity::getCouponId, id));
+ return list;
+ }
+
+ @ResponseBody
+ @PostMapping("/base/coupon/queryStore")
+ public List<Integer> queryStore(@RequestBody Integer id){
+ return couStoreService.list(new LambdaQueryWrapper<CouponStore>().eq(CouponStore::getCouponId,id)).stream().map(CouponStore::getStoreId).collect(Collectors.toList());
+ }
+
+
+ @PostMapping("/base/coupon/listRecord")
+ @ResponseBody
+ public List<Map<String,Object>> listRecord(@RequestBody CouponRecordQuery ofSearch){
+ Page<Object> objectPage = new Page<>(ofSearch.getOffset(), ofSearch.getLimit());
+ return couponService.listRecord(objectPage,ofSearch.getId(),ofSearch.getIds(),ofSearch.getType());
+ }
+
+
+
+ @PostMapping("/base/coupon/updateType")
+ public void updateType(@RequestBody Long id){
+ couponService.updateType(id);
+ }
}
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/entity/CouponCity.java b/cloud-server-activity/src/main/java/com/dsh/activity/entity/CouponCity.java
index 92edd0c..5d818af 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/entity/CouponCity.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/entity/CouponCity.java
@@ -25,7 +25,6 @@
@TableName("t_coupon_city")
public class CouponCity extends Model<CouponCity> {
- private static final long serialVersionUID = 1L;
/**
* 主键
@@ -35,6 +34,7 @@
/**
* 优惠券id
*/
+ @TableField("couponId")
private Integer couponId;
/**
* 省
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/AppUserClient.java b/cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/AppUserClient.java
index dc45750..71d39e9 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/AppUserClient.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/AppUserClient.java
@@ -19,4 +19,5 @@
*/
@PostMapping("/base/appUser/queryAppUser")
AppUser queryAppUser(Integer appUserId);
+
}
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/mapper/CouponMapper.java b/cloud-server-activity/src/main/java/com/dsh/activity/mapper/CouponMapper.java
index c522a07..b622619 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/mapper/CouponMapper.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/mapper/CouponMapper.java
@@ -38,4 +38,8 @@
@Param("page")Page<Map<String, Object>> page);
+ List<Map<String, Object>> listRecord(@Param("objectPage") Page<Object> objectPage, @Param("id") Integer id, @Param("ids") List<Integer> ids, @Param("type") Integer type);
+
+
+ void updateType(@Param("id") Long id);
}
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/model/CouponRecordQuery.java b/cloud-server-activity/src/main/java/com/dsh/activity/model/CouponRecordQuery.java
new file mode 100644
index 0000000..f6054d6
--- /dev/null
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/model/CouponRecordQuery.java
@@ -0,0 +1,23 @@
+package com.dsh.activity.model;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class CouponRecordQuery {
+
+ private long offset;
+
+ private long limit;
+
+ private Integer id;
+
+ private List<Integer> ids;
+
+ private Integer type;
+
+}
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/service/ICouponService.java b/cloud-server-activity/src/main/java/com/dsh/activity/service/ICouponService.java
index 77c8a58..8df533f 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/service/ICouponService.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/service/ICouponService.java
@@ -1,5 +1,6 @@
package com.dsh.activity.service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dsh.activity.entity.Coupon;
import com.dsh.activity.feignclient.model.CouponExamineListSearch;
@@ -33,4 +34,7 @@
List<Map<String, Object>> queryCouponExamineList(CouponExamineListSearch ofSearch);
+ List<Map<String, Object>> listRecord(Page<Object> objectPage, Integer id, List<Integer> ids, Integer type);
+
+ void updateType(Long id);
}
diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/CouponServiceImpl.java b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/CouponServiceImpl.java
index 1da2f4b..bc5edce 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/CouponServiceImpl.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/CouponServiceImpl.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
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.activity.entity.Coupon;
import com.dsh.activity.feignclient.account.AppUserClient;
@@ -111,4 +112,14 @@
return this.baseMapper.queryCouponExamineList(ofSearch.getName(),ofSearch.getType(),ofSearch.getUserPopulation(),ofSearch.getDistributionMethod(),ofSearch.getAuditStatus(),ofSearch.getPage());
}
+ @Override
+ public List<Map<String, Object>> listRecord(Page<Object> objectPage, Integer id, List<Integer> ids, Integer type) {
+ return this.baseMapper.listRecord(objectPage,id,ids,type);
+ }
+
+ @Override
+ public void updateType(Long id) {
+ this.baseMapper.updateType(id);
+ }
+
}
diff --git a/cloud-server-activity/src/main/resources/mapper/CouponMapper.xml b/cloud-server-activity/src/main/resources/mapper/CouponMapper.xml
index 323ebac..a09094e 100644
--- a/cloud-server-activity/src/main/resources/mapper/CouponMapper.xml
+++ b/cloud-server-activity/src/main/resources/mapper/CouponMapper.xml
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsh.activity.mapper.CouponMapper">
+ <update id="updateType">
+ update t_user_coupon set status = 2 where id =#{id}
+ </update>
<select id="queryConponRuleOfJson" resultType="java.util.Map">
SELECT JSON_EXTRACT(content, "$.conditionalAmount") as conditionalAmount,
@@ -79,6 +82,15 @@
</if>
order by insertTime desc
</select>
+ <select id="listRecord" resultType="java.util.Map">
+ select id,userId,status from t_user_coupon where couponId =#{id}
+ and userId in <foreach collection="ids" separator="," open="(" item="i" close=")">
+ #{i}
+ </foreach>
+ <if test="type !=null">
+ and status =#{type}
+ </if>
+ </select>
</mapper>
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/IntegralClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/IntegralClient.java
index 3f47e33..4b937be 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/IntegralClient.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/IntegralClient.java
@@ -1,5 +1,6 @@
package com.dsh.course.feignClient.account;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsh.course.feignClient.account.model.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@@ -12,6 +13,6 @@
@PostMapping("/userIntegralChanges/list")
- List<UserIntegral> list(IntegralListQuery integralListQuery);
+ Page<UserIntegral> list(IntegralListQuery integralListQuery);
}
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/CouponClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/CouponClient.java
index e4cca9c..e90d072 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/CouponClient.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/CouponClient.java
@@ -1,9 +1,7 @@
package com.dsh.course.feignClient.activity;
-import com.dsh.course.feignClient.activity.model.Coupon;
-import com.dsh.course.feignClient.activity.model.CouponExamineListSearch;
-import com.dsh.course.feignClient.activity.model.CouponListOfSearch;
+import com.dsh.course.feignClient.activity.model.*;
import com.dsh.guns.modular.system.model.CouponDataVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@@ -37,4 +35,14 @@
@PostMapping("/base/coupon/insertIntoCouponData")
void insertIntoData(@RequestBody CouponDataVo dataVo);
+ @PostMapping("/base/coupon/queryCity")
+ List<CouponCity> queryCity(Integer id);
+ @PostMapping("/base/coupon/queryStore")
+ List<Integer> queryStore(Integer id);
+
+ @PostMapping("/base/coupon/listRecord")
+ List<Map<String,Object>> listRecord(CouponRecordQuery ofSearch);
+
+ @PostMapping("/base/coupon/updateType")
+ void updateType(Long id);
}
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/Coupon.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/Coupon.java
index fa8977e..d299f01 100644
--- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/Coupon.java
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/Coupon.java
@@ -77,10 +77,12 @@
/**
* 开始时间
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
/**
* 结束时间
*/
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
/**
* 使用范围(1=全国,2=指定城市,3=指定门店)
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponCity.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponCity.java
new file mode 100644
index 0000000..bdffc88
--- /dev/null
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponCity.java
@@ -0,0 +1,65 @@
+package com.dsh.course.feignClient.activity.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 优惠券使用门店关系数据
+ * </p>
+ *
+ * @author jqs
+ * @since 2023-07-07
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("t_coupon_city")
+public class CouponCity extends Model<CouponCity> {
+
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Integer id;
+ /**
+ * 优惠券id
+ */
+ private Integer couponId;
+ /**
+ * 省
+ */
+ @TableField("province")
+ private String province;
+ /**
+ * 省编号
+ */
+ @TableField("provinceCode")
+ private String provinceCode;
+ /**
+ * 市
+ */
+ @TableField("city")
+ private String city;
+ /**
+ * 市编号
+ */
+ @TableField("cityCode")
+ private String cityCode;
+
+
+ @Override
+ protected Serializable pkVal() {
+ return this.id;
+ }
+
+}
diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponRecordQuery.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponRecordQuery.java
new file mode 100644
index 0000000..a938af4
--- /dev/null
+++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/CouponRecordQuery.java
@@ -0,0 +1,23 @@
+package com.dsh.course.feignClient.activity.model;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class CouponRecordQuery {
+
+ private long offset;
+
+ private long limit;
+
+ private Integer id;
+
+ private List<Integer> ids;
+
+ private Integer type;
+
+}
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
index a98b635..668c3e4 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
@@ -1,22 +1,31 @@
package com.dsh.guns.modular.system.controller.code;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.dsh.course.feignClient.account.AppUserClient;
import com.dsh.course.feignClient.account.CityManagerClient;
import com.dsh.course.feignClient.account.model.CityManager;
+import com.dsh.course.feignClient.account.model.QueryByNamePhone;
+import com.dsh.course.feignClient.account.model.TAppUser;
import com.dsh.course.feignClient.activity.CouponClient;
+import com.dsh.course.feignClient.activity.model.Coupon;
+import com.dsh.course.feignClient.activity.model.CouponCity;
import com.dsh.course.feignClient.activity.model.CouponListOfSearch;
+import com.dsh.course.feignClient.activity.model.CouponRecordQuery;
import com.dsh.guns.config.UserExt;
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.CouponDataVo;
import com.dsh.guns.modular.system.model.Region;
+import com.dsh.guns.modular.system.model.TStore;
import com.dsh.guns.modular.system.service.IRegionService;
import com.dsh.guns.modular.system.service.IStoreService;
import com.dsh.guns.modular.system.util.OBSUploadUtil;
import org.apache.commons.beanutils.ConvertUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
@@ -24,10 +33,9 @@
import javax.annotation.Resource;
import java.io.IOException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
/**
@@ -55,6 +63,9 @@
@Resource
private CityManagerClient cmgrClient;
+ @Autowired
+ private AppUserClient appUserClient;
+
/**
@@ -77,6 +88,74 @@
}
+ @RequestMapping("/coupon_record/{id}")
+ public String memberCouponAdd(@PathVariable Integer id,Model model) {
+ Coupon coupon = client.queryCouponById(id);
+
+ model.addAttribute("id",id);
+ model.addAttribute("type",coupon.getType());
+ return PREFIX + "TCouponRecord.html";
+ }
+
+
+
+ @RequestMapping("/coupon_detail/{id}")
+ public String memberCouponDetail(@PathVariable Integer id,Model model) {
+ Coupon coupon = client.queryCouponById(id);
+ String content = coupon.getContent();
+ JSONObject jsonObject = JSONObject.parseObject(content);
+ String one ="";
+ String two ="";
+ String three ="";
+ if(coupon.getType()==1){
+ one = jsonObject.get("conditionalAmount").toString();
+ two = jsonObject.get("deductionAmount").toString();
+ }
+ if(coupon.getType()==2){
+ one = jsonObject.get("conditionalAmount").toString();
+ }
+ if(coupon.getType()==3){
+ three = jsonObject.get("experienceName").toString();
+ }
+ List<CouponCity> list = new ArrayList<>();
+ List<Integer> list1=null;
+ List<TStore> list2=new ArrayList<>();
+ if(coupon.getUseScope()==2){
+ list = client.queryCity(coupon.getId());
+ }
+ if(coupon.getUseScope()==3){
+ list1 = client.queryStore(coupon.getId());
+ list2 = storeService.list(new LambdaQueryWrapper<TStore>().in(TStore::getId, list1));
+ for (TStore tStore : list2) {
+ CityManager cityManager = cmgrClient.queryCityManagerById(tStore.getCityManagerId());
+ if (ToolUtil.isNotEmpty(cityManager)){
+ tStore.setProvince(tStore.getProvince()+tStore.getCity());
+ tStore.setPhone(cityManager.getName()+"-"+cityManager.getPhone());
+ }
+ }
+
+ }
+ model.addAttribute("city",list);
+ model.addAttribute("store",list2);
+ model.addAttribute("s",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getStartTime()));
+ model.addAttribute("e",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getEndTime()));
+ model.addAttribute("one",one);
+ model.addAttribute("two",two);
+ model.addAttribute("three",three);
+ ArrayList<String> strings = new ArrayList<>();
+ String productImages = coupon.getProductImages();
+ for (String s : productImages.split(",")) {
+ strings.add(s);
+ }
+
+ model.addAttribute("img",strings);
+ Integer objectType = UserExt.getUser().getObjectType();
+ System.out.println(objectType);
+ model.addAttribute("item",coupon);
+ return PREFIX + "TCouponInfo.html";
+ }
+
+
/**
* 跳转到门店管理列表页
@@ -84,6 +163,12 @@
@RequestMapping("/storeList")
public String storePage(Model model) {
return PREFIX + "TStoreList.html";
+ }
+ @RequestMapping("/updateType")
+ @ResponseBody
+ public Object updateType(Long id) {
+ client.updateType(id);
+ return new SuccessTip<>();
}
@RequestMapping("/storeDetailsOfSearch")
@@ -137,12 +222,47 @@
ofSearch.setState(state);
return client.getCouponListOfSearch(ofSearch);
}
+ @RequestMapping(value = "/listRecord")
+ @ResponseBody
+ public Object listRecord(Integer id,String name, Integer type, String phone) {
+ Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
+ List<TAppUser> tAppUsers = appUserClient.queryByNamePhone(new QueryByNamePhone(name, phone));
+ if(tAppUsers.size()==0){
+ return new ArrayList<>();
+ }
+ CouponRecordQuery ofSearch = new CouponRecordQuery();
+ ofSearch.setId(id);
+ ofSearch.setLimit(page.getSize());
+ ofSearch.setOffset(page.getCurrent());
+ ofSearch.setIds(tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()));
+ ofSearch.setType(type);
+ List<Map<String, Object>> maps = client.listRecord(ofSearch);
+ for (Map<String, Object> map : maps) {
+ map.put("id",map.get("id").toString());
+ for (TAppUser tAppUser : tAppUsers) {
+ if(map.get("userId").equals(tAppUser.getId())){
+ map.put("name",tAppUser.getName());
+ map.put("phone",tAppUser.getPhone());
+ }
+ }
+ }
+ return maps;
+ }
@RequestMapping(value = "/getProvince")
@ResponseBody
public Object getProvince(){
return regiService.list(new LambdaQueryWrapper<Region>()
.eq(Region::getParentId,0));
+ }
+
+ @RequestMapping(value = "/onShelf")
+ @ResponseBody
+ public Object onShelf(Integer id,Integer type){
+ Coupon coupon = client.queryCouponById(id);
+ coupon.setState(type);
+ client.updateCouponData(coupon);
+ return new SuccessTip<>();
}
@@ -188,4 +308,14 @@
client.insertIntoData(dataVo);
return new SuccessTip<>();
}
+ @PostMapping(value = "/update")
+ @ResponseBody
+ public Object update( Integer id,Integer num,Integer num1,String text){
+ Coupon coupon = client.queryCouponById(id);
+ coupon.setQuantityIssued(num);
+ coupon.setPickUpQuantity(num1);
+ coupon.setIllustrate(text);
+ client.updateCouponData(coupon);
+ return new SuccessTip<>();
+ }
}
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java
new file mode 100644
index 0000000..75c6d7c
--- /dev/null
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TGoodsController.java
@@ -0,0 +1,330 @@
+package com.dsh.guns.modular.system.controller.code;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.dsh.course.feignClient.account.AppUserClient;
+import com.dsh.course.feignClient.account.CityManagerClient;
+import com.dsh.course.feignClient.account.model.CityManager;
+import com.dsh.course.feignClient.account.model.QueryByNamePhone;
+import com.dsh.course.feignClient.account.model.TAppUser;
+import com.dsh.course.feignClient.activity.CouponClient;
+import com.dsh.course.feignClient.activity.model.Coupon;
+import com.dsh.course.feignClient.activity.model.CouponCity;
+import com.dsh.course.feignClient.activity.model.CouponListOfSearch;
+import com.dsh.course.feignClient.activity.model.CouponRecordQuery;
+import com.dsh.guns.config.UserExt;
+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.CouponDataVo;
+import com.dsh.guns.modular.system.model.Region;
+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.IRegionService;
+import com.dsh.guns.modular.system.service.IStoreService;
+import com.dsh.guns.modular.system.util.OBSUploadUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+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;
+
+
+/**
+ * 优惠券管理 控制器
+ */
+
+@Controller
+@RequestMapping("/tGoods")
+public class TGoodsController {
+
+
+
+ private String PREFIX = "/system/tGoods/";
+
+
+ @Resource
+ private IRegionService regiService;
+
+ @Resource
+ private IStoreService storeService;
+
+ @Resource
+ private CouponClient client;
+
+ @Resource
+ private CityManagerClient cmgrClient;
+
+ @Autowired
+ private AppUserClient appUserClient;
+ @Autowired
+ private ICityService cityService;
+
+
+
+ /**
+ * 跳转到优惠券管理首页
+ */
+ @RequestMapping("")
+ public String index(Model model) {
+
+ return PREFIX + "TGoods.html";
+ }
+
+ /**
+ * 跳转到添加
+ */
+ @RequestMapping("/tGoods_add")
+ public String memberCouponAdd(Model model) {
+ Integer objectType = UserExt.getUser().getObjectType();
+ System.out.println(objectType);
+ model.addAttribute("userType",objectType);
+ List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
+ model.addAttribute("list",list);
+ return PREFIX + "TGoods_add.html";
+ }
+
+
+ @RequestMapping("/coupon_record/{id}")
+ public String memberCouponAdd(@PathVariable Integer id,Model model) {
+ Coupon coupon = client.queryCouponById(id);
+
+ model.addAttribute("id",id);
+ model.addAttribute("type",coupon.getType());
+ return PREFIX + "TCouponRecord.html";
+ }
+
+
+
+ @RequestMapping("/coupon_detail/{id}")
+ public String memberCouponDetail(@PathVariable Integer id,Model model) {
+ Coupon coupon = client.queryCouponById(id);
+ String content = coupon.getContent();
+ JSONObject jsonObject = JSONObject.parseObject(content);
+ String one ="";
+ String two ="";
+ String three ="";
+ if(coupon.getType()==1){
+ one = jsonObject.get("conditionalAmount").toString();
+ two = jsonObject.get("deductionAmount").toString();
+ }
+ if(coupon.getType()==2){
+ one = jsonObject.get("conditionalAmount").toString();
+ }
+ if(coupon.getType()==3){
+ three = jsonObject.get("experienceName").toString();
+ }
+ List<CouponCity> list = new ArrayList<>();
+ List<Integer> list1=null;
+ List<TStore> list2=new ArrayList<>();
+ if(coupon.getUseScope()==2){
+ list = client.queryCity(coupon.getId());
+ }
+ if(coupon.getUseScope()==3){
+ list1 = client.queryStore(coupon.getId());
+ list2 = storeService.list(new LambdaQueryWrapper<TStore>().in(TStore::getId, list1));
+ for (TStore tStore : list2) {
+ CityManager cityManager = cmgrClient.queryCityManagerById(tStore.getCityManagerId());
+ if (ToolUtil.isNotEmpty(cityManager)){
+ tStore.setProvince(tStore.getProvince()+tStore.getCity());
+ tStore.setPhone(cityManager.getName()+"-"+cityManager.getPhone());
+ }
+ }
+
+ }
+ model.addAttribute("city",list);
+ model.addAttribute("store",list2);
+ model.addAttribute("s",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getStartTime()));
+ model.addAttribute("e",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getEndTime()));
+ model.addAttribute("one",one);
+ model.addAttribute("two",two);
+ model.addAttribute("three",three);
+ ArrayList<String> strings = new ArrayList<>();
+ String productImages = coupon.getProductImages();
+ for (String s : productImages.split(",")) {
+ strings.add(s);
+ }
+
+ model.addAttribute("img",strings);
+ Integer objectType = UserExt.getUser().getObjectType();
+ System.out.println(objectType);
+ model.addAttribute("item",coupon);
+ return PREFIX + "TCouponInfo.html";
+ }
+
+
+
+ /**
+ * 跳转到门店管理列表页
+ */
+ @RequestMapping("/storeList")
+ public String storePage(Model model) {
+ return PREFIX + "TStoreList.html";
+ }
+ @RequestMapping("/updateType")
+ @ResponseBody
+ public Object updateType(Long id) {
+ client.updateType(id);
+ return new SuccessTip<>();
+ }
+
+ @RequestMapping("/storeDetailsOfSearch")
+ @ResponseBody
+ public Object listOfStore(Integer provinceId,Integer cityId,Integer cityManagerId,String storeName){
+ System.out.println("provinceId"+provinceId);
+ System.out.println("cityId"+cityId);
+ System.out.println("cityManagerId"+cityManagerId);
+ System.out.println("storeName"+storeName);
+ String provinceCode = null;
+ String cityCode = null;
+ if (ToolUtil.isNotEmpty(provinceId)){
+ Region provinceRegion = regiService.getById(provinceId);
+ provinceCode = provinceRegion.getCode();
+ }
+ if (ToolUtil.isNotEmpty(cityId)){
+ Region cityRegion = regiService.getById(cityId);
+ cityCode = cityRegion.getCode();
+ }
+ Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
+ List<Map<String,Object>> storeList = storeService.queryListOfpage(provinceCode,cityCode,cityManagerId,storeName,page);
+ if (storeList.size() > 0 ){
+ for (Map<String, Object> stringObjectMap : storeList) {
+ String provinceName = (String) stringObjectMap.get("province");
+ String cityName = (String) stringObjectMap.get("city");
+ stringObjectMap.put("provinceCity",provinceName+cityName);
+ Integer managerId = (Integer) stringObjectMap.get("cityManagerId");
+ CityManager cityManager = cmgrClient.queryCityManagerById(managerId);
+ if (ToolUtil.isNotEmpty(cityManager)){
+ stringObjectMap.put("accountName",cityManager.getName()+"+"+cityManager.getPhone());
+ }
+ }
+ }
+ return storeList;
+ }
+
+ /**
+ * 获取 优惠券管理
+ */
+ @RequestMapping(value = "/list")
+ @ResponseBody
+ public Object listOfDatas(String name, Integer type, Integer distributionMethod , Integer userPopulation, Integer status, Integer state) {
+ Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
+ CouponListOfSearch ofSearch = new CouponListOfSearch();
+ ofSearch.setPage(page);
+ ofSearch.setName(name);
+ ofSearch.setType(type);
+ ofSearch.setDistributionMethod(distributionMethod);
+ ofSearch.setUserPopulation(userPopulation);
+ ofSearch.setStatus(status);
+ ofSearch.setState(state);
+ return client.getCouponListOfSearch(ofSearch);
+ }
+ @RequestMapping(value = "/listRecord")
+ @ResponseBody
+ public Object listRecord(Integer id,String name, Integer type, String phone) {
+ Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
+ List<TAppUser> tAppUsers = appUserClient.queryByNamePhone(new QueryByNamePhone(name, phone));
+ if(tAppUsers.size()==0){
+ return new ArrayList<>();
+ }
+ CouponRecordQuery ofSearch = new CouponRecordQuery();
+ ofSearch.setId(id);
+ ofSearch.setLimit(page.getSize());
+ ofSearch.setOffset(page.getCurrent());
+ ofSearch.setIds(tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()));
+ ofSearch.setType(type);
+ List<Map<String, Object>> maps = client.listRecord(ofSearch);
+ for (Map<String, Object> map : maps) {
+ map.put("id",map.get("id").toString());
+ for (TAppUser tAppUser : tAppUsers) {
+ if(map.get("userId").equals(tAppUser.getId())){
+ map.put("name",tAppUser.getName());
+ map.put("phone",tAppUser.getPhone());
+ }
+ }
+ }
+ return maps;
+ }
+
+ @RequestMapping(value = "/getProvince")
+ @ResponseBody
+ public Object getProvince(){
+ return regiService.list(new LambdaQueryWrapper<Region>()
+ .eq(Region::getParentId,0));
+ }
+
+ @RequestMapping(value = "/onShelf")
+ @ResponseBody
+ public Object onShelf(Integer id,Integer type){
+ Coupon coupon = client.queryCouponById(id);
+ coupon.setState(type);
+ client.updateCouponData(coupon);
+ return new SuccessTip<>();
+ }
+
+
+ @RequestMapping(value = "/getCity")
+ @ResponseBody
+ public Object getCity(Integer province){
+ return regiService.list(new LambdaQueryWrapper<Region>()
+ .eq(Region::getParentId,province));
+ }
+
+ @RequestMapping(value = "/uploadPic")
+ @ResponseBody
+ public Object add(@RequestParam("file") MultipartFile imgFile) throws IOException {
+ String originalFilename = imgFile.getOriginalFilename();
+ String newName = originalFilename.substring(imgFile.getOriginalFilename().lastIndexOf("."));
+ String url = OBSUploadUtil.inputStreamUpload(imgFile);
+ Map<String, String> map = new HashMap<String, String>();
+ //是否上传成功
+ map.put("state", "SUCCESS");
+ //现在文件名称
+ map.put("title", newName);
+ //文件原名称
+ map.put("original", originalFilename);
+ //文件类型 .+后缀名
+ map.put("type", originalFilename.substring(imgFile.getOriginalFilename().lastIndexOf(".")));
+ //文件路径
+ map.put("url", url);
+ //文件大小(字节数)
+ map.put("size", imgFile.getSize() + "");
+ System.out.println(map);
+ return url;
+ }
+
+ /**
+ * 提交添加
+ */
+ @PostMapping(value = "/commitData")
+ @ResponseBody
+ public Object commitData( CouponDataVo dataVo){
+ System.out.println(dataVo);
+ Integer objectType = UserExt.getUser().getObjectType();
+ dataVo.setUserType(objectType);
+ client.insertIntoData(dataVo);
+ return new SuccessTip<>();
+ }
+ @PostMapping(value = "/update")
+ @ResponseBody
+ public Object update( Integer id,Integer num,Integer num1,String text){
+ Coupon coupon = client.queryCouponById(id);
+ coupon.setQuantityIssued(num);
+ coupon.setPickUpQuantity(num1);
+ coupon.setIllustrate(text);
+ client.updateCouponData(coupon);
+ return new SuccessTip<>();
+ }
+}
diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntegralController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntegralController.java
index 6d22eac..1268219 100644
--- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntegralController.java
+++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntegralController.java
@@ -60,9 +60,12 @@
public Object list(String name, String phone,Integer type,Integer category,String time) {
Page<UserIntegral> page = new PageFactory<UserIntegral>().defaultPage();
IntegralListQuery integralListQuery = new IntegralListQuery(page.getSize(), page.getCurrent(), name, phone, type, category, time);
- List<UserIntegral> list = client.list(integralListQuery);
- page.setRecords(list);
- return super.packForBT(page);
+ Page<UserIntegral> list = client.list(integralListQuery);
+ return super.packForBT(list);
+ }
+ @RequestMapping("/tIntegral_add")
+ public String tCompetitionAdd(Model model) {
+ return PREFIX + "TIntegral_add.html";
}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCoupon.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCoupon.html
index 84e028e..d394b6d 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCoupon.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCoupon.html
@@ -6,6 +6,7 @@
<h5>优惠券管理</h5>
</div>
<div class="ibox-content">
+
<div class="row row-lg">
<div class="col-sm-12">
<div class="row">
@@ -59,8 +60,8 @@
<div class="hidden-xs" id="TCouponTableToolbar" role="group">
<#button name="添加" icon="fa-plus" clickFun="TCoupon.openAdd()"/>
<#button name="编辑" icon="fa-edit" clickFun="TCoupon.openChange()" space="true"/>
- <#button name="上架" icon="fa-remove" clickFun="TCoupon.onShelf()" space="true"/>
- <#button name="下架" icon="fa-remove" clickFun="TCoupon.offShelf()" space="true"/>
+ <#button name="上架" icon="fa-remove" clickFun="TCoupon.onShelf(1)" space="true"/>
+ <#button name="下架" icon="fa-remove" clickFun="TCoupon.onShelf(2)" space="true"/>
<#button name="查看详情" icon="fa-remove" clickFun="TCoupon.openDetail()" space="true"/>
<#button name="领取记录" icon="fa-remove" clickFun="TCoupon.openCollectionRecord()" space="true"/>
</div>
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponInfo.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponInfo.html
new file mode 100644
index 0000000..2c032f4
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponInfo.html
@@ -0,0 +1,415 @@
+@layout("/common/_container.html"){
+<style>
+ .avatar-uploader .el-upload {
+ border: 1px dashed #d9d9d9;
+ border-radius: 6px;
+ cursor: pointer;
+ position: relative;
+ height: 100px;
+ width: 100px;
+ overflow: hidden;
+ }
+
+ .avatar-uploader .el-upload:hover {
+ border-color: #409eff;
+ }
+ .avatar-uploader-icon {
+ font-size: 28px;
+ color: #8c939d;
+ width: 100px;
+ height: 100px;
+ line-height: 100px;
+ margin-top: 34px;
+ text-align: center;
+ }
+ .avatar {
+ width: 100px;
+ height: 100px;
+ display: block;
+ }
+
+ .col-sm-12 {
+ margin-top: 20px;
+ }
+
+ .col-sm-12 select {
+ height: 33px;
+ }
+</style>
+<div class="ibox float-e-margins">
+ <div class="ibox-content">
+ <input hidden id="t1" value="${item.type}">
+ <input hidden id="t2" value="${item.distributionMethod}">
+ <input hidden id="t3" value="${item.redemptionMethod}">
+ <input hidden id="t4" value="${item.userPopulation}">
+ <input hidden id="t5" value="${item.useScope}">
+ <input hidden id="one" value="${one}">
+ <input hidden id="two" value="${two}">
+ <input hidden id="three" value="${three}">
+ <input hidden id="city" value="${city}">
+ <div class="form-horizontal">
+ <div class="row">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*优惠券名称: </label>
+ <div class="col-sm-9">
+ <input class="form-control" id="name" name="name" autocomplete="off" placeholder="请输入优惠券名称" value="${item.name}" readonly>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*优惠券类型: </label>
+ <input class="col-sm-1" style="margin-left: 2.7%;width: 13px;height: 13px;"
+ name="prescription" onclick="radio1()" checked disabled
+ value="1" type="radio">
+ <label class="col-sm-1" style="margin-left: 10px;width: 17%">满减券: 满</label>
+ <input type="text" class="col-sm-1" id="conditionalAmount" readonly
+ onkeyup="value=value.replace(/\D/g,'')"/>
+ <label class="col-sm-1" style="margin-left: -1.5%;width: 14%"> 元 , 减 </label>
+ <input type="text" class="col-sm-1" id="deductionAmount" readonly
+ onkeyup="value=value.replace(/\D/g,'')"/>
+ <label class="col-sm-1" style="margin-left: -1.5%"> 元</label>
+ </div>
+ <div class="form-group">
+ <input class="col-sm-1" name="prescription" type="radio" value="2" disabled
+ onclick="radio2()"
+ style="margin-left: 24.7%;">
+ <label class="col-sm-1" style="margin-left: -17px;width: 20%;">代金券: 可抵</label>
+ <input class="col-sm-1" id="voucherAmount" readonly />
+ <label class="col-sm-1">元</label>
+ </div>
+ <div class="form-group">
+ <input class="col-sm-1" name="prescription" type="radio" value="3" disabled
+ onclick="radio3()"
+ style="margin-left: 24.7%;">
+ <label class="col-sm-1 control-label" style="margin-left: -1%;width: 14%;margin-top: -5px">体验券: </label>
+ <input class="col-sm-1" style="width: 35%" id="experienceName" name="name"
+ autocomplete="off" placeholder="请输入体验券名称" readonly>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*优惠券说明: </label>
+ <div class="col-sm-9">
+ <textarea type="checkbox" id="illustrate" style="margin-left: 1%;width: 75%;height: 120px"
+ placeholder="请输入优惠券说明" disabled>${item.illustrate}</textarea>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <div class="initialLevel col-sm-12 control-label form-group">
+ <label class="col-sm-3 control-label">*发放方式: </label>
+ <input class="col-sm-1 control-label" name="distributionMethod" type="radio" disabled
+ value="1" checked style="margin-top: 10px"/>
+ <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分购买</label>
+ <input class="col-sm-1 control-label" name="distributionMethod" type="radio" disabled
+ value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-1" style="width: 16%;margin-top: 7px">注册赠送</label>
+ <input class="col-sm-1 control-label" name="distributionMethod" type="radio" disabled
+ value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-1" style="width: 16%;margin-top: 7px">自动发券</label>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="exchangeType" >
+ <div class="col-sm-6">
+ <div class="form-group">
+ <div class="initialLevel col-sm-12 control-label form-group">
+ <label class="col-sm-3 control-label">*兑换方式: </label>
+ <input class="col-sm-1 control-label" onclick="exchangeMethod1()" name="exchangeMethod" type="radio" disabled
+ value="1" style="margin-top: 10px"/>
+ <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分</label>
+ <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod2()" type="radio" disabled
+ value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金+积分</label>
+ <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod3()" type="radio" disabled
+ value="3" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-1" style="width: 9%;margin-top: 7px">现金</label>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="needAmount" >
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*所需现金</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="requiredCash" placeholder="请输入所需现金" name="requiredCash" autocomplete="off" type="text" value="${item.cash}" readonly
+ onkeyup="this.value=this.value.replace(/\D/g,'')">
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="needIntegral" >
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*所需积分</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="requiredPoints" placeholder="请输入所需积分" name="requiredPoints" autocomplete="off" type="text" value="${item.integral}" readonly
+ onkeyup="this.value=this.value.replace(/\D/g,'')">
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <div class="initialLevel col-sm-12 control-label form-group">
+ <label class="col-sm-3 control-label">*用户人群: </label>
+ <input class="col-sm-1 control-label" name="userGroup" type="radio" disabled
+ value="1" checked style="margin-top: 10px"/>
+ <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label>
+ <input class="col-sm-1 control-label" name="userGroup" type="radio" disabled
+ value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label>
+ <input class="col-sm-1 control-label" name="userGroup" type="radio" disabled
+ value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*发放数量</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="quantityIssued" placeholder="请输入发放数量" name="quantityIssued" autocomplete="off" type="text" value="${item.quantityIssued}" readonly
+ onkeyup="this.value=this.value.replace(/\D/g,'')">
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*限领数量</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="pickUpQuantity" placeholder="请输入限领数量" name="pickUpQuantity" autocomplete="off" type="text" value="${item.pickUpQuantity}" readonly
+ onkeyup="this.value=this.value.replace(/\D/g,'')">
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-6">
+ <label class="col-sm-3 control-label">*有效期: </label>
+ <input type="text" style="width: 30%;margin-left: 1%" class="col-sm-3" id="periodOfValidity" value="${s} - ${e}" disabled
+ placeholder="请选择"/>
+ </div>
+ </div>
+
+ <div class="row" id="app" >
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*商品封面: </label>
+ <div class="col-sm-2" style="margin-top: 2%">
+ <img src=${item.cover}>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="app1" >
+ <div class="col-sm-6" style="width: 100%">
+ <div class="form-group">
+ <label class="col-sm-3 control-label" style="width: 15%;margin-left: 7%">*商品图片(请上传不超过五张图片): </label>
+ <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%">
+ @for(i in img){
+ <img src=${i} style="width: 150px">
+ @}
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="belongsCon" >
+ <div class="col-sm-6">
+ <div class="form-group">
+ <div class="initialLevel col-sm-12 control-label form-group">
+ <label class="col-sm-3">*适用范围: </label>
+ <div class="col-sm-3" id="belongsNationwide" >
+ <input class="col-sm-1" onclick="scopeOfApplication1()" name="company" type="radio" disabled
+ value="1" style="margin-top: 10px"/>
+ <label class="col-sm-2" style="width: 68%;margin-top: 7px">全国通用</label>
+ </div>
+ <div class="col-sm-3" id="belongsCity" >
+ <input class="col-sm-1" name="company" onclick="scopeOfApplication2()" type="radio" disabled
+ value="2" style="margin-top: 10px"/>
+ <label class="col-sm-2" style="width: 64%;margin-top: 7px">指定城市</label>
+ </div>
+ <div class="col-sm-3" id="belongsStore" >
+ <input class="col-sm-1" name="company" onclick="scopeOfApplication3()" type="radio" disabled
+ value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-2" style="width: 64%;margin-top: 6px;">指定门店</label>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="citySelect" hidden="hidden">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*指定城市: </label>
+ <table class="table table-bordered" style="width: 70%;margin-left: 228px;" id="">
+ <thead>
+ <tr>
+ <td>省</td>
+ <td>市</td>
+ </tr>
+ @for(c in city){
+ <td>${c.province}</td>
+ <td>${c.city}</td>
+ @}
+ </thead>
+ </table>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="storeSelect" hidden="hidden">
+ <div class="col-sm-6">
+ <div class="form-group">
+ <div class="col-sm-12">
+ <label class="col-sm-3 control-label">*指定门店: </label>
+ </div>
+ <div class="col-sm-12" style="margin-left: -57px;margin-top: 20px">
+ <table class="table table-bordered" style="width: 70%;margin-left: 228px;" id="storeTable">
+ <thead>
+ <tr>
+ <td>所在省市</td>
+ <td>所属账号</td>
+ <td>门店名称</td>
+ </tr>
+ @for(s in store){
+ <td>${s.province}</td>
+ <td>${s.phone}</td>
+ <td>${s.name}</td>
+ @}
+ </thead>
+ </table>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="row btn-group-m-t">
+ <div class="col-sm-10" style="margin-left: 20%;">
+ <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser"
+ clickFun="couponInfoDlg.close()"/>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</div>
+<script src="${ctxPath}/js/vue/vue.js"></script>
+<script src="${ctxPath}/js/elementui/index.js"></script>
+<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css">
+<script src="${ctxPath}/modular/system/tCoupon/TCouponInfo.js"></script>
+<script src="${ctxPath}/modular/system/tCoupon/TStoreInfo.js"></script>
+<script type="text/javascript">
+ window.onload = function() {
+ console.log(12312)
+ }
+ laydate.render({
+ elem: '#periodOfValidity',
+ type: 'date',
+ range: true
+ });
+ var vue1 = new Vue({
+ el: '#app',
+ data: {
+ autoUpload: true,//自动上传
+ imageUrl: '',//模型数据,用于上传图片完成后图片预览
+ dialogVisible: false
+ },
+ methods: {
+ handleAvatarSuccess(res, file) {
+ this.imageUrl = URL.createObjectURL(file.raw);
+ couponInfoDlg.goodsCover = file.response;
+ },
+ beforeAvatarUpload(file) {
+ const isLt2M = file.size / 1024 / 1024 < 10;
+ if (!isLt2M) {
+ this.$message.error('上传图片大小不能超过 10MB!');
+ }
+ return isLt2M;
+ },
+ handleRemove(file, fileList) {
+ couponInfoDlg.goodsCover = '';
+ console.log(couponInfoDlg.goodsCover)
+ },
+ },
+ created() {
+ },
+ });
+
+ var vue2 = new Vue({
+ el: '#app1',
+ data: {
+ autoUpload: true,//自动上传
+ imageUrl1: '',//模型数据,用于上传图片完成后图片预览
+ dialogVisible: false
+ },
+ methods: {
+ handleAvatarSuccess(res, file) {
+ couponInfoDlg.goodsPicArray.push(file);
+ },
+ beforeAvatarUpload(file) {
+ const isLt2M = file.size / 1024 / 1024 < 10;
+ if (!isLt2M) {
+ this.$message.error('上传图片大小不能超过 10MB!');
+ }
+ return isLt2M;
+ },
+ handleRemove(file, fileList) {
+ couponInfoDlg.goodsPicArray = couponInfoDlg.goodsPicArray.filter(item => {
+ return item.uid != file.uid;
+ });
+ },
+ },
+ created() {
+ },
+ });
+
+
+
+</script>
+@}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponRecord.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponRecord.html
new file mode 100644
index 0000000..36db409
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponRecord.html
@@ -0,0 +1,45 @@
+@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">
+ <input hidden id="id" value="${id}">
+ <div class="col-sm-12">
+ <div class="row">
+ <div class="col-sm-3">
+ <#NameCon id="name" name="姓名" />
+ </div>
+ <div class="col-sm-3">
+ <#NameCon id="phone" name="联系方式" />
+ </div>
+ <div class="col-sm-3">
+ <#SelectCon id="type" name="状态" >
+ <option value="">全部</option>
+ <option value="2">已使用</option>
+ <option value="1">未使用</option>
+ </#SelectCon>
+ </div>
+ <div class="col-sm-3">
+ <#button name="搜索" icon="fa-search" clickFun="TCoupon.search()"/>
+ <#button name="重置" icon="fa-trash" clickFun="TCoupon.resetSearch()"/>
+ </div>
+ </div>
+ <div class="hidden-xs" id="TCouponTableToolbar" role="group">
+ @if(type==3){
+ <#button name="核销" icon="fa-plus" clickFun="TCoupon.updateType()"/>
+ @}
+ </div>
+ <#table id="TCouponTable"/>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</div>
+<script src="${ctxPath}/modular/system/tCoupon/TCouponRecord.js"></script>
+@}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TCity_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TCity_edit.html
new file mode 100644
index 0000000..1d8f66c
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TCity_edit.html
@@ -0,0 +1,98 @@
+@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>
+@}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods.html
new file mode 100644
index 0000000..8bea802
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods.html
@@ -0,0 +1,56 @@
+@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">
+ <#NameCon id="name" name="优惠券名称" />
+ </div>
+ <div class="col-sm-3">
+ <#SelectCon id="type" name="优惠券类型">
+ <option value="">全部</option>
+ <option value="1">满减券</option>
+ <option value="2">体验券</option>
+ <option value="3">代金券</option>
+ </#SelectCon>
+ </div>
+ <div class="col-sm-3">
+ <#NameCon id="phone" name="管理员手机号" />
+ </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.openAddTCompetition()"/>
+ <#button name="编辑" icon="fa-edit" clickFun="TCompetition.openTCompetitionDetail()" space="true"/>
+ <#button name="冻结" icon="fa-remove" clickFun="TCompetition.freeze()" space="true"/>
+ <#button name="解冻" icon="fa-remove" clickFun="TCompetition.unfreeze()" space="true"/>
+ <#button name="重置密码" icon="fa-remove" clickFun="TCompetition.reload()" space="true"/>
+
+ </div>
+ <#table id="TCompetitionTable"/>
+ </div>
+ </div>
+ </div>
+</div>
+</div>
+</div>
+<script src="${ctxPath}/modular/system/tGoods/tGoods.js"></script>
+<script>
+ laydate.render({
+ elem: '#createTime'
+ ,range: true
+ ,lang:"en"
+ });
+</script>
+@}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html
new file mode 100644
index 0000000..2a03a9d
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TGoods_add.html
@@ -0,0 +1,363 @@
+@layout("/common/_container.html"){
+<style>
+ .avatar-uploader .el-upload {
+ border: 1px dashed #d9d9d9;
+ border-radius: 6px;
+ cursor: pointer;
+ position: relative;
+ height: 100px;
+ width: 100px;
+ overflow: hidden;
+ }
+
+ .avatar-uploader .el-upload:hover {
+ border-color: #409eff;
+ }
+ .avatar-uploader-icon {
+ font-size: 28px;
+ color: #8c939d;
+ width: 100px;
+ height: 100px;
+ line-height: 100px;
+ margin-top: 34px;
+ text-align: center;
+ }
+ .avatar {
+ width: 100px;
+ height: 100px;
+ display: block;
+ }
+
+ .col-sm-12 {
+ margin-top: 20px;
+ }
+
+ .col-sm-12 select {
+ height: 33px;
+ }
+</style>
+<div class="ibox float-e-margins">
+ <div class="ibox-content">
+ <div class="form-horizontal" id="carInfoForm">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">商品类型:</label>
+ <div class="col-sm-9">
+ <input type="radio" name="type" value="1" checked onclick="updateType(1)"> 实体商品
+ <input type="radio" name="type" value="2"onclick="updateType(2)" > 课包商品
+ <input type="radio" name="type" value="3" onclick="updateType(1)"> 门票商品
+ </div>
+ </div>
+ <div id="b1">
+ <#input id="name" name="商品名称" type="text"/>
+ <#input id="price" name="原价" type="text"/>
+ <div class="form-group">
+ <label class="col-sm-3 control-label">兑换方式:</label>
+ <div class="col-sm-9">
+ <input type="radio" name="redemptionMethod" value="1" checked> 积分
+ <input type="radio" name="redemptionMethod" value="2" > 现金+积分
+ <input type="radio" name="redemptionMethod" value="3" > 现金
+ </div>
+ </div>
+
+
+ <div class="form-group" id="y1" hidden>
+ <label class="col-sm-3 control-label">所需现金:</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="cash" name="cash" type="text">
+
+ </div>
+ </div>
+ <div class="form-group" id="y2">
+ <label class="col-sm-3 control-label">所需积分:</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="integral" name="integral" type="text">
+
+ </div>
+ </div>
+
+ <#avatar id="cover" name="商品封面" />
+ <div class="row" id="app" style="margin-left: 225px;" >
+ <div class="col-sm-6">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">商品图片: </label>
+ <div class="col-sm-2" style="margin-top: 2%">
+ <el-upload
+ class="avatar-uploader"
+ action="/tCouponManage/uploadPic"
+ :on-success="handleAvatarSuccess"
+ accept=".jpg,.jpeg,.png,.JPG,.JPEG"
+ :on-remove="handleRemove"
+ :before-upload="beforeAvatarUpload">
+ <img v-if="imageUrl" :src="imageUrl" class="avatar">
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+ </el-upload>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+
+ <div class="form-group">
+ <label class="col-sm-3 control-label">用户人群:</label>
+ <div class="col-sm-9">
+ <input type="radio" name="userPopulation" value="1" checked> 全部用户
+ <input type="radio" name="userPopulation" value="2" > 年度会员
+ <input type="radio" name="userPopulation" value="3" > 已有学员用户
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-sm-3 control-label">发放数量:</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="quantityIssued" name="quantityIssued" type="text">
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-sm-3 control-label">限领数量:</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="pickUpQuantity" name="pickUpQuantity" type="text">
+ </div>
+ </div>
+ <#input id="startTime" name="有效期" type="text"/>
+
+ <div class="row" id="belongsCon" >
+ <div class="form-group">
+ <div class="form-group">
+ <div class="initialLevel col-sm-12 control-label form-group">
+ <label class="col-sm-3">*适用范围: </label>
+ <div class="col-sm-2" id="belongsNationwide" >
+ <input class="col-sm-1" onclick="scopeOfApplication1()" name="company" type="radio"
+ value="0" checked style="margin-top: 10px"/>
+ <label class="col-sm-1" style="width: 38%;margin-top: 7px">全国通用</label>
+ </div>
+ <div class="col-sm-2" id="belongsCity" >
+ <input class="col-sm-1" name="company" onclick="scopeOfApplication2()" type="radio"
+ value="1" style="margin-top: 10px"/>
+ <label class="col-sm-1" style="width: 38%;margin-top: 7px">指定城市</label>
+ </div>
+ <div class="col-sm-2" id="belongsStore" >
+ <input class="col-sm-1" name="company" onclick="scopeOfApplication3()" type="radio"
+ value="1" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/>
+ <label class="col-sm-1" style="width: 38%;margin-top: 6px;">指定门店</label>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="citySelect" hidden="hidden">
+ <div class="form-group">
+ <div class="form-group">
+ <label class="col-sm-3 control-label">*指定城市: </label>
+ <div class="col-sm-9 control-label">
+ <select class="col-sm-1" id="provinceData" style="margin-top: 1%;width: 25%" onchange="changeCity(null)">
+ <option value="">请选择</option>
+ </select>
+ <label class="col-sm-1" style="width: 9%;margin-top: 7px">省</label>
+ <select class="col-sm-1" style="margin-top: 1%;width: 25%" id="cityData">
+ <option value="">请选择</option>
+ </select>
+ <label class="col-sm-1" style="width: 7%;margin-top: 7px">市</label>
+ <label name="addBranch" class="col-sm-1" onclick="TCarInfoDlg.addBranch()" style="border: 0px;cursor: pointer;margin-top: 1%"><i class="fa fa-plus-circle"></i></label>
+ </div>
+ <div id="cityDemo"></div>
+ </div>
+
+ </div>
+ </div>
+
+ <div class="row" id="storeSelect" hidden="hidden">
+ <div class="form-group">
+ <div class="form-group">
+ <div class="col-sm-12">
+ <label class="col-sm-3 control-label">*指定门店: </label>
+ <button onclick="storeList()"
+ style="height: 22px;width: 82px;background-color: #4a8ff1;color: white;z-index: 15;position:relative;border: none;margin-top: 1%">
+ 选择门店
+ </button>
+ </div>
+ <div class="col-sm-12" style="margin-left: -57px;margin-top: 20px">
+ <table class="table table-bordered" style="width: 70%;margin-left: 228px;" id="storeTable">
+ <thead>
+ <tr>
+ <td>所在省市</td>
+ <td>所属账号</td>
+ <td>门店名称</td>
+ <td>操作</td>
+ </tr>
+ </thead>
+ <tbody id="coun"></tbody>
+ </table>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ <div class="form-group" style="margin-left:262px">
+ <label class="col-sm-1 control-label">兑换说明:</label>
+ <div class="col-sm-5">
+ <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;"></textarea>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label class="col-sm-3 control-label">排序:</label>
+ <div class="col-sm-9">
+ <input class="form-control" id="sort" name="sort" type="text">
+
+ </div>
+ </div>
+ </div>
+
+ <div id="b2" hidden>
+
+ <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>
+
+ </div>
+
+
+ </div>
+</div>
+
+<div class="row btn-group-m-t">
+ <div class="col-sm-10 col-sm-offset-5">
+ <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/>
+ <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/>
+ </div>
+</div>
+
+ </div>
+
+ </div>
+</div>
+<script src="${ctxPath}/js/vue/vue.js"></script>
+<script src="${ctxPath}/js/elementui/index.js"></script>
+<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css">
+<script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script>
+<script src="${ctxPath}/modular/system/tGoods/TStoreInfo.js"></script>
+<script>
+
+ function updateType(e) {
+ if(e==2){
+ $("#b1").hide()
+ $("#b2").show()
+ }else {
+ $("#b2 ").hide()
+ $("#b1").show()
+ }
+ }
+
+
+
+ function changeCity(n){
+
+ var provinceSelect = null;
+ if (n === undefined || n === null || n === ''){
+ provinceSelect = document.getElementById("provinceData");
+ }else {
+ provinceSelect = document.getElementById("provinceData"+n);
+ }
+
+ var citySelect = null;
+ if (n === undefined || n === null || n === ''){
+ citySelect = document.getElementById("cityData");
+ }else {
+ citySelect = document.getElementById("cityData"+n);
+ }
+
+ var selectedProvince = provinceSelect.value;
+ // 清空城市下拉框
+ citySelect.innerHTML = '<option value="">请选择</option>';
+ if (selectedProvince === "") {
+ return;
+ }
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){
+ data.forEach(province => {
+ var option = document.createElement("option");
+ option.value = province.id; // 根据你的数据结构确定省份的id字段
+ option.text = province.name; // 根据你的数据结构确定省份的name字段
+ citySelect.appendChild(option);
+ });
+ },function(data){
+ console.log('data:',data)
+ Feng.error("获取失败!" + data.responseJSON.message + "!");
+ });
+ ajax.set('province',selectedProvince);
+ ajax.start();
+ }
+
+ /**
+ * 全国通用
+ */
+ function scopeOfApplication1() {
+ $("#storeSelect").hide();
+ $("#citySelect").hide();
+ }
+ /**
+ * 指定城市
+ */
+ function scopeOfApplication2() {
+ $("#storeSelect").hide();
+ $("#citySelect").show();
+ }
+ /**
+ * 指定门店
+ */
+ function scopeOfApplication3() {
+ $("#storeSelect").show();
+ $("#citySelect").hide();
+ }
+
+
+
+
+ var vue2 = new Vue({
+ el: '#app',
+ data: {
+ autoUpload: true,//自动上传
+ imageUrl1: '',//模型数据,用于上传图片完成后图片预览
+ dialogVisible: false
+ },
+ methods: {
+ handleAvatarSuccess(res, file) {
+ TCarInfoDlg.goodsPicArray.push(file);
+ },
+ beforeAvatarUpload(file) {
+ const isLt2M = file.size / 1024 / 1024 < 10;
+ if (!isLt2M) {
+ this.$message.error('上传图片大小不能超过 10MB!');
+ }
+ return isLt2M;
+ },
+ handleRemove(file, fileList) {
+ couponInfoDlg.goodsPicArray = couponInfoDlg.goodsPicArray.filter(item => {
+ return item.uid != file.uid;
+ });
+ },
+ },
+ created() {
+ },
+ });
+</script>
+@}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TStoreList.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TStoreList.html
new file mode 100644
index 0000000..7c6e1a5
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tGoods/TStoreList.html
@@ -0,0 +1,58 @@
+@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">
+ <select class="form-control" id="province">
+ <option value="">全部</option>
+ </select>
+ </div>
+ <div class="col-sm-3">
+ <select class="form-control" id="city">
+ <option value="">全部</option>
+ </select>
+ </div>
+ <div class="col-sm-3">
+ <#SelectCon id="userPopulation" name="所属账号" >
+ <option value="">全部</option>
+ </#SelectCon>
+ </div>
+ <div class="col-sm-3">
+ <#NameCon id="storeName" name="门店名称" placeholder="请输入门店名称"/>
+ </div>
+ <div class="col-sm-3">
+ <#button name="搜索" icon="fa-search" clickFun="TStoreProvince.search()"/>
+ <#button name="重置" icon="fa-trash" clickFun="TStoreProvince.resetSearch()"/>
+ </div>
+ </div>
+ <div class="hidden-xs" id="TStoreProvinceTableToolbar" role="group">
+ </div>
+ <#table id="TStoreProvinceTable"/>
+ <div style="margin-left: 30%">
+ <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.storeOfClosePage()"
+ id="closePage" style="width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;">
+ <i class="fa fa-check"></i> 关闭
+ </button>
+
+ <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.saveSelectStores()"
+ id="submit" style="margin-left: 5%;width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;">
+ <i class="fa fa-check"></i> 保存
+ </button>
+ </div>
+ </div>
+ </div>
+</div>
+
+</div>
+</div>
+</div>
+<script src="${ctxPath}/modular/system/tGoods/TStoreInfo.js"></script>
+<script src="${ctxPath}/modular/system/tGoods/TCouponInfo.js"></script>
+@}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral.html
index 46602af..8c91b71 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral.html
@@ -36,12 +36,12 @@
<#NameCon id="time" name="变动时间" />
</div>
<div class="col-sm-3">
- <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/>
- <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/>
+ <#button name="搜索" icon="fa-search" clickFun="TSite.search()"/>
+ <#button name="重置" icon="fa-trash" clickFun="TSite.resetSearch()" space="true"/>
</div>
</div>
<div class="hidden-xs" id="TCompetitionTableToolbar" role="group">
- <#button name="赠送积分" icon="fa-plus" clickFun="TCompetition.openAddTCompetition()"/>
+ <#button name="赠送积分" icon="fa-plus" clickFun="TSite.openAdd()"/>
</div>
<#table id="TSiteTable"/>
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral_add.html
new file mode 100644
index 0000000..fd52d35
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TIntegral_add.html
@@ -0,0 +1,27 @@
+@layout("/common/_container.html"){
+<div class="ibox float-e-margins">
+ <div class="ibox-content">
+ <div class="form-horizontal" id="carInfoForm">
+ <div class="row" id="app1">
+ <#input id="phone" name="用户手机号" type="text" />
+ <#input id="number" name="赠送数量" type="text" />
+
+
+
+ </div>
+ </div>
+</div>
+
+<div class="row btn-group-m-t">
+ <div class="col-sm-10 col-sm-offset-5">
+ <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/>
+ <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/>
+ </div>
+</div>
+
+ </div>
+
+ </div>
+</div>
+<script src="${ctxPath}/modular/system/tIntegral/tIntegral.js"></script>
+@}
diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TShop_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TShop_add.html
deleted file mode 100644
index 5677e41..0000000
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tIntegral/TShop_add.html
+++ /dev/null
@@ -1,181 +0,0 @@
-@layout("/common/_container.html"){
-<style>
- .avatar-uploader .el-upload {
- border: 1px dashed #d9d9d9;
- border-radius: 6px;
- cursor: pointer;
- position: relative;
- height: 100px;
- width: 100px;
- overflow: hidden;
- }
-
- .avatar-uploader .el-upload:hover {
- border-color: #409EFF;
- }
- .avatar-uploader-icon {
- font-size: 28px;
- color: #8c939d;
- width: 100px;
- height: 100px;
- line-height: 100px;
- margin-top: 32px;
- text-align: center;
- }
- .avatar {
- width: 100px;
- height: 100px;
- display: block;
- }
-
- .col-sm-12 {
- margin-top: 20px;
- }
-
- .col-sm-12 select {
- height: 33px;
- }
-</style>
-<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script>
-<div class="ibox float-e-margins">
- <div class="ibox-content">
-
-
- <div class="form-horizontal" id="carInfoForm">
- <input hidden id="role" value="${role}">
- @if(role=='1'){
- <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" onchange="TCarInfoDlg.oneChangeNext(this)">
- <option value="">选择市</option>
- </select>
- </div>
- </div>
- <div class="form-group" >
- <label class="col-sm-3 control-label">所属账号:</label>
- <div class="col-sm-9">
- <select class="form-control" id="account" name="account">
- <option value="">选择账号</option>
- </select>
- </div>
- </div>
- @}
- <#input id="name" name="门店名称" type="text"/>
- <#input id="phone" name="联系电话" type="text"/>
- <div class="form-group">
- <label class="col-sm-3 control-label">门店地址:</label>
- <div class="col-sm-9">
- <input class="form-control" id="address" name="address" type="text" onchange="TCarInfoDlg.searchByStationName(this,1)">
-
- </div>
- </div>
- <div class="col-sm-10" style="margin-left: 397px;width: 70%;" >
- <!-- 创建地图容器-->
- <div id="container" style="height: 500px;" ></div>
- </div>
- <#input id="time" name="营业时间" type="text"/>
- <div class="form-group">
- <label class="col-sm-3 control-label">门店介绍:</label>
- <div class="col-sm-9">
- <textarea id="introduce" style="width: 617px; height: 180px;"></textarea>
- </div>
- </div>
- <#input id="userName" name="店长姓名" type="text"/>
- <#input id="userPhone" name="店长手机号" type="text"/>
- <#avatar id="img" name="门店封面(推荐像素722*360px)" />
- <div class="row" id="app1">
- <div class="col-sm-6" style="width: 100%">
- <div class="form-group">
- <label class="col-sm-3 control-label" style="width: 15%;margin-left: 5%">*实景图片(请上传不超过五张图片): </label>
- <div class="col-sm-2" style="width: 100%;margin-left: 11%;margin-top: 1%">
- <el-upload
- :limit="5"
- class="avatar-uploader"
- action="/tCouponManage/uploadPic"
- list-type="picture-card"
- accept="."
- :on-success="handleAvatarSuccess"
- :on-remove="handleRemove">
- <i class="el-icon-plus"></i>
- </el-upload>
- <el-dialog :visible.sync="dialogVisible">
- <img width="100%" :src="imageUrl1" alt="">
- </div>
- </div>
-
- </div>
- </div>
-
-
- </div>
-</div>
-
-<div class="row btn-group-m-t">
- <div class="col-sm-10 col-sm-offset-5">
- <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/>
- <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/>
- </div>
-</div>
-
- </div>
-
- </div>
-</div>
-<script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script>
-<script src="${ctxPath}/js/vue/vue.js"></script>
-<script src="${ctxPath}/js/elementui/index.js"></script>
-<link rel="stylesheet" href="${ctxPath}/js/elementui/index.css">
-<script>
- laydate.render({
- elem: '#time',
- range:true
- });
-
- var vue2 = new Vue({
- el: '#app1',
- props: {
- // 数量限制
- limit: {
- type: Number,
- default: 2
- },
- },
- data: {
- autoUpload: true,//自动上传
- imageUrl1: '',//模型数据,用于上传图片完成后图片预览
- dialogVisible: false
- },
- methods: {
- handleAvatarSuccess(res, file) {
- couponInfoDlg.goodsPicArray.push(file);
- },
- beforeAvatarUpload(file) {
- const isLt2M = file.size / 1024 / 1024 < 10;
- if (!isLt2M) {
- this.$message.error('上传图片大小不能超过 10MB!');
- }
- return isLt2M;
- },
- handleRemove(file, fileList) {
- couponInfoDlg.goodsPicArray = couponInfoDlg.goodsPicArray.filter(item => {
- return item.uid != file.uid;
- });
- },
- },
- created() {
- },
- });
-</script>
-@}
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCoupon.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCoupon.js
index 7904f52..2f452dd 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCoupon.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCoupon.js
@@ -83,14 +83,103 @@
*/
TCoupon.openChange = function () {
if (this.check()){
- var index = layer.open({
- type: 2,
- title: '编辑',
- area: ['800px', '420px'], //宽高
- fix: false, //不固定
- maxmin: true,
- content: Feng.ctxPath + '/tCouponManage/tCouponManage_add'
+ let id = TCoupon.seItem.id
+ let name = TCoupon.seItem.name
+ let quantityIssued = TCoupon.seItem.quantityIssued
+ let pickUpQuantity = TCoupon.seItem.pickUpQuantity
+ let illustrate = TCoupon.seItem.illustrate
+ let hasPickQty = TCoupon.seItem.hasPickQty
+ 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' +
+ ' <label class="form-control" id="name" >'+name+'</label> '+
+ ' </div>\n' +
+ ' </div>\n'+
+ ' <div class="form-group">\n' +
+ ' <label class="col-sm-3 control-label">发放数量:</label>\n' +
+ ' <div class="col-sm-9">\n' +
+ ' <input class="form-control" id="num" value="'+quantityIssued+'" > '+
+ ' </div>\n' +
+ ' </div>\n' +
+ ' <div class="form-group">\n' +
+ ' <label class="col-sm-3 control-label">限领数量:</label>\n' +
+ ' <div class="col-sm-9">\n' +
+ ' <input class="form-control" id="num1" value="'+pickUpQuantity+'" > '+
+ ' </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 class="form-control" id="text" >'+illustrate+'</textarea> '+
+ ' </div>\n' +
+ ' </div>\n' +
+ ' </div>' +
+ ' </div>' +
+ '</div>'
+ , btn: ['关闭', '保存']
+ , btnAlign: 'c' //按钮居中
+ , shade: 0.5 //不显示遮罩
+ ,load:1
+ , yes: function () {
+ layer.closeAll();
+ },
+ btn2:function () {
+ let num = $("#num").val()
+ if(num==''){
+ Feng.info("请输入发放数量")
+ return false;
+ }
+ let num1 = $("#num1").val()
+ if(num1==''){
+ Feng.info("请输入限领数量")
+ return false;
+ }
+ let text = $("#text").val()
+ if(text==''){
+ Feng.info("请输入优惠券说明")
+ return false;
+ }
+
+ if(num<hasPickQty){
+ Feng.info("发放数量不能小于已领取数量")
+ return false;
+ }
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/update", 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", id);
+ ajax.set("num", num);
+ ajax.set("num1", num1);
+ ajax.set("text", text);
+ ajax.start();
+ layer.closeAll();
+ }
});
+
this.layerIndex = index;
}
};
@@ -100,10 +189,6 @@
/**
* 上架
*/
-TCoupon.onShelf = function () {
-
-
-};
/**
@@ -123,7 +208,7 @@
var index = layer.open({
type: 2,
title: '详情',
- area: ['800px', '420px'], //宽高
+ area: ['100%', '100%'], //宽高
fix: false, //不固定
maxmin: true,
content: Feng.ctxPath + '/tCouponManage/coupon_detail/' + TCoupon.seItem.id
@@ -151,6 +236,21 @@
this.layerIndex = index;
}
};
+TCoupon.onShelf = function (e) {
+ if (this.check()) {
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/onShelf", function(data){
+ if(data.code==200){
+ Feng.success("操作成功!")
+ TCoupon.table.refresh();
+ }
+ },function(data){
+ Feng.error("操作失败!" + data.responseJSON.message + "!");
+ });
+ ajax.set("id",TCoupon.seItem.id)
+ ajax.set("type",e)
+ ajax.start();
+ }
+};
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
index 687001d..ee79454 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
@@ -396,6 +396,57 @@
$(function () {
getProvince(null);
radio1();
+ var OBJradio = document.getElementsByName("prescription")
+ for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio
+ if ($("#t1").val() == OBJradio[i].value) {//判断是否与radio的值相同
+ OBJradio[i].checked = true//修改选中状态
+ }
+ }
+
+ var OBJradio = document.getElementsByName("distributionMethod")
+ for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio
+ if ($("#t2").val() == OBJradio[i].value) {//判断是否与radio的值相同
+ OBJradio[i].checked = true//修改选中状态
+ }
+ }
+ var OBJradio = document.getElementsByName("exchangeMethod")
+ for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio
+ if ($("#t3").val() == OBJradio[i].value) {//判断是否与radio的值相同
+ OBJradio[i].checked = true//修改选中状态
+ }
+ }
+ var OBJradio = document.getElementsByName("userGroup")
+ for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio
+ if ($("#t4").val() == OBJradio[i].value) {//判断是否与radio的值相同
+ OBJradio[i].checked = true//修改选中状态
+ }
+ }
+ var OBJradio = document.getElementsByName("company")
+ for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio
+ if ($("#t5").val() == OBJradio[i].value) {//判断是否与radio的值相同
+ OBJradio[i].checked = true//修改选中状态
+ }
+ }
+ if($("#t5").val() ==2){
+ $("#citySelect").show();
+ }
+ if($("#t5").val() ==3){
+ $("#storeSelect").show();
+ }
+ if($("#t1").val()==1){
+ console.log(1)
+ $("#conditionalAmount").val($("#one").val())
+ $("#deductionAmount").val($("#two").val())
+ }
+ if($("#t1").val()==2){
+ radio2()
+ $("#voucherAmount").val($("#one").val())
+ }
+ if($("#t1").val()==3){
+ console.log(3)
+ $("#experienceName").val($("#three").val())
+ }
+
var userType = $('#userType').val();
if (userType === '1'){
// 兑换方式
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponRecord.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponRecord.js
new file mode 100644
index 0000000..9665595
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponRecord.js
@@ -0,0 +1,264 @@
+/**
+ * 管理初始化
+ */
+var TCoupon = {
+ id: "TCouponTable", //表格id
+ seItem: null, //选中的条目
+ table: null,
+ layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+TCoupon.initColumn = function () {
+ return [
+ {field: 'selectItem', radio: true},
+ {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
+ {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle'},
+ {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle',
+ },
+ {title: '使用状态', field: 'status', visible: true, align: 'center', valign: 'middle',
+ formatter: function (value, row, index) {
+ return {2: "已使用", 1: "未使用"}[value]
+ }},
+ ];
+};
+
+/**
+ * 检查是否选中
+ */
+TCoupon.check = function () {
+ var selected = $('#' + this.id).bootstrapTable('getSelections');
+ if(selected.length == 0){
+ Feng.info("请先选中表格中的某一记录!");
+ return false;
+ }else{
+ TCoupon.seItem = selected[0];
+ return true;
+ }
+};
+
+/**
+ * 点击添加
+ */
+TCoupon.openAdd = function () {
+ var index = layer.open({
+ type: 2,
+ title: '添加',
+ area: ['100%', '100%'], //宽高
+ fix: false, //不固定
+ maxmin: true,
+ content: Feng.ctxPath + '/tCouponManage/coupon_add'
+ });
+ this.layerIndex = index;
+};
+
+
+/**
+ * 点击编辑
+ */
+TCoupon.openChange = function () {
+ if (this.check()){
+ let id = TCoupon.seItem.id
+ let name = TCoupon.seItem.name
+ let quantityIssued = TCoupon.seItem.quantityIssued
+ let pickUpQuantity = TCoupon.seItem.pickUpQuantity
+ let illustrate = TCoupon.seItem.illustrate
+ let hasPickQty = TCoupon.seItem.hasPickQty
+ 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' +
+ ' <label class="form-control" id="name" >'+name+'</label> '+
+ ' </div>\n' +
+ ' </div>\n'+
+ ' <div class="form-group">\n' +
+ ' <label class="col-sm-3 control-label">发放数量:</label>\n' +
+ ' <div class="col-sm-9">\n' +
+ ' <input class="form-control" id="num" value="'+quantityIssued+'" > '+
+ ' </div>\n' +
+ ' </div>\n' +
+ ' <div class="form-group">\n' +
+ ' <label class="col-sm-3 control-label">限领数量:</label>\n' +
+ ' <div class="col-sm-9">\n' +
+ ' <input class="form-control" id="num1" value="'+pickUpQuantity+'" > '+
+ ' </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 class="form-control" id="text" >'+illustrate+'</textarea> '+
+ ' </div>\n' +
+ ' </div>\n' +
+ ' </div>' +
+ ' </div>' +
+ '</div>'
+ , btn: ['关闭', '保存']
+ , btnAlign: 'c' //按钮居中
+ , shade: 0.5 //不显示遮罩
+ ,load:1
+ , yes: function () {
+ layer.closeAll();
+ },
+ btn2:function () {
+ let num = $("#num").val()
+ if(num==''){
+ Feng.info("请输入发放数量")
+ return false;
+ }
+ let num1 = $("#num1").val()
+ if(num1==''){
+ Feng.info("请输入限领数量")
+ return false;
+ }
+ let text = $("#text").val()
+ if(text==''){
+ Feng.info("请输入优惠券说明")
+ return false;
+ }
+
+ if(num<hasPickQty){
+ Feng.info("发放数量不能小于已领取数量")
+ return false;
+ }
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/update", 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", id);
+ ajax.set("num", num);
+ ajax.set("num1", num1);
+ ajax.set("text", text);
+ ajax.start();
+ layer.closeAll();
+ }
+ });
+
+ this.layerIndex = index;
+ }
+};
+
+
+
+/**
+ * 上架
+ */
+
+
+/**
+ * 下架
+ */
+TCoupon.offShelf = function () {
+
+
+};
+
+
+/**
+ * 打开查看详情
+ */
+TCoupon.openDetail = function () {
+ if (this.check()) {
+ var index = layer.open({
+ type: 2,
+ title: '详情',
+ area: ['100%', '100%'], //宽高
+ fix: false, //不固定
+ maxmin: true,
+ content: Feng.ctxPath + '/tCouponManage/coupon_detail/' + TCoupon.seItem.id
+ });
+ this.layerIndex = index;
+ }
+};
+
+
+
+
+/**
+ * 打开领取记录
+ */
+TCoupon.openCollectionRecord = function () {
+ if (this.check()) {
+ var index = layer.open({
+ type: 2,
+ title: '详情',
+ area: ['800px', '420px'], //宽高
+ fix: false, //不固定
+ maxmin: true,
+ content: Feng.ctxPath + '/tCouponManage/coupon_record/' + TCoupon.seItem.id
+ });
+ this.layerIndex = index;
+ }
+};
+TCoupon.updateType = function () {
+ if (this.check()) {
+ if(TCoupon.seItem.status==2){
+ Feng.info("该券已核销")
+ return false;
+ }
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/updateType", function(data){
+ if(data.code==200){
+ Feng.success("核销成功!")
+ TCoupon.table.refresh();
+ }
+ },function(data){
+ Feng.error("核销失败!" + data.responseJSON.message + "!");
+ });
+ ajax.set("id",TCoupon.seItem.id)
+ ajax.start();
+ }
+};
+
+
+
+/**
+ * 查询列表
+ */
+TCoupon.search = function () {
+ var queryData = {};
+ queryData['name'] = $("#name").val();
+ queryData['type'] = $("#type").val();
+ queryData['phone'] = $("#state").val();
+ TCoupon.table.refresh({query: queryData});
+};
+
+
+/**
+ * 重置搜索
+ */
+TCoupon.resetSearch = function () {
+ $("#name").val('');
+ $("#type").val('');
+ $("#phone").val('');
+ TCoupon.search();
+};
+
+$(function () {
+ var defaultColunms = TCoupon.initColumn();
+ var table = new BSTable(TCoupon.id, "/tCouponManage/listRecord?id="+$("#id").val(), defaultColunms);
+ table.setPaginationType("client");
+ TCoupon.table = table.init();
+});
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js
new file mode 100644
index 0000000..329797c
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/TStoreInfo.js
@@ -0,0 +1,157 @@
+/**
+ * 管理初始化
+ */
+var TStoreProvince = {
+ id: "TStoreProvinceTable", //表格id
+ seItem: null, //选中的条目
+ table: null,
+ layerIndex: -1,
+ storeList: []
+};
+
+/**
+ * 初始化表格的列
+ */
+TStoreProvince.initColumn = function () {
+ return [
+ {field: 'selectItem', checkbox: true},
+ {title: '选择', field: '', visible: true, align: 'center', valign: 'middle'},
+ {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
+ {title: '所属账号', field: 'accountName', visible: true, align: 'center', valign: 'middle'},
+ {title: '所在省市', field: 'provinceCity', visible: true, align: 'center', valign: 'middle'},
+ {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'},
+ ];
+};
+
+/**
+ * 检查是否选中
+ */
+TStoreProvince.check = function () {
+ var selected = $('#' + this.id).bootstrapTable('getSelections');
+ if(selected.length == 0){
+ Feng.info("请先选中表格中的某一记录!");
+ return false;
+ }else{
+ TStoreProvince.seItem = selected[0];
+ return true;
+ }
+};
+
+
+TStoreProvince.storeOfClosePage = function (){
+ parent.layer.close(parent.layer.getFrameIndex(window.frameElement.id));
+}
+
+TStoreProvince.saveSelectStores = function (){
+ var selected = $('#' + this.id).bootstrapTable('getSelections');
+ if (selected.length == 0) {
+ Feng.info("请先选中表格中的某一记录!");
+ return false;
+ }
+ var arr = [];
+ console.log('selected--->',selected)
+ for(var i in selected){
+ if(typeof selected[i].id != "undefined"){
+ arr.push({
+ id: selected[i].id,
+ provinceCity: typeof selected[i].provinceCity != "undefined" ? selected[i].provinceCity : "",
+ accountName: typeof selected[i].accountName != "undefined" ? selected[i].accountName : "",
+ name: typeof selected[i].name != "undefined" ? selected[i].name : ""
+ })
+ }
+ }
+ window.parent.TCarInfoDlg.selecUserOpt(arr);
+ TStoreProvince.storeOfClosePage();
+
+}
+
+
+
+/**
+ * 查询列表
+ */
+TStoreProvince.search = function () {
+ var queryData = {};
+
+ var provinceElement = document.getElementById("province");
+ var provinceId = provinceElement.value;
+
+ var cityElement = document.getElementById("city");
+ var cityElementId = cityElement.value;
+
+ queryData['provinceId'] = provinceId;
+ queryData['cityId'] = cityElementId;
+ queryData['cityManagerId'] = $("#userPopulation").val();
+ queryData['storeName'] = $("#storeName").val();
+ TStoreProvince.table.refresh({query: queryData});
+};
+
+
+/**
+ * 重置搜索
+ */
+TStoreProvince.resetSearch = function () {
+ var provinceSelect = document.getElementById("province");
+ provinceSelect.innerHTML = '<option value="">全部</option>';
+
+ var citySelect = document.getElementById("city");
+ citySelect.innerHTML = '<option value="">全部</option>';
+
+ queryProvince();
+
+ $("#userPopulation").val('');
+ $("#storeName").val('');
+ TStoreProvince.search();
+};
+
+function queryProvince(){
+ // 发送AJAX请求到后台获取省份数据
+ // 假设后台返回的数据格式为一个包含省份ID和名称的数组
+ var provinceSelect = document.getElementById("province");
+
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getProvince", function(data){
+ data.forEach(province => {
+ var option = document.createElement("option");
+ option.value = province.id; // 根据你的数据结构确定省份的id字段
+ option.text = province.name; // 根据你的数据结构确定省份的name字段
+ provinceSelect.appendChild(option);
+ });
+ },function(data){
+ Feng.error("下拉失败!" + data.responseJSON.message + "!");
+ });
+ ajax.start();
+ provinceSelect.addEventListener("change", queryCity);
+}
+
+
+// 获取城市数据
+function queryCity() {
+ var selectedProvinceId = this.value; // 获取选择的省份ID
+ // 发送AJAX请求到后台获取对应省份的城市数据
+ // 假设后台返回的数据格式为一个包含城市ID和名称的数组
+
+ var citySelect = document.getElementById("city");
+ citySelect.innerHTML = "";
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){
+ data.forEach(province => {
+ var option = document.createElement("option");
+ option.value = province.id; // 根据你的数据结构确定省份的id字段
+ option.text = province.name; // 根据你的数据结构确定省份的name字段
+ citySelect.appendChild(option);
+ });
+ },function(data){
+ console.log('data:',data)
+ Feng.error("获取失败!" + data.responseJSON.message + "!");
+ });
+ ajax.set('province',selectedProvinceId);
+ ajax.start();
+}
+
+$(function () {
+ var defaultColunms = TStoreProvince.initColumn();
+ var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeDetailsOfSearch", defaultColunms);
+ table.setPaginationType("client");
+ TStoreProvince.table = table.init();
+
+ queryProvince();
+});
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js
new file mode 100644
index 0000000..e6151cd
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods.js
@@ -0,0 +1,384 @@
+/**
+ * 车辆管理管理初始化
+ */
+var TCompetition = {
+ id: "TCompetitionTable", //表格id
+ seItem: null, //选中的条目
+ table: null,
+ layerIndex: -1
+};
+var language =1
+/**
+ * 初始化表格的列
+ */
+TCompetition.initColumn = function () {
+ return [
+ {field: 'selectItem', radio: true},
+ {title: '商品类型', field: 'province', visible: true, align: 'center', valign: 'middle'
+ },
+ {title: '商品名称', field: 'city', visible: true, align: 'center', valign: 'middle'},
+ {title: '商品封面', field: 'name', visible: true, align: 'center', valign: 'middle'
+ },
+ {title: '有效期', field: 'phone', visible: true, align: 'center', valign: 'middle'
+ },
+ {title: '兑换地点', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '用户人群', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '发放数量', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '限领数量', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '已领数量', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '已兑换数量', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '排序', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '活动状态', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ {title: '可售状态', field: 'state', visible: true, align: 'center', valign: 'middle'
+
+ },
+ ];
+};
+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 + '/tGoods/tGoods_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.delete = function () {
+ if (this.check()) {
+ var nickname = TCompetition.seItem.carLicensePlate;
+ if (nickname == "" || nickname == null || nickname == undefined){
+ nickname = "该车辆";
+ }else{
+ nickname = "【"+nickname+"】";
+ }
+ swal({
+ title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"),
+ text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'),
+ type: "warning",
+ showCancelButton: true,
+ confirmButtonColor: "#DD6B55",
+ confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'),
+ closeOnConfirm: true
+ }, function () {
+ var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) {
+ if(language==1){
+ swal("删除成功", "您已经成功删除了" + nickname + "。", "success");
+ }else if(language==2){
+ swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success");
+ }else {
+ swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success");
+ }
+ TCompetition.table.refresh();
+ }, function (data) {
+ if(language==1){
+ swal("删除失败", data.responseJSON.message + "!", "warning");
+ }else if(language==2){
+ swal("Failed to delete", data.responseJSON.message + "!", "warning");
+ }else {
+ swal("Hapus Gagal", data.responseJSON.message + "!", "warning");
+ }
+
+ });
+ ajax.set("TCompetitionId",TCompetition.seItem.id);
+ 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.search = function () {
+ var queryData = {};
+ queryData['provinceCode'] = $("#pCode").val();
+ queryData['cityCode'] = $("#cCode").val();
+ queryData['name'] = $("#name").val();
+ queryData['phone'] = $("#phone").val();
+ TCompetition.table.refresh({query: queryData});
+};
+
+TCompetition.resetSearch = function () {
+ $("#pCode").val("");
+ $("#cCode").val("");
+ $("#name").val("");
+ $("#phone").val("");
+ TCompetition.search();
+};
+
+$(function () {
+ var defaultColunms = TCompetition.initColumn();
+ var table = new BSTable(TCompetition.id, "/tCity/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);
+ }
+}
\ No newline at end of file
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js
new file mode 100644
index 0000000..c314067
--- /dev/null
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tGoods/tGoods_info.js
@@ -0,0 +1,447 @@
+/**
+ * 初始化车辆管理详情对话框
+ */
+var language=1;
+var TCarInfoDlg = {
+ tCarInfoData : {},
+ validateFields: {
+ },
+ goodsPicArray:[],
+ storeIds: [],
+
+};
+
+/**
+ * 验证数据是否为空
+ */
+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');
+}
+function storeList(){
+ var index = layer.open({
+ type: 2,
+ title: '门店列表',
+ area: ['80%', '80%'], //宽高
+ fix: false, //不固定
+ maxmin: true,
+ content: Feng.ctxPath + '/tGoods/storeList'
+ });
+ this.layerIndex = index;
+}
+TCarInfoDlg.selecUserOpt = function (arrays){
+ console.log(arrays)
+ //获取所有的值
+ var subArr= this.storeIds;
+ $(".timeClass").each(function () {
+ subArr.push($(this).find("input[name*='id']").val());
+ });
+ var str = '';
+ for(var i in arrays){
+ var b = true;
+ for(var j in subArr){
+ if(arrays[i].id === Number(subArr[j])){
+ b = false;
+ break
+ }
+ }
+ if(b){
+ this.storeIds.push(arrays[i].id)
+ str += '<tr class="timeClass">' +
+ '<td><input type="hidden" id="id" name="id" value="'+arrays[i].id+'"><input type="hidden" id="provinceCity" name="provinceCity" value="'+arrays[i].provinceCity+'">' + arrays[i].provinceCity + '</td>' +
+ '<td><input type="hidden" id="accountName" name="accountName" value="'+arrays[i].accountName+'">' + arrays[i].accountName + '</td>' +
+ '<td><input type="hidden" id="name" name="name" value="'+arrays[i].name+'">' + arrays[i].name + '</td><td><button onclick="deleteSub(this)">移除</button></td></tr>';
+ }
+ }
+ $("#coun").append(str);
+ console.log('storeIds',this.storeIds)
+}
+function deleteSub(e) {
+ console.log(e);
+ var row = $(e).closest('tr');
+ var value = row.find('#id').val();
+ TCarInfoDlg.storeIds.splice(TCarInfoDlg.storeIds.indexOf(value), 1)
+ $(e).parent().parent().remove();
+ console.log('storeIds',TCarInfoDlg.storeIds)
+}
+TCarInfoDlg.delete = function (o) {
+ $(o).parent("div").remove()
+}
+var num = 0;
+TCarInfoDlg.addBranch = function () {
+ num=num+1;
+ var a= "";
+ a = "<div style=\'margin-left: 25%\' class=\"col-sm-9 control-label\">\n" +
+ " <select class=\"col-sm-1\" id=\'provinceData"+num+"\' style=\"margin-top: 1%;width: 25%\" onchange=\'changeCity("+num+")\'>\n" +
+ " <option value=\"\">请选择</option>\n" +
+ " </select>\n" +
+ " <label class=\"col-sm-1\" style=\"width: 9%;margin-top: 7px\">省</label>\n" +
+ " <select class=\"col-sm-1\" style=\"margin-top: 1%;width: 25%\" id=\'cityData"+num+"\'>\n" +
+ " <option value=\"\">请选择</option>\n" +
+ " </select>\n" +
+ " <label class=\"col-sm-1\" style=\"width: 7%;margin-top: 7px\">市</label>\n" +
+ " <label name=\"addBranch\" class=\"col-sm-1\" onclick=\"TCarInfoDlg.delete(this)\" style=\"border: 0px;cursor: pointer;margin-top: 1%\"><i class=\"fa fa-trash\"></i></label>"+
+ " </div>";
+ $("#cityDemo").append($(a));
+ getProvince(num);
+}
+function changeCity(n){
+
+ var provinceSelect = null;
+ if (n === undefined || n === null || n === ''){
+ provinceSelect = document.getElementById("provinceData");
+ }else {
+ provinceSelect = document.getElementById("provinceData"+n);
+ }
+
+ var citySelect = null;
+ if (n === undefined || n === null || n === ''){
+ citySelect = document.getElementById("cityData");
+ }else {
+ citySelect = document.getElementById("cityData"+n);
+ }
+
+ var selectedProvince = provinceSelect.value;
+ // 清空城市下拉框
+ citySelect.innerHTML = '<option value="">请选择</option>';
+ if (selectedProvince === "") {
+ return;
+ }
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){
+ data.forEach(province => {
+ var option = document.createElement("option");
+ option.value = province.id; // 根据你的数据结构确定省份的id字段
+ option.text = province.name; // 根据你的数据结构确定省份的name字段
+ citySelect.appendChild(option);
+ });
+ },function(data){
+ console.log('data:',data)
+ Feng.error("获取失败!" + data.responseJSON.message + "!");
+ });
+ ajax.set('province',selectedProvince);
+ ajax.start();
+}
+function getProvince(n){
+ var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getProvince", function(data){
+ console.log(data)
+ var provinceSelect = null;
+ if (n === undefined || n === null || ''){
+ provinceSelect = document.getElementById("provinceData");
+ }else {
+ provinceSelect = document.getElementById("provinceData"+n);
+ }
+ data.forEach(province => {
+ var option = document.createElement("option");
+ option.value = province.id; // 根据你的数据结构确定省份的id字段
+ option.text = province.name; // 根据你的数据结构确定省份的name字段
+ provinceSelect.appendChild(option);
+ });
+ },function(data){
+ Feng.error("下拉失败!" + data.responseJSON.message + "!");
+ });
+ ajax.start();
+}
+/**
+ * 提交添加
+ */
+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() {
+ getProvince(null);
+ Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields);
+ // 初始化图片上传
+ var carPhoto = new $WebUpload("cover");
+ carPhoto.setUploadBarId("progressBar");
+ carPhoto.init();
+ var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto");
+ drivingLicensePhoto.setUploadBarId("progressBar");
+ drivingLicensePhoto.init();
+ TCarInfoDlg.editor = UE.getEditor('editor');
+});
+
+/**
+ * 选择分公司后执行
+ */
+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();
+ }
+}
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js b/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js
index b95ac37..700a94f 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tIntegral/tIntegral.js
@@ -15,22 +15,28 @@
return [
{field: 'selectItem', radio: true},
{title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'},
- {title: '省', field: 'insertTime', visible: true, align: 'center', valign: 'middle',width:'20%',
+ {title: '省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'20%',
},
- {title: '市', field: 'name', visible: true, align: 'center', valign: 'middle',
+ {title: '市', field: 'city', visible: true, align: 'center', valign: 'middle',
},
- {title: '姓名', field: 'insertUserId', visible: false, align: 'center', valign: 'middle'},
- {title: '联系电话', field: 'insertUser', visible: true, align: 'center', valign: 'middle',
+ {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle'},
+ {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',
},
- {title: '积分类型', field: 'province', visible: true, align: 'center', valign: 'middle',
+ {title: '积分类型', field: 'type', visible: true, align: 'center', valign: 'middle',
+ formatter:function (data) {
+ return{1:"赠送积分", 2:"兑换商品",3:"完成课后练习",4:"观看教学视频"}[data]
+ }
},
- {title: '积分明细', field: 'lineNum', visible: true, align: 'center', valign: 'middle',
+ {title: '积分明细', field: 'integral', visible: true, align: 'center', valign: 'middle',
},
- {title: '变动类型', field: 'state', visible: true, align: 'center', valign: 'middle',
+ {title: '变动类型', field: 'category', visible: true, align: 'center', valign: 'middle',
+ formatter:function (data) {
+ return{1:"增加", 2:"减少"}[data]
+ }
},
- {title: '时间', field: 'state', visible: true, align: 'center', valign: 'middle',
+ {title: '时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle',
},
- {title: '备注', field: 'state', visible: true, align: 'center', valign: 'middle',
+ {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle',
}
];
};
@@ -71,14 +77,15 @@
/**
* 点击添加跨城站点管理
*/
-TSite.openAddTSite = function () {
+let language =1
+TSite.openAdd = function () {
var index = layer.open({
type: 2,
- title: language==1?'添加':(language==2?'Add':'Tambahkan'),
- area: ['100%', '100%'], //宽高
+ title: language==1?'赠送积分':(language==2?'Add':'Tambahkan'),
+ area: ['50%', '50%'], //宽高
fix: false, //不固定
maxmin: true,
- content: Feng.ctxPath + '/tSite/tSite_add'
+ content: Feng.ctxPath + '/tIntegral/tIntegral_add'
});
this.layerIndex = index;
};
@@ -171,20 +178,20 @@
*/
TSite.search = function () {
var queryData = {};
- queryData['insertTime'] = $("#insertTime").val();
queryData['name'] = $("#name").val();
- queryData['insertUser'] = $("#insertUser").val();
- queryData['city'] = $("#city").val();
- queryData['state'] = $("#state").val();
+ queryData['phone'] = $("#phone").val();
+ queryData['type'] = $("#type").val();
+ queryData['category'] = $("#category").val();
+ queryData['time'] = $("#time").val();
TSite.table.refresh({query: queryData});
};
TSite.resetSearch = function () {
- $("#insertTime").val("");
- $("#name").val("");
- $("#insertUser").val("");
- $("#city").val("");
- $("#state").val("");
+ $("#name").val('');
+ $("#phone").val('');
+ $("#type").val('');
+ $("#category").val('');
+ $("#time").val('');
TSite.search();
};
--
Gitblit v1.7.1