Explorar o código

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

wangxiaoming %!s(int64=7) %!d(string=hai) anos
pai
achega
3936290985

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

@@ -1,5 +1,7 @@
 package com.iamberry.rst.core.order;
 
+import com.iamberry.rst.core.cm.FittingsInfo;
+
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Date;
@@ -39,6 +41,9 @@ public class Product implements Serializable {
 
     private List<ProductColor> colorList = new ArrayList<ProductColor>();   //产品颜色集合
 
+    private List<FittingsInfo> fittingsList = new ArrayList<FittingsInfo>();   //产品配件集合
+
+
     public Integer getProductId() {
         return productId;
     }
@@ -126,6 +131,14 @@ public class Product implements Serializable {
         this.typeName = typeName;
     }
 
+    public List<FittingsInfo> getFittingsList() {
+        return fittingsList;
+    }
+
+    public void setFittingsList(List<FittingsInfo> fittingsList) {
+        this.fittingsList = fittingsList;
+    }
+
     @Override
     public String toString() {
         return "Product{" +
@@ -138,6 +151,7 @@ public class Product implements Serializable {
                 ", productRemark='" + productRemark + '\'' +
                 ", productType=" + productType +
                 ", colorList=" + colorList +
+                ", fittingsList=" + fittingsList +
                 '}';
     }
 }

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

@@ -78,4 +78,11 @@ public interface ProductService {
      * @return
      */
     List<ProductType> listProductType(ProductType productType);
+
+    /**
+     * 根据条件查询产品及颜色 配件集合
+     * @param product
+     * @return
+     */
+    List<Product> listProductAndColorAndfittings(Product product);
 }

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/product/ProductServiceImpl.java

@@ -127,4 +127,9 @@ public class ProductServiceImpl implements ProductService {
     public List<ProductType> listProductType(ProductType productType) {
         return productMapper.listProductType(productType);
     }
+
+    @Override
+    public List<Product> listProductAndColorAndfittings(Product product) {
+        return productMapper.listProductAndColorAndfittings(product);
+    }
 }

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

@@ -59,4 +59,13 @@ public interface ProductMapper {
      * @return
      */
     List<ProductType> listProductType(ProductType productType);
+
+    /**
+     * 根据条件查询产品及颜色 配件集合
+     * @param product
+     * @return
+     */
+    List<Product> listProductAndColorAndfittings(Product product);
+
+
 }

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

@@ -112,4 +112,57 @@
     <select id="getProduce"  resultType="product">
         select * from tb_rst_product_info where product_id = #{productId}
     </select>
+    
+    <select id="listProductAndColorAndfittings" parameterType="Product" resultMap="productColorFittingsMap">
+        select * from
+        tb_rst_product_info
+    </select>
+
+    <resultMap id="productColorFittingsMap" type="Product">
+        <id property="product_id" column="productId"/>
+        <result property="product_name" column="productName"/>
+        <result property="product_abbreviation" column="productAbbreviation"/>
+        <result property="product_salesnum" column="productSalesnum"/>
+        <result property="product_status" column="productStatus"/>
+        <result property="product_create_time" column="ProductCreateTime"/>
+        <result property="product_remark" column="productRemark"/>
+        <result property="product_type" column="productType"/>
+        <result property="product_number" column="ProductNumber"/>
+        <collection property="colorList" column="PRODUCT_ID" ofType="ProductColor" select="listProduceColorById"/>
+        <collection property="fittingsList" column="PRODUCT_ID" ofType="FittingsInfo" select="listProduceFittingsById"/>
+    </resultMap>
+
+    <select id="listProduceColorById" parameterType="String" resultType="ProductColor">
+        select
+        c.color_id colorId,
+        c.color_product_id colorProductId,
+        c.color_name colorName,
+        c.color_discount colorDiscount,
+        c.color_price colorPrice,
+        c.color_bar colorBar,
+        c.color_picture colorPicture,
+        c.color_status colorStatus,
+        c.color_cretae_time colorCretaeTime,
+        c.color_update_time colorUpdateTime
+        from
+        tb_rst_product_color c
+        WHERE
+        c.color_product_id  = #{productId}
+    </select>
+
+    <select id="listProduceFittingsById" parameterType="String" resultType="FittingsInfo">
+        select
+        fittings_id fittingsId,
+        product_id productId,
+        fittings_name fittingsName,
+        fittings_discount fittingsDiscount,
+        fittings_price fittingsPrice,
+        fittings_bar fittingsBar,
+        fittings_status fittingsStatus,
+        fittings_cretae_time fittingsCretaeTime
+        from
+        tb_rst_product_fittings
+        WHERE
+        product_id  = #{productId}
+    </select>
 </mapper>

+ 9 - 34
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -1,9 +1,6 @@
 package com.iamberry.rst.controllers.cm;
 
-import com.iamberry.rst.core.cm.AwaitingSignclosedProductInfo;
-import com.iamberry.rst.core.cm.ComplaintDetectInfo;
-import com.iamberry.rst.core.cm.ComplaintSignclosedInfo;
-import com.iamberry.rst.core.cm.SignclosedProductInfo;
+import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.order.Product;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
@@ -46,20 +43,19 @@ public class AdminSignclosedController {
     @Autowired
     private ComplaintSignclosedInfoService complaintSignclosedInfoService;
     /**
-     * 跳转到添加检测记录页面
+     * 跳转到添加签收记录页面
      *
      * @return
      */
-    @RequiresPermissions("detect:add:detect")
-    @RequestMapping(value = "/to_add_detect")
+    @RequiresPermissions("signclosed:add:signclosed")
+    @RequestMapping(value = "/to_add_signclosed")
     public ModelAndView toAddDetect(HttpServletRequest request) {
-        ModelAndView mv = new ModelAndView("cm/inspection/add_detect");
-        //获取所有产品
-        List<Product> productList = productService.listProduce();
+        ModelAndView mv = new ModelAndView("cm/signclosed/add_signclosed");
+        //获取所有产品及其颜色,配件
+        Product product = new Product();
+        List<Product> productList = productService.listProductAndColorAndfittings(product);
         mv.addObject("productList",productList);
-        /*//获取所有配件
-        List<FittingsInfo> listFittings = fittingsInfoService.listFittings();
-        mv.addObject("listFittings",listFittings);*/
+
         return mv;
     }
 
@@ -80,27 +76,6 @@ public class AdminSignclosedController {
 
         ModelAndView mv = new ModelAndView("cm/signclosed/signclosed_list");
         StringBuilder url = new StringBuilder("/admin/signclosed/select_signclosed_list?pageSize=" + pageSize);
-// 请求参数
-        /*if (signclosedInfo.getSignclosedType() != null) {
-            url.append("&signclosedType=").append(signclosedInfo.getSignclosedType());
-            mv.addObject("signclosedType",signclosedInfo.getSignclosedType());
-        }
-        if (StringUtils.isNotEmpty(signclosedInfo.getSignclosedSendName())) {
-            url.append("&signclosedInfo=").append(signclosedInfo.getSignclosedSendName());
-            mv.addObject("signclosedInfo",signclosedInfo.getSignclosedSendName());
-        }
-        if (StringUtils.isNotEmpty(signclosedInfo.getSignclosedSendTel())) {
-            url.append("&signclosedSendTel=").append(signclosedInfo.getSignclosedSendTel());
-            mv.addObject("signclosedSendTel",signclosedInfo.getSignclosedSendTel());
-        }
-        if (StringUtils.isNotEmpty(signclosedInfo.getSignclosedLogisticsNumber())) {
-            url.append("&signclosedLogisticsNumber=").append(signclosedInfo.getSignclosedLogisticsNumber());
-            mv.addObject("signclosedLogisticsNumber",signclosedInfo.getSignclosedLogisticsNumber());
-        }
-        if (signclosedInfo.getSignclosedObjectsState() != null) {
-            url.append("&signclosedObjectsState=").append(signclosedInfo.getSignclosedObjectsState());
-            mv.addObject("signclosedObjectsState",signclosedInfo.getSignclosedObjectsState());
-        }*/
         // 封装请求数据
         PageRequest<ComplaintSignclosedInfo> pageRequest = new PageRequest<>(signclosedInfo, pageNO, pageSize, pageTotal == null);
         // 查询订单列表

+ 711 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/add_signclosed.ftl

@@ -0,0 +1,711 @@
+<!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">
+    <link href="${path}/common/lib/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css"/>
+    <link href="${path}/common/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
+    <link href="${path}/common/lib/icheck/icheck.css" rel="stylesheet" type="text/css"/>
+    <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;}
+
+        #suggest, #suggest2 {width:200px}
+        .gray {color:gray}
+        .ac_results {background:#fff;border:1px solid #7f9db9;position: absolute;z-index: 10000;display: none}
+        .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_over, .ac_results li a:hover {background:#c8e3fc}
+        .ac_results li a span {float:right}
+        .ac_result_tip {border-bottom:1px dashed #666;padding:3px}
+
+        .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;}
+        .dalog-ask .ask{color: #000;margin: 10px 0 5px 0;}
+        .dalog-ask .answer{color: #666;margin-bottom: 10px;}
+        .dalog-ask .answer:hover{color: #32a3d8;cursor: pointer;}
+        .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;}
+        .my-search-input{padding-left: 30px;background: url(${path}/common/images/cm/search.png) 6px center no-repeat;background-size: auto 60%; }
+    </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>
+</nav>
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+        <form action="" method="post" class="form form-horizontal" id="form-article-add">
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收类型:</label>
+				<div class="radio-box">
+                        <input type="radio" id="tel-1" name="signclosedType" datatype="*"  checked nullmsg="请选择签收类型!">
+                        <label for="tel-1">客诉寄回</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-2" name="signclosedType">
+                        <label for="tel-2">代理商退货</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-3" name="signclosedType">
+                        <label for="tel-3">其他</label>
+                        <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="选择其他时有值" id="signclosedTypeName" name="signclosedTypeName">
+                    </div>
+
+            </div>
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄回产品:</label>
+                <div class="formControls col-8 col-sm-8 text-c" id="produceSelect">
+                    <table class="table table-border table-bg table-bordered">
+                        <thead>
+                        <tr class="text-c">
+                            <th style="text-align: center;" width="100">产品名称</th>
+                            <th style="text-align: center;" width="100">产品颜色</th>
+                            <th style="text-align: center;" width="100">产品配件</th>
+                        </tr>
+                        </thead>
+                        <tbody id="addProduct">
+                        <#if (productList?size > 0)>
+                            <#list productList as product>
+                            <tr >
+
+
+                                <td>${product.productName!''}</td>
+                                <td>
+                                    <#if (product.colorList?size > 0)>
+                                        <#list product.colorList as colorList>
+                                        ${colorList.colorName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                        </#list>
+                                    <#else>
+                                        暂无颜色,请先添加产品颜色
+                                    </#if>
+                                </td>
+                                <td>
+                                    <#if (product.fittingsList?size > 0)>
+                                        <#list product.fittingsList as fittingsList>
+                                        ${fittingsList.fittingsName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                        </#list>
+                                    <#else>
+                                        暂无配件,请先添加配件
+                                    </#if>
+                                </td>
+
+                            </tr>
+                            </#list>
+                        </#if>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄回物流:</label>
+                <div class="formControls col-3 col-sm-3 skin-minimal">
+                    <span class="select-box">
+                    <select name="signclosedLogistics" class="select">
+                        <option value="">请选择物流公司</option>
+                        <option value="sto">申通快递</option>
+                        <option value="yto">圆通快递</option>
+                        <option value="sf">顺丰快递</option>
+                        <option value="ems">邮政EMS</option>
+                        <option value="zto">中通快递</option>
+                        <option value="zjs">宅急送</option>
+                        <option value="yunda">韵达快递</option>
+                        <option value="cces">cces快递</option>
+                        <option value="pick">上门提货</option>
+                        <option value="htky">汇通快递</option>
+                        <option value="ttkdex">天天快递</option>
+                        <option value="stars">星晨急便</option>
+                        <option value="jd">京东快递</option>
+                        <option value="01">其他</option>
+                        <option value="02">上门送货</option>
+                    </select>
+                    </span>
+                </div>
+                <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="物流单号" id="signclosedLogisticsNumber" name="signclosedLogisticsNumber">
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄件人信息:</label>
+                <div class="formControls col-4 col-sm-4 skin-minimal">
+                    <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="寄件方姓名/公司名称" id="signclosedSendName" name="signclosedSendName">
+                    <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="寄件方联系电话" id="signclosedSendTel" name="signclosedSendTel">
+                </div>
+            </div>
+
+            <div class="row cl" style="position: relative;">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>寄件区域:</label>
+                <div class="formControls col-3 col-sm-3 skin-minimal">
+                    <span class="select-box">
+                    <select name="signclosedAddrProvinces" id="province" class="select">
+
+
+                    </select>
+                     </span>
+                </div>
+                    <div class="formControls col-3 col-sm-3 skin-minimal">
+                    <span class="select-box">
+                    <select name="signclosedAddrCity" id="city" class="select">
+
+
+                    </select>
+                    </span>
+                </div>
+            </div>
+
+            <div class="row cl" id="renewedProduct">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收产品:</label>
+                <div class="formControls col-8 col-sm-8 text-c" id="produceSelect">
+                    <table class="table table-border table-bg table-bordered">
+                        <thead>
+                        <tr class="text-c">
+                            <th style="text-align: center;" width="100">产品名称</th>
+                            <th style="text-align: center;" width="100">产品颜色</th>
+                            <th style="text-align: center;" width="100">产品配件</th>
+                        </tr>
+                        </thead>
+                        <tbody id="addProduct">
+                        <#if (productList?size > 0)>
+                            <#list productList as product>
+                        <tr >
+
+
+                            <td>${product.productName!''}</td>
+                            <td>
+                                <#if (product.colorList?size > 0)>
+                                    <#list product.colorList as colorList>
+                                    ${colorList.colorName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                    </#list>
+                                <#else>
+                                暂无颜色,请先添加产品颜色
+                                </#if>
+                             </td>
+                            <td>
+                                <#if (product.fittingsList?size > 0)>
+                                    <#list product.fittingsList as fittingsList>
+                                    ${fittingsList.fittingsName!''}<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="" name=""><br>
+                                    </#list>
+                                <#else>
+                                    暂无配件,请先添加配件
+                                </#if>
+                            </td>
+
+                        </tr>
+                            </#list>
+                        </#if>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+
+
+
+
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否少配件:</label>
+                <div class="formControls col-5 col-sm-5 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="tel-4" name="signclosedIsFittings" datatype="*" checked  >
+                        <label for="tel-4">缺少配件</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-5" name="signclosedIsFittings" datatype="*">
+                        <label for="tel-5">不缺配件</label>
+                    </div>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>签收日期:</label>
+                <div class="formControls col-5 col-sm-5 skin-minimal">
+                   <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" placeholder="签收日期" id="signclosedDate" name="signclosedDate">
+                </div>
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否品检:</label>
+                <div class="formControls col-5 col-sm-5 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="tel-6" name="signclosedIsQuality" datatype="*" checked  >
+                        <label for="tel-6">需要品检</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-7" name="signclosedIsQuality" datatype="*">
+                        <label for="tel-7">不需要品检</label>
+                    </div>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3"><span class="c-red">*</span>是否已转入:</label>
+                <div class="formControls col-5 col-sm-5 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="tel-8" name="signclosedIsInto" datatype="*" checked  >
+                        <label for="tel-8">已转入品检</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-9" name="signclosedIsInto" datatype="*">
+                        <label for="tel-9">未转入品检</label>
+                    </div>
+                </div>
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-3 col-sm-3">备注:</label>
+                <div class="formControls col-5 col-sm-5">
+                    <textarea name="signclosedDesc" id="signclosedDesc" cols="" rows="2" class="textarea" placeholder="请填写备注"></textarea>
+                </div>
+            </div>
+            <div class="row cl">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <button onClick="save_submit();" class="btn btn-block btn-primary size-XL" type="submit">确认录入</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</article>
+
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript" src="${path}/common/lib/webuploader/0.1.5/webuploader.min.js"></script>
+<script type="text/javascript" src="${path}/common/lib/icheck/jquery.icheck.min.js"></script>
+<script type="text/javascript" src="${path}/common/lib/cm.lib/jquery.provincesCity.js"></script>
+<script type="text/javascript" src="${path}/common/lib/cm.lib/provincesData.js"></script>
+<script type="text/javascript" src="${path}/common/lib/cm.lib/airCity.js"></script>
+<#--<script type="text/javascript" src="${path}/common/lib/cm.lib/dimensions.js"></script>-->
+<script type="text/javascript" src="${path}/common/lib/cm.lib/suggest.js"></script>
+<script type="text/javascript">
+    $(function(){
+    });
+
+    $(document).on('click', '.dalog-ask .answer', function() {
+        $("#answer-textarea").text($(this).find("span").text());
+    });
+
+</script>
+<script type="text/javascript">
+
+    /*处理结果的执行状态*/
+    var isSolve = {
+        solved : [],
+        noSolved : [],
+        renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
+        maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
+        reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
+        backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
+        noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
+    }
+
+    /*全局标识当前状态  type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货*/
+    var allCustomerType = 1;
+
+    /*初始化页面参数*/
+    $(function () {
+
+        /*初始化问题分类*/
+        initComplaintTypeInfo();
+
+        /*初始化客服*/
+        initSysAdmin();
+
+        /*初始化产品类型 --  客诉头部的产品类型单选 */
+        initProduceType();
+
+        /*初始化选择处理结果 -- type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货 */
+        initProcessResult(1);
+
+        /*监听处理结果选择事件*/
+        $("[name='customerIsSolve']").change(function(){
+            initProcessResult(parseInt($(this).val()));
+            allCustomerType = parseInt($(this).val());
+        })
+
+        /*监听问题类型 选择事件*/
+        $("[name='complaintId']").change(function(){
+            initComplaintSmallClassInfo($(this).val());
+        })
+
+        /*监听问题关键字搜索*/
+        $(document).on('click', '#search_button', function() {
+            initComplaintQuestionInfo();
+        });
+
+        /*搜索订单事件*/
+        $(document).on('click', '#selectOrder', function() {
+            selectOrder();
+        });
+
+        /*监听省选择事件*/
+        $(document).on('change', '#province', function() {
+            var proId = $("#province").val();
+            var cityId = setCity("",proId,2)
+            setDistrict("",cityId,2)
+        });
+
+        /*监听市选择事件*/
+        $(document).on('change', '#city', function() {
+            var city = $("#city").val();
+            setDistrict("",city,2)
+        });
+
+        /* 初始化单选框样式 */
+        initCheck();
+
+    })
+
+    /*初始化单选框样式*/
+    function initCheck(){
+        $('.skin-minimal input').iCheck({
+            checkboxClass: 'icheckbox-blue',
+            radioClass: 'iradio-blue',
+            increaseArea: '20%'
+        });
+    }
+
+
+
+    /*初始化产品类型 --  客诉头部的产品类型单选*/
+    function initProduceType(){
+        var html = "";
+        $.ajax({
+            type: "POST",
+            data: {
+            },
+            url: "${path}/admin/customer/select_produce_type",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    var check = "checked";
+                    for(var i=0;i<data.returnMsg.productTypeList.length;i++){
+                        var produce = data.returnMsg.productTypeList[i];
+                        html += ' <div class="radio-box">' +
+                                '<input type="radio" id="tel-3" name="produceType" datatype="*" value="'+ produce.typeId +'"  '+ check +' nullmsg="请选择产品类型!" >' +
+                                ' <label for="tel-3">'+ produce.typeName +'</label>' +
+                                ' </div>';
+                        check = "";
+                    }
+                }else{
+                    html = '';
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+        $("#produceTypeHtml").html(html);
+    }
+
+
+
+
+    /**
+     * 设置地址
+     */
+    function setAdress(){
+        var addres = $("#addressInfo").val();
+
+        $("#addrssMsg").html("");
+        if(addres == null){
+            $("#addrssMsg").html("*未能获取到地址,请手动选择地址");
+            return;
+        }
+        var addresList = addres.split("-");
+        if(addresList[0] == null || addresList[1]==null || addresList[2]==null || addresList[3]==null){
+            $("#addrssMsg").html("*未能获取到地址,请手动选择地址");
+            return;
+        }
+        var proId = setPro(getAddress(addresList[0],0),1);
+        var cityId = setCity(getAddress(addresList[1],1),proId,1);
+        setDistrict(getAddress(addresList[2],2),cityId,1);
+        $("#sendAddress").val(addresList[3]);
+    }
+
+    /***
+     * 删除 “省”,“市”,“区”关键字
+     * type : 0:省   2:市   3:区
+     */
+    function getAddress(addrss,type) {
+        var abbreviation = "";
+        if(addrss == ""){
+            abbreviation = "";
+        }else{
+            switch(type)
+            {
+                case 0:
+                    var proReg = new RegExp("省","g");
+                    abbreviation = addrss.replace(proReg,"");
+                    break;
+                case 1:
+                    var cityReg = new RegExp("市","g");
+                    abbreviation = addrss.replace(cityReg,"");
+                    break;
+                case 2:
+                    var districtReg = new RegExp("市","g");
+                    abbreviation = addrss.replace(districtReg,"");
+                    break;
+                default:
+                    break;
+            }
+        }
+        return abbreviation
+    }
+
+    /**
+     * 设置省
+     * type  1:搜索订单赋值   2:只查询全部,默认第一个
+     */
+    function setPro(provinceName,type) {
+        var proId = '';
+        var province = listProvince();
+        var selectPro = {};
+        if(type == 1){
+            selectPro = listProvince("",provinceName);
+        }else if(type == 2){
+            selectPro = null;
+        }
+        if(province!=null){
+            var provinceHtml = ''
+            for(var i=0;i<province.length;i++){
+                if(selectPro!= null && province[i].provinceId == selectPro[0].provinceId){
+                    proId = selectPro[0].provinceId;
+                    provinceHtml += '<option value="'+ province[i].provinceId +'" selected>'+ province[i].province +'</option>';
+                }else{
+                    provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
+                }
+            }
+            $("#province").html(provinceHtml);
+        }
+        return proId;
+    }
+
+    /**
+     * 设置市
+     * type  1:搜索订单赋值   2:只查询全部,默认第一个
+     */
+    function setCity(cityName,proId,type) {
+        var cityId = '';
+        var city = listCity(proId,"");
+        var selectCity = {};
+        if(type == 1){
+            selectCity = listCity(proId,cityName);
+        }else if(type == 2){
+            selectCity = null;
+            cityId = city[0].cityId;
+        }
+
+        if(city!=null){
+            var cityHtml = ''
+            for(var i=0;i<city.length;i++){
+                if(selectCity != null && city[i].cityId == selectCity[0].cityId){
+                    cityId = city[i].cityId;
+                    cityHtml += '<option value="'+ city[i].cityId +'" selected>'+ city[i].city +'</option>';
+                }else{
+                    cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
+                }
+            }
+            $("#city").html(cityHtml);
+        }
+        return cityId;
+    }
+
+    /**
+     * 设置区
+     * type  1:搜索订单赋值   2:只查询全部,默认第一个
+     */
+    function setDistrict(districtName,cityId,type) {
+        var district = listDistrict(cityId,"");
+        var selectDistrict = {};
+        if(type == 1){
+            selectDistrict = listDistrict(cityId,districtName);
+        }else if(type == 2){
+            selectDistrict = null;
+        }
+        if(district!=null){
+            var districtHtml = ''
+            for(var i=0;i<district.length;i++){
+                if(selectDistrict != null && district[i].districtId == selectDistrict[0].districtId){
+                    districtHtml += '<option value="'+ district[i].districtId +'" selected>'+ district[i].district +'</option>';
+                }else{
+                    districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
+                }
+            }
+            $("#district").html(districtHtml);
+        }
+    }
+
+    /**
+     * 展示产品
+     * @param produceList
+     */
+    function setProduce(orderItemList) {
+        var html = "";
+        $.ajax({
+            type: "POST",
+            data: {
+            },
+            url: "${path}/admin/customer/select_produce",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.productList.length;i++){
+                        var product = data.returnMsg.productList[i];    //所有产品
+                        var produceFittings = getProduceFittings(product.productId);  //获取该产品的所有配件
+                        var colorList = product.colorList;  //该产品的所有颜色
+
+                        var isColorSelect = false;
+                        var selectColor = new Array();    //颜色选择html和颜色数量对应 对象
+                        if(colorList != null){
+                            for(var m=0;m<orderItemList.length;m++){
+                                var colorNumber = 1;
+                                var colorHtml = '';
+                                for(var j=0;j<colorList.length;j++){
+                                    var colors = {};
+                                    if(colorList[j].colorId == orderItemList[m].itemColorId){
+                                        colorHtml += '<option value="'+ colorList[j].colorId +'" selected>'+ colorList[j].colorName +'</option>';
+                                        isColorSelect = true;
+                                        colorNumber = orderItemList[m].itemNum;
+                                    }else{
+                                        colorHtml += '<option value="'+ colorList[j].colorId +'">'+ colorList[j].colorName +'</option>';
+                                    }
+                                }
+                                colors.colorNumber = colorNumber;
+                                colors.colorHtml = colorHtml;
+                                selectColor.push(colors);
+                            }
+                        }
+
+                        var fittingsHtml = '';
+                        if(produceFittings != null){
+                            for(var k=0;k<produceFittings.length;k++){
+                                fittingsHtml += '<div class="check-box">' +
+                                        '<input type="checkbox" id="checkbox-2" name="ck-produce-fittings" value="'+ produceFittings[k].fittingsId +'">' +
+                                        '<label for="checkbox-2">'+ produceFittings[k].fittingsName +'</label>' +
+                                        '<input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="produceFittings">' +
+                                        '</div>';
+                            }
+                        }
+
+                        var isChecked = '';
+                        if(isColorSelect){
+                            isChecked = 'checked';
+                        }
+                        for(var f=0;f<selectColor.length;f++){
+                            html += '<div class="skin-minimal">' +
+                                    '        <div class="check-box">' +
+                                    '            <input type="checkbox" name="ck-produce" id="checkbox-'+ i +'" '+ isChecked +'>' +
+                                    '' +
+                                    '           <label for="checkbox-'+ i +'" name="produceName">'+ convertUndefinedToEmpty(product.typeName) +'</label> -' +
+                                    '           <input type="hidden" name="productType" value="">' +
+                                    '' +
+                                    '            <label for="checkbox-'+ i +'">'+ convertUndefinedToEmpty(product.productName) +'</label>' +
+                                    '           <input type="hidden" name="productId" value="">' +
+                                    '' +
+                                    '            <select class="select colorId" name="colorId" style="width: 100px;">' +
+                                    selectColor[f].colorHtml +
+                                    '            </select>' +
+                                    '            <input type="text" class="input-text" style="width: 40px;text-align: center;" value="'+ selectColor[f].colorNumber +'" placeholder="" id="" name="produceNumber">' +
+                                    '        </div>' +
+                                    fittingsHtml +
+                                    '    </div>';
+
+                            if(!isColorSelect){
+                                break;
+                            }
+                        }
+                    }
+                }else{
+                    html = '';
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+        $("#produceSelect").html(html);
+
+        initCheck(); //因为需要展示产品,所以再次初始化多选框
+
+        setBackProduct();  //设置寄回产品
+
+        monitorProduct();   //监听产品变化
+    }
+
+    /*获取产品配件*/
+    function getProduceFittings(productId){
+        var produceFittings;
+        $.ajax({
+            type: "get",
+            data: {
+                productId : productId
+            },
+            url: "${path}/admin/customer/select_produce_fittings",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    produceFittings = data.returnMsg.produceFittingsList;
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+        return produceFittings;
+    }
+
+    /*监听产品变化*/
+    function monitorProduct(){
+        /*产品的多选框*/
+        $("#produceSelect").find("input[name='ck-produce']").change(function (){
+            setBackProduct();
+        })
+        /*选择产品颜色*/
+        $("#produceSelect").find(".colorId").change(function (){
+            setBackProduct();
+        })
+        /*产品数量*/
+        $("#produceSelect").find("input[name='produceNumber']").blur(function (){
+            setBackProduct();
+        })
+        /*配件数量*/
+        $("#produceSelect").find("input[name='produceFittings']").blur(function (){
+            setBackProduct();
+        })
+        /*配件多选框*/
+        $("#produceSelect").find("input[name='ck-produce-fittings']").click(function (){
+            setBackProduct();
+        })
+    }
+
+    /*设置寄回产品*/
+    function setBackProduct() {
+        $("#produceSelect").find(".skin-minimal").each(function (){
+            var isChecked = $(this).find("input[name='ck-produce']").attr('checked');
+            var produceName =  $(this).find("input[name='produceName']").eq(0).html();
+            alert(isChecked + "--" +produceName);
+//            if(){
+//                html = '<div class="update-parts" style="margin-bottom: 10px;"><span>红色净水机(wx-1)x 1台</span><span>水箱 x 1件</span><span>t1 x 1件</span><span>t2 x 1件</span></div>';
+//            }
+        })
+    }
+    
+</script>
+<!--/请在上方写此页面业务相关的脚本-->
+</body>
+</html>

+ 3 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/signclosed_list.ftl

@@ -26,7 +26,7 @@
 <div class="page-container">
     <div class="text-c">
         <form name="form1" action="${path}/admin/signclosed/select_signclosed_list" method="post">
-            <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_detect('添加品质检测','${path}/admin/detect/to_add_detect','570','450');">新建签收</button>
+            <button type="button" style="cursor:pointer;float: left;" class="my-btn-search" onclick="add_signclosed('${path}/admin/signclosed/to_add_signclosed');">新建签收</button>
             <input class="my-input" style="width: 70px;" type="text" name="signclosedSendName" value="${signclosedSendName!}" placeholder="寄件人姓名"/>
             <input class="my-input" style="width: 70px;" type="text" name="signclosedSendTel" value="${signclosedSendTel!}" placeholder="寄件人电话号码"/>
             <input class="my-input" style="width: 70px;" type="text" name="signclosedLogisticsNumber" value="${signclosedLogisticsNumber!}" placeholder="快递单号"/>
@@ -212,8 +212,8 @@
 
 <script type="text/javascript">
     /*添加*/
-    function add_detect(title,url,w,h){
-        layer_show(title,url,w,h);
+    function add_signclosed(url){
+        window.location.href = url;
     }
     /*修改备注*/
     function add_remark(title,url,w,h){