Browse Source

添加客户基本信息

dujinyan 7 years ago
parent
commit
1aa79d0842

+ 26 - 14
watero-rst-web/src/main/webapp/WEB-INF/views/customer/update_customer_info.ftl

@@ -187,10 +187,6 @@
             <div class="formControls col-1 col-sm-1">
                 <span class="select-box">
                     <select name="channelCategory" id="channelCategory" class="select">
-                        <option value="1">电商</option>
-                        <option value="2">特殊渠道</option>
-                        <option value="3">线下</option>
-                        <option value="4">海外</option>
                     </select>
                 </span>
             </div>
@@ -470,7 +466,7 @@
         initCity('${customerBasicInfo.customerProvinceCode!''}');
 
         /*初始化渠道类别(大类)*/
-        /*initChannelCategory();*/
+        initChannelCategory();
 
         /*初始化销售产品(大类)*/
         initPromotingProducts();
@@ -604,10 +600,6 @@
     /*根据渠道类别初始化渠道类型*/
     function initChannelType(channelCategory){
         var channelTypeListInfo = null;
-        /* if(channelCategory == null || channelCategory == ""){
-             var html = '<option value="">请选择渠道类别</option>';
-             $("[name='channelCategory']").html(html);
-         }else{*/
         $.ajax({
             type: "POST",
             data: {
@@ -630,7 +622,6 @@
             error: function(XmlHttpRequest, textStatus, errorThrown){
             }
         });
-        //}
     }
 
     /*初始化销售产品*/
@@ -719,6 +710,13 @@
         if(contactPhone == "" || contactPhone == null ){
             layer.msg("电话不能为空");
             return;
+        }else{
+            //var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
+            var reg =  /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
+            if(!reg.test(contactPhone)){
+                layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
+                return;
+            }
         }
         if(contactType == "" || contactType == null ){
             layer.msg("职位/身份不能为空");
@@ -727,6 +725,12 @@
         if(contactEmail == "" || contactEmail == null ){
             layer.msg("联系邮箱不能为空");
             return;
+        }else{
+            var reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
+            if(!reg.test(contactEmail)){
+                layer.msg("请填写正确的邮箱!", {icon: 5, time: 3000});
+                return;
+            }
         }
         //var operation = "删除";
         var operation = "<a href='javascript:;' onclick='deleteContact(this)'>删除</a>";
@@ -838,10 +842,6 @@
             layer.msg("客户名称不能为空");
             return;
         }
-        if(customerBasicInfo.customerIndustry == "" || customerBasicInfo.customerIndustry == null ){
-            layer.msg("客户行业不能为空");
-            return;
-        }
         if(customerBasicInfo.customerProvinceCode == "" || customerBasicInfo.customerProvinceCode == null ){
             layer.msg("客户省份不能为空");
             return;
@@ -959,6 +959,12 @@
         }if(billingInfo.receivablesPhone == "" || billingInfo.receivablesPhone == null ){
             layer.msg("收款人手机不能为空");
             return;
+        }else{
+            var reg =  /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
+            if(!reg.test(phone)){
+                layer.msg("请填写正确的手机号码!", {icon: 5, time: 3000});
+                return;
+            }
         }
         //开票信息
         var ticketOpeningInfo = {};
@@ -990,6 +996,12 @@
             if(ticketOpeningInfo.ticketOpeningPhone == "" || ticketOpeningInfo.ticketOpeningPhone == null ){
                 layer.msg("开票电话不能为空");
                 return;
+            }else{
+                var reg =  /^(0?(13[0-9]|15[012356789]|17[013678]|18[0-9]|14[57])[0-9]{8})$/
+                if(!reg.test(ticketOpeningInfo.ticketOpeningPhone)){
+                    layer.msg("请填写正确的电话号码!", {icon: 5, time: 3000});
+                    return;
+                }
             }if(ticketOpeningInfo.enterpriseAddress == "" || ticketOpeningInfo.enterpriseAddress == null ){
                 layer.msg("企业地址不能为空");
                 return;