2 コミット 708140be55 ... 4269d3afe7

作者 SHA1 メッセージ 日付
  liujiankang 4269d3afe7 Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent 5 年 前
  liujiankang 5ed232132c Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent 5 年 前
22 ファイル変更1050 行追加273 行削除
  1. 18 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyColor.java
  2. 2 2
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/DeliveryStrategyService.java
  3. 8 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/LogisticsInfoService.java
  4. 7 48
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java
  5. 8 3
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  6. 26 33
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/DeliveryStrategyServiceImpl.java
  7. 11 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/LogisticsInfoServiceImpl.java
  8. 3 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/deliveryStrategyMapper.xml
  9. 9 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/logisticsInfoMapper.xml
  10. 116 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/kuaidi/LogisticsController.java
  11. 12 23
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/DeliveryStrategyController.java
  12. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_repair_list.ftl
  13. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/perfect_detect.ftl
  14. 193 0
      watero-rst-web/src/main/webapp/WEB-INF/views/logistics/add_logistics.ftl
  15. 131 0
      watero-rst-web/src/main/webapp/WEB-INF/views/logistics/logistics_list.ftl
  16. 193 0
      watero-rst-web/src/main/webapp/WEB-INF/views/logistics/update_logistics.ftl
  17. 4 5
      watero-rst-web/src/main/webapp/WEB-INF/views/order/downsingle/downsingleRule_list.ftl
  18. 2 2
      watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/list_wait_send_order.ftl
  19. 1 1
      watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_list.ftl
  20. 149 50
      watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/add_deliveryStrategy.ftl
  21. 7 9
      watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/deliveryStrategy_List.ftl
  22. 148 92
      watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/update_deliveryStrategy.ftl

+ 18 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/StrategyColor.java

@@ -8,6 +8,8 @@ public class StrategyColor implements Serializable {
     private Integer strategyId;
     private Integer colorId;
     private String colorName;
+    private Integer productId;
+    private String productName;
 
     public Integer getStrategyColorId() {
         return strategyColorId;
@@ -40,4 +42,20 @@ public class StrategyColor implements Serializable {
     public void setColorName(String colorName) {
         this.colorName = colorName;
     }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
 }

+ 2 - 2
watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/DeliveryStrategyService.java

@@ -36,13 +36,13 @@ public interface DeliveryStrategyService {
      * @param  deliveryStrategy
      * @return Integer
      */
-    Integer  save(DeliveryStrategy deliveryStrategy);
+    Integer  save(DeliveryStrategy deliveryStrategy,String strategyColorArray);
     /**
      * 修改数据
      * @param  deliveryStrategy
      * @return Integer
      */
-    Integer  update(DeliveryStrategy deliveryStrategy);
+    Integer  update(DeliveryStrategy deliveryStrategy,String strategyColorArray);
     /**
      * 删除数据
      * @param  strategyId

+ 8 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/order/LogisticsInfoService.java

@@ -1,5 +1,7 @@
 package com.iamberry.rst.faces.order;
 
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.tools.LogisticsInfo;
 
 import java.util.List;
@@ -42,4 +44,10 @@ public interface LogisticsInfoService {
      * @return Integer
      */
     Integer  update(LogisticsInfo  logisticsInfo);
+    /**
+     * 获取分页集合
+     * @param  logisticsInfo
+     * @return List
+     */
+    PagedResult<LogisticsInfo> listLogisticsInfo(int pageNO, int pageSize, LogisticsInfo  logisticsInfo, boolean isTotalNum);
 }

+ 7 - 48
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -779,24 +779,6 @@ public class SalesOrderServiceImpl implements SalesOrderService {
             for(DeliveryStrategy strategy : trategyList){
                 if(salesOrder.getSalesCompanyId().equals(strategy.getStrategyCompanyId())){
 
-
-                    /*if(salesOrder.getSalesStoreId().equals(strategy.getStrategyStoreId()) || strategy.getStrategyStoreId() == 0){
-                        if(strategy.getStrategyProvinceNumber() == 0 || (salesOrder.getSalesAddressInfo().indexOf(strategy.getStrategyProvinceName()))!=-1){
-                            //判断产品
-                            for(SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()){
-                                if(strategy.getStrategyProductId() == 0){
-                                        salesOrder.setSalesPostFirm(strategy.getStrategyPostFirm());
-                                        return;
-                                }else if(salesOrderItem.getItemProductId().equals(strategy.getStrategyProductId())){
-                                    if(strategy.getStrategyColorId() == 0 || salesOrderItem.getItemColorId().equals(strategy.getStrategyColorId())){
-                                        salesOrder.setSalesPostFirm(strategy.getStrategyPostFirm());
-                                        return;
-                                    }
-                                }
-                            }
-                        }
-                    }*/
-
                     //判断店铺
                     boolean isMeet1 = false;
                     if(strategy.getStrategyStoreId() == 0){
@@ -808,38 +790,16 @@ public class SalesOrderServiceImpl implements SalesOrderService {
                             }
                         }
                     }
-                    //判断产品
-                    boolean isMeet2 = false;
-                    if(strategy.getStrategyProductId() == 0){
-                        isMeet2 = true;
-                    }else{
-                        for(SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()){
-                            boolean isProduct = false;
-                            for(StrategyProduct strategyProduct : strategy.getListStrategyProduct()){
-                                if(salesOrderItem.getItemProductId().equals(strategyProduct.getProductId())){
-                                    isProduct = true;
-                                    break;
-                                }
-                            }
-                            if(!isProduct){
-                                isMeet2 = false;
-                                break;
-                            }else{
-                                isMeet2 = true;
-                            }
-                        }
-                    }
-                    //判断颜色
+                    //判断产品、颜色
                     boolean isMeet3 = false;
-                    if(strategy.getStrategyProductId() == 0 || strategy.getStrategyColorId() == 0){
-                        isMeet3 = true;
-                    }else{
                         for(SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()){
                             boolean isProduct = false;
                             for(StrategyColor strategyColor : strategy.getListStrategyColor()){
-                                if(salesOrderItem.getItemColorId().equals(strategyColor.getColorId())){
-                                    isProduct = true;
-                                    break;
+                                if(strategyColor.getProductId() == 0 || strategyColor.getProductId().equals(salesOrderItem.getItemProductId())){
+                                    if(strategyColor.getColorId() == 0 ||salesOrderItem.getItemColorId().equals(strategyColor.getColorId())){
+                                        isProduct = true;
+                                        break;
+                                    }
                                 }
                             }
                             if(!isProduct){
@@ -849,8 +809,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
                                 isMeet3 = true;
                             }
                         }
-                    }
-                    if(isMeet1 && isMeet2 && isMeet3){
+                    if(isMeet1  && isMeet3){
                         salesOrder.setSalesPostFirm(strategy.getStrategyPostFirm());
                         return;
                     }

+ 8 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml

@@ -1649,7 +1649,9 @@
     <update id="listSalesPostFirmByIds" parameterType="SalesOrder" >
         update tb_rst_sales_order_info
         SET
-        sales_post_firm = #{salesPostFirm}
+        sales_post_firm = #{salesPostFirm},
+        sales_is_sublist = null,
+        sales_belong_orderId = null
         where
          sales_id IN
          <foreach collection="salesIds" item="node" index="index" separator="," open="(" close=")">
@@ -2508,12 +2510,15 @@
       insert INTO tb_rst_order_strategy_color
       (
         strategy_id,
-        color_id
+        color_id,
+        product_id
       )
       VALUES
       (
         #{strategyId},
-        #{colorId})
+        #{colorId},
+        #{productId}
+        )
     </insert>
     <!-- 添加快递策略店铺项 -->
     <insert id="addStrategyStore" parameterType="StrategyStore">

+ 26 - 33
watero-rst-service/src/main/java/com/iamberry/rst/service/order/DeliveryStrategyServiceImpl.java

@@ -1,6 +1,7 @@
 package com.iamberry.rst.service.order;
 
 import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.cm.SalesOrderItem;
 import com.iamberry.rst.core.order.DeliveryStrategy;
 import com.iamberry.rst.core.order.StrategyColor;
 import com.iamberry.rst.core.order.StrategyProduct;
@@ -11,6 +12,7 @@ import com.iamberry.rst.faces.order.DeliveryStrategyService;
 import com.iamberry.rst.service.cm.mapper.SalesOrderMapper;
 import com.iamberry.rst.service.order.mapper.DeliveryStrategyMapper;
 import com.iamberry.rst.util.PageUtil;
+import net.sf.json.JSONArray;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -47,27 +49,26 @@ public class DeliveryStrategyServiceImpl implements DeliveryStrategyService {
     }
     @Transactional
     @Override
-    public Integer save(DeliveryStrategy deliveryStrategy) {
+    public Integer save(DeliveryStrategy deliveryStrategy,String strategyColorArray) {
         DeliveryStrategy ds2 = new DeliveryStrategy();
         ds2.setStrategyPriority(deliveryStrategy.getStrategyPriority());
         updatePriority(ds2);
+
+
+
+
         deliveryStrategyMapper.save(deliveryStrategy);
+
+        JSONArray jsonArray = JSONArray.fromObject(strategyColorArray);
+        List<StrategyColor> strategyColorList = (List) JSONArray.toCollection(jsonArray, StrategyColor.class);
         //添加策略项
-        if(deliveryStrategy.getStrategyProducts() != null){
-            for(String prductId : deliveryStrategy.getStrategyProducts()){
-                StrategyProduct strategyProduct = new StrategyProduct();
-                strategyProduct.setStrategyId(deliveryStrategy.getStrategyId());
-                strategyProduct.setProductId(Integer.valueOf(prductId));
-                salesOrderMapper.addStrategyProduct(strategyProduct);
-            }
-        }
-        if(deliveryStrategy.getStrategyColors() != null){
-            for(String colorId : deliveryStrategy.getStrategyColors()){
-                StrategyColor strategyColor = new StrategyColor();
-                strategyColor.setStrategyId(deliveryStrategy.getStrategyId());
-                strategyColor.setColorId(Integer.valueOf(colorId));
-                salesOrderMapper.addStrategyColor(strategyColor);
-            }
+
+        for(StrategyColor strategyColor : strategyColorList){
+                StrategyColor color = new StrategyColor();
+                color.setStrategyId(deliveryStrategy.getStrategyId());
+                color.setColorId(Integer.valueOf(strategyColor.getColorId()));
+                color.setProductId(Integer.valueOf(strategyColor.getProductId()));
+                salesOrderMapper.addStrategyColor(color);
         }
         if(deliveryStrategy.getStrategyStores() != null){
             for(String storeId : deliveryStrategy.getStrategyStores()){
@@ -81,7 +82,7 @@ public class DeliveryStrategyServiceImpl implements DeliveryStrategyService {
     }
     @Transactional
     @Override
-    public Integer update(DeliveryStrategy deliveryStrategy) {
+    public Integer update(DeliveryStrategy deliveryStrategy,String strategyColorArray) {
         if(deliveryStrategy.getStrategyPriority() != null){
             DeliveryStrategy ds2 = new DeliveryStrategy();
             ds2.setStrategyPriority(deliveryStrategy.getStrategyPriority());
@@ -90,24 +91,16 @@ public class DeliveryStrategyServiceImpl implements DeliveryStrategyService {
         }
         //删除策略项
         deliveryStrategyMapper.delStrategyStore(deliveryStrategy.getStrategyId());
-        deliveryStrategyMapper.delStrategyProduct(deliveryStrategy.getStrategyId());
         deliveryStrategyMapper.delStrategyColor(deliveryStrategy.getStrategyId());
         //添加策略项
-        if(deliveryStrategy.getStrategyProducts() != null){
-            for(String prductId : deliveryStrategy.getStrategyProducts()){
-                StrategyProduct strategyProduct = new StrategyProduct();
-                strategyProduct.setStrategyId(deliveryStrategy.getStrategyId());
-                strategyProduct.setProductId(Integer.valueOf(prductId));
-                salesOrderMapper.addStrategyProduct(strategyProduct);
-            }
-        }
-        if(deliveryStrategy.getStrategyColors() != null){
-            for(String colorId : deliveryStrategy.getStrategyColors()){
-                StrategyColor strategyColor = new StrategyColor();
-                strategyColor.setStrategyId(deliveryStrategy.getStrategyId());
-                strategyColor.setColorId(Integer.valueOf(colorId));
-                salesOrderMapper.addStrategyColor(strategyColor);
-            }
+        JSONArray jsonArray = JSONArray.fromObject(strategyColorArray);
+        List<StrategyColor> strategyColorList = (List) JSONArray.toCollection(jsonArray, StrategyColor.class);
+        for(StrategyColor strategyColor : strategyColorList){
+            StrategyColor color = new StrategyColor();
+            color.setStrategyId(deliveryStrategy.getStrategyId());
+            color.setColorId(Integer.valueOf(strategyColor.getColorId()));
+            color.setProductId(Integer.valueOf(strategyColor.getProductId()));
+            salesOrderMapper.addStrategyColor(color);
         }
         if(deliveryStrategy.getStrategyStores() != null){
             for(String storeId : deliveryStrategy.getStrategyStores()){

+ 11 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/order/LogisticsInfoServiceImpl.java

@@ -1,8 +1,12 @@
 package com.iamberry.rst.service.order;
 
+import com.github.pagehelper.PageHelper;
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.tools.LogisticsInfo;
 import com.iamberry.rst.faces.order.LogisticsInfoService;
 import com.iamberry.rst.service.order.mapper.LogisticsInfoMapper;
+import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -66,4 +70,11 @@ public class LogisticsInfoServiceImpl  implements LogisticsInfoService {
     public  Integer  update(LogisticsInfo  logisticsInfo){
         return  logisticsInfoMapper.update(logisticsInfo);
     }
+
+    @Override
+    public PagedResult<LogisticsInfo> listLogisticsInfo(int pageNO, int pageSize, LogisticsInfo logisticsInfo, boolean isTotalNum) {
+        PageHelper.startPage(pageNO, pageSize, isTotalNum);
+        List<LogisticsInfo> list = logisticsInfoMapper.getLogisticsInfoList(logisticsInfo);
+        return PageUtil.getPage(list);
+    }
 }

+ 3 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/deliveryStrategyMapper.xml

@@ -194,9 +194,11 @@
     <select id="selectStrategyColor" parameterType="Integer" resultType="StrategyColor">
         SELECT
         sc.*,
-        pc.color_name AS colorName
+        pc.color_name AS colorName,
+        pi.product_name AS productName
         FROM tb_rst_order_strategy_color sc
         LEFT JOIN tb_rst_product_color pc on sc.color_id = pc.color_id
+        LEFT JOIN tb_rst_product_info pi on sc.product_id = pi.product_id
         where
         strategy_id = #{strategyId}
     </select>

+ 9 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/order/mapper/logisticsInfoMapper.xml

@@ -59,7 +59,9 @@
         logistics_rst_code,
         logistics_efast_code,
         logistics_onehundred_code,
-        logistics_reamk
+        logistics_reamk,
+        create_date,
+        logistics_is_lash_single
         )
         values
         (
@@ -67,7 +69,9 @@
         #{logisticsRstCode},
         #{logisticsEfastCode},
         #{logisticsOnehundredCode},
-        #{logisticsReamk}
+        #{logisticsReamk},
+        NOW(),
+        #{logisticsIsLashSingle}
         )
     </insert>
     <update id="update" parameterType="LogisticsInfo" >
@@ -89,6 +93,9 @@
             <if test="logisticsReamk != null and logisticsReamk != ''">
                 logistics_reamk = #{logisticsReamk},
             </if >
+            <if test="logisticsIsLashSingle != null and logisticsIsLashSingle != ''">
+                logistics_is_lash_single = #{logisticsIsLashSingle}
+            </if >
         </set >
         where logistics_id= #{logisticsId}
     </update>

+ 116 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/kuaidi/LogisticsController.java

@@ -1,19 +1,28 @@
 package com.iamberry.rst.controllers.kuaidi;
 
+import com.iamberry.rst.core.order.*;
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.tools.LogisticsInfo;
 import com.iamberry.rst.faces.order.LogisticsInfoService;
 import com.iamberry.rst.core.tools.KuaiDi100;
 import com.iamberry.rst.utils.ResultMsg;
+import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.NameUtils;
+import com.iamberry.wechat.tools.ResponseJson;
 import com.iamberry.wechat.tools.ResultInfo;
+import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -56,4 +65,111 @@ public class LogisticsController {
         msg.setStatus(true);
         return msg;
     }
+
+    /**
+     * 快递列表
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("Logistics:list:Logistics")
+    @RequestMapping("/logistics_list")
+    public ModelAndView logistics_list(HttpServletRequest request, LogisticsInfo logisticsInfo,
+                                       @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
+                                       @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
+                                       @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
+        ModelAndView mv = new ModelAndView("logistics/logistics_list");
+
+        PagedResult<LogisticsInfo> pagedResult = logisticsInfoService.listLogisticsInfo(pageNO, pageSize, logisticsInfo, totalNum == 0);
+        if (totalNum != 0){
+            pagedResult.setTotal(totalNum);
+        }
+
+        StitchAttrUtil.getSa()
+                .setModelAndView(logisticsInfo, mv, "/logistics/logistics_list", pagedResult);
+        return mv;
+    }
+
+    /**
+     * 到添加页面产品
+     * @param request
+     * @return
+     */
+    @RequestMapping("/to_add_Logistics")
+    public ModelAndView to_add_Logistics(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("logistics/add_logistics");
+        return mv;
+    }
+
+    /**
+     * 添加产品
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/add_Logistics")
+    public ResponseJson addLogistics(HttpServletRequest request, LogisticsInfo logisticsInfo) {
+        ResponseJson rj = ResponseJson.getSUCCESS();
+        if(logisticsInfo == null){
+            rj = ResponseJson.getFAILURE();
+            return  rj;
+        }
+        Integer flag = 0;
+        try{
+            flag = logisticsInfoService.save(logisticsInfo);
+        }catch (RuntimeException e){
+            e.printStackTrace();
+            rj = ResponseJson.getFAILURE();
+            rj.setResultMsg("增加快递失败,失败原因:"+e.getMessage());
+            return  rj;
+        }
+        if(flag > 0){
+            rj.setResultMsg("添加成功");
+            return rj;
+        }else{
+            rj = ResponseJson.getFAILURE();
+            return  rj;
+        }
+    }
+    /**
+     * 到修改页面快递
+     * @param request
+     * @return
+     */
+    @RequestMapping("/to_update_Logistics")
+    public ModelAndView to_update_Logistics(HttpServletRequest request,Integer logisticsId) {
+        ModelAndView mv = new ModelAndView("logistics/update_logistics");
+        LogisticsInfo logisticsInfo = logisticsInfoService.getLogisticsInfoById(logisticsId);
+        mv.addObject("logisticsInfo",logisticsInfo);
+        return mv;
+    }
+    /**
+     * 修改产品
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/update_Logistics")
+    public ResponseJson update_Logistics(HttpServletRequest request, LogisticsInfo logisticsInfo) {
+        ResponseJson rj = ResponseJson.getSUCCESS();
+        if(logisticsInfo == null){
+            rj = ResponseJson.getFAILURE();
+            return  rj;
+        }
+        Integer flag = 0;
+        try{
+            flag = logisticsInfoService.update(logisticsInfo);
+        }catch (RuntimeException e){
+            e.printStackTrace();
+            rj = ResponseJson.getFAILURE();
+            rj.setResultMsg("修改快递失败,失败原因:"+e.getMessage());
+            return  rj;
+        }
+        if(flag > 0){
+            rj.setResultMsg("修改成功");
+            return rj;
+        }else{
+            rj = ResponseJson.getFAILURE();
+            return  rj;
+        }
+    }
 }

+ 12 - 23
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/DeliveryStrategyController.java

@@ -18,6 +18,8 @@ import com.iamberry.rst.faces.order.LogisticsInfoService;
 import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.ResponseJson;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -125,22 +127,23 @@ public class DeliveryStrategyController {
      */
     @ResponseBody
     @RequestMapping(value = "/addDeliveryStrategy")
-    public ResponseJson addDeliveryStrategy(HttpServletRequest request, DeliveryStrategy deliveryStrategy) throws Exception {
+    public ResponseJson addDeliveryStrategy(HttpServletRequest request, DeliveryStrategy deliveryStrategy,String strategyColorArray) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(deliveryStrategy == null ){
             msg.setResultCode(500);
             msg.setReturnCode(500);
             return msg;
         }
+        JSONArray jsonArray = JSONArray.fromObject(strategyColorArray);
+        JSONObject jsonArray2  = jsonArray.getJSONObject(0);
+
         String[] storeId1 = request.getParameterValues("storeId1");
-        String[] productId1 = request.getParameterValues("productId1");
-        String[] productColorId1 = request.getParameterValues("productColorId1");
         if(storeId1 != null && storeId1.length > 0){
             deliveryStrategy.setStrategyStoreId(1);
             deliveryStrategy.setStrategyStores(storeId1);
         }else{
             deliveryStrategy.setStrategyStoreId(0);
-        }
+        }/*
         if(productId1 != null && productId1.length > 0){
             deliveryStrategy.setStrategyProductId(1);
             deliveryStrategy.setStrategyProducts(productId1);
@@ -153,10 +156,10 @@ public class DeliveryStrategyController {
         }else{
             deliveryStrategy.setStrategyProductId(0);
             deliveryStrategy.setStrategyColorId(0);
-        }
+        }*/
 
         deliveryStrategy.setStrategyStatus(1);
-        if(deliveryStrategyService.save(deliveryStrategy) > 0){
+        if(deliveryStrategyService.save(deliveryStrategy,strategyColorArray) > 0){
             msg.setResultCode(200);
             msg.setReturnCode(200);
         }else{
@@ -212,7 +215,7 @@ public class DeliveryStrategyController {
      */
     @ResponseBody
     @RequestMapping(value = "/updateDeliveryStrategy")
-    public ResponseJson updateDeliveryStrategy(HttpServletRequest request, DeliveryStrategy deliveryStrategy) throws Exception {
+    public ResponseJson updateDeliveryStrategy(HttpServletRequest request, DeliveryStrategy deliveryStrategy,String strategyColorArray) throws Exception {
         ResponseJson msg = new ResponseJson();
         if(deliveryStrategy == null ){
             msg.setResultCode(500);
@@ -220,28 +223,14 @@ public class DeliveryStrategyController {
             return msg;
         }
         String[] storeId1 = request.getParameterValues("storeId1");
-        String[] productId1 = request.getParameterValues("productId1");
-        String[] productColorId1 = request.getParameterValues("productColorId1");
         if(storeId1 != null && storeId1.length > 0){
             deliveryStrategy.setStrategyStoreId(1);
             deliveryStrategy.setStrategyStores(storeId1);
         }else{
             deliveryStrategy.setStrategyStoreId(0);
         }
-        if(productId1 != null && productId1.length > 0){
-            deliveryStrategy.setStrategyProductId(1);
-            deliveryStrategy.setStrategyProducts(productId1);
-            if(productColorId1 != null && productColorId1.length > 0){
-                deliveryStrategy.setStrategyColorId(1);
-                deliveryStrategy.setStrategyColors(productColorId1);
-            }else{
-                deliveryStrategy.setStrategyColorId(0);
-            }
-        }else{
-            deliveryStrategy.setStrategyProductId(0);
-            deliveryStrategy.setStrategyColorId(0);
-        }
-        if(deliveryStrategyService.update(deliveryStrategy) > 0){
+
+        if(deliveryStrategyService.update(deliveryStrategy,strategyColorArray) > 0){
             msg.setResultCode(200);
             msg.setReturnCode(200);
         }else{

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_repair_list.ftl

@@ -208,7 +208,7 @@
                             </#if>
                             <#if detect.detectState == 40>
                                 <a style="text-decoration:none" href="javascript:;" title="完善信息"
-                                   onclick="add_remark('完善信息','${path}/admin/detect/to_perfect_detect?detectId=${detect.detectId!''}','600','650');">
+                                   onclick="add_remark('完善信息','${path}/admin/detect/to_perfect_detect?detectId=${detect.detectId!''}','800','650');">
                                     <i class="Hui-iconfont">完善信息</i>
                                 </a><br>
                             </#if>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/perfect_detect.ftl

@@ -472,7 +472,7 @@
         disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
         inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
         placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
-        width: '320px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+        width: '180px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
         max_shown_results: 1000, //下拉框最大显示选项数量
         display_disabled_options: false,
         single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除

+ 193 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/logistics/add_logistics.ftl

@@ -0,0 +1,193 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta http-equiv="Cache-Control" content="no-siteapp"/>
+<#include "/base/add_base.ftl">
+
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;color: #50a2ea;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
+        #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
+        .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
+        .ac_results li {border:1px solid #fff}
+        .ac_results li a span {float:right}
+        .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
+        .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 15px;}
+        .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
+        .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
+        .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent  #32a3d8 transparent transparent;font-size:0; line-height:0;}
+        .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
+        .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
+        .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
+        .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
+        .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
+        .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
+        .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent  transparent  transparent #32a3d8;font-size:0; line-height:0;}
+        .time-line-list>li:first-child .arrow{display: none;}
+        .table-bg th{background-color: #e2f6ff;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+        .msg-phone{height: 35px;line-height: 35px;}
+        .col-sm-1{width: 10%;}
+        .all_down{text-decoration: underline;color: #00c;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+
+    </style>
+    <title>添加产品 - 产品管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">/</span> 快递管理
+    <span class="c-gray en">/</span> 添加快递公司
+    <a class="btn radius r"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+    <a class="btn radius r"
+       href="javascript:history.back(-1);" title="后退"><i class="Hui-iconfont">&#xe6d4;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+        <form action="#" method="post" class="form form-horizontal" id="form-admin-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>快递名称:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="快递名称" id="logisticsName" name="logisticsName" datatype="*1-32" errormsg="快递名称格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>rst物流代码:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写rst物流代码" id="logisticsRstCode" name="logisticsRstCode" datatype="*1-32" errormsg="rst物流代码格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>Efast物流代码:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写Efast物流代码" id="logisticsEfastCode" name="logisticsEfastCode" datatype="*1-32" errormsg="Efast物流代码格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>快递100物流代码:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写快递100物流代码" id="logisticsOnehundredCode" name="logisticsOnehundredCode" datatype="*1-32" errormsg="快递100物流代码格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>是否支持子母单:</label>
+                <div class="formControls col-4 col-sm-4">
+                    <div class="radio-box">
+                        <input type="radio" id="logisticsIsLashSingle-1" name="logisticsIsLashSingle" value="1" checked>
+                        <label for="logisticsIsLashSingle-1">是&nbsp;&nbsp;&nbsp;</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="logisticsIsLashSingle-2" name="logisticsIsLashSingle" value="2">
+                        <label for="logisticsIsLashSingle-2">否</label>
+                    </div>
+                </div>
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1">备注:</label>
+                <div class="formControls col-3 col-sm-3" style="">
+                    <textarea id="logisticsReamk" name="logisticsReamk" style="width: 100%;"></textarea>
+                </div>
+            </div>
+
+            <div class="row cl" style="margin-bottom: 20px">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <button class="btn btn-block btn-primary size-XL" onclick="add();" type="button">确认录入</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</article>
+
+<script type="text/javascript">
+    var url_path = "${path}";
+</script>
+<#--时间控件-->
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
+
+<script type="text/javascript">
+    $('.skin-minimal input').iCheck({
+        checkboxClass: 'icheckbox-blue',
+        radioClass: 'iradio-blue',
+        increaseArea: '20%'
+    });
+
+    function  add() {
+        var logisticsName = $("#logisticsName").val();
+        if( logisticsName != null && "" != logisticsName){
+            if( logisticsName.length > 30 ){
+                layer.msg('快递名称不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('快递名称不能为空',{icon: 5,time:1000});
+            return;
+        }
+        var logisticsRstCode = $("#logisticsRstCode").val();
+        if( logisticsRstCode != null && "" != logisticsRstCode){
+            if( logisticsRstCode.length > 30 ){
+                layer.msg('rst物流代码不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('rst物流代码不能为空',{icon: 5,time:1000});
+            return;
+        }
+        var logisticsEfastCode = $("#logisticsEfastCode").val();
+        if( logisticsEfastCode != null && "" != logisticsEfastCode){
+            if( logisticsEfastCode.length > 30 ){
+                layer.msg('Efast物流代码不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('Efast物流代码不能为空',{icon: 5,time:1000});
+            return;
+        }
+        var logisticsOnehundredCode = $("#logisticsOnehundredCode").val();
+        if( logisticsOnehundredCode != null && "" != logisticsOnehundredCode){
+            if( logisticsOnehundredCode.length > 30 ){
+                layer.msg('快递100物流代码不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('快递100物流代码不能为空',{icon: 5,time:1000});
+            return;
+        }
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/logistics/add_Logistics",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                alert(1);
+                if (data.returnCode == 200) {
+                    layer.msg('添加成功',{icon: 1,time:2000},function () {
+                        location.href =  "${path}/logistics/logistics_list";
+                    });
+                } else {
+                    layer.msg('添加失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('添加错误',{icon: 5,time:1000});
+            }
+        });
+    }
+
+
+</script>
+
+</body>
+</html>

+ 131 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/logistics/logistics_list.ftl

@@ -0,0 +1,131 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <link rel="Bookmark" href="/favicon.ico" >
+    <link rel="Shortcut Icon" href="/favicon.ico" />
+<#include "/base/list_base.ftl">
+    <title>订单批次列表</title>
+    <style>
+        html{-webkit-text-size-adjust:none;}
+        *{padding: 0;margin: 0;}
+        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
+        /*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-11.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #50a2ea;padding: 1px 25px;height: 32px;background-color: #fff;color: #50a2ea;}
+        .barcodeImg{margin:10px 0px}
+        .table-bg thead th{background-color: #e2f6ff;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">/</span> 快递管理
+    <span class="c-gray en">/</span> 快递列表
+    <a class="btn radius r" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="page-container">
+    <div class="text-c">
+        <form action="${path}/admin/product/product_page" method="post">
+
+            <div style="position: relative;float: left;display: block;width: 110px;height: 32px;"  >
+                <button type="button" style="cursor:pointer;" class="my-btn-search my-order" id="addProduct" onclick="to_add()" >添加快递</button>
+            </div>
+
+          <#--  <select class="my-select" name="productType" id="productType" style="height: 36px;width: 132px;margin: 0px;padding: 12px 10px 6px 15px;margin-bottom: 10px;">
+                <option value="">产品分类</option>
+                <#list productTypeList as productType>
+                    <option value="${productType.typeId}"  <#if product.productType??><#if product.productType == productType.typeId >selected="selected"</#if></#if> >${productType.typeName}</option>
+                </#list>
+            </select>
+
+            <select class="my-select" name="productStatus" id="productStatus" style="height: 36px;width: 132px;margin: 0px;padding: 12px 10px 6px 15px;margin-bottom: 10px;">
+                <option value="">状态</option>
+                <option value="1" <#if product.productStatus??><#if product.productStatus == 1 >selected="selected"</#if></#if>>使用</option>
+                <option value="2" <#if product.productStatus??><#if product.productStatus == 2 >selected="selected"</#if></#if>>禁用</option>
+            </select>
+
+            <input type="text" class="my-input trim_input"  style="width:120px;margin-right: 0px; margin-bottom: 8px;" value="${product.productName!}" placeholder="产品名称" id="productName" name="productName">
+            <input type="text" class="my-input trim_input"  style="width:120px;margin-right: 0px; margin-bottom: 8px;" value="${product.colorName!}" placeholder="颜色名称" id="colorName" name="colorName">
+            <input type="text" class="my-input trim_input"  style="width:120px;margin-right: 0px; margin-bottom: 8px;" value="${product.colorBar!}" placeholder="69码" id="colorBar" name="colorBar">
+
+            <button type="submit" class="btn" style="background: #50a2ea;border: 1px solid #50a2ea;color: #fff;height: 35px;margin-top: -8px;"><i class="Hui-iconfont">&#xe665;</i> 查询</button>-->
+
+        </form>
+    </div>
+
+    <div class="mt-20">
+        <table class="table table-border table-bordered table-bg table-hover table-sort">
+            <thead>
+                <tr class="text-c">
+                    <th width="50">物流公司名称</th>
+                    <th width="100">rst物流公司代码</th>
+                    <th width="50">快递100物流公司代码</th>
+                    <th width="50">备注</th>
+                    <th width="80">是否支持子母单</th>
+                    <th width="80">创建时间</th>
+                    <th width="80">操作</th>
+                </tr>
+            </thead>
+        <tbody>
+            <#if page.dataList?? &&  (page.dataList?size > 0) >
+                    <#list page.dataList as logisticsInfo>
+                        <tr class="text-c">
+                            <td>${logisticsInfo.logisticsName!''}</td>
+                            <td>${logisticsInfo.logisticsRstCode!''}</td>
+                            <td>${logisticsInfo.logisticsOnehundredCode!''}</td>
+                            <td>
+                                ${logisticsInfo.logisticsReamk!''}
+                            </td>
+                            <td>
+                                <#if logisticsInfo.logisticsIsLashSingle == 1>
+                                    是
+                                <#elseif logisticsInfo.logisticsIsLashSingle == 2>
+                                    否
+                                </#if>
+                            </td>
+                            <td>${(logisticsInfo.createDate?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                            <td>
+                                <a style="text-decoration:none;color: #00E;" href="javascript:void(0);" title="修改" onclick="to_update('${logisticsInfo.logisticsId!''}')">
+                                    修改
+                                </a>
+                            </td>
+                        </tr>
+                    </#list>
+            <#else>
+                <tr><td colspan="7" class="td-manage text-c" >暂时没有快递公司,请添加!</td></tr>
+            </#if>
+        </tbody>
+    </table>
+    </div>
+</div>
+<tfoot>
+<#include "/base/page_util.ftl">
+</tfoot>
+<script>
+
+    /**
+     *跳转到添加
+     * @param employee
+     */
+    function to_add() {
+        window.location.href= "${path}/logistics/to_add_Logistics";
+    }
+
+    /**
+     *跳转到修改产品
+     * @param employee
+     */
+    function to_update(logisticsId) {
+        window.location.href= "${path}/logistics/to_update_Logistics?logisticsId="+logisticsId;
+    }
+
+
+</script>
+</body>
+</html>

+ 193 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/logistics/update_logistics.ftl

@@ -0,0 +1,193 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta http-equiv="Cache-Control" content="no-siteapp"/>
+<#include "/base/add_base.ftl">
+
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;color: #50a2ea;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 50%;height: 6px;width: 6px;border-radius: 6px;margin-top: -3px; background-color: #32a3d8;}
+        #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
+        .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
+        .ac_results li {border:1px solid #fff}
+        .ac_results li a span {float:right}
+        .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
+        .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 15px;}
+        .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
+        .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
+        .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent  #32a3d8 transparent transparent;font-size:0; line-height:0;}
+        .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
+        .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
+        .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
+        .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
+        .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
+        .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
+        .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent  transparent  transparent #32a3d8;font-size:0; line-height:0;}
+        .time-line-list>li:first-child .arrow{display: none;}
+        .table-bg th{background-color: #e2f6ff;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+        .msg-phone{height: 35px;line-height: 35px;}
+        .col-sm-1{width: 10%;}
+        .all_down{text-decoration: underline;color: #00c;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+
+    </style>
+    <title>添加产品 - 产品管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">/</span> 快递管理
+    <span class="c-gray en">/</span> 修改快递公司
+    <a class="btn radius r"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+    <a class="btn radius r"
+       href="javascript:history.back(-1);" title="后退"><i class="Hui-iconfont">&#xe6d4;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+        <form action="#" method="post" class="form form-horizontal" id="form-admin-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>快递名称:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="${logisticsInfo.logisticsName!''}" placeholder="快递名称" id="logisticsName" name="logisticsName" datatype="*1-32" errormsg="快递名称格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>rst物流代码:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="${logisticsInfo.logisticsRstCode!''}" placeholder="填写rst物流代码" id="logisticsRstCode" name="logisticsRstCode" datatype="*1-32" errormsg="rst物流代码格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>Efast物流代码:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="${logisticsInfo.logisticsEfastCode!''}" placeholder="填写Efast物流代码" id="logisticsEfastCode" name="logisticsEfastCode" datatype="*1-32" errormsg="Efast物流代码格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>快递100物流代码:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="${logisticsInfo.logisticsOnehundredCode!''}" placeholder="填写快递100物流代码" id="logisticsOnehundredCode" name="logisticsOnehundredCode" datatype="*1-32" errormsg="快递100物流代码格式只支持1-32个字符!" >
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>是否支持子母单:</label>
+                <div class="formControls col-4 col-sm-4">
+                    <div class="radio-box">
+                        <input type="radio" id="logisticsIsLashSingle-1" name="logisticsIsLashSingle" value="1" <#if logisticsInfo.logisticsIsLashSingle??><#if logisticsInfo.logisticsIsLashSingle == 1>checked</#if></#if>>
+                        <label for="logisticsIsLashSingle-1">是&nbsp;&nbsp;&nbsp;</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="logisticsIsLashSingle-2" name="logisticsIsLashSingle" value="2" <#if logisticsInfo.logisticsIsLashSingle??><#if logisticsInfo.logisticsIsLashSingle == 2>checked</#if></#if>>
+                        <label for="logisticsIsLashSingle-2">否</label>
+                    </div>
+                </div>
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1">备注:</label>
+                <div class="formControls col-3 col-sm-3" style="">
+                    <textarea id="logisticsReamk" name="logisticsReamk" style="width: 100%;">${logisticsInfo.logisticsReamk!''}</textarea>
+                </div>
+            </div>
+
+            <div class="row cl" style="margin-bottom: 20px">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <input type="hidden" value="${logisticsInfo.logisticsId!''}" name="logisticsId">
+                    <button class="btn btn-block btn-primary size-XL" onclick="update();" type="button">确认录入</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</article>
+
+<script type="text/javascript">
+    var url_path = "${path}";
+</script>
+<#--时间控件-->
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
+
+<script type="text/javascript">
+    $('.skin-minimal input').iCheck({
+        checkboxClass: 'icheckbox-blue',
+        radioClass: 'iradio-blue',
+        increaseArea: '20%'
+    });
+
+    function  update() {
+        var logisticsName = $("#logisticsName").val();
+        if( logisticsName != null && "" != logisticsName){
+            if( logisticsName.length > 30 ){
+                layer.msg('快递名称不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('快递名称不能为空',{icon: 5,time:1000});
+            return;
+        }
+        var logisticsRstCode = $("#logisticsRstCode").val();
+        if( logisticsRstCode != null && "" != logisticsRstCode){
+            if( logisticsRstCode.length > 30 ){
+                layer.msg('rst物流代码不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('rst物流代码不能为空',{icon: 5,time:1000});
+            return;
+        }
+        var logisticsEfastCode = $("#logisticsEfastCode").val();
+        if( logisticsEfastCode != null && "" != logisticsEfastCode){
+            if( logisticsEfastCode.length > 30 ){
+                layer.msg('Efast物流代码不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('Efast物流代码不能为空',{icon: 5,time:1000});
+            return;
+        }
+        var logisticsOnehundredCode = $("#logisticsOnehundredCode").val();
+        if( logisticsOnehundredCode != null && "" != logisticsOnehundredCode){
+            if( logisticsOnehundredCode.length > 30 ){
+                layer.msg('快递100物流代码不得大于30个字符',{icon: 5,time:1000});
+                return;
+            }
+        }else{
+            layer.msg('快递100物流代码不能为空',{icon: 5,time:1000});
+            return;
+        }
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/logistics/update_Logistics",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('修改成功',{icon: 1,time:2000},function () {
+                        location.href =  "${path}/logistics/logistics_list";
+                    });
+                } else {
+                    layer.msg('修改失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('修改错误',{icon: 5,time:1000});
+            }
+        });
+    }
+
+
+</script>
+
+</body>
+</html>

+ 4 - 5
watero-rst-web/src/main/webapp/WEB-INF/views/order/downsingle/downsingleRule_list.ftl

@@ -33,8 +33,8 @@
 				<tr class="text-c">
                     <th width="100">优先级</th>
 					<th width="100">状态</th>
-					<th width="100">备注</th>
 					<th width="100">产品</th>
+                    <th width="100">备注</th>
 					<th width="100">创建时间</th>
 					<th width="100">操作</th>
 				</tr>
@@ -53,16 +53,15 @@
                                 </#if>
                             </td>
 							<td class="text-c" width="100">
-                                ${list.downsingleDesc!''}
-                            </td>
-
-							<td class="text-c" width="100">
                             <#if list.downsingleRuleItemList?? &&  (list.downsingleRuleItemList?size > 0) >
                                 <#list list.downsingleRuleItemList as Item>
                                     ${Item.productName!''}-${Item.colorName!''}*${Item.downsingleItemNum!''}
                                 </#list>
                             </#if>
                             </td>
+                            <td class="text-c" width="100">
+                                ${list.downsingleDesc!''}
+                            </td>
 							<td class="text-c" width="100">${list.downsingleCreateTime?string("yyyy-MM-dd HH:mm:ss")}</td>
 							<!-- 遍历操作 -->
 							<td class="td-manage text-c">

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/list_wait_send_order.ftl

@@ -538,7 +538,7 @@
                             $("#subOrderUl").append('<tr class="text-c order_tr">' +
                                     '<td><input type="checkbox" class="main_index" value="0" ></td>' +
                                     '<td>'+LogisticCode+'</td>' +
-                                    '<td>'+product+'</td>' +
+                                    '<td><span class="label label-success radius">'+product+'</span></td>' +
                                     '<td>'+salesOrder.salesAddressName +"/"+salesOrder.salesAddressTel+'</td>' +
                                     '</tr>');
                             product = "";
@@ -558,7 +558,7 @@
                                 $("#subOrderUl").append('<tr class="text-c order_tr">' +
                                         '<td><input type="checkbox" class="sub_index" value="'+index+'" ></td>' +
                                         '<td>'+item+'</td>' +
-                                        '<td>'+product+'</td>' +
+                                        '<td><span class="label label-success radius">'+product+'</span></td>' +
                                         '<td>'+salesOrder.salesAddressName +"/"+salesOrder.salesAddressTel+'</td>' +
                                         '</tr>');
                                 product = "";

ファイルの差分が大きいため隠しています
+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_list.ftl


+ 149 - 50
watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/add_deliveryStrategy.ftl

@@ -42,7 +42,7 @@
         .b-close{position: relative; display: inline-block;margin: 2px 0; padding:4px 1em 4px 4px; width: 150px;background: #f0f0f0;border: 1px solid rgba(0,0,0,.1);border-radius: 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor: pointer;}
         .my-close{position:absolute;right: 0.5em;top: 0.45em;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(45deg);transform: rotate(45deg);display: inline-block;}
         .my-close:after{content: "";position: absolute;top: 0;left: 0;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(270deg);transform: rotate(270deg);}
-
+        .my-btn-submit2{width: 88px;height: 30px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
     </style>
     <meta name="keywords" content="${path}">
     <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
@@ -109,6 +109,50 @@
             </div>
         </div>
         <div class="row cl">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-3 col-sm-3 huanhang" >
+                <table class="table table-border table-bg table-bordered" style="margin-top: 10px;" id="all_product">
+                    <thead>
+                    <tr class="text-c">
+                        <th style="text-align: center;" width="10">产品</th>
+                        <th style="text-align: center;" width="10">颜色</th>
+                        <th style="text-align: center;" width="10">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="add_product">
+                     <tr id="trid"><td colspan="3" class="td-manage text-c" >暂时没有产品信息,请添加!</td></tr>
+                    </tbody>
+                </table>
+                <button type="button" class="my-btn-submit2" onclick="isShow();" style="margin-top: 20px;">添加产品</button>
+            </div>
+        </div>
+        <div class="row cl" id="productDiv" style="display: none;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
+                <div style="line-height: 30px;width: 400px;line-break: auto;background-color: #E6E6E6;padding-left: 10px;padding-bottom: 10px;">
+                    <span style="margin-bottom: 15px;">产品:</span><br>
+                    <select id="productId"  class="chosen2" class="my-select" style="width: 195px;">
+                        <option value="0">所有产品</option>
+                        <#if (productList?size > 0)>
+                            <#list productList as product>
+                                    <option value="${product.productId!""}" >${product.productName!""}</option>
+                            </#list>
+                        </#if>
+                    </select><br>
+                    颜色:<br>
+                    <select id="productColorId"  class="chosen2" class="my-select" style="width: 195px">
+                        <option value="0">所有颜色</option>
+                        <#if (productColorList?size > 0)>
+                            <#list productColorList as productColor>
+                                <option value="${productColor.colorId!""}" >${productColor.colorName!""}</option>
+                            </#list>
+                        </#if>
+                    </select><br>
+                    <button type="button" class="my-btn-submit2" onclick="addPorduct();" style="margin-top: 20px;">确认添加</button>
+                </div>
+            </div>
+        </div>
+        <#--<div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>产品:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
                 <select id="productId" name="strategyProductId" class="chosen" class="my-select" style="width: 195px">
@@ -155,7 +199,7 @@
                 </div>
 
             </div>
-        </div>
+        </div>-->
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>快递公司:</label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
@@ -177,6 +221,7 @@
         <div class="row cl">
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;padding-left: 0;">
+                <input type="hidden" id="strategyColorArray" name="strategyColorArray" value="">
                 <button type="button" class="my-btn-submit" onclick="addDeliveryStrategy();" style="margin-top: 20px;">确认新建</button>
             </div>
         </div>
@@ -184,6 +229,52 @@
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript">
+    function isShow() {
+        $("#productDiv").show();
+    }
+    function addPorduct() {
+        $("#trid").remove();
+
+        var productId = $("#productId").val();
+        var productColorId = $("#productColorId").val();
+        var productIdName = $("#productId").find("option:selected").text();
+        var productColorIdName = $("#productColorId").find("option:selected").text();
+        if(productId === "0"){
+            productColorId = 0;
+            productColorIdName = "所有颜色";
+        }
+        var isProduct = true;
+        $("#add_product").find("tr").each(function(){
+            var productIdc = $(this).find(".productId").val();
+            var productColorId = $(this).find(".productColorId").val();
+            if(productIdc === "0"){
+                /*layer.msg("已选择所有产品,请先删除!", {icon: 5, time: 2000});*/
+                $("#add_product").html("");
+            }
+            if(productColorId === "0" && productId == productIdc && productId != "0"){
+                layer.msg("已选择该产品所有颜色,请先删除!", {icon: 5, time: 2000});
+                isProduct = false;
+            }
+        });
+        if(!isProduct){
+            return;
+        }
+        var html = '<tr class="text-c">' +
+                ' <input type="hidden" class="productId" value="'+ productId +'">' +
+                ' <input type="hidden" class="productColorId" value="'+ productColorId +'">' +
+                ' <td>'+ productIdName +'</td>' +
+                ' <td>'+ productColorIdName +'</td>' +
+                ' <td><a onclick="updateProduct(this);">编辑</a>&nbsp;&nbsp;&nbsp;<a onclick="delEmployee(this);">删除</a></td>' +
+                ' </tr>';
+        if(productId === "0"){
+            $("#add_product").html(html);
+        }else{
+            $("#add_product").append(html);
+        }
+
+    }
+
+
     $('#storeId').change(function() {
         var name = $("#storeId option:selected").text();
         var id = $('#storeId').val();
@@ -204,66 +295,36 @@
         }
 
     });
-    $('#productId').change(function() {
-        var name = $("#productId option:selected").text();
-        var id = $('#productId').val();
-        var bl = true;
-        if(id != "" && id != 0) {
-            $("input[name='strategyProductId']").each(function (j, item) {
-                var s = $(item).val();
-                if (s === id) {
-                    bl = false;
-                }
-            });
-            if (bl) {
-                $("#configui2").append('<li class="b-close" id="productId1">' +
-                        ' <input type="hidden" value="' + id + '" name="productId1">' + name +
-                        '<span class="my-close" onclick="deleteli(this)"></span>' +
-                        '</li>');
-            }
-        }
-
-    });
-    $('#productColorId').change(function() {
-        var name = $("#productColorId option:selected").text();
-        var id = $('#productColorId').val();
-        var bl = true;
-        if(id != "" && id != 0) {
-            $("input[name='strategyColorId']").each(function (j, item) {
-                var s = $(item).val();
-                if (s === id) {
-                    bl = false;
-                }
-            });
-            if (bl) {
-                $("#configui3").append('<li class="b-close" id="productColorId1">' +
-                        ' <input type="hidden" value="' + id + '" name="productColorId1">' + name +
-                        '<span class="my-close" onclick="deleteli(this)"></span>' +
-                        '</li>');
-            }
-        }
 
-    });
     function deleteli(obj) {
         $(obj).parent().remove();
     }
-    /**
-     * 打开员工列表
-     */
-    function add_employee() {
-        layer_show("员工列表","${path}/admin/employee/employee_list?pageSize=1000","800","500");
-    }
 
 
     /**
-     *  删除员工
+     *  删除
      */
     function delEmployee($this){
-        $this.parents("tr").remove();
+        $($this).parent().parent().remove();
+        if($("table#all_product tr:visible").length == 1){
+            $("#add_product").html("<tr id=\"trid\"><td colspan=\"3\" class=\"td-manage text-c\" >暂时没有产品信息,请添加!</td></tr>");
+        }
+    }
+    /**
+     *  编辑
+     */
+    function updateProduct($this){
+        var productId = $($this).parent().parent().find(".productId").val();
+        var productColorId = $($this).parent().parent().find(".productColorId").val();
+        $("#productId").val(productId);
+        getProduct(productId);
+        $("#productColorId").val(productColorId);
+        $("#productId").trigger("chosen:updated");//初始化
+        $("#productColorId").trigger("chosen:updated");//初始化
     }
 
     /**
-     * 添加回访信息
+     * 添加
      */
     function addDeliveryStrategy() {
         var companyId = $("#companyId").val();
@@ -286,6 +347,23 @@
             layer.msg("优先级不能为空!", {icon: 5, time: 2000});
             return;
         }
+
+        //选择产品
+        var flag = false;
+        /*封装产品项*/
+        var strategyColorArray = new Array();
+        $("#add_product").find("tr").each(function(){
+            var strategyColor = new Object();
+            strategyColor.colorId = $(this).find(".productColorId").val();
+            strategyColor.productId = $(this).find(".productId").val();
+            strategyColorArray.push(strategyColor);
+            flag = true;
+        })
+        if(!flag){
+            layer.msg("必须要有一个产品!", {icon: 5, time: 5000});
+            return false;
+        }
+        $("#strategyColorArray").val(JSON.stringify(strategyColorArray));
             $.ajax({
                 cache: true,
                 type: "POST",
@@ -341,6 +419,11 @@
         getProduct($(this).children('option:selected').val())
     })
     function  getProduct(productId) {
+        if(productId === "0"){
+            $("#productColorId").html("<option value='0'>所有颜色</option>");
+            $("#productColorId").trigger("chosen:updated");//初始化
+            return;
+        }
         $.ajax({
             cache: true,
             type: "POST",
@@ -383,6 +466,22 @@
         group_search: false, //选项组是否可搜。此处搜索不可搜
         include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
     });
+    $('.chosen2').chosen({
+        no_results_text: "没有找到结果!",//搜索无结果时显示的提示
+        search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
+        disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
+        disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
+        inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
+        placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+        width: '255px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+        max_shown_results: 1000, //下拉框最大显示选项数量
+        display_disabled_options: false,
+        single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
+        case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
+        group_search: false, //选项组是否可搜。此处搜索不可搜
+        include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
+    });
 </script>
 </body>
 </html>

+ 7 - 9
watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/deliveryStrategy_List.ftl

@@ -34,8 +34,7 @@
                     <th width="100">公司</th>
 					<th width="100">店铺</th>
 					<th width="100">地区</th>
-					<th width="100">产品</th>
-					<th width="100">颜色</th>
+					<th width="100">产品/颜色</th>
 					<th width="100">优先级</th>
 					<th width="100">快递</th>
 					<th width="100">操作</th>
@@ -63,7 +62,7 @@
                             <#else>
                                 ${list.strategyProvinceName!''}
                             </#if>
-                            </td>
+                            </td><#--
 							<td class="text-c" width="100">
                                 <#if list.strategyProductId == 0>
                                     所有产品
@@ -74,17 +73,16 @@
                                         </#list>
                                     </#if>
                                 </#if>
-                            </td>
+                            </td>-->
 							<td class="text-c" width="100">
-                                <#if list.strategyColorId == 0>
-                                    所有颜色
-                                <#else>
                                     <#if list.listStrategyColor?? &&  (list.listStrategyColor?size > 0) >
                                         <#list list.listStrategyColor as listColor>
-                                            ${listColor.colorName}<br>
+                                            <#if listColor.productId == 0>所有产品 <#else >${listColor.productName!''}</#if>
+                                            -
+                                            <#if listColor.colorId == 0>所有颜色<#else >${listColor.colorName!''}</#if>
+                                            <br>
                                         </#list>
                                     </#if>
-                                </#if>
                             </td>
 
 							<td class="text-c" width="100">${list.strategyPriority!''}</td>

+ 148 - 92
watero-rst-web/src/main/webapp/WEB-INF/views/order/strategy/update_deliveryStrategy.ftl

@@ -42,7 +42,7 @@
         .b-close{position: relative; display: inline-block;margin: 2px 0; padding:4px 1em 4px 4px; width: 150px;background: #f0f0f0;border: 1px solid rgba(0,0,0,.1);border-radius: 5px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor: pointer;}
         .my-close{position:absolute;right: 0.5em;top: 0.45em;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(45deg);transform: rotate(45deg);display: inline-block;}
         .my-close:after{content: "";position: absolute;top: 0;left: 0;width:0.15em;height:1em;background: #333;-webkit-transform: rotate(270deg);transform: rotate(270deg);}
-
+        .my-btn-submit2{width: 88px;height: 30px; background-color: #50a2ea;color: #fff;border: 1px solid #50a2ea;cursor:pointer;margin: 10px 10px 0 10px;}
     </style>
     <meta name="keywords" content="${path}">
     <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
@@ -116,66 +116,59 @@
                 </select>
             </div>
         </div>
-        <div class="row cl">
-            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>产品:</label>
-            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
-                <select id="productId" name="strategyProductId" class="chosen" style="width: 195px">
-                    <option value="0" <#if deliveryStrategy.strategyProductId == 0>selected</#if>>所有产品</option>
-                    <#if (productList?size > 0)>
-                            <#list productList as product>
-                                <option value="${product.productId!""}">${product.productName!""}</option>
-                            </#list>
-                    </#if>
-                </select>
-            </div>
-        </div>
-        <div class="input-box" style="margin-top: -20px;">
-            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
-            <div class="formControls col-9 col-sm-9 huanhang" id="config2">
-                <div class="row">
-                    <ul class="close-box" id="configui2">
-                        <#if deliveryStrategy.listStrategyProduct?? &&  (deliveryStrategy.listStrategyProduct?size > 0) >
-                            <#list deliveryStrategy.listStrategyProduct as list>
-                                 <li class="b-close" id="productId1">
-                                     <input type="hidden" value="${list.productId}" name="productId1">${list.productName}
-                                     <span class="my-close" onclick="deleteli(this)"></span>
-                                 </li>
-                            </#list>
-                        </#if>
-                    </ul>
-                </div>
 
-            </div>
-        </div>
         <div class="row cl">
-            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"><span class="c-red">*</span>产品:</label>
-            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
-                <select id="productColorId" name="strategyColorId" class="chosen" style="width: 195px">
-                    <option value="0" <#if deliveryStrategy.strategyColorId == 0>selected</#if>>所有颜色</option>
-                    <#if (productColorList?size > 0)>
-                        <#list productColorList as productColor>
-                            <option value="${productColor.colorId!""}">${productColor.colorName!""}</option>
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-3 col-sm-3 huanhang" >
+                <table class="table table-border table-bg table-bordered" style="margin-top: 10px;" id="all_product">
+                    <thead>
+                    <tr class="text-c">
+                        <th style="text-align: center;" width="10">产品</th>
+                        <th style="text-align: center;" width="10">颜色</th>
+                        <th style="text-align: center;" width="10">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="add_product">
+                    <#if deliveryStrategy.listStrategyColor?? &&  (deliveryStrategy.listStrategyColor?size > 0) >
+                        <#list deliveryStrategy.listStrategyColor as list>
+                        <tr class="text-c">
+                            <input type="hidden" class="productId" value="${list.productId!''}">
+                            <input type="hidden" class="productColorId" value="${list.colorId!''}">
+                            <td>${list.productName!''}</td>
+                            <td>${list.colorName!''}</td>
+                            <td><a onclick="updateProduct(this);">编辑</a>&nbsp;&nbsp;&nbsp;<a onclick="delEmployee(this);">删除</a></td>
+                        </tr>
                         </#list>
                     </#if>
-                </select>
+                    </tbody>
+                </table>
+                <button type="button" class="my-btn-submit2" onclick="isShow();" style="margin-top: 20px;">添加产品</button>
             </div>
         </div>
-        <div class="input-box" style="margin-top: -20px;">
-            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;"></label>
-            <div class="formControls col-9 col-sm-9 huanhang" id="config3">
-                <div class="row">
-                    <ul class="close-box" id="configui3">
-                        <#if deliveryStrategy.listStrategyColor?? &&  (deliveryStrategy.listStrategyColor?size > 0) >
-                            <#list deliveryStrategy.listStrategyColor as list>
-                                 <li class="b-close" id="productColorId1">
-                                     <input type="hidden" value="${list.colorId}" name="productColorId1">${list.colorName}
-                                     <span class="my-close" onclick="deleteli(this)"></span>
-                                 </li>
+        <div class="row cl" id="productDiv" style="display: none;">
+            <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
+            <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
+                <div style="line-height: 30px;width: 400px;line-break: auto;background-color: #E6E6E6;padding-left: 10px;padding-bottom: 10px;">
+                    <span style="margin-bottom: 15px;">产品:</span><br>
+                    <select id="productId"  class="chosen2" class="my-select" style="width: 195px;">
+                        <option value="0">所有产品</option>
+                        <#if (productList?size > 0)>
+                            <#list productList as product>
+                                    <option value="${product.productId!""}" >${product.productName!""}</option>
                             </#list>
                         </#if>
-                    </ul>
+                    </select><br>
+                    颜色:<br>
+                    <select id="productColorId"  class="chosen2" class="my-select" style="width: 195px">
+                        <option value="0">所有颜色</option>
+                        <#if (productColorList?size > 0)>
+                            <#list productColorList as productColor>
+                                <option value="${productColor.colorId!""}" >${productColor.colorName!""}</option>
+                            </#list>
+                        </#if>
+                    </select><br>
+                    <button type="button" class="my-btn-submit2" onclick="addPorduct();" style="margin-top: 20px;">确认添加</button>
                 </div>
-
             </div>
         </div>
         <div class="row cl">
@@ -200,6 +193,7 @@
             <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin-top: 14px;"></label>
             <div class="formControls col-9 col-sm-9 huanhang" style="margin: 10px 0px 10px 0;">
                 <input type="hidden" name="strategyId" value="${deliveryStrategy.strategyId!""}">
+                <input type="hidden" id="strategyColorArray" name="strategyColorArray" value="">
                 <button type="button" class="my-btn-submit" onclick="addDeliveryStrategy();" style="margin-top: 20px;">确认修改</button>
             </div>
         </div>
@@ -207,6 +201,49 @@
 </article>
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript">
+    function isShow() {
+        $("#productDiv").show();
+    }
+    function addPorduct() {
+        $("#trid").remove();
+        var productId = $("#productId").val();
+        var productColorId = $("#productColorId").val();
+        var productIdName = $("#productId").find("option:selected").text();
+        var productColorIdName = $("#productColorId").find("option:selected").text();
+        if(productId === "0"){
+            productColorId = 0;
+            productColorIdName = "所有颜色";
+        }
+        var isProduct = true;
+        $("#add_product").find("tr").each(function(){
+            var productIdc = $(this).find(".productId").val();
+            var productColorId = $(this).find(".productColorId").val();
+            if(productIdc === "0"){
+                /*layer.msg("已选择所有产品,请先删除!", {icon: 5, time: 2000});*/
+                $("#add_product").html("");
+            }
+            if(productColorId === "0" && productId == productIdc && productId != "0"){
+                layer.msg("已选择该产品所有颜色,请先删除!", {icon: 5, time: 2000});
+                isProduct = false;
+            }
+        });
+        if(!isProduct){
+            return;
+        }
+        var html = '<tr class="text-c">' +
+                ' <input type="hidden" class="productId" value="'+ productId +'">' +
+                ' <input type="hidden" class="productColorId" value="'+ productColorId +'">' +
+                ' <td>'+ productIdName +'</td>' +
+                ' <td>'+ productColorIdName +'</td>' +
+                ' <td><a onclick="updateProduct(this);">编辑</a>&nbsp;&nbsp;&nbsp;<a onclick="delEmployee(this);">删除</a></td>' +
+                ' </tr>';
+        if(productId === "0"){
+            $("#add_product").html(html);
+        }else{
+            $("#add_product").append(html);
+        }
+
+    }
     $('#storeId').change(function() {
         var name = $("#storeId option:selected").text();
         var id = $('#storeId').val();
@@ -227,51 +264,33 @@
         }
 
     });
-    $('#productId').change(function() {
-        var name = $("#productId option:selected").text();
-        var id = $('#productId').val();
-        var bl = true;
-        if(id != "" && id != 0) {
-            $("input[name='strategyProductId']").each(function (j, item) {
-                var s = $(item).val();
-                if (s === id) {
-                    bl = false;
-                }
-            });
-            if (bl) {
-                $("#configui2").append('<li class="b-close" id="productId1">' +
-                        ' <input type="hidden" value="' + id + '" name="productId1">' + name +
-                        '<span class="my-close" onclick="deleteli(this)"></span>' +
-                        '</li>');
-            }
-        }
-
-    });
-    $('#productColorId').change(function() {
-        var name = $("#productColorId option:selected").text();
-        var id = $('#productColorId').val();
-        var bl = true;
-        if(id != "" && id != 0) {
-            $("input[name='strategyColorId']").each(function (j, item) {
-                var s = $(item).val();
-                if (s === id) {
-                    bl = false;
-                }
-            });
-            if (bl) {
-                $("#configui3").append('<li class="b-close" id="productColorId1">' +
-                        ' <input type="hidden" value="' + id + '" name="productColorId1">' + name +
-                        '<span class="my-close" onclick="deleteli(this)"></span>' +
-                        '</li>');
-            }
-        }
 
-    });
     function deleteli(obj) {
         $(obj).parent().remove();
     }
 
-
+    /**
+     *  删除
+     */
+    function delEmployee($this){
+        $($this).parent().parent().remove();
+        if($("table#all_product tr:visible").length == 1){
+            $("#add_product").html("<tr id=\"trid\"><td colspan=\"3\" class=\"td-manage text-c\" >暂时没有产品信息,请添加!</td></tr>");
+        }
+    }
+    /**
+     *  编辑
+     */
+    function updateProduct($this){
+        $("#productDiv").show();
+        var productId = $($this).parent().parent().find(".productId").val();
+        var productColorId = $($this).parent().parent().find(".productColorId").val();
+        $("#productId").val(productId);
+        getProduct(productId);
+        $("#productColorId").val(productColorId);
+        $("#productId").trigger("chosen:updated");//初始化
+        $("#productColorId").trigger("chosen:updated");//初始化
+    }
 
     /**
      * 修改
@@ -297,6 +316,22 @@
             layer.msg("优先级不能为空!", {icon: 5, time: 2000});
             return;
         }
+        //选择产品
+        var flag = false;
+        /*封装产品项*/
+        var strategyColorArray = new Array();
+        $("#add_product").find("tr").each(function(){
+            var strategyColor = new Object();
+            strategyColor.colorId = $(this).find(".productColorId").val();
+            strategyColor.productId = $(this).find(".productId").val();
+            strategyColorArray.push(strategyColor);
+            flag = true;
+        })
+        if(!flag){
+            layer.msg("必须要有一个产品!", {icon: 5, time: 5000});
+            return false;
+        }
+        $("#strategyColorArray").val(JSON.stringify(strategyColorArray));
             $.ajax({
                 cache: true,
                 type: "POST",
@@ -350,6 +385,11 @@
         getProduct($(this).children('option:selected').val());
     })
     function  getProduct(productId) {
+        if(productId === "0"){
+            $("#productColorId").html("<option value='0'>所有颜色</option>");
+            $("#productColorId").trigger("chosen:updated");//初始化
+            return;
+        }
         $.ajax({
             cache: true,
             type: "POST",
@@ -392,6 +432,22 @@
         group_search: false, //选项组是否可搜。此处搜索不可搜
         include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
     });
+    $('.chosen2').chosen({
+        no_results_text: "没有找到结果!",//搜索无结果时显示的提示
+        search_contains:true,   //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        allow_single_deselect:true, //单选下拉框是否允许取消选择。如果允许,选中选项会有一个x号可以删除选项
+        disable_search: false, //禁用搜索。设置为true,则无法搜索选项。
+        disable_search_threshold: 0, //当选项少等于于指定个数时禁用搜索。
+        inherit_select_classes: true, //是否继承原下拉框的样式类,此处设为继承
+        placeholder_text_single: '选择国家', //单选选择框的默认提示信息,当选项为空时会显示。如果原下拉框设置了data-placeholder,会覆盖这里的值。
+        width: '255px', //设置chosen下拉框的宽度。即使原下拉框本身设置了宽度,也会被width覆盖。
+        max_shown_results: 1000, //下拉框最大显示选项数量
+        display_disabled_options: false,
+        single_backstroke_delete: false, //false表示按两次删除键才能删除选项,true表示按一次删除键即可删除
+        case_sensitive_search: false, //搜索大小写敏感。此处设为不敏感
+        group_search: false, //选项组是否可搜。此处搜索不可搜
+        include_group_label_in_selected: true //选中选项是否显示选项分组。false不显示,true显示。默认false。
+    });
 </script>
 </body>
 </html>