Bläddra i källkod

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

# Conflicts:
#	watero-rst-core/src/main/java/com.iamberry.rst.core/order/EfastOrder.java
#	watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java
wangxiaoming 7 år sedan
förälder
incheckning
a2548835c2

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

@@ -54,6 +54,7 @@
             height: 35px;
             line-height: 35px;
         }
+
     </style>
     <title>添加客诉 - 客诉管理 - RST</title>
 </head>
@@ -411,13 +412,15 @@
                     &nbsp;&nbsp;&nbsp;&nbsp;<span id="DTS-in"></span>&nbsp;&nbsp;  <span id="DTS-out"></span>
                 </div>
             </div>
+
             <div class="row cl" id="sendAddressInfo">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>寄回信息:</label>
-                <div class="formControls col-5 col-sm-5" style="height: 250px" id="sendAddressSmsHtml">
+                <div class="formControls col-5 col-sm-5" style="height: 240px" id="sendAddressSmsHtml">
                    <#-- <script id="sendAddressSms" type="text/plain" style="width:983px;height:200px;"></script>
                     </script>-->
                 </div>
             </div>
+
             <div class="row cl" id="sendAddressByPhone" style="display: none;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-2 col-sm-2">
@@ -430,6 +433,7 @@
                     <div id="m-msg" style="color: #e00"></div>
                 </div>
             </div>
+
             <div class="row cl" id="updateProduct" style="display: none;">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>更换产品:</label>
                 <div class="formControls col-9 col-sm-9" >
@@ -517,6 +521,7 @@
                     </div>
                 </div>
             </div>
+
             <div id="needToVisit" style="display: none;">
                 <div class="row cl">
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>被回访人:</label>
@@ -603,6 +608,8 @@
 
     /*是否是修改页面*/
     var isUpdate = false;
+    /*是否需要回访  只有修改页面才会使用*/
+    var customerIsVisit = false;
 
     /*个人id*/
     var adminId = 0;

+ 22 - 211
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl

@@ -701,6 +701,8 @@
 
     /*是否是修改页面*/
     var isUpdate = true;
+    /*是否需要回访  只有修改页面才会使用*/
+    var customerIsVisit = true;
 
     /*个人id*/
     var adminId = 0;
@@ -868,220 +870,29 @@
         });
     }
 
-
     /**
-     * 选择处理结果-- 默认选择已解决
-     * type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货
+     * 设置省市区
      */
-    function initProcessResult(type){
-
-        if(type == null || type == ""){
-            type = 1;
-        }
-
-        allCustomerType = type;
-
-        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();//未解决
-        if(allCustomerInfoType == 1){  //售前
-            $("#renewed").hide();
-            $("#maintain").hide();
-            $("#reissue").hide();
-            $("#backGoods").hide();
-            $("#noReasonBack").hide();
-
-            switch(type)
-            {
-                case 1:
-                    otherHied();
-                    visitByType(1);
-                    break;
-                case 2:
-                    otherHied();
-                    visitByType(2);
-                    break;
-                default:
-                    break;
-            }
-        }else if(allCustomerInfoType == 2){ //售后
-
-            if(!isInitSendAddressSms){
-                initComplaintQuestionInfo("m");
-                isInitSendAddressSms = true;
-            }
-
-            /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
-            if(isInitAddress == 1 || isInitAddress == 2){
-//                var proId = setPro(null,2);
-//                var cityId = setCity(null,proId,2);
-//                setDistrict(null,cityId,2);
-//                isInitAddress = 1;
-            }else if(isInitAddress == 3 || isInitAddress == 4 ||  isInitAddress == 5 ||  isInitAddress == 6 ||  isInitAddress == 7){
-                    setPro(null,2);  //创建省
-                    setCity(null,proId,2);
-                    setDistrict(null, cityId, 2);
-                <#if customerCommon.provinceNumber?? >
-                    var proId = ${customerCommon.provinceNumber!''};
-                    $("#province option[value='"+ proId +"']").attr("selected","true"); //设置省
-                </#if>
-                <#if customerCommon.cityNumber?? >
-                    var cityId = ${customerCommon.cityNumber!''};
-                    $("#city option[value='" + cityId + "']").attr("selected", "true"); //设置市
-                </#if>
-                <#if customerCommon.areaNumber?? >
-                    var disId = ${customerCommon.areaNumber!''};
-                    $("#district option[value='" + disId + "']").attr("selected", "true"); //设置地区
-                    isInitAddress = 1;
-                </#if>
-            }
-
-            $("#renewed").show();
-            $("#maintain").show();
-            $("#reissue").show();
-            $("#backGoods").show();
-            $("#noReasonBack").show();
-            switch(type)
-            {
-                case 1:
-                    otherHied();
-                    visitByType(1);
-                    break;
-                case 2:
-                    otherHied();
-                    visitByType(2); //需要回访
-                    break;
-                case 3: //换新
-                    result = isSolve.renewed;
-                    resultProductTableTitle = isSolveTitleMsg.renewed;
-                    $("#relationProduct").html("换新产品");
-                    $("#processResultStatus").show();
-                    $("#orderHead").show();
-                    $("#order").show();
-                    $("#recipientInfo").show();
-                    $("#recipientInfoTitle").show();
-                    $("#recipientAddress").show();
-                    $("#recipientAddressText").show();
-                    $("#renewedProduct").show();
-                    $("#TDScollect").show();
-                    $("#TDScollectShow").show();
-                    $("#sendAddressInfo").show();
-                    $("#sendAddressByPhone").show();
-                    $("#updateProduct").show(); //换新产品
-                    $("#postageAccount").show();    //邮费转账账户
-                    visitByType(2); //需要回访
-                    break;
-                case 4: //维修
-                    result = isSolve.maintain;
-                    resultProductTableTitle = isSolveTitleMsg.maintain;
-                    $("#relationProduct").html("维修产品");
-                    $("#processResultStatus").show();
-                    $("#orderHead").show();
-                    $("#order").show();
-                    $("#recipientInfo").show();
-                    $("#recipientInfoTitle").show();
-                    $("#recipientAddress").show();
-                    $("#recipientAddressText").show();
-                    $("#renewedProduct").show();
-                    $("#TDScollect").show();
-                    $("#TDScollectShow").show();
-                    $("#sendAddressInfo").show();
-                    $("#sendAddressByPhone").show();
-                    $("#updateProduct").show();//维修产品
-                    $("#postageAccount").show();    //邮费转账账户
-                    visitByType(2); //需要回访
-                    break;
-                case 5://补发
-                    result = isSolve.reissue;
-                    resultProductTableTitle = isSolveTitleMsg.reissue;
-                    $("#relationProduct").html("补发产品");
-                    $("#processResultStatus").show();
-                    $("#orderHead").show();
-                    $("#order").show();
-                    $("#recipientInfo").show();
-                    $("#recipientInfoTitle").show();
-                    $("#recipientAddress").show();
-                    $("#recipientAddressText").show();
-                    $("#renewedProduct").show();
-                    $("#TDScollect").show();
-                    $("#TDScollectShow").show();
-                    $("#sendAddressInfo").hide();
-                    $("#sendAddressByPhone").hide();
-                    $("#updateProduct").hide();
-                    $("#postageAccount").hide();    //邮费转账账户 -- 隐藏
-                    visitByType(2); //需要回访
-                    break;
-                case 6: //退货
-                    result = isSolve.backGoods;
-                    resultProductTableTitle = isSolveTitleMsg.backGoods;
-                    $("#relationProduct").html("退货产品");
-                    $("#processResultStatus").show();
-                    $("#orderHead").show();
-                    $("#order").show();
-                    $("#recipientInfo").hide();
-                    $("#recipientInfoTitle").hide();
-                    $("#recipientAddress").hide();
-                    $("#recipientAddressText").hide();
-                    $("#renewedProduct").show();
-                    $("#TDScollect").show();
-                    $("#TDScollectShow").show();
-                    $("#sendAddressInfo").show();
-                    $("#sendAddressByPhone").show();
-                    $("#updateProduct").hide();
-                    $("#postageAccount").show();    //邮费转账账户
-                    visitByType(2); //需要回访
-                    break;
-                case 7://无理由退货
-                    result = isSolve.noReasonBack;
-                    resultProductTableTitle = isSolveTitleMsg.noReasonBack;
-                    $("#relationProduct").html("退货产品");
-                    $("#processResultStatus").show();
-                    $("#orderHead").show();
-                    $("#order").show();
-                    $("#recipientInfo").hide();
-                    $("#recipientInfoTitle").hide();
-                    $("#recipientAddress").hide();
-                    $("#recipientAddressText").hide();
-                    $("#renewedProduct").show();
-                    $("#TDScollect").show();
-                    $("#TDScollectShow").show();
-                    $("#sendAddressInfo").show();
-                    $("#sendAddressByPhone").show();
-                    $("#updateProduct").hide();
-                    $("#postageAccount").show();    //邮费转账账户
-                    visitByType(2); //需要回访
-                    break;
-                default:
-                    break;
-            }
-        }
-        for(var i=0;i< result.length;i++){
-            var html = statusHtml.replace("status_index",i+1);
-            html = html.replace("status_html",result[i]);
-            resultHtml += html;
-        }
-
-        if(resultProductTableTitle != null && resultProductTableTitle.length > 0){
-            /* 根据处理类型来切换 产品列表的列名称 */
-            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);
+    function setAddressInfo(){
+        var proId = setPro(null,1);  //创建省
+        <#if customerCommon.provinceNumber?? >
+            var proId = ${customerCommon.provinceNumber!''};
+            $("#province option[value='"+ proId +"']").attr("selected","true"); //设置省
+        </#if>
+
+        var cityId = setCity(null,proId,2);
+        <#if customerCommon.cityNumber?? >
+            var cityId = ${customerCommon.cityNumber!''};
+            $("#city option[value='" + cityId + "']").attr("selected", "true"); //设置市
+        </#if>
+
+        setDistrict(null, cityId, 2);
+        <#if customerCommon.areaNumber?? >
+            var disId = ${customerCommon.areaNumber!''};
+            $("#district option[value='" + disId + "']").attr("selected", "true"); //设置地区
+            isInitAddress = 1;
+        </#if>
     }
-
 </script>
 <!--/请在上方写此页面业务相关的脚本-->
 </body>

+ 22 - 15
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -65,7 +65,7 @@ var tool = [
     'fontborder', //字符边框
     'superscript', //上标
     'formatmatch', //格式刷
-    //'source', //源代码
+    'source', //源代码 --
     'blockquote', //引用
     'pasteplain', //纯文本粘贴模式
     'selectall', //全选
@@ -201,7 +201,7 @@ var isSolveTitleMsg = {
 /*===============================定义全局变量以及监听事件和初始化  -- end -- =============================== */
 
 
-/*用于初始化回访信息的展示*/
+/*用于初始化监听回访信息的展示*/
 function initVisitEvent(){
     $("input[name='customerIsVisit']").change(function (){
         if($(this).val() == 2){
@@ -239,6 +239,10 @@ function initCheckByNode(node){
 * type 1:不需要回访  2:需要回访
 * */
 function visitByType(type){
+    if(isUpdate &&  customerIsVisit){
+        customerIsVisit = false;
+        return false;
+    }
     if(1 == type){  //不需要回访
         $("#customer-visit-2").iCheck('check');  //设置不需要回访
         $("#needToVisit").css("display","none");
@@ -397,13 +401,16 @@ function initProcessResult(type){
             initComplaintQuestionInfo("m");
             isInitSendAddressSms = true;
         }
-
-        /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
-        if(isInitAddress == 0){
-            var proId = setPro(null,2);
-            var cityId = setCity(null,proId,2);
-            setDistrict(null,cityId,2);
-            isInitAddress = 1;
+        if(isUpdate){       //修改页面加载省市区
+            setAddressInfo();       //修改页面才会调用
+        }else{
+            /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
+            if(isInitAddress == 0){
+                var proId = setPro(null,2);
+                var cityId = setCity(null,proId,2);
+                setDistrict(null,cityId,2);
+                isInitAddress = 1;
+            }
         }
 
         $("#renewed").show();
@@ -753,13 +760,13 @@ function sendPhone(type,node){
         questionId = complaint_questionId;
 
         //desc = UE.getEditor('sendAddressSms').getContent();
-        desc = $("#sendAddressSmsHtml").html();    //取值从html填写
+        //desc = $("#sendAddressSmsHtml").html();    //取值从html填写  -- 邮寄地址不用传过去,直接后台取
 
-        if(desc == null || desc == ""){
-            layer.close(index);
-            layer.msg("请填写邮寄信息内容!", {icon: 5, time: 3000});
-            return false;
-        }
+        // if(desc == null || desc == ""){
+        //     layer.close(index);
+        //     layer.msg("请填写邮寄信息内容!", {icon: 5, time: 3000});
+        //     return false;
+        // }
     }else{
         layer.close(index);
         layer.msg("发送报错!", {icon: 5, time: 3000});