Kaynağa Gözat

添加客户基本信息

dujinyan 7 yıl önce
ebeveyn
işleme
00a71de63a

+ 349 - 92
watero-rst-web/src/main/webapp/WEB-INF/views/customer/save_customer_info.ftl

@@ -1,20 +1,55 @@
 <!DOCTYPE HTML>
 <html>
 <head>
-    <meta charset="UTF-8">
-    <title></title>
-        <#include "/base/list_base.ftl">
+    <#--new style begin-->
+    <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>
-        *{padding: 0;margin: 0;}
-        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
-        /*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
-        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
-        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
-        .barcodeImg{margin:10px 0px}
-        .table-bg thead th{background-color: #e2f6ff;}
-        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
-        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .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 .red{display: inline-block; padding: 2px; background: red;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%; }
+        .txt-red{color:red}
     </style>
+    <title>增加客户信息</title>
 </head>
 <body>
 <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
@@ -38,14 +73,19 @@
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>客户类型:</label>
             <div class="formControls col-4 col-sm-4">
                  <span class="select-box">
-                        <select name="customerType" id="customerType" class="select">
+                        <select name="customerType" class="select">
+                            <option value="1">个人</option>
+                            <option value="2">公司</option>
                         </select>
                  </span>
             </div>
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>合作进度:</label>
             <div class="formControls col-4 col-sm-4">
                 <span class="select-box">
-                        <select name="cooperativeState" id="cooperativeState" class="select">
+                        <select name="cooperativeState" class="select">
+                            <option value="1">意向合作</option>
+                            <option value="2">已经合作</option>
+                            <option value="3">停止合作</option>
                         </select>
                 </span>
             </div>
@@ -65,13 +105,13 @@
             <div class="formControls col-4 col-sm-4">
                 <#--省份-->
                 <span class="select-box">
-                        <select name="customerProvinceCode" id="customerProvinceCode" class="select">
+                        <select name="customerProvinceCode" class="select">
                             <option value="">请选择省份</option>
                         </select>
                 </span>
                 <#--城市-->
                 <span class="select-box">
-                        <select name="customerCityCode" id="customerCityCode" class="select">
+                        <select name="customerCityCode" class="select">
                             <option value="">请选择城市</option>
                         </select>
                 </span>
@@ -117,69 +157,60 @@
             <label class="form-label col-3">
                 <div class="tit-2">客户销售渠道信息备案</div>
             </label>
-            <div class="formControls col-8">
+            <div class="formControls col-9">
             </div>
         </div>
         <div class="row cl">
-            <div class="formControls col-8">
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道类别:</label>
-                <div class="formControls col-1 col-sm-1">
-
-                        <select name="customerType" id="customerType" class="select">
-                        </select>
-
-                </div>
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道类型:</label>
-                <div class="formControls col-1 col-sm-1">
-
-                        <select name="channelType" id="channelType" class="select">
-                        </select>
-
-                </div>
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道名称:</label>
-                <div class="formControls col-1 col-sm-1">
-                    <input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="填写具体店名" id="channelName" name="channelName">
-                </div>
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>销售产品:</label>
-                <div class="formControls col-1 col-sm-1">
-                        <select name="promotingProducts" id="promotingProducts" class="select">
-                        </select>
-                </div>
-                <br><label class="form-label col-1 col-sm-1"><span class="c-red">*</span>供货价格:</label>
-                <div class="formControls col-1 col-sm-1">
-
-                        <select name="supplyPrice" id="supplyPrice" class="select">
-                        </select>
-
-
-                        <input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="填写供货价格" id="supplyPrice" name="supplyPrice">
-
-                </div>
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>账期:</label>
-                <div class="formControls col-1 col-sm-1">
-
-                        <select name="accountPeriod" id="accountPeriod" class="select">
-                        </select>
-
-                </div>
-                <button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddCustomerInfo();">保存</button>
-                <div class="mt-20" style="margin: 20px;">
-                    <table class="table table-border table-bordered table-bg table-hover table-sort">
-                        <thead>
-                        <tr class="text-c">
-                            <th width="100">渠道类别</th>
-                            <th width="100">渠道类型</th>
-                            <th width="100">渠道/平台名称</th>
-                            <th width="100">销售产品型号</th>
-                            <th width="100">供货价(元)</th>
-                            <th width="100">账期 </th>
-                            <th width="100">操作</th>
-                        </tr>
-                        </thead>
-                        <tbody id="listid">
-                        </tbody>
-                    </table>
-                </div>
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道类别:</label>
+            <div class="formControls col-1 col-sm-1">
+                    <select name="channelCategory" class="select">
+                    </select>
+            </div>
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道类型:</label>
+            <div class="formControls col-1 col-sm-1">
+                    <select name="channelType" class="select">
+                    </select>
+            </div>
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>渠道名称:</label>
+            <div class="formControls col-1 col-sm-1">
+                <input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="填写具体店名" id="channelName" name="channelName">
+            </div>
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>销售产品:</label>
+            <div class="formControls col-1 col-sm-1">
+                    <select name="promotingProducts" class="select">
+                    </select>
+            </div>
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>供货价格:</label>
+            <div class="formControls col-1 col-sm-1">
+                    <select name="supplyPrice" class="select">
+                    </select>
+                    <input type="text" class="my-input"  style="width:90px;margin-right: 0px;margin-bottom: 10px;"  placeholder="填写供货价格" id="supplyPrice" name="supplyPrice">
+            </div>
+            <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>账期:</label>
+            <div class="formControls col-1 col-sm-1">
+                    <select name="accountPeriod" class="select">
+                        <option value="1">先款</option>
+                        <option value="2">月结</option>
+                        <option value="3">两个月</option>
+                    </select>
+            </div>
+            <button type="button" style="cursor:pointer; float: right;height: 35px;margin-right: 30px;margin-bottom: 10px;" class="my-btn-search" onclick="toAddCustomerInfo();">保存</button>
+            <div class="mt-20" style="margin: 20px;">
+                <table class="table table-border table-bordered table-bg table-hover table-sort">
+                    <thead>
+                    <tr class="text-c">
+                        <th width="100">渠道类别</th>
+                        <th width="100">渠道类型</th>
+                        <th width="100">渠道/平台名称</th>
+                        <th width="100">销售产品型号</th>
+                        <th width="100">供货价(元)</th>
+                        <th width="100">账期 </th>
+                        <th width="100">操作</th>
+                    </tr>
+                    </thead>
+                    <tbody id="listid">
+                    </tbody>
+                </table>
             </div>
         </div>
         <#--付款/退款信息-->
@@ -223,37 +254,37 @@
         <div class="row cl">
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>发票类型:</label>
             <div class="formControls col-2 col-sm-2">
-
-                            <select name="adminId" id="adminId" class="select">
-                            </select>
-
+                <select name="ticketType" class="select">
+                    <option value="1">专票</option>
+                    <option value="2">普票</option>
+                </select>
             </div>
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开户支行:</label>
             <div class="formControls col-2 col-sm-2 skin-minimal">
-                <input type="text" class="input-text trim_input" placeholder="开户支行名称" id="customerName" name="customerName" value="">
+                <input type="text" class="input-text trim_input" placeholder="开户支行名称" id="accountOpeningBranch" name="accountOpeningBranch" value="">
             </div>
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开票账户:</label>
             <div class="formControls col-2 col-sm-2 skin-minimal">
-                <input type="text" class="input-text trim_input" placeholder="开票账户" id="customerWechatName" name="customerWechatName" value="">
+                <input type="text" class="input-text trim_input" placeholder="开票账户" id="ticketOpeningAccount" name="ticketOpeningAccount" value="">
             </div>
-            <label class="form-label col-2 col-sm-2">企业名称:</label>
+            <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>企业名称:</label>
             <div class="formControls col-2 col-sm-2 skin-minimal">
-                <input type="text" class="input-text trim_input" placeholder="企业名称" id="customerName" name="customerName" value="">
+                <input type="text" class="input-text trim_input" placeholder="企业名称" id="enterpriseName" name="enterpriseName" value="">
             </div>
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>纳税人识别号:</label>
             <div class="formControls col-2 col-sm-2 skin-minimal">
-                <input type="text" class="input-text trim_input" placeholder="纳税人识别号" id="customerWechatName" name="customerWechatName" value="">
+                <input type="text" class="input-text trim_input" placeholder="纳税人识别号" id="taxpayerIdentificationNum" name="taxpayerIdentificationNum" value="">
             </div>
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>开票电话:</label>
             <div class="formControls col-2 col-sm-2 skin-minimal">
-                <input type="text" class="input-text trim_input" placeholder="开票电话" id="customerWechatName" name="customerWechatName" value="">
+                <input type="text" class="input-text trim_input" placeholder="开票电话" id="ticketOpeningPhone" name="ticketOpeningPhone" value="">
             </div>
             <label class="form-label col-2 col-sm-2"><span class="c-red">*</span>企业地址:</label>
             <div class="formControls col-2 col-sm-2 skin-minimal">
-                <input type="text" class="input-text trim_input" placeholder="企业地址" id="customerWechatName" name="customerWechatName" value="">
+                <input type="text" class="input-text trim_input" placeholder="企业地址" id="enterpriseAddress" name="enterpriseAddress" value="">
             </div>
         </div>
-    <#--客户备注-->
+        <#--客户备注-->
         <div class="row cl">
             <label class="form-label col-3">
                 <div class="tit-2">客户备注</div>
@@ -262,12 +293,20 @@
                 <textarea id="customerRemarks" name="customerRemarks" ></textarea>
             </div>
         </div>
-        <div class="row cl">
+        <#--添加保存按钮-->
+        <!-- Unnamed (矩形) -->
+        <div id="u29" class="ax_default _三级标题">
+            <div id="u29_div" class=""></div>
+            <!-- Unnamed () -->
+            <div id="u30" class="text" style="visibility: visible;">
+                <p><span onclick="addCustomerBasicInfo()">添加客户信息</span></p>
+            </div>
+        </div>
     </form>
 </div>
 
 <#--业务js-->
-<script type="text/javascript" src="${path}/common/js/customerSaveAdmin/save_customer_info.js"></script>
+<#--<script type="text/javascript" src="${path}/common/js/customerSaveAdmin/save_customer_info.js"></script>-->
 <script>
     //定义变量
 
@@ -282,16 +321,234 @@
         /*初始化渠道类别(大类)*/
         initChannelCategory();
 
+        /*初始化销售产品(大类)*/
+        initPromotingProducts();
+
         /*监听省份*/
-        $("input[name='customerProvince']").change(function (){
+        $("[name='customerProvince']").click(function (){
             initCity($(this).val());
         })
 
         /*监听渠道类别*/
-        $("input[name='customerChannelCategory']").change(function (){
+        $("[name='channelCategory']").click(function (){
             initChannelType($(this).val());
         })
 
+        /*监听销售产品*/
+        $("[name='promotingProducts']").click(function (){
+            initSupplyPrice($(this).val());
+        })
+    })
+
+    /*业务逻辑js控制 start*/
+    $(document).on('click', '.dalog-ask .answer', function() {
+        var customerProvinceCode = $(this).find(".customerProvinceCode").val();
+        $("select[name='complaintId']").val(customerProvinceCode);
+        initCity(customerProvinceCode); //根据省份初始化城市
+        $(".dalog-ask").hide();
+    });
+
+    /*初始化省份*/
+    function initProvince() {
+        //默认查询参数为空
+        var provinceListInfo = null;
+        $.ajax({
+            type: "POST",
+            data: {
+                provinceId : provinceListInfo
+            },
+            url: "${path}/admin/customerBasic/query_provinceList",
+            async: true,
+            success: function(data){
+                var html = '<option value="">请选择省份</option>';
+                var id;
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.provinceList.length;i++){
+                        provinceListInfo = data.returnMsg.provinceList[i];
+                        if(i == 0 ){
+                            id = provinceListInfo.provinceId;
+                        }
+                        html += '<option value="'+ provinceListInfo.provinceId +'">'+ provinceListInfo.province +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='customerProvinceCode']").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+
+    /*根据省份代号初始化城市*/
+    function initCity(customerProvince){
+        alert("initCity start...");
+        var cityListInfo = null;
+        if(customerProvince == null || customerProvince == ""){
+            var html = '<option value="">请选择城市</option>';
+            $("[name='customerCityCode']").html(html);
+        }else{
+            $.ajax({
+                type: "POST",
+                data: {
+                    provinceId : customerProvince
+                },
+                url: "${path}/admin/customerBasic/query_cityList",
+                async: true,
+                success: function(data){
+                    var html = '<option value="">请选择城市</option>';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.cityList.length;i++){
+                            cityListInfo = data.returnMsg.cityList[i];
+                            html += '<option value="'+ cityListInfo.cityId +'">'+ cityListInfo.city +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='customerCityCode']").html(html);
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
+
+    /*初始化渠道类别*/
+    function initChannelCategory() {
+        //默认为售前咨询
+        //var customerCounselTypeOverall = allCustomerInfoType;
+        var customerChannelCategory = null;
+        $.ajax({
+            type: "POST",
+            data: {
+                complaintConsultingType : customerChannelCategory
+            },
+            url: "${path}/admin/complaintQuestion/list_complaintType",
+            async: true,
+            success: function(data){
+                var html = '<option value="">请选择渠道类别</option>';
+                var id;
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
+                        var complaintTypeInfo = data.returnMsg.complaintTypeInfoList[i];
+                        if(i == 0 ){
+                            id = complaintTypeInfo.complaintId;
+                        }
+                        html += '<option value="'+ complaintTypeInfo.complaintId +'">'+ complaintTypeInfo.complaintClassName +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='complaintId']").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+
+    /*根据渠道类别初始化渠道类型*/
+    function initChannelType(complaintId,smallId){
+        if(complaintId == null || complaintId == ""){
+            var html = '<option value="">请选择渠道类别</option>';
+            $("[name='smallClassId']").html(html);
+        }else{
+            $.ajax({
+                type: "POST",
+                data: {
+                    complaintId : complaintId
+                },
+                url: "${path}/admin/complaintQuestion/list_complaintSmallClass",
+                async: true,
+                success: function(data){
+                    var html = '<option value="">请选择渠道类型</option>';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.customerChannelTypeList.length;i++){
+                            var ComplaintSmallClassInfo = data.returnMsg.customerChannelTypeList[i];
+                            html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='smallClassId']").html(html);
+
+                    if(smallId != null && smallId != "" && typeof(smallId)!="undefined" ){
+                        $("select[name='smallClassId']").val(smallId);
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
+
+    /*初始化销售产品*/
+    function initPromotingProducts() {
+        //默认为售前咨询
+        //var customerCounselTypeOverall = allCustomerInfoType;
+        var customerChannelCategory = null;
+        $.ajax({
+            type: "POST",
+            data: {
+                complaintConsultingType : customerChannelCategory
+            },
+            url: "${path}/admin/complaintQuestion/list_complaintType",
+            async: true,
+            success: function(data){
+                var html = '<option value="">请选择渠道类别</option>';
+                var id;
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
+                        var complaintTypeInfo = data.returnMsg.complaintTypeInfoList[i];
+                        if(i == 0 ){
+                            id = complaintTypeInfo.complaintId;
+                        }
+                        html += '<option value="'+ complaintTypeInfo.complaintId +'">'+ complaintTypeInfo.complaintClassName +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='complaintId']").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+    }
+
+    /*初始化产品价格*/
+    function initSupplyPrice(complaintId,smallId){
+        if(complaintId == null || complaintId == ""){
+            var html = '<option value="">请选择渠道类别</option>';
+            $("[name='smallClassId']").html(html);
+        }else{
+            $.ajax({
+                type: "POST",
+                data: {
+                    complaintId : complaintId
+                },
+                url: "${path}/admin/complaintQuestion/list_complaintSmallClass",
+                async: true,
+                success: function(data){
+                    var html = '<option value="">请选择渠道类型</option>';
+                    if (data.returnCode == 200) {
+                        for(var i=0;i<data.returnMsg.customerChannelTypeList.length;i++){
+                            var ComplaintSmallClassInfo = data.returnMsg.customerChannelTypeList[i];
+                            html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
+                        }
+                    }else{
+                        html = '';
+                    }
+                    $("[name='smallClassId']").html(html);
+
+                    if(smallId != null && smallId != "" && typeof(smallId)!="undefined" ){
+                        $("select[name='smallClassId']").val(smallId);
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            });
+        }
+    }
+    /*业务逻辑js控制 end*/
 </script>
 
 </body>

+ 59 - 833
watero-rst-web/src/main/webapp/common/js/customerSaveAdmin/save_customer_info.js

@@ -1,507 +1,72 @@
-/**
- * 初始化销售渠道
- */
-getCompany();
-/*===============================TDS 城市加载  -- start -- =============================== */
-$(function(){
-    $("#province").ProvinceCity();
-    $('.skin-minimal input').iCheck({
-        checkboxClass: 'icheckbox-blue',
-        radioClass: 'iradio-blue',
-        increaseArea: '20%'
-    });
-    $("#arrcity").suggest(citys,{hot_list:commoncitys,dataContainer:'#arrcity_3word',onSelect:function(result){
-        console.log($(this)[0].value);
-        $("#city2").click()
-    },
-        attachObject:'#suggest'
-    });
-    $("#city2").suggest(citys,{hot_list:commoncitys,attachObject:"#suggest2"})
-});
-/*===============================TDS 城市加载  -- start -- =============================== */
-
-/*===============================问题回复选择  -- start -- =============================== */
-$(document).on('click', '.dalog-ask .answer', function() {
-
-    initCity();//初始化城市
-    var QA_complaintId = $(this).find(".QA_complaintId").val();
-    var QA_smallClassId = $(this).find(".QA_smallClassId").val();
-    $("select[name='complaintId']").val(QA_complaintId);
-    initChannelType(QA_complaintId,QA_smallClassId); //初始化渠道类型
-
-    var questionId = $(this).find(".quesId").val();
-    var title = $(this).find("span").html();
-    var desc = $(this).find("#questionProfile").html();
-
-    $("#questionId").val(questionId);
-    $("#describeTitle").val(title);
-    UE.getEditor('describeContentText').setContent(desc);
-
-    //$("#answer-textarea").text();
-    $(".dalog-ask").hide(); //隐藏qa
-});
-
-
-
-var isInitSendAddressSms = false;
-
-/*处理结果的执行状态*/
-var isSolve = {
-    solved : [],
-    noSolved : [],
-    renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
-    maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
-    reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
-    backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
-    noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
-}
-
-/*处理结果的变更状态  产品列表表头信息*/
-var isSolveTitleMsg = {
-    solved : [[],[]],
-    noSolved : [[],[]],
-    renewed : [["寄回产品","寄回产品颜色","退回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
-    maintain : [["寄回产品","寄回产品颜色","寄回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
-    reissue : [[],["补发产品","补发产品颜色","补发产品配件"]],
-    backGoods : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]],
-    noReasonBack : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]]
-}
-/*===============================定义全局变量以及监听事件和初始化  -- end -- =============================== */
-
-/*===============================正则表达式  -- start -- =============================== */
-var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;
-var phoneReg2 = /(^[0-9]{3,4}\-[0-9]{3,8}$)|(^[0-9]{3,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/;
-/*===============================正则表达式  -- end -- =============================== */
-
-/*=============================== 页面加载完成启动事件  -- start -- =============================== */
-$(function (){
-    /* 所有trim_input 样式,input框都需要去除前后空格*/
-    $(".trim_input").change(function(){
-        var value = $.trim($(this).val());
-        $(this).val(value);
-    })
-
-    /*监听销售公司选择事件*/
-    $("#selectCompany").change(function (){
-        var companyId = $(this).val();
-        $("#companyId").val(companyId);
-        setStore(companyId,$("#selectStore"));       //获取店铺
-    })
-
-    /*监听店铺选择事件*/
-    $("#selectStore").change(function (){
-        var storeId = $(this).val();
-        $("#storeId").val(storeId);
-    })
-})
-/*===============================页面加载完成启动事件  -- end -- =============================== */
-
-/*用于初始化监听回访信息的展示*/
-function initVisitEvent(){
-    $("input[name='customerIsVisit']").change(function (){
-        if($(this).val() == 2){
-            $("#needToVisit").css("display","block");
-        }else{
-            $("#needToVisit").css("display","none");
-        }
-    })
-}
-
-/*关闭qa*/
-function closeQA(){
-    $(".dalog-ask").hide(); //隐藏qa
-}
-
-/*初始化单选框样式*/
-function initCheck(){
-    $('.skin-minimal input').iCheck({
-        checkboxClass: 'icheckbox-blue',
-        radioClass: 'iradio-blue',
-        increaseArea: '20%'
-    });
-}
-
-/*初始化单选框样式*/
-function initCheckByNode(node){
-    $(node).iCheck({
-        checkboxClass: 'icheckbox-blue',
-        radioClass: 'iradio-blue',
-        increaseArea: '20%'
-    });
-}
-
-/*
-* 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");
-    }else{
-        $("#customer-visit-1").iCheck('check');  //设置需要回访
-        $("#needToVisit").css("display","block");
-    }
-    initVisitEvent();
-}
-
-function initSysAdmin() {
-    sysAminList = getSysAdmin();
-    var html = "";
-    for(var i=0;i<sysAminList.length;i++){
-        var adminList = sysAminList[i];
-        if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
-            html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
-        }else{
-            html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
-        }
-    }
-    $("#adminId").html(html);
-}
-
-/*初始化回访客服的选择*/
-function initVisitSysAdmin(){
-    var html = "";
-    var flag = false;
-    for(var i=0;i<sysAminList.length;i++){
-        var adminList = sysAminList[i];
-        if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
-            html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
-            flag = true;
-        }else{
-            html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
-        }
-    }
-    $("#visitAdminId").html(html);
-    if(flag){
-        showVisitMsg(1);
-    }
-}
-
-/**
- * 用于显示回访指派任务提示信息
- * 1 :自己
- * 2 :其他人
- */
-function showVisitMsg(type,adminName) {
-    if(type == 1){
-        $("#visitAdminIdMsg").html("您将为自己指定一个回访任务");
-    }else{
-        $("#visitAdminIdMsg").html("您将为"+ adminName +"指定一个回访任务");
-    }
-}
-
-function getSysAdmin(){
-    if(sysAminList != null && sysAminList.length > 0){
-        return sysAminList;
-    }
-    $.ajax({
-        type: "POST",
-        data: {
-        },
-        url: url_path + "/admin/customer/select_sys_admin",
-        async: false,
-        success: function(data){
-            if (data.returnCode == 200) {
-                sysAminList = data.returnMsg.adminList;
-                adminId = data.returnMsg.adminId;
-            }
-        },
-        error: function(XmlHttpRequest, textStatus, errorThrown){
-        }
-    });
-    return sysAminList;
-}
-
-/*初始化产品类型 --  客诉头部的产品类型单选*/
-function initProduceType(){
+/*初始化省份*/
+function initProvince() {
+    //默认查询参数为空
+    var provinceListInfo = null;
     $.ajax({
         type: "POST",
         data: {
+            provinceId : provinceListInfo
         },
-        url: url_path + "/admin/customer/select_produce_type",
+        url: url_path + "/admin/customerBasic/query_provinceList",
+        async: true,
         success: function(data){
-            var html = "";
+            var html = '<option value="">请选择省份</option>';
+            var id;
             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" class="single_loading"  id="produce-type-'+ i +'" name="typeId" typeCompany="'+ produce.typeCompany +'"  datatype="*" value="'+ produce.typeId +'"  '+ check +' nullmsg="请选择产品类型!" >' +
-                        ' <label for="produce-type-'+ i +'">'+ produce.typeName +'</label>' +
-                        ' </div>';
-                    check = "";
+                for(var i=0;i<data.returnMsg.provinceList.length;i++){
+                    var provinceListInfo = data.returnMsg.provinceList[i];
+                    if(i == 0 ){
+                        id = provinceListInfo.provinceId;
+                    }
+                    html += '<option value="'+ provinceListInfo.provinceId +'">'+ provinceListInfo.provinceName +'</option>';
                 }
             }else{
                 html = '';
             }
-            $("#produceTypeHtml").html(html);
-            initCheckByNode(".produce_type_html input");
-
-            /*绑定产品类型选择事件*/
-            $("input[name='typeId']").change(function (){
-                var typeId = parseInt($(this).val());
-                var isOrder = 1;
-                switch (typeId){    //1:Soodo电动牙刷   6:WaterO净水机    7:Aiberle净水机    9 :YULIA净水机
-                    case 1:
-                        isOrder = 2;
-                        break;
-                    case 6:
-                        isOrder = 1;
-                        break;
-                    case 7:
-                        isOrder = 1;
-                        break;
-                    case 9:
-                        isOrder = 1;
-                        break;
-                    default:
-                        break;
-                }
-                opentionSelectOrder(isOrder);
-            })
-            /*当前第一个默认选中上朵电动牙刷  isNeedSelectOrder = 2  默认不需要选择订单*/
-            opentionSelectOrder(2);
+            $("[name='customerProvinceCode']").html(html);
         },
         error: function(XmlHttpRequest, textStatus, errorThrown){
         }
     });
 }
 
-/**
- * 选择处理结果-- 默认选择已解决
- * 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);
-                //getCompany();
-                break;
-            case 2:
-                otherHied();
-                visitByType(2);
-                //getCompany();
-                break;
-            default:
-                break;
-        }
-    }else if(allCustomerInfoType == 2){ //售后
+/*根据省份代号初始化城市*/
+function initCity(complaintId,smallId){
+    if(complaintId == null || complaintId == ""){
+        var html = '<option value="">请选择城市</option>';
+        $("[name='smallClassId']").html(html);
+    }else{
+        $.ajax({
+            type: "POST",
+            data: {
+                complaintId : complaintId
+            },
+            url: url_path + "/admin/complaintQuestion/list_complaintSmallClass",
+            async: true,
+            success: function(data){
+                var html = '<option value="">请选择城市</option>';
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.complaintSmallClassInfoList.length;i++){
+                        var ComplaintSmallClassInfo = data.returnMsg.complaintSmallClassInfoList[i];
+                        html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
+                    }
+                }else{
+                    html = '';
+                }
+                $("[name='smallClassId']").html(html);
 
-        if(!isInitSendAddressSms){
-            initComplaintQuestionInfo("m");
-            isInitSendAddressSms = true;
-        }
-        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;
+                if(smallId != null && smallId != "" && typeof(smallId)!="undefined" ){
+                    $("select[name='smallClassId']").val(smallId);
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
             }
-        }
-
-        $("#renewed").show();
-        $("#maintain").show();
-        $("#reissue").show();
-        $("#backGoods").show();
-        $("#noReasonBack").show();
-        switch(type)
-        {
-            case 1:
-                otherHied();
-                visitByType(1);
-                //getCompany();
-                break;
-            case 2:
-                otherHied();
-                visitByType(2); //需要回访
-                //getCompany();
-                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").hide(); //换新产品
-                $("#postageAccount").show();    //邮费转账账户
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").hide();  //屏蔽销售公司
-                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").hide();//维修产品
-                $("#postageAccount").show();    //邮费转账账户
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").hide();  //屏蔽销售公司
-                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").hide();
-                $("#TDScollect").show();
-                $("#TDScollectShow").show();
-                $("#sendAddressInfo").hide();
-                $("#sendAddressByPhone").hide();
-                $("#updateProduct").hide();
-                $("#postageAccount").hide();    //邮费转账账户 -- 隐藏
-                visitByType(2); //需要回访
-                $("#salesChannelsSelect").hide();  //屏蔽销售公司
-                break;
-            case 6: //退货
-                result = isSolve.backGoods;
-                resultProductTableTitle = isSolveTitleMsg.backGoods;
-                $("#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").hide();
-                $("#postageAccount").show();    //邮费转账账户
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").hide();  //屏蔽销售公司
-                break;
-            case 7://无理由退货
-                result = isSolve.noReasonBack;
-                resultProductTableTitle = isSolveTitleMsg.noReasonBack;
-                $("#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").hide();
-                $("#postageAccount").show();    //邮费转账账户
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").hide();  //屏蔽销售公司
-                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);
-
-    opentionSelectOrderDiv();
-}
-
-/*已解决|未解决 */
-function otherHied(){
-    $("#salesChannelsSelect").show();  //展示销售公司
-    $("#processResultStatus").hide();   //处理结果的执行状态  已解决未解决没有该信息
-    $("#orderHead").hide();
-    $("#order").hide();
-    $("#recipientInfo").hide();
-    $("#recipientInfoTitle").hide();
-    $("#recipientAddress").hide();
-    $("#recipientAddressText").hide();
-    $("#renewedProduct").hide();
-    $("#TDScollect").show();
-    $("#TDScollectShow").show();
-    $("#sendAddressInfo").hide();
-    $("#sendAddressByPhone").hide();
-    $("#updateProduct").hide();
 }
 
-
-/*初始化省份*/
-function initProvince() {
+/*初始化渠道类别*/
+function initChannelCategory() {
     //默认为售前咨询
     //var customerCounselTypeOverall = allCustomerInfoType;
     var customerChannelCategory = null;
@@ -513,7 +78,7 @@ function initProvince() {
         url: url_path + "/admin/complaintQuestion/list_complaintType",
         async: true,
         success: function(data){
-            var html = '<option value="">请选择省份</option>';
+            var html = '<option value="">请选择渠道类别</option>';
             var id;
             if (data.returnCode == 200) {
                 for(var i=0;i<data.returnMsg.complaintTypeInfoList.length;i++){
@@ -533,10 +98,10 @@ function initProvince() {
     });
 }
 
-/*初始化城市*/
-function initCity(complaintId,smallId){
+/*根据渠道类别初始化渠道类型*/
+function initChannelType(complaintId,smallId){
     if(complaintId == null || complaintId == ""){
-        var html = '<option value="">请选择城市</option>';
+        var html = '<option value="">请选择渠道类别</option>';
         $("[name='smallClassId']").html(html);
     }else{
         $.ajax({
@@ -547,10 +112,10 @@ function initCity(complaintId,smallId){
             url: url_path + "/admin/complaintQuestion/list_complaintSmallClass",
             async: true,
             success: function(data){
-                var html = '<option value="">请选择城市</option>';
+                var html = '<option value="">请选择渠道类型</option>';
                 if (data.returnCode == 200) {
-                    for(var i=0;i<data.returnMsg.complaintSmallClassInfoList.length;i++){
-                        var ComplaintSmallClassInfo = data.returnMsg.complaintSmallClassInfoList[i];
+                    for(var i=0;i<data.returnMsg.customerChannelTypeList.length;i++){
+                        var ComplaintSmallClassInfo = data.returnMsg.customerChannelTypeList[i];
                         html += '<option value="'+ ComplaintSmallClassInfo.smallClassId +'">'+ ComplaintSmallClassInfo.smallClassName +'</option>';
                     }
                 }else{
@@ -568,8 +133,8 @@ function initCity(complaintId,smallId){
     }
 }
 
-/*初始化渠道类别*/
-function initChannelCategory() {
+/*初始化销售产品*/
+function initPromotingProducts() {
     //默认为售前咨询
     //var customerCounselTypeOverall = allCustomerInfoType;
     var customerChannelCategory = null;
@@ -601,8 +166,8 @@ function initChannelCategory() {
     });
 }
 
-/*显示小类*/
-function initChannelType(complaintId,smallId){
+/*初始化产品价格*/
+function initSupplyPrice(complaintId,smallId){
     if(complaintId == null || complaintId == ""){
         var html = '<option value="">请选择渠道类别</option>';
         $("[name='smallClassId']").html(html);
@@ -636,342 +201,3 @@ function initChannelType(complaintId,smallId){
     }
 }
 
-
-
-
-/**
- * 设置市
- * type  1:搜索订单赋值   2:只查询全部,默认第一个
- */
-function setCity(cityName,proId,type) {
-    var cityId = '';
-    var city = listCity(proId,"");
-    var selectCity = new Array();
-    if(type == 1){
-        selectCity = listCity(proId,cityName);
-    }
-
-    if(city!=null){
-        var cityHtml = ''
-        for(var i=0;i<city.length;i++){
-            cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
-        }
-        $("#city").html(cityHtml);
-        if(selectCity != null && selectCity.length > 0 ){
-            cityId = selectCity[0].cityId;
-        }else{
-            cityId = city[0].cityId;
-        }
-        $("#city option[value='" + cityId + "']").attr("selected","true");
-    }
-    return cityId;
-}
-
-/*===============================客户信息提交  -- start -- =============================== */
-$(function(){
-    $("#form-customerInfoAdmin-add").Validform({
-        tiptype: function (msg, o, cssctl) {
-            if (o.type == 3) {//失败
-                layer.msg(msg, {icon: 5, time: 3000});
-                $(window).scrollTop(o.obj.offset().top - 40);
-            }
-        },
-        datatype: {//自定义验证类型
-
-        },
-        ignoreHidden: true,
-        tipSweep: true, //若为true,则只在表单提交时验证
-        ajaxPost: true, //异步提交
-        beforeCheck: function (curform) {  //验证通过之前执行的函数
-        },
-        beforeSubmit: function (curform) {  //验证通过之后执行的函数
-            var flag  = addCustomerReady();
-            if(!flag){
-                return false;
-            }
-        },
-        callback: function (data) {//异步回调函数
-            if (data) {
-                var index = layer.alert(data.resultMsg, function (index) {
-                    if (data.resultCode == 200) {
-                        location.href = url_path + "/admin/customer/select_customer_list";
-                    } else if(data.resultCode == 505){
-                        location.href = url_path + "/admin/customer/select_customer_list";
-                    }else {
-                        layer.close(index);
-                    }
-                });
-            }
-        }
-    });
-})
-
-/* 添加客诉的准备 */
-function addCustomerReady(){
-    //保存AQ
-    saveQuestion(2);
-
-    /* 是否需要添加订单,赋值 */
-    $("#isNeedSelectOrder").val(isNeedSelectOrder);
-
-    var phoneFlag = true;
-    $(".associated-phone").each(function () {
-        var phone = $(this).val();
-        if(phone != null && phone != "" && typeof (phone) != "undefined"){
-            if(phone.length != 11){
-                vailErrorMsg($(this),"手机号码格式不正确");
-                phoneFlag = false;
-            }
-            /*if (!phoneReg.test(phone)) {
-                vailErrorMsg($(this),"手机号码格式不正确");
-                phoneFlag = false;
-            }*/
-        }
-    })
-
-    if(!phoneFlag){
-        return false;
-    }
-
-    /*验证来源入口*/
-    var customerSourceType = $("input:radio[name='customerSourceType']:checked").val();
-    if(customerSourceType == 3){
-        var customerSourceOld = $("#customerSourceOld").val();
-        if(customerSourceOld == null || customerSourceOld == "" || typeof(customerSourceOld)=="undefined"){
-            vailErrorMsg($("#customerSourceOld"),"未填写来源入口");
-            return false;
-        }else{
-            $("#customerSource").val(customerSourceOld);
-        }
-    }
-
-    /*根据产品类型,获取来源商城*/
-    var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
-    $("#typeCompany").val(typeCompany);
-
-    /*----TDS收集模块--start-----*/
-    var valicity = $(".ac_result_tip").html();
-    if(valicity == null || valicity == "" || typeof(valicity)=="undefined"){
-        $("#TDSArea").html("");
-    }else if(valicity.indexOf("对不起,找不到") > 0 ){
-        $("#TDSArea").html("");
-        $("#customerArea").val("");
-    }else{
-        var TDSArea = $("#TDSArea").find("option:selected").text();
-        if(TDSArea != null && TDSArea != ""){
-            var area = TDSCity + "-" + TDSArea
-            $("#customerArea").val(area);
-        }
-    }
-    /*----TDS收集模块--end-----*/
-
-    /* 地址拼接  */
-    var province = $("#province").find("option:selected").text();
-    var city = $("#city").find("option:selected").text();
-    var district = $("#district").find("option:selected").text();
-    var relationSendMergeAddress = province + "-" + city + "-" + district;
-    $("#relationSendMergeAddress").val(relationSendMergeAddress);
-    /* 地址拼接  */
-
-    /*----问题描述- start --*/
-    var quId = $("#questionId").val();
-    if(quId == null || quId == ""){
-        vailErrorMsg($("#questionId"),"未保存QA!");
-        return false;
-    }
-    var describeContentText = UE.getEditor('describeContentText').getContent();
-    if(describeContentText == null || describeContentText == ""){
-        //layer.msg("未填写问题描述", {icon: 5, time: 3000});
-        vailErrorMsg($("#describeTitle"),"未填写问题描述");
-        return false;
-    }
-    if(describeContentText.length > 3000){
-        vailErrorMsg($("#describeContent"),"问题回复最大支持3000个字符");
-        return false;
-    }
-    $("#describeContent").val(describeContentText);
-    /*----问题描述--end-----*/
-
-    /*----处理描述- start --*/
-    var describeHandleDescText = UE.getEditor('describeHandleDescText').getContent();
-    if(describeHandleDescText.length > 3000){
-        vailErrorMsg($("#describeHandleDesc"),"问题描述最大支持3000个字符");
-        return false;
-    }
-    $("#describeHandleDesc").val(describeHandleDescText);
-    /*----处理描述--end-----*/
-
-    /* --- 类型:售后   处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
-
-    if(isNeedSelectOrder == 1) {     //需要订单
-
-        var sendProdcues = new Array();  //寄出产品表
-        var sendFittings = new Array();
-        var closedProdcues = new Array();         //获取寄回,寄出直接复制寄回
-        var closedFittings = new Array();         //获取寄回,寄出直接复制寄回
-
-        $("#addProduct").find(".input-number").each(function () {
-            var machineNo = $(this).val();    //机器编号
-            var number = $(this).attr("number");    //机器编号
-            var itemIsSource = $(this).attr("itemissource");    //是否为配件  1:产品颜色表,2:配件表
-            if (number != null && number != "" && number != 0) {
-                var product = new Object();
-                var fittings = new Object();
-                product.productId = $(this).parent().find(".input-produce-id").val();
-                product.colorId = $(this).parent().find(".input-fc-id").val();
-                fittings.productId = $(this).parent().find(".input-produce-id").val();
-                fittings.fittingsId = $(this).parent().find(".input-fc-id").val();
-                if(itemIsSource == 1){ //产品颜色
-                    product.sendProdcueNumber = number;
-                    product.closedProdcueNumber = number;
-                    product.closedProdcueMachineNo = machineNo;
-                    //换新、维修,退货,无理由退货,
-                    if (allCustomerType == 3 || allCustomerType == 4 ){        //换新/维修
-                        sendProdcues.push(product);
-                        closedProdcues.push(product);
-                    }else if(allCustomerType == 6 || allCustomerType == 7){
-                        closedProdcues.push(product);
-                    }else if(allCustomerType == 5){             //补发
-                        sendProdcues.push(product);
-                    }
-                }else{
-                    fittings.sendFittingNumber = number;
-                    fittings.closedFittingNumber = number;
-                    //换新、维修,退货,无理由退货,
-                    if (allCustomerType == 3 || allCustomerType == 4 ) {        //换新/维修
-                        sendFittings.push(fittings);
-                        closedFittings.push(fittings);
-                    }else if(allCustomerType == 6 || allCustomerType == 7){
-                        closedFittings.push(fittings);
-                    }else if(allCustomerType == 5){             //补发
-                        sendFittings.push(fittings);
-                    }
-                }
-            }
-        })
-
-        var backErrorMsg = "请选择一个replace_error_msg寄回的产品或配件并填写一个以上的数量!"
-        var sendErrorMsg = "请选择一个replace_error_msg寄送的产品或配件并填写一个以上的数量!"
-        var process = true;
-        switch (allCustomerType) {
-            case 3:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "换新");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                process = processIsEmpty([sendProdcues, sendFittings]);
-                if (!process) {
-                    var msg = sendErrorMsg.replace("replace_error_msg", "换新");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 4:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "维修");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                process = processIsEmpty([sendProdcues, sendFittings]);
-                if (!process) {
-                    var msg = sendErrorMsg.replace("replace_error_msg", "维修");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 5:
-                process = processIsEmpty([sendProdcues, sendFittings]);
-                if (!process) {
-                    var msg = sendErrorMsg.replace("replace_error_msg", "补发");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 6:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "退货");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 7:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "退货");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            default:
-                break;
-        }
-        $("#sendProdcues").val(JSON.stringify(sendProdcues));
-        $("#sendFittings").val(JSON.stringify(sendFittings));
-        $("#closedProdcues").val(JSON.stringify(closedProdcues));
-        $("#closedFittings").val(JSON.stringify(closedFittings));
-    }
-
-    var visitTimeSelect = $("input[name='visitTimeSelect']:checked").val();
-    var visit_date = $('#datemin').val();
-    var myDate = new Date();
-    var date = myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate();
-    var hours = myDate.getHours();
-    //如果两个时间相等,则判断可选的回访时间
-    if(Date.parse(visit_date) == Date.parse(date)){
-        var msg = "该时间已超过当前时间,请重新选择回访时间!";
-        if (hours > 12 && visitTimeSelect == 1) {
-            vailErrorMsg($("#datemin"),msg);
-            return false;
-        } else if (hours > 14 && visitTimeSelect == 2) {
-            vailErrorMsg($("#datemin"),msg);
-            return false;
-        } else if (hours > 18 && visitTimeSelect == 3) {
-            vailErrorMsg($("#datemin"),msg);
-            return false;
-        }
-    }
-    return true;
-}
-
-/* 判断产品与配件是否填入值 */
-function processIsEmpty(process){
-    if(process != null && process != "" && process.length > 0){
-        var flag = 2;
-        var num = 0;
-        if(process[0] == null ||  process[0].length < 1 ){
-            flag -- ;
-        }
-        if(process[1] == null ||  process[1].length < 1 ){
-            flag -- ;
-        }
-
-        for(var j=0; j<process.length;j++){
-            for(var i=0;i<process[j].length;i++){
-                if(process[j][i].sendProdcueNumber !== undefined){
-                    num +=  process[j][i].sendProdcueNumber;
-                }
-                if(process[j][i].sendFittingNumber !== undefined){
-                    num += process[j][i].sendFittingNumber;
-                }
-                if(process[j][i].closedProdcueNumber !== undefined){
-                    num += process[j][i].closedProdcueNumber ;
-                }
-                if(process[j][i].closedFittingNumber !== undefined){
-                    num += process[j][i].closedFittingNumber;
-                }
-            }
-        }
-        if(flag == 0){
-            return false;
-        }
-        if(num == 0){
-            return false;
-        }
-    }
-    return true;
-}
-/*===============================客诉提交  -- end -- =============================== */