Преглед на файлове

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 години
родител
ревизия
ae38d30a8d
променени са 1 файла, в които са добавени 97 реда и са изтрити 20 реда
  1. 97 20
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

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

@@ -111,11 +111,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" class="customerCounselType" id="customer-type-1" name="customerCounselType" value="1" checked >
+                        <input type="radio" class="customerCounselType" id="customer-type-1" name="customerCounselType" value="1"  >
                         <label for="customer-type-1">售前咨询</label>
                     </div>
                     <div class="radio-box">
-                        <input type="radio" class="customerCounselType" id="customer-type-2" name="customerCounselType" value="2" >
+                        <input type="radio" class="customerCounselType" id="customer-type-2" name="customerCounselType" value="2"  checked>
                         <label for="customer-type-2">售后咨询</label>
                     </div>
                 </div>
@@ -224,7 +224,7 @@
                 <label class="form-label col-1 col-sm-1">处理类型:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
                     <div class="radio-box" id="solved">
-                        <input type="radio" id="customer-process-1" value="1" name="customerIsSolve" checked>
+                        <input type="radio" id="customer-process-1" value="1" name="customerIsSolve" >
                         <label for="customer-process-1">已解决</label>
                     </div>
                     <div class="radio-box" id="noSolved">
@@ -232,11 +232,11 @@
                         <label for="customer-process-2">未解决</label>
                     </div>
                     <div class="radio-box" id="renewed" style="display: none">
-                        <input type="radio" id="customer-process-3" value="3" name="customerIsSolve">
+                        <input type="radio" id="customer-process-3" value="3" name="customerIsSolve" checked>
                         <label for="customer-process-3">换新</label>
                     </div>
                     <div class="radio-box" id="maintain" style="display: none">
-                        <input type="radio" id="customer-process-4" value="4" name="customerIsSolve">
+                        <input type="radio" id="customer-process-4" value="4" name="customerIsSolve" >
                         <label for="customer-process-4">维修</label>
                     </div>
                     <div class="radio-box" id="reissue" style="display: none">
@@ -351,7 +351,7 @@
 
                     <table class="table table-border table-bg table-bordered">
                         <thead>
-                            <tr class="text-c">
+                            <tr class="text-c" id="table1">
                                 <th style="text-align: center;" width="60">产品名称</th>
                                 <th style="text-align: center;" width="60">产品颜色</th>
                                 <th style="text-align: center;" width="60">产品配件</th>
@@ -371,7 +371,7 @@
                 <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;">
                     <input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
-                    <input style="width: 140px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" />
+                    <input style="width: 190px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" />
                     <div id="suggest" class="ac_results"></div>
                 </div>
                 <div class="formControls col-2 col-sm-2">
@@ -421,11 +421,11 @@
 
                     <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>
+                            <tr class="text-c" id="table2">
+                                <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="back-product">
                             <tr id="showOrder">
@@ -684,6 +684,8 @@
         elementPathEnabled : false  /*去掉元素路径*/
     });
 
+    var isInitSendAddressSms = false;
+
     sendAddressSms.ready(function() {
         sendAddressSms.setHeight(130);  //固定高度
     });
@@ -701,11 +703,22 @@
         noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
     }
 
+    /*处理结果的变更状态  产品列表表头信息*/
+    var isSolveTitleMsg = {
+        solved : [[],[]],
+        noSolved : [[],[]],
+        renewed : [["退回产品","退回产品颜色","退回产品配件"],["更换产品","更换产品颜色","更换产品配件"]],
+        maintain : [["需要维修的产品","需要维修的产品颜色","需要维修的产品配件"],["维修产品","维修产品颜色","维修产品配件"]],
+        reissue : [["补发产品","补发产品颜色","补发产品配件"],[]],
+        backGoods : [["退回产品","退回产品颜色","退回产品配件"],[]],
+        noReasonBack : [["退回产品","退回产品颜色","退回产品配件"],[]]
+    }
+
     /*个人id*/
     var adminId = 0;
 
     /* 咨询类型  1:售前咨询  2:售后咨询  3:其他  */
-    var allCustomerInfoType = 1;
+    var allCustomerInfoType;
 
     /*全局标识当前状态  type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货*/
     var allCustomerType = 1;
@@ -735,7 +748,7 @@
         initVisitSysAdmin();
 
         /*初始化选择处理结果 -- type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货 */
-        initProcessResult(1);
+        initProcessResult(3);
 
         /*监听来源入口选择事件*/
         $("input[name='customerSourceType']").change(function (){
@@ -996,9 +1009,15 @@
         if(type == null || type == ""){
             type = 1;
         }
+
+        if(allCustomerInfoType == null || allCustomerInfoType == ""){
+            allCustomerInfoType = $("input[name='customerCounselType']:checked").val();
+        }
+
         var statusHtml = '<li><span class="arrow"></span><div class="number">status_index</div><div>status_html</div></li>';
         var resultHtml = '';
         var result = {};
+        var resultProductTableTitle = {};
 
         $("#solved").show(); //已解决
         $("#noSolved").show();//未解决
@@ -1024,9 +1043,9 @@
             }
         }else if(allCustomerInfoType == 2){ //售后
 
-            var msg = UE.getEditor('sendAddressSms').getContent();
-            if(msg == null || msg == ""){
+            if(!isInitSendAddressSms){
                 initComplaintQuestionInfo("m");
+                isInitSendAddressSms = true;
             }
 
             /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
@@ -1054,6 +1073,7 @@
                     break;
                 case 3: //换新
                     result = isSolve.renewed;
+                    resultProductTableTitle = isSolveTitleMsg.renewed;
                     $("#relationProduct").html("换新产品");
                     $("#processResultStatus").show();
                     $("#orderHead").show();
@@ -1073,6 +1093,7 @@
                     break;
                 case 4: //维修
                     result = isSolve.maintain;
+                    resultProductTableTitle = isSolveTitleMsg.maintain;
                     $("#relationProduct").html("维修产品");
                     $("#processResultStatus").show();
                     $("#orderHead").show();
@@ -1092,6 +1113,7 @@
                     break;
                 case 5://补发
                     result = isSolve.reissue;
+                    resultProductTableTitle = isSolveTitleMsg.reissue;
                     $("#relationProduct").html("补发产品");
                     $("#processResultStatus").show();
                     $("#orderHead").show();
@@ -1111,6 +1133,7 @@
                     break;
                 case 6: //退货
                     result = isSolve.backGoods;
+                    resultProductTableTitle = isSolveTitleMsg.backGoods;
                     $("#relationProduct").html("退货产品");
                     $("#processResultStatus").show();
                     $("#orderHead").show();
@@ -1130,6 +1153,7 @@
                     break;
                 case 7://无理由退货
                     result = isSolve.noReasonBack;
+                    resultProductTableTitle = isSolveTitleMsg.noReasonBack;
                     $("#relationProduct").html("退货产品");
                     $("#processResultStatus").show();
                     $("#orderHead").show();
@@ -1156,6 +1180,16 @@
             html = html.replace("status_html",result[i]);
             resultHtml += html;
         }
+
+        /* 根据处理类型来切换 产品列表的列名称 */
+        for(var i=0;i<resultProductTableTitle[0].length;i++){
+            $("#table1").find("th").eq(i).html(resultProductTableTitle[0][i]);
+        }
+        for(var i=0;i<resultProductTableTitle[1].length;i++){
+            $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
+        }
+
+
         $("#processResultStatus").html(resultHtml);
     }
 
@@ -1179,8 +1213,8 @@
     /*初始化问题大类*/
     function initComplaintTypeInfo() {
         //默认为售前咨询
-        var customerCounselTypeOverall = allCustomerInfoType;
-
+        //var customerCounselTypeOverall = allCustomerInfoType;
+        var customerCounselTypeOverall = null;
         $.ajax({
             type: "POST",
             data: {
@@ -1288,13 +1322,21 @@
                     if (data.returnCode == 200) {
                         msg = data.returnMsg.complaintQuestionInfoList[0].questionProfile;
                     }
-                    UE.getEditor('sendAddressSms').setContent(msg,false);
+                    addSmsMsg(msg);
                 }
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
             }
         });
+    }
+
+    /*添加邮寄信息*/
+    function addSmsMsg(msg){
+        sendAddressSms.addListener("ready", function () {
+            // editor准备好之后才可以使用
+            sendAddressSms.setContent(msg);
 
+        });
     }
 
     /**
@@ -1504,7 +1546,7 @@
                                 ' <td>'+ salesOrder.salesId +'</td>' +
                                 ' <td>'+ salesOrder.salesAddressName +'</td>' +
                                 ' <td>'+ salesOrder.salesAddressTel +'</td>' +
-                                ' <td>'+ salesOrder.salesAmount +'</td>' +
+                                ' <td>'+ salesOrder.salesAmount/100 +'</td>' +
                                 ' <td>'+ productsHtml +'</td>' +
                                 ' <td>'+ time +'</td>' +
                                 '';
@@ -1850,6 +1892,41 @@
         if(html != null && html != "" && typeof(html) != "undefined"){
             $("#back-product").html(html);
         }else{
+            return false;
+//            $("#addProduct").find(".input-color-number").each(function(){
+//                var number = $(this).val();
+//                if(number != null && number != ""){
+//                    var product = new Object();
+//                    product.productId = $(this).parent().find(".input-produce-id").val();
+//                    product.colorId = $(this).parent().find(".input-color-id").val();
+//                    //换新、维修,退货,无理由退货,
+//                    if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7){
+//                        product.closedProdcueNumber = number;
+//                        closedProdcues.push(product);
+//                    }else if(allCustomerType == 5){
+//                        product.sendProdcueNumber = number;
+//                        sendProdcues.push(product);
+//                    }
+//                }
+//            })
+//
+//            $("#addProduct").find(".input-fittings-number").each(function(){
+//                var number = $(this).val();
+//                if(number != null && number != ""){
+//                    var fittings = new Object();
+//                    fittings.productId = $(this).parent().find(".input-produce-id").val();
+//                    fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
+//                    //换新、维修,退货,无理由退货,
+//                    if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7){
+//                        fittings.closedFittingNumber = number;
+//                        closedFittings.push(fittings);
+//                    }else if(allCustomerType == 5){
+//                        fittings.sendFittingNumber = number;
+//                        sendFittings.push(fittings);
+//                    }
+//                }
+//            })
+
 
         }
     }