浏览代码

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

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
wangxiaoming 7 年之前
父节点
当前提交
f5c5b2f79a
共有 1 个文件被更改,包括 212 次插入246 次删除
  1. 212 246
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

+ 212 - 246
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

@@ -45,6 +45,8 @@
         .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%; }
+        .input-produce{height: 25px;line-height: 25px}
+        .color-div{height: 30px;}
     </style>
     <title>添加客诉 - 客诉管理 - RST</title>
 </head>
@@ -98,11 +100,11 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>咨询类型:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box">
-                        <input type="radio" id="customer-type-1" name="customerCounselType" value="1" datatype="*" checked nullmsg="请选择咨询类型!" >
+                        <input type="radio" class="customerCounselType" id="customer-type-1" name="customerCounselType" value="1" checked >
                         <label for="customer-type-1">售前咨询</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" id="customer-type-2" name="customerCounselType" value="2"  datatype="*" nullmsg="请选择咨询类型!">
+                        <input type="radio" class="customerCounselType" id="customer-type-2" name="customerCounselType" value="2" >
                         <label for="customer-type-2">售后咨询</label>
                     </div>
                 </div>
@@ -305,131 +307,41 @@
                     <table class="table table-border table-bg table-bordered">
                         <thead>
                             <tr class="text-c">
-                                <th style="text-align: center;" width="30">产品类型</th>
-                                <th style="text-align: center;" width="300">产品名称</th>
+                                <th style="text-align: center;" width="60">产品名称</th>
                                 <th style="text-align: center;" width="60">产品颜色</th>
-                                <th style="text-align: center;" width="20">产品数量</th>
                                 <th style="text-align: center;" width="60">产品配件</th>
                             </tr>
                         </thead>
                         <tbody id="addProduct">
                             <tr >
-                                <td rowspan="5">爱贝源-微信商城</td>
-                                <td rowspan="2">1290387806</td>
-                                <td>何小小</td>
-                                <td>1882222888</td>
-                                <td>1882222888</td>
-                            </tr>
-                            <tr >
-                                <td>何小小</td>
-                                <td>1882222888</td>
-                                <td>1882222888</td>
-                            </tr>
-                            <tr>
-                                <td rowspan="2">1290387806</td>
-                                <td>何小小</td>
-                                <td>1882222888</td>
-                                <td>1882222888</td>
-                            </tr>
-                            <tr>
-                                <td>何小小</td>
-                                <td>1882222888</td>
-                                <td>1882222888</td>
-                            </tr>
-                            <tr>
-                                <td>1290387806</td>
-                                <td>何小小</td>
-                                <td>1882222888</td>
-                                <td>1882222888</td>
+                                <td>冲奶机</td>
+                                <td>
+                                    <div>
+                                        白色
+                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                    </div>
+                                    <div>
+                                        白色
+                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                    </div>
+                                </td>
+                                <td>
+                                    <div>
+                                        水箱
+                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                    </div>
+                                    <div>
+                                        水箱
+                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                    </div>
+                                </td>
                             </tr>
                         </tbody>
                     </table>
 
-                    <div class="skin-minimal">
-                        <div class="check-box">
-                            <input type="checkbox" id="checkbox-1" checked>
-
-                            <label for="checkbox-1">净水机</label> -
-
-                            <label for="checkbox-1">净水机</label>
-
-                            <select name="" class="select" style="width: 100px;">
-                                <option value="0">黑色</option>
-                                <option value="1">白色</option>
-                            </select>
-                            <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                        </div>
-
-                        <div class="check-box">
-                            <input type="checkbox" id="checkbox-2" checked>
-                            <label for="checkbox-2">水箱</label>
-                            <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                        </div>
-                        <div class="check-box">
-                            <input type="checkbox" id="checkbox-3" checked>
-                            <label for="checkbox-2">T1</label>
-                            <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                        </div>
-                        <div class="check-box">
-                            <input type="checkbox" id="checkbox-4" checked>
-                            <label for="checkbox-2">T2</label>
-                            <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                        </div>
-                    </div>
-
                 </div>
             </div>
 
-           <#-- <div class="row cl">
-                <label class="form-label col-1 col-sm-1"></label>
-
-                <div class="formControls col-10 col-sm-10">
-
-                    <div id="addProductWait">
-                        <div class="skin-minimal">
-                            <div class="check-box" style="padding-left: 0px; ">
-
-                                <select name="" class="select" style="width: 100px;">
-                                    <option value="0">净水机</option>
-                                    <option value="1">净水机</option>
-                                </select>
-
-                                <select name="" class="select" style="width: 100px;">
-                                    <option value="0">黑色</option>
-                                    <option value="1">白色</option>
-                                </select>
-                                <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                            </div>
-
-                            <div class="check-box">
-                                <input type="checkbox" id="checkbox-2" checked>
-                                <label for="checkbox-2">水箱</label>
-                                <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                            </div>
-                            <div class="check-box">
-                                <input type="checkbox" id="checkbox-3" checked>
-                                <label for="checkbox-2">T1</label>
-                                <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                            </div>
-                            <div class="check-box">
-                                <input type="checkbox" id="checkbox-4" checked>
-                                <label for="checkbox-2">T2</label>
-                                <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                            </div>
-                            <div class="check-box">
-                                <a><img src="${path}/common/images/cm/add-produce.png" width="21" height="21"></button></a>
-                            </div>
-                        </div>
-                    </div>
-
-
-                    <div class="skin-minimal">
-                        <button type="button" class="btn btn-primary" id="addProduct()">添加产品</button>
-                    </div>
-                </div>
-
-            </div>-->
-
             <div class="row cl" id="TDScollect">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>TDS收集:</label>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
@@ -479,8 +391,42 @@
             <div class="row cl" id="updateProduct">
                 <label class="form-label col-1 col-sm-1">更换产品:</label>
                 <div class="formControls col-7 col-sm-7" id="back-product">
-                    <#--<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>
-                    <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>-->
+
+                    <table class="table table-border table-bg table-bordered">
+                        <thead>
+                        <tr class="text-c">
+                            <th style="text-align: center;" width="60">产品名称</th>
+                            <th style="text-align: center;" width="60">产品颜色</th>
+                            <th style="text-align: center;" width="60">产品配件</th>
+                        </tr>
+                        </thead>
+                        <tbody id="addProduct">
+                        <tr >
+                            <td>冲奶机</td>
+                            <td>
+                                <div>
+                                    白色
+                                    <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                </div>
+                                <div>
+                                    白色
+                                    <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                </div>
+                            </td>
+                            <td>
+                                <div>
+                                    水箱
+                                    <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                </div>
+                                <div>
+                                    水箱
+                                    <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
+                                </div>
+                            </td>
+                        </tr>
+                        </tbody>
+                    </table>
+
                 </div>
 
             </div>
@@ -588,6 +534,7 @@
 
     $(document).on('click', '.dalog-ask .answer', function() {
         $("#answer-textarea").text($(this).find("span").text());
+        //$(".dalog-ask").hide(); 隐藏qa
     });
 
 </script>
@@ -615,13 +562,8 @@
 
     /*初始化页面参数*/
     $(function () {
-
-        /*监听客诉类型选择事件*/
-        $("input[name='customerCounselType']").change(function(){
-            allCustomerInfoType = parseInt($(this).val());
-            allCustomerType = parseInt($(this).val());
-            initProcessResult(parseInt($(this).val()));
-        })
+        /* 初始化单选框样式 */
+        initCheck();
 
         /*初始化问题分类*/
         initComplaintTypeInfo();
@@ -638,6 +580,12 @@
         /*初始化选择处理结果 -- type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货 */
         initProcessResult(1);
 
+        /*监听客诉类型选择事件*/
+        $("input[name='customerCounselType']").change(function (){
+            allCustomerInfoType = parseInt($(this).val());
+            initProcessResult(allCustomerType);
+        })
+
         /*监听处理结果选择事件*/
         $("[name='customerIsSolve']").change(function(){
             allCustomerType = parseInt($(this).val());
@@ -681,6 +629,8 @@
             }
         })
 
+
+
         /*监听回访选择客服的选择事件*/
         $(document).on('change', '#visitAdminId', function() {
             var visitAdminName = $("#visitAdminId").find("option:selected").text();
@@ -691,10 +641,6 @@
                 showVisitMsg(2,visitAdminName);
             }
         });
-
-        /* 初始化单选框样式 */
-        initCheck();
-
     })
 
     /*初始化单选框样式*/
@@ -803,6 +749,7 @@
             }
         });
         $("#produceTypeHtml").html(html);
+        initCheck();
     }
 
     /**
@@ -818,9 +765,9 @@
         var resultHtml = '';
         var result = {};
 
-        if(allCustomerInfoType = 1){  //售前
-            $("#solved").show();
-            $("#noSolved").show();
+        $("#solved").show(); //已解决
+        $("#noSolved").show();//未解决
+        if(allCustomerInfoType == 1){  //售前
             $("#renewed").hide();
             $("#maintain").hide();
             $("#reissue").hide();
@@ -829,28 +776,15 @@
             switch(type)
             {
                 case 1:
-                    $("#processResultStatus").hide();   //处理结果的执行状态  已解决未解决没有该信息
-                    $("#orderHead").hide();
-                    $("#order").hide();
-                    $("#recipientInfo").hide();
-                    $("#recipientAddress").hide();
-                    $("#recipientAddressText").hide();
-                    $("#renewedProduct").hide();
-                    $("#TDScollect").hide();
-                    $("#TDScollectShow").hide();
-                    $("#sendAddressInfo").hide();
-                    $("#sendAddressByPhone").hide();
-                    $("#updateProduct").hide();
+                    otherHied();
                     break;
                 case 2:
-                    $("#processResultStatus").hide();
+                    otherHied();
                     break;
                 default:
                     break;
             }
-        }else if(allCustomerInfoType = 2){ //售后
-            $("#solved").show();
-            $("#noSolved").show();
+        }else if(allCustomerInfoType == 2){ //售后
             $("#renewed").show();
             $("#maintain").show();
             $("#reissue").show();
@@ -859,30 +793,85 @@
             switch(type)
             {
                 case 1:
-                    $("#processResultStatus").hide(); //处理结果的执行状态  已解决未解决没有该信息
+                    otherHied();
                     break;
                 case 2:
-                    $("#processResultStatus").hide(); //处理结果的执行状态  已解决未解决没有该信息
+                    otherHied();
                     break;
-                case 3:
+                case 3: //换新
                     result = isSolve.renewed;
                     $("#processResultStatus").show();
+                    $("#orderHead").show();
+                    $("#order").show();
+                    $("#recipientInfo").show();
+                    $("#recipientAddress").show();
+                    $("#recipientAddressText").show();
+                    $("#renewedProduct").show();
+                    $("#TDScollect").show();
+                    $("#TDScollectShow").show();
+                    $("#sendAddressInfo").show();
+                    $("#sendAddressByPhone").show();
+                    $("#updateProduct").show();
                     break;
-                case 4:
+                case 4: //维修
                     result = isSolve.maintain;
                     $("#processResultStatus").show();
+                    $("#orderHead").show();
+                    $("#order").show();
+                    $("#recipientInfo").show();
+                    $("#recipientAddress").show();
+                    $("#recipientAddressText").show();
+                    $("#renewedProduct").show();
+                    $("#TDScollect").show();
+                    $("#TDScollectShow").show();
+                    $("#sendAddressInfo").show();
+                    $("#sendAddressByPhone").show();
+                    $("#updateProduct").show();
                     break;
-                case 5:
+                case 5://补发
                     result = isSolve.reissue;
                     $("#processResultStatus").show();
+                    $("#orderHead").show();
+                    $("#order").show();
+                    $("#recipientInfo").show();
+                    $("#recipientAddress").show();
+                    $("#recipientAddressText").show();
+                    $("#renewedProduct").show();
+                    $("#TDScollect").show();
+                    $("#TDScollectShow").show();
+                    $("#sendAddressInfo").hide();
+                    $("#sendAddressByPhone").hide();
+                    $("#updateProduct").hide();
                     break;
-                case 6:
+                case 6: //退货
                     result = isSolve.backGoods;
                     $("#processResultStatus").show();
+                    $("#orderHead").show();
+                    $("#order").show();
+                    $("#recipientInfo").show();
+                    $("#recipientAddress").show();
+                    $("#recipientAddressText").show();
+                    $("#renewedProduct").show();
+                    $("#TDScollect").show();
+                    $("#TDScollectShow").show();
+                    $("#sendAddressInfo").show();
+                    $("#sendAddressByPhone").show();
+                    $("#updateProduct").hide();
                     break;
-                case 7:
+                case 7://无理由退货
                     result = isSolve.noReasonBack;
                     $("#processResultStatus").show();
+                    $("#orderHead").show();
+                    $("#order").show();
+                    $("#recipientInfo").show();
+                    $("#recipientAddress").show();
+                    $("#recipientAddressText").show();
+                    $("#renewedProduct").show();
+                    $("#TDScollect").show();
+                    $("#TDScollectShow").show();
+                    $("#sendAddressInfo").show();
+                    $("#sendAddressByPhone").show();
+                    $("#updateProduct").hide();
                     break;
                 default:
                     break;
@@ -896,6 +885,22 @@
         $("#processResultStatus").html(resultHtml);
     }
 
+    /*已解决|未解决 */
+    function otherHied(){
+        $("#processResultStatus").hide();   //处理结果的执行状态  已解决未解决没有该信息
+        $("#orderHead").hide();
+        $("#order").hide();
+        $("#recipientInfo").hide();
+        $("#recipientAddress").hide();
+        $("#recipientAddressText").hide();
+        $("#renewedProduct").hide();
+        $("#TDScollect").hide();
+        $("#TDScollectShow").hide();
+        $("#sendAddressInfo").hide();
+        $("#sendAddressByPhone").hide();
+        $("#updateProduct").hide();
+    }
+
     /*初始化问题大类*/
     function initComplaintTypeInfo() {
         //默认为售前咨询
@@ -1218,45 +1223,59 @@
             var colorList = product.colorList;  //该产品的所有颜色
 
             var productType = product.productType;
-            var productTypeName = product.typeName;
-
-            html += '<tr >' +
-                    '    <td rowspan="5">爱贝源-微信商城</td>' +
-                    '    <td rowspan="2">1290387806</td>' +
-                    '    <td>何小小</td>' +
-                    '    <td>1882222888</td>' +
-                    '    <td>1882222888</td>' +
-                    '</tr>' +
-                    '<tr >' +
-                    '    <td>何小小</td>' +
-                    '    <td>1882222888</td>' +
-                    '    <td>1882222888</td>' +
-                    '</tr>' +
-                    '<tr>' +
-                    '    <td rowspan="2">1290387806</td>' +
-                    '    <td>何小小</td>' +
-                    '    <td>1882222888</td>' +
-                    '    <td>1882222888</td>' +
-                    '</tr>' +
-                    '<tr>' +
-                    '    <td>何小小</td>' +
-                    '    <td>1882222888</td>' +
-                    '    <td>1882222888</td>' +
-                    '</tr>' +
-                    '<tr>' +
-                    '    <td>1290387806</td>' +
-                    '    <td>何小小</td>' +
-                    '    <td>1882222888</td>' +
-                    '    <td>1882222888</td>' +
-                    '</tr>';
 
-//            productAll[t] = [productType,convertUndefinedToEmpty(productTypeName)];
-//            productTypeNo = product.productType;
-//            productAll[t][s] = [product.productId,product.productName];
-//            productAll[t][s][f] =[color.colorId,color.colorName];
-        }
+            var colorHtml = '';
+            if(colorList != null && colorList.length >0 ){
+                for(var k=0;k<orderItemList.length;k++){
+                    var item = orderItemList[k];
+                    for(var j=0;j<colorList.length;j++){
+                        var color = colorList[j];
+                        var number = "";
+                        if(item.itemColorId == color.colorId){
+                            number = item.itemNum;
+                        }
+                        if(color.colorProductId == product.productId) {
+                            colorHtml += '<div class="color-div">' +
+                                    '<input type="hidden" value="' + color.colorId + '">' +
+                                    '<span>' + color.colorName + '<span>&nbsp;&nbsp;' +
+                                    '<input type="text" class="input-text input-produce input-pro-number" style="width: 40px;text-align: center;" value="'+ number +'" placeholder="" id="" name="">' +
+                                    '</div>';
+                        }
+                    }
+                }
+            }else{
+                colorHtml += '<span>暂无该产品的颜色!<span>';
+            }
+
+            var produceFittingsHtml = '';
+            if(produceFittings != null && produceFittings.length > 0){
+                for(var m=0;m<produceFittings.length;m++){
+                    var produceFit = produceFittings[m];
+                    if(produceFit.productId == product.productId){
+                        produceFittingsHtml += '<div class="color-div">' +
+                                '<input type="hidden" value="' + produceFit.fittingsId +'">'+
+                                '<span>' + produceFit.fittingsName +'<span>&nbsp;&nbsp;'+
+                                '<input type="text" class="input-text input-produce input-pro-number" style="width: 40px;text-align: center;" value="" placeholder="" id="" name="">' +
+                                '</div>';
+                    }
+                }
+            }else{
+                produceFittingsHtml += '<span>暂无产品配件!<span>';
+            }
 
-        var productTypeHtml = "";
+            var produceHtml = '<input type="hidden" value="'+ product.productId +'">' +
+                    '<span>'+  product.productName +'</span>';
+
+            html += ' <tr >' +
+                    '    <td>'+ produceHtml +'</td>' +
+                    '    <td>' +
+                    colorHtml +
+                    '    </td>' +
+                    '    <td>' +
+                    produceFittingsHtml +
+                    '    </td>' +
+                    '</tr>';
+        }
 
         $("#addProduct").html(html);
 
@@ -1312,24 +1331,8 @@
 
     /*监听产品变化*/
     function monitorProduct(){
-        /*产品的多选框*/
-        $("#produceSelect").find("input[name='ck-produce']").change(function (){
-            setBackProduct();
-        })
-        /*选择产品颜色*/
-        $("#produceSelect").find(".colorId").change(function (){
-            setBackProduct();
-        })
         /*产品数量*/
-        $("#produceSelect").find("input[name='productNumber']").blur(function (){
-            setBackProduct();
-        })
-        /*配件数量*/
-        $("#produceSelect").find("input[name='productFittings']").blur(function (){
-            setBackProduct();
-        })
-        /*配件多选框*/
-        $("#produceSelect").find("input[name='ck-product-fittings']").click(function (){
+        $(".input-pro-number").blur(function (){
             setBackProduct();
         })
     }
@@ -1383,44 +1386,8 @@
 
     /*设置寄回产品*/
     function setBackProduct() {
-        var  html = '<div class="update-parts" style="margin-bottom: 10px;">';
-        $("#produceSelect").find(".skin-minimal").each(function (){
-            var $skinMinimal = $(this);
-            var isChecked = $(this).find("input[name='ck-produce']").get(0).checked;
-            var isFittingsChecked = false;
-            if(isChecked){
-                var productName =  $(this).find("label[name='productName']").eq(0).html();
-                var productId = $(this).find("label[name='productId']").eq(0).val();
-                var colorName = $(this).find(".colorId").eq(0).find("option:selected").text();
-                var colorId = $(this).find(".colorId").eq(0).val();
-                var productNumber = $(this).find("input[name='productNumber']").eq(0).val();
-                //alert(isChecked + "--" +productName + "-" +colorName);
-
-                html += '<span class="back_product">'+ productName +'('+ colorName +')x '+ productNumber +'台 ' +
-                        '<input type="hidden" value="'+ productId +'" class="pr-id">' +
-                        '<input type="hidden" value="'+ colorId +'" class="pr-co-id">' +
-                        '<input type="hidden" value="'+ productNumber +'" class="pr-number">' +
-                        '</span>';
-            }
-            var isfi = false;
-            $skinMinimal.find(".product-fittings-list").each(function () {
-                isFittingsChecked = $(this).find("input[name='ck-product-fittings']").get(0).checked;
-                var fittingsId = $(this).find("input[name='fittingsId']").eq(0).val();
-                var fittingsName = $(this).find("label[name='fittingsName']").eq(0).html() ;
-                var fittingsNumber = $(this).find("input[name='productFittings']").eq(0).val() ;
-                if(isFittingsChecked){
-                    isfi = true;
-                    html += '<span class="back_fittings">'+ fittingsName +' x '+ fittingsNumber +'件 ' +
-                            '<input type="hidden" value="'+ fittingsId +'" class="fi-id">' +
-                            '<input type="hidden" value="'+ fittingsNumber +'" class="fi-number">' +
-                            '</span>'
-                }
-            })
-            if( isChecked || isfi){
-                html += '<br><br>';
-            }
-        })
-        html += '</div>';
+        var  html = '';
+
         $("#back-product").html(html);
     }
 
@@ -1428,7 +1395,6 @@
     function addCustomer(){
 
 
-
     }
 
     /*提示错误信息*/