wangxiaoming 6 anni fa
parent
commit
33b8faefe5
16 ha cambiato i file con 1247 aggiunte e 13 eliminazioni
  1. 11 0
      watero-rst-core/src/main/java/com.iamberry.rst.core/order/Product.java
  2. 55 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductColorService.java
  3. 23 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductService.java
  4. 1 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml
  5. 84 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductColorServiceImpl.java
  6. 36 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductServiceImpl.java
  7. 55 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductColorMapper.java
  8. 26 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductMapper.java
  9. 182 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productColorMapper.xml
  10. 101 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml
  11. 2 2
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminOrderController.java
  12. 75 10
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/product/AdminProductController.java
  13. 3 0
      watero-rst-web/src/main/resources/watero-rst-orm.xml
  14. 228 0
      watero-rst-web/src/main/webapp/WEB-INF/views/product/add_product.ftl
  15. 134 0
      watero-rst-web/src/main/webapp/WEB-INF/views/product/product_list.ftl
  16. 231 0
      watero-rst-web/src/main/webapp/common/js/product/product.js

+ 11 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/Product.java

@@ -39,6 +39,9 @@ public class Product implements Serializable {
 
     private String typeName;            //产品类型名称
 
+    //是否可批发 1:可批发 2:不可批发'
+    private Integer productWholesale;
+
     private List<ProductColor> colorList = new ArrayList<ProductColor>();   //产品颜色集合
 
     private List<FittingsInfo> fittingsList = new ArrayList<FittingsInfo>();   //产品配件集合
@@ -139,6 +142,14 @@ public class Product implements Serializable {
         this.fittingsList = fittingsList;
     }
 
+    public Integer getProductWholesale() {
+        return productWholesale;
+    }
+
+    public void setProductWholesale(Integer productWholesale) {
+        this.productWholesale = productWholesale;
+    }
+
     @Override
     public String toString() {
         return "Product{" +

+ 55 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductColorService.java

@@ -0,0 +1,55 @@
+package com.iamberry.rst.faces.product;
+
+import com.iamberry.rst.core.order.ProductColor;
+
+import java.util.List;
+
+/**
+ *  颜色
+ * @author
+ * @Date 2018-11-09
+ */
+public interface ProductColorService {
+    /**
+     * 获取集合
+     * @param  productColor
+     * @return List
+     */
+    List<ProductColor> getProductColorList(ProductColor  productColor);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  productColor
+     */
+    ProductColor  getProductColorById(Integer  id);
+    /**
+     * 增加数据
+     * @param  productColor
+     * @return Integer
+     */
+    Integer  save(ProductColor  productColor);
+    /**
+     * 修改数据
+     * @param  productColor
+     * @return Integer
+     */
+    Integer  update(ProductColor  productColor);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+    /**
+     * 增加数据 <集合>
+     * @param  productColorList
+     * @return Integer
+     */
+    Integer  saveList(List<ProductColor>  productColorList);
+    /**
+     * 删除数据 <集合>
+     * @param  ids
+     * @return Integer
+     */
+    Integer  deleteList(Integer[]  ids);
+}

+ 23 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/product/ProductService.java

@@ -1,9 +1,11 @@
 package com.iamberry.rst.faces.product;
 
 import com.iamberry.rst.core.cm.FittingsInfo;
+import com.iamberry.rst.core.order.OrderBatch;
 import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.order.ProductType;
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.product.Gift;
 import com.iamberry.rst.core.product.OrderGift;
 
@@ -118,4 +120,25 @@ public interface ProductService {
      * @return
      */
     ProductColor getColorByBar(String colorBar);
+
+    PagedResult<Product> listProductPage(int pageNO, int pageSize, Product  product, boolean isTotalNum);
+
+    /**
+     * 增加数据
+     * @param  product
+     * @return Integer
+     */
+    Integer  save(Product  product);
+    /**
+     * 修改数据
+     * @param  product
+     * @return Integer
+     */
+    Integer  update(Product  product);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
 }

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

@@ -1277,6 +1277,7 @@
         LEFT JOIN tb_rst_sales_order_item oi ON t.sales_id = oi.item_order_id
         <where>
             t.sales_batch_id != 'KS00000000000001'
+            AND  t.sales_status = 1
             <if test="salesShippingStatus !=null">
                 AND t.sales_shipping_status =  #{salesShippingStatus}
             </if>

+ 84 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductColorServiceImpl.java

@@ -0,0 +1,84 @@
+package com.iamberry.rst.service.product;
+
+import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.faces.product.ProductColorService;
+
+import java.util.List;
+
+import com.iamberry.rst.service.product.mapper.ProductColorMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ *  接口
+ * @author
+ * @Date 2018-11-09
+ */
+@Service
+public class ProductColorServiceImpl  implements ProductColorService {
+    @Autowired
+    private ProductColorMapper productColorMapper;
+    /**
+     * 获取集合
+     * @param  productColor
+     * @return List
+     */
+    @Override
+    public List<ProductColor> getProductColorList(ProductColor  productColor){
+        return  productColorMapper.getProductColorList(productColor);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  productColor
+     */
+    @Override
+    public  ProductColor  getProductColorById(Integer  id){
+        return  productColorMapper.getProductColorById(id);
+    }
+    /**
+     * 增加数据
+     * @param  productColor
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(ProductColor  productColor){
+        return  productColorMapper.save(productColor);
+    }
+    /**
+     * 修改数据
+     * @param  productColor
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(ProductColor  productColor){
+        return  productColorMapper.update(productColor);
+    }
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    @Override
+    public  Integer  delete(Integer  id){
+        return  productColorMapper.delete(id);
+    }
+    /**
+     * 增加数据 <集合>
+     * @param  productColorList
+     * @return Integer
+     */
+    @Override
+    public  Integer  saveList(List<ProductColor>  productColorList){
+        return  productColorMapper.saveList(productColorList);
+    }
+    /**
+     * 删除数据 <集合>
+     * @param  ids
+     * @return Integer
+     */
+    @Override
+    public  Integer  deleteList(Integer[]  ids){
+        return  productColorMapper.deleteList(ids);
+    }
+}

+ 36 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductServiceImpl.java

@@ -1,16 +1,18 @@
 package com.iamberry.rst.service.product;
 
+import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.cm.FittingsInfo;
 import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.order.ProductType;
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.product.Gift;
 import com.iamberry.rst.core.product.OrderGift;
 import com.iamberry.rst.faces.product.ProductService;
 import com.iamberry.rst.service.product.mapper.ProductMapper;
+import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.util.Assert;
 
 import java.util.*;
 
@@ -164,5 +166,38 @@ public class ProductServiceImpl implements ProductService {
         return productMapper.getColorByBar(colorBar);
     }
 
+    @Override
+    public PagedResult<Product> listProductPage(int pageNO, int pageSize, Product product, boolean isTotalNum) {
+        PageHelper.startPage(pageNO, pageSize, isTotalNum);
+        List<Product> list = productMapper.getProductList(product);
+        return PageUtil.getPage(list);
+    }
 
+    /**
+     * 增加数据
+     * @param  product
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(Product  product){
+        return  productMapper.save(product);
+    }
+    /**
+     * 修改数据
+     * @param  product
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(Product  product){
+        return  productMapper.update(product);
+    }
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    @Override
+    public  Integer  delete(Integer  id){
+        return  productMapper.delete(id);
+    }
 }

+ 55 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductColorMapper.java

@@ -0,0 +1,55 @@
+package com.iamberry.rst.service.product.mapper;
+
+import com.iamberry.rst.core.order.ProductColor;
+
+import java.util.List;
+
+/**
+ *  接口
+ * @author
+ * @Date 2018-11-09
+ */
+public interface ProductColorMapper {
+    /**
+     * 获取集合
+     * @param  productColor
+     * @return List
+     */
+    List<ProductColor> getProductColorList(ProductColor  productColor);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  productColor
+     */
+    ProductColor  getProductColorById(Integer  id);
+    /**
+     * 增加数据
+     * @param  productColor
+     * @return Integer
+     */
+    Integer  save(ProductColor  productColor);
+    /**
+     * 修改数据
+     * @param  productColor
+     * @return Integer
+     */
+    Integer  update(ProductColor  productColor);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+    /**
+     * 增加数据 <集合>
+     * @param  productColorList
+     * @return Integer
+     */
+    Integer  saveList(List<ProductColor>  productColorList);
+    /**
+     * 删除数据 <集合>
+     * @param  ids
+     * @return Integer
+     */
+    Integer  deleteList(Integer[]  ids);
+}

+ 26 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/ProductMapper.java

@@ -105,4 +105,30 @@ public interface ProductMapper {
      */
     ProductColor getColorByBar(String colorBar);
 
+    /**
+     * 获取集合
+     * @param  product
+     * @return List
+     */
+    List<Product>  getProductList(Product  product);
+
+    /**
+     * 增加数据
+     * @param  product
+     * @return Integer
+     */
+    Integer  save(Product  product);
+    /**
+     * 修改数据
+     * @param  product
+     * @return Integer
+     */
+    Integer  update(Product  product);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+
 }

+ 182 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productColorMapper.xml

@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.rst.service.product.mapper.ProductColorMapper">
+    <resultMap  id="BaseResultMap" type="ProductColor" >
+        <result    column="color_id"    property="colorId" />
+        <result    column="color_product_id"    property="colorProductId" />
+        <result    column="color_name"    property="colorName" />
+        <result    column="color_abbreviation"    property="colorAbbreviation" />
+        <result    column="color_discount"    property="colorDiscount" />
+        <result    column="color_price"    property="colorPrice" />
+        <result    column="color_bar"    property="colorBar" />
+        <result    column="color_picture"    property="colorPicture" />
+        <result    column="color_status"    property="colorStatus" />
+        <result    column="color_cretae_time"    property="colorCretaeTime" />
+        <result    column="color_update_time"    property="colorUpdateTime" />
+        <result    column="color_is_machine"    property="colorIsMachine" />
+        <result    column="color_is_weight"    property="colorIsWeight" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.color_id,
+        t.color_product_id,
+        t.color_name,
+        t.color_abbreviation,
+        t.color_discount,
+        t.color_price,
+        t.color_bar,
+        t.color_picture,
+        t.color_status,
+        t.color_cretae_time,
+        t.color_update_time,
+        t.color_is_machine,
+        t.color_is_weight
+    </sql>
+    <select id="getProductColorList" resultMap="BaseResultMap" parameterType="ProductColor" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_product_color t
+        <where>
+            <if test="colorId != null ">
+                AND t.color_id = #{colorId}
+            </if >
+            <if test="colorProductId != null ">
+                AND t.color_product_id = #{colorProductId}
+            </if >
+            <if test="colorName != null and colorName != ''">
+                AND t.color_name  like  CONCAT ('%',#{colorName},'%')
+            </if >
+            <if test="colorAbbreviation != null and colorAbbreviation != ''">
+                AND t.color_abbreviation  like  CONCAT ('%',#{colorAbbreviation},'%')
+            </if >
+            <if test="colorBar != null and colorBar != ''">
+                AND t.color_bar = #{colorBar}
+            </if >
+            <if test="colorStatus != null ">
+                AND t.color_status = #{colorStatus}
+            </if >
+        </where>
+    </select>
+    <select id="getProductColorById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_product_color t
+        where t.color_id= #{colorId}
+    </select>
+    <insert id="save" parameterType="ProductColor" >
+        insert into
+        tb_rst_product_color
+        (
+        color_product_id,
+        color_name,
+        color_abbreviation,
+        color_discount,
+        color_price,
+        color_bar,
+        color_picture,
+        color_status,
+        color_cretae_time,
+        color_is_machine,
+        color_is_weight
+        )
+        values
+        (
+        #{colorProductId},
+        #{colorName},
+        #{colorAbbreviation},
+        #{colorDiscount},
+        #{colorPrice},
+        #{colorBar},
+        #{colorPicture},
+        #{colorStatus},
+        #{colorCretaeTime},
+        #{colorIsMachine},
+        #{colorIsWeight}
+        )
+    </insert>
+    <update id="update" parameterType="ProductColor" >
+        update
+        tb_rst_product_color
+        <set >
+            <if test="colorProductId != null ">
+                color_product_id = #{colorProductId},
+            </if >
+            <if test="colorName != null and colorName != ''">
+                color_name = #{colorName},
+            </if >
+            <if test="colorAbbreviation != null and colorAbbreviation != ''">
+                color_abbreviation = #{colorAbbreviation},
+            </if >
+            <if test="colorDiscount != null ">
+                color_discount = #{colorDiscount},
+            </if >
+            <if test="colorPrice != null ">
+                color_price = #{colorPrice},
+            </if >
+            <if test="colorBar != null and colorBar != ''">
+                color_bar = #{colorBar},
+            </if >
+            <if test="colorPicture != null and colorPicture != ''">
+                color_picture = #{colorPicture},
+            </if >
+            <if test="colorStatus != null ">
+                color_status = #{colorStatus},
+            </if >
+            <if test="colorCretaeTime != null and colorCretaeTime != ''">
+                color_cretae_time = #{colorCretaeTime},
+            </if >
+            <if test="colorIsMachine != null ">
+                color_is_machine = #{colorIsMachine},
+            </if >
+            <if test="colorIsWeight != null ">
+                color_is_weight = #{colorIsWeight}
+            </if >
+        </set >
+        where color_id= #{colorId}
+    </update>
+    <delete id="delete" parameterType="Integer" >
+        delete FROM
+        tb_rst_product_color
+        where color_id=#{colorId}
+    </delete>
+    <insert id="saveList" parameterType="java.util.List" >
+        insert into
+        tb_rst_product_color
+        (
+        color_product_id,
+        color_name,
+        color_abbreviation,
+        color_discount,
+        color_price,
+        color_bar,
+        color_picture,
+        color_status,
+        color_cretae_time,
+        color_is_machine,
+        color_is_weight
+        )
+        values
+        <foreach collection="list" item="node" index="index" separator="," open="" close="">
+            (
+            #{node.colorProductId},
+            #{node.colorName},
+            #{node.colorAbbreviation},
+            #{node.colorDiscount},
+            #{node.colorPrice},
+            #{node.colorBar},
+            #{node.colorPicture},
+            #{node.colorStatus},
+            #{node.colorCretaeTime},
+            #{node.colorIsMachine},
+            #{node.colorIsWeight}
+            )
+        </foreach >
+    </insert>
+    <delete id="deleteList" parameterType="String" >
+        delete FROM
+        tb_rst_product_color
+        where color_id  in
+        <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
+            #{item}
+        </foreach >
+    </delete>
+</mapper>

+ 101 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/mapper/productMapper.xml

@@ -255,4 +255,105 @@
         WHERE pc.color_bar = #{colorBar}
     </select>
 
+
+    <select id="getProductList" resultType="Product" parameterType="Product" >
+        select
+            t.product_id,
+            t.product_name,
+            t.product_abbreviation,
+            t.product_salesnum,
+            t.product_status,
+            t.product_create_time,
+            t.product_remark,
+            t.product_type,
+            t.product_number,
+            t.product_wholesale
+        from tb_rst_product_info t
+        <where>
+            <if test="productId != null ">
+                AND t.product_id = #{productId}
+            </if >
+            <if test="productName != null and productName != ''">
+                AND t.product_name  like  CONCAT ('%',#{productName},'%')
+            </if >
+            <if test="productAbbreviation != null and productAbbreviation != ''">
+                AND t.product_abbreviation  like  CONCAT ('%',#{productAbbreviation},'%')
+            </if >
+            <if test="productStatus != null ">
+                AND t.product_status = #{productStatus}
+            </if >
+            <if test="productType != null ">
+                AND t.product_type = #{productType}
+            </if >
+            <if test="productNumber != null and productNumber != ''">
+                AND t.product_number  like  CONCAT ('%',#{productNumber},'%')
+            </if >
+            <if test="productWholesale != null ">
+                AND t.product_wholesale = #{productWholesale}
+            </if >
+        </where>
+    </select>
+
+    <insert id="save" parameterType="Product" >
+        insert into
+        tb_rst_product_info
+        (
+        product_name,
+        product_abbreviation,
+        product_salesnum,
+        product_status,
+        product_remark,
+        product_type,
+        product_number,
+        product_wholesale
+        )
+        values
+        (
+        #{productName},
+        #{productAbbreviation},
+        #{productSalesnum},
+        #{productStatus},
+        #{productRemark},
+        #{productType},
+        #{productNumber},
+        #{productWholesale}
+        )
+    </insert>
+    <update id="update" parameterType="Product" >
+        update
+        tb_rst_product_info
+        <set >
+            <if test="productName != null and productName != ''">
+                product_name = #{productName},
+            </if >
+            <if test="productAbbreviation != null and productAbbreviation != ''">
+                product_abbreviation = #{productAbbreviation},
+            </if >
+            <if test="productSalesnum != null ">
+                product_salesnum = #{productSalesnum},
+            </if >
+            <if test="productStatus != null ">
+                product_status = #{productStatus},
+            </if >
+            <if test="productRemark != null and productRemark != ''">
+                product_remark = #{productRemark},
+            </if >
+            <if test="productType != null ">
+                product_type = #{productType},
+            </if >
+            <if test="productNumber != null and productNumber != ''">
+                product_number = #{productNumber},
+            </if >
+            <if test="productWholesale != null ">
+                product_wholesale = #{productWholesale}
+            </if >
+        </set >
+        where product_id= #{productId}
+    </update>
+    <delete id="delete" parameterType="Integer" >
+        delete FROM
+        tb_rst_product_info
+        where product_id=#{productId}
+    </delete>
+
 </mapper>

+ 2 - 2
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminOrderController.java

@@ -735,7 +735,7 @@ public class AdminOrderController {
     public ResponseJson valDownloadOrderExcel(HttpServletRequest request,SalesOrder so) throws Exception {
         ResponseJson rj = ResponseJson.getFAILURE();
         Integer num = salesOrderService.listSalesOrderAndItemNum(so);
-        if(num > 1000){
+        if(num > 5000){
             rj.setResultMsg("下载订单超过1000条,请精确查询条件");
             return rj;
         }
@@ -754,7 +754,7 @@ public class AdminOrderController {
 
         List<SalesOrder> temporarySalesOrderList = salesOrderService.listSalesOrderAndItem(so);
 
-        if(temporarySalesOrderList.size() > 1000){
+        if(temporarySalesOrderList.size() > 5000){
             return new ModelAndView().addObject("下载出错");
         }
 

+ 75 - 10
watero-rst-web/src/main/java/com/iamberry/rst/controllers/product/AdminProductController.java

@@ -1,8 +1,11 @@
 package com.iamberry.rst.controllers.product;
 
 import com.iamberry.rst.controllers.sys.SysController;
+import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.product.ProductService;
+import com.iamberry.rst.utils.StitchAttrUtil;
 import com.iamberry.wechat.tools.ResponseJson;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.slf4j.Logger;
@@ -10,7 +13,9 @@ import org.slf4j.LoggerFactory;
 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 java.text.SimpleDateFormat;
@@ -45,19 +50,79 @@ public class AdminProductController {
     }
 
     /**
-     * 获取产品和颜色的下拉框选择
+     * 产品列表
      * @param request
-     * @param productColor
      * @return
-     * @throws Exception
      */
-    @ResponseBody
-    @RequestMapping("/getProductAndColor")
-    public ResponseJson getProductAndColor(HttpServletRequest request, ProductColor productColor) throws Exception {
-        ResponseJson rj =  new ResponseJson(200, "SUCCESS", 200);
-        List<ProductColor> productColorList = productService.listproductAndColor(productColor);
-        rj.addResponseKeyValue("productColorList",productColorList);
-        return rj;
+    @RequiresPermissions("salesOrder:list:product")
+    @RequestMapping("/product_page")
+    public ModelAndView productPage(HttpServletRequest request, Product product,
+                                         @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("product/product_list");
+
+        PagedResult<Product> pagedResult = productService.listProductPage(pageNO, pageSize, product, totalNum == 0);
+        if (totalNum != 0){
+            pagedResult.setTotal(totalNum);
+        }
+
+        StitchAttrUtil.getSa()
+                .setModelAndView(product, mv, "/admin/product/product_page", pagedResult);
+        return mv;
+    }
+
+
+    /**
+     * 到添加页面产品
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("salesOrder:save:product")
+    @RequestMapping("/to_add_product")
+    public ModelAndView toAddProduct(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("product/product_list");
+
+        return mv;
+    }
+
+    /**
+     * 添加产品
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("salesOrder:save:product")
+    @RequestMapping("/add_product")
+    public ModelAndView addProduct(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("product/product_list");
+
+        return mv;
+    }
+
+
+    /**
+     * 到修改页面产品
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("salesOrder:update:product")
+    @RequestMapping("/to_update_product")
+    public ModelAndView toUpdateProduct(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("product/product_list");
+
+        return mv;
+    }
+
+    /**
+     * 修改产品
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("salesOrder:update:product")
+    @RequestMapping("/update_product")
+    public ModelAndView updateProduct(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("product/product_list");
+        return mv;
     }
 
 }

+ 3 - 0
watero-rst-web/src/main/resources/watero-rst-orm.xml

@@ -184,7 +184,10 @@
 		<mapper resource="com/iamberry/rst/service/sys/mapper/sysMapper.xml"/>
 
 		<mapper resource="com/iamberry/rst/service/sms/mapper/messageMapper.xml"/>
+
 		<mapper resource="com/iamberry/rst/service/product/mapper/productMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/product/mapper/productColorMapper.xml"/>
+
 		<mapper resource="com/iamberry/rst/service/faq/mapper/faqMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/pts/mapper/produceMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/pts/mapper/ptsEmployeeMapper.xml"/>

+ 228 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/product/add_product.ftl

@@ -0,0 +1,228 @@
+<!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;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 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: 25px;}
+        .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: 150px;}
+
+        .all_down{text-decoration: underline;color: #00c;}
+    </style>
+    <title>添加产品 - 产品管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 产品管理
+    <span class="c-gray en">&gt;</span> 添加产品
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;margin-right: 5px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       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="${path}/admin/product/add_product" method="post" class="form form-horizontal" id="form-order-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <div class="row cl">
+                <label class="form-label col-3">
+                    <div class="tit-2">产品基本信息</div>
+                </label>
+                <div class="formControls col-9">
+                </div>
+            </div>
+
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1">类型:</label>
+                <div class="formControls col-2 col-sm-2" style="">
+                    <span class="select-box">
+                        <select class="select" id="salesBatchId" name="salesBatchId" >
+                            <option value="1" >新增批次</option>
+                        <#--<#list orderBatchs as orderBatch>-->
+                            <#--<option value="${orderBatch.batchId}" >${orderBatch.batchId}</option>-->
+                        <#--</#list>-->
+                        </select>
+				    </span>
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">产品名称:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写产品名称" id="productName" name="productName" datatype="*1-32" errormsg="产品名称格式不正确!" >
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">产品简称:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写产品简称" id="productAbbreviation" name="productAbbreviation" datatype="*1-15" errormsg="产品简称格式不正确!">
+                </div>
+            </div>
+
+
+            <div class="row cl" id="recipientAddressText" style="">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="addressDesc" style="height: 50px;" id="addressDesc" cols="" rows="2" datatype="*" errormsg="收货地址不正确!" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
+                    <span id="addrssMsg"></span>
+                </div>
+                <input type="hidden" name="salesAddressInfo" id="salesAddressInfo" value="">
+            </div>
+
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">支付时间:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" placeholder="购买日期" id="salesPayTime"  name="salesPayTime" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate: '%y-%M-%d'})"  readonly="readonly">
+                </div>
+                <label class="form-label col-2 col-sm-2">支付方式:</label>
+                <div class="formControls col-2 col-sm-2" style="">
+                    <span class="select-box">
+                        <select class="select" id="salesPayType" name="salesPayType">
+                            <#--1:微信支付 2:现金支付3:已支付定金¥99 4:刷卡支付 5:支付宝支付-->
+                                <option value="1">微信支付</option>
+                            <option value="2">现金支付</option>
+                            <option value="4">刷卡支付</option>
+                            <option value="5">支付宝支付</option>
+                        </select>
+				    </span>
+                </div>
+            </div>
+
+
+            <div class="row cl">
+                <label class="form-label col-3">
+                    <div class="tit-2">商品信息</div>
+                </label>
+                <div class="formControls col-9">
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">商品信息:</label>
+                <div class="formControls col-8 col-sm-8">
+                    <input type="button" class="btn btn-primary add-order-button" onclick="add_product()" value="添加商品" >
+                    <table class="table table-border table-bg table-bordered" style="margin-top: 10px;display: none" id="all_add_product">
+                        <thead>
+                        <tr class="text-c" id="table1">
+                            <th style="text-align: center;" width="30" >产品名称</th>
+                            <th style="text-align: center;" width="25" >产品颜色</th>
+                            <th style="text-align: center;" width="10">售价</th>
+                            <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">
+                        </tbody>
+                    </table>
+                    <input type="hidden" id="orderItemString" name="orderItemString" value="" >
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">总金额:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="总金额" datatype="*" errormsg="必须要输入总金额!" id="salesAmount" name="salesAmount"  >
+                </div>
+                <label class="form-label col-2 col-sm-2">实付金额:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="0" placeholder="实付金额" datatype="*" errormsg="必须要输入总金额!" id="salesPayMoney" name="salesPayMoney"  >
+                </div>
+                <div class="formControls col-2 col-sm-2" style="display: none">
+                    <input type="text" class="input-text" value="0" placeholder="优惠金额" datatype="*" errormsg="必须要输入总金额!" id="salesDiscountMoney" name="salesDiscountMoney"  >
+                </div>
+
+                <div class="formControls col-2 col-sm-2">
+                    <input type="button" style="width: 100%;" class="btn btn-primary add-order-button" onclick="calculatePrice()" value="计算商品总价" >
+                </div>
+            </div>
+
+            <input type="hidden" class="input-text" value="0" placeholder="待付金额" id="salesWaitMoney" name="salesWaitMoney"  >
+            <input type="hidden" class="input-text" value="0" placeholder="本次支付金额" id="salesLastMoney" name="salesLastMoney"  >
+            <input type="hidden" class="input-text" value="0" placeholder="邮费" id="salesShippingFee" name="salesShippingFee"  >
+
+            <div class="row cl">
+                <label class="form-label col-3">
+                    <div class="tit-2">备注信息</div>
+                </label>
+                <div class="formControls col-9">
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">用户备注:</label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="salesUserRemark" id="salesUserRemark" cols="" rows="2"  class="textarea" placeholder="请填写用户备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
+                <#--<span id="addrssMsg"></span>-->
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1">后台备注:</label>
+                <div class="formControls col-6 col-sm-6">
+                    <textarea name="salesAdminRemark" id="salesAdminRemark" cols="" rows="2" class="textarea" placeholder="请填写后台备注,最多支持100字符" onKeyUp="$.Huitextarealength(this,100)"></textarea>
+                <#--<span id="addrssMsg"></span>-->
+                </div>
+            </div>
+
+            <div class="row cl">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <button class="btn btn-block btn-primary size-XL" type="submit">确认录入</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">
+    $('.skin-minimal input').iCheck({
+        checkboxClass: 'icheckbox-blue',
+        radioClass: 'iradio-blue',
+        increaseArea: '20%'
+    });
+</script>
+
+<script type="text/javascript" charset="utf-8" src="${path}/common/js/product/product.js"></script>
+
+</body>
+</html>

+ 134 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/product/product_list.ftl

@@ -0,0 +1,134 @@
+<!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;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
+        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
+        .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">&gt;</span> 订单管理
+    <span class="c-gray en">&gt;</span> 产品列表
+    <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" 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/order_batch/batch_list" method="post">
+
+            <div style="position: relative;float: left;display: block;width: 110px;height: 30px;" id="addOrderDiv" >
+                <button type="button" style="cursor:pointer" class="my-btn-search my-order" id="addProduct" onclick="to_add()" >添加产品</button>
+            </div>
+
+            <#--<input type="text" class="my-input trim_input"  style="margin-top: -3px;width:118px;margin-right: 0px;height: 28px;padding: 0px;" value="${orderBatch.batchId!}" placeholder="批次编号" name="batchId" id="batchId">-->
+
+             <button type="submit" class="my-btn-search" style="" id="" name=""><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="100">名称</th>
+                    <th width="80">简称</th>
+                    <th width="50">状态</th>
+                    <th width="50">颜色</th>
+                    <th width="50">类型</th>
+                    <th width="50">型号</th>
+                    <th width="50">备注</th>
+                    <th width="80">创建时间</th>
+                    <th width="80">操作</th>
+                </tr>
+            </thead>
+        <tbody>
+            <#if page.dataList?? &&  (page.dataList?size > 0) >
+                    <#list page.dataList as product>
+                        <tr class="text-c">
+                            <td>${product.productName!''}</td>
+                            <td>${product.productAbbreviation!''}</td>
+                            <td>${product.productStatus!''}</td>
+                            <td></td>
+                            <td>${product.productType!''}</td>
+                            <td>${product.productNumber!''}</td>
+                            <td>${product.productRemark!''}</td>
+                            <td>${(product.productCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                            <td>
+                                <a style="text-decoration:none;color: #00E;" href="javascript:void(0);" title="修改" onclick="update('${product.productId!''}')">
+                                    修改
+                                </a>
+                            </td>
+                        </tr>
+                    </#list>
+            <#else>
+                <tr><td colspan="9" 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}/admin/salesOrder/list_order_page?salesBatchId="+batchId + "&salesShippingStatus=0";
+    }
+
+    /**
+     *下载
+     * @param employee
+     */
+    function download_order(batchId) {
+        window.location.href= "${path}/admin/order/download_order_excel?salesBatchId="+batchId;
+    }
+
+    /**
+     * 审核订单
+     */
+    function review_order(batchId){
+        $.ajax('${path}/admin/order_batch/confirm_salesOrder_batch?dates=' + new Date().getTime(), {
+            data: {"batchId":batchId},
+            dataType: 'json',
+            type: 'post',
+            timeout: 15000,
+            success: function(dt) {
+                layer.msg("确认订单成功", {icon: 1, time: 3000});
+                location.reload();
+            },
+            error: function(xhr, type, errorThrown) {
+                layer.msg("确认订单失败,请重试!", {icon: 5, time: 3000});
+            }
+        });
+    }
+
+    /*分配快递方式*/
+    function distribution_postFirm(title,url,w,h){
+        layer_show(title,url,w,h);
+    }
+</script>
+</body>
+</html>

+ 231 - 0
watero-rst-web/src/main/webapp/common/js/product/product.js

@@ -0,0 +1,231 @@
+
+var allCustomerId = "";
+
+
+/**
+ * 打开商品列表
+ */
+function add_product() {
+    layer_show("商品列表",url_path + "/admin/salesOrder/to_add_product","1000","500");
+}
+
+/**
+ * 打开客诉列表
+ */
+function add_customer() {
+    layer_show("客诉列表",url_path + "/admin/customer/to_add_customer_list","1000","500");
+}
+
+$(function(){
+    $("#salesOrderStatus").change(function(){
+        var status = $(this).val();
+        if(status == 1){    //正常订单
+            $("#selectCustomer").hide();
+            $("#salesCustomer").hide();
+            $("#salesCustomerIdHtml").html("");
+            $("#salesCustomerId").val("");
+        }else{
+            $("#selectCustomer").show();
+            $("#salesCustomer").show();
+            $("#salesCustomerIdHtml").html("未选择客诉编号!");
+        }
+    })
+})
+
+$(function(){
+    var loadIndex = 0;
+    $("#form-order-add").Validform({
+        tiptype: function (msg, o, cssctl) {
+            if (o.type == 3) {//失败
+                layer.msg(msg, {icon: 5, time: 3000});
+                $(window).scrollTop(o.obj.offset().top - 40);
+            }
+        },
+        datatype: {//自定义验证类型
+        },
+        ignoreHidden: true,
+        tipSweep: true, //若为true,则只在表单提交时验证
+        ajaxPost: true, //异步提交
+        beforeCheck: function (curform) {  //验证通过之前执行的函数
+            var flag = false;
+        },
+        beforeSubmit: function (curform) {  //验证通过之后执行的函数
+            var addressProvince = $("#addressProvince").find("option:selected").text();
+            var addressCity = $("#addressCity").find("option:selected").text();
+            var addressCountry = $("#addressCountry").find("option:selected").text();
+            var addressDesc = $("#addressDesc").val();
+            var salesAddressInfo = addressProvince + " " + addressCity + " " + addressCountry + " " + addressDesc
+            $("#salesAddressInfo").val(salesAddressInfo);
+
+            var flag = false;
+            /*封装订单项*/
+            var orderItemArray = new Array();
+            $("#add_product").find("tr").each(function(){
+                var orderItem = new Object();
+                orderItem.itemColorId = $(this).find(".color_id").val();
+                orderItem.itemNum = $(this).find(".item-num").val();
+                orderItemArray.push(orderItem);
+                flag = true;
+            })
+            if(!flag){
+                vailErrorMsg($(".add-order-button"),"必须要有一个产品");
+                return false;
+            }
+
+            $("#orderItemString").val(JSON.stringify(orderItemArray));
+
+            loadIndex = layer.load(1, {
+                shade: [0.5,'#fff'] //0.1透明度的白色背景
+            });
+        },
+        callback: function (data) {//异步回调函数
+            if (data) {
+                var index = layer.alert(data.resultMsg, function (index) {
+                    if (data.resultCode == 200) {
+                        location.href = url_path + "/admin/salesOrder/list_order_page";
+                    }else {
+                        layer.close(index);
+                    }
+                });
+                if(loadIndex != 0 ){
+                    layer.close(loadIndex);
+                }
+            }
+            return false;
+        }
+    });
+});
+
+
+/**
+ * 客诉回调
+ * @param colorIds
+ */
+function setSelectCustomer(customerId){
+    var index = layer.load(1, {
+        shade: [0.5,'#fff'] //0.1透明度的白色背景
+    });
+
+    $.ajax({
+        type: "POST",
+        data: { customerId : customerId},
+        url: url_path +"/admin/customer/get_customer_info",
+        success: function(data){
+            if (data.returnCode == 200 && data.returnMsg.customer != null ) {
+                var customer = data.returnMsg.customer;
+                $("#salesCustomerIdHtml").html("已经选择客诉记录:"+customer.customerId);
+                $("#salesCustomerId").val(customer.customerId);
+                sc.setCompanyId(customer.companyId);
+                sc.setStoreId(customer.storeId);
+                /*设置用户姓名、电话*/
+                $("#salesAddressName").val(customer.customerName);
+                $("#salesAddressTel").val(customer.customerTel);
+                /* 售后订单的支付时间、支付方式默认 */
+                $("#salesPayTime").val(customer.salesTime);
+
+            }else{
+            }
+            $("#salesCustomer").show();
+        }
+    });
+    layer.close(index);
+}
+
+
+/**
+ * 选择商品回调
+ * @param colorIds
+ */
+function setSelectProduct(colorIds){
+    var index = layer.load(1, {
+        shade: [0.5,'#fff'] //0.1透明度的白色背景
+    });
+
+    $("#all_add_product").show();
+
+    var colorIdArray = colorIds.split("_");
+    for(var i=0;i<colorIdArray.length;i++){
+        var colorId = colorIdArray[i];
+        if(colorId == ""){
+            break;
+        }
+
+        var flag = true;
+        $("#add_product").find("tr").each(function (){
+            var colId = $(this).find(".color_id").eq(0).val();
+            if(colId == colorId){
+                flag  = false;
+            }
+        })
+        if(!flag){
+            continue;
+        }
+        $.ajax({
+            type: "POST",
+            data: { colorId : colorId},
+            url: url_path +"/admin/product/get_product",
+            success: function(data){
+                var html = "";
+                if (data.returnCode == 200 && data.returnMsg.productColorList.length > 0 ) {
+                    for(var i=0;i<data.returnMsg.productColorList.length;i++){
+                        var productColor = data.returnMsg.productColorList[i];
+                        html += '<tr class="text-c">' +
+                            '<input type="hidden" class="color_id" id="" value="'+ productColor.colorId +'" >' +
+                            '<input type="hidden" class="color_price" id="" value="'+ productColor.colorPrice +'" >' +
+                            '<input type="hidden" class="color_discount" id="" value="'+ productColor.colorDiscount +'" >' +
+                            ' <td>'+ cufte(productColor.productName) +'</td>' +
+                            ' <td>'+ cufte(productColor.colorName) +'</td>' +
+                            ' <td>'+ cufte(productColor.colorPrice)/100 +'</td>' +
+                            ' <td>'+ cufte(productColor.colorBar) +'</td>' +
+                            ' <td><input type="text" class="input-text input-number item-num" value="1"  style="width: 100%;border: none;text-align: center;" name="" id="" placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>' +
+                            ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))" >删除</a></td>' +
+                            ' </tr>';
+                    }
+                }else{
+                    html = '<tr class="text-c"><td colspan="12">没有搜索到商品,请重试!</td></tr>';
+                }
+                $("#add_product").append(html);
+                /*计算价格*/
+                calculatePrice();
+            }
+        });
+    }
+    layer.close(index);
+}
+
+/**
+ *  删除商品
+ */
+function delProduct($this){
+    $this.parents("tr").remove();
+}
+
+/**
+ * 计算价格
+ */
+function calculatePrice(){
+    /*总价,折扣价,优惠金额*/
+    var colorDiscountAll = 0,colorPriceAll = 0,salesPayMoneyAll=0;
+    $("#add_product").find("tr").each(function(){
+        var colorDiscount = 0,colorPrice = 0,salesPayMoney=0,itemNum=0;
+        colorDiscount = parseInt($(this).find(".color_discount").val())/100;
+        colorPrice = parseInt($(this).find(".color_price").val())/100;
+        itemNum = $(this).find(".item-num").val();
+        if(!isEmpty(itemNum)){
+            return;
+        }
+        itemNum = parseInt(itemNum);
+        salesPayMoney = colorPrice -colorDiscount;
+        if(salesPayMoney < 0){
+            salesPayMoney = 0;
+        }
+        colorDiscountAll += colorDiscount*itemNum;
+        colorPriceAll += colorPrice*itemNum;
+        salesPayMoneyAll += salesPayMoney*itemNum;
+    })
+    $("#salesAmount").val(colorPriceAll);
+    $("#salesPayMoney").val(colorDiscountAll);
+    $("#salesDiscountMoney").val(salesPayMoneyAll);
+
+    $("#salesLastMoney").val(colorDiscountAll);
+}