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

添加客户基本信息

dujinyan преди 7 години
родител
ревизия
ed1aa9ab88
променени са 1 файла, в които са добавени 71 реда и са изтрити 69 реда
  1. 71 69
      watero-rst-web/src/main/webapp/WEB-INF/views/customer/save_customer_info.ftl

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

@@ -574,6 +574,7 @@
                         }
                         html += '<option value="'+ channelCategoryListInfo.channelCategory +'">'+ channelCategoryListInfo.channelName +'</option>';
                     }
+                    initChannelType(id);
                 }else{
                     html = '';
                 }
@@ -582,7 +583,6 @@
             error: function(XmlHttpRequest, textStatus, errorThrown){
             }
         });
-        initChannelType(id);
     }
 
     /*根据渠道类别初始化渠道类型*/
@@ -1014,7 +1014,7 @@
         //var channelSaleInfoListJson = $("#channelSaleInfoJson").val(JSON.stringify(channelSaleInfoList));
         //付款/退款信息
         var billingInfo = {};
-        if(customerBasicInfo.cooperativeState != "1")
+        if(customerBasicInfo.cooperativeState == "2" || customerBasicInfo.cooperativeState == "3"){
             billingInfo.accountType = $("input[name='accountType']:checked").val();
             billingInfo.accountOpeningBranch = $("[name='billAccountOpeningBranch']").val();
             billingInfo.accountName = $("[name='accountName']").val();
@@ -1054,80 +1054,82 @@
                 if(!reg.test(billingInfo.receivablesPhone)){
                     layer.msg("请填写正确的收款人手机号!", {icon: 5, time: 3000});
                     return;
+                }
             }
-         }
-
+        }
         //开票信息
         var ticketOpeningInfo = {};
         var isOpenTicket = $("input[name='isOpenTicket']:checked").val();
-        if(customerBasicInfo.cooperativeState != "1" && isOpenTicket != "1"){
-            ticketOpeningInfo.ticketType = $("[name='ticketType']").val();
-            ticketOpeningInfo.accountOpeningBranch = $("[name='ticketAccountOpeningBranch']").val();
-            ticketOpeningInfo.ticketOpeningAccount = $("[name='ticketOpeningAccount']").val();
-            ticketOpeningInfo.enterpriseName = $("[name='enterpriseName']").val();
-            ticketOpeningInfo.taxpayerIdentificationNum = $("[name='taxpayerIdentificationNum']").val();
-            ticketOpeningInfo.ticketOpeningPhone = $("[name='ticketOpeningPhone']").val();
-            ticketOpeningInfo.enterpriseAddress = $("[name='enterpriseAddress']").val();
-            if(ticketOpeningInfo.ticketType == "1" ){
-                if(ticketOpeningInfo.accountOpeningBranch == "" || ticketOpeningInfo.accountOpeningBranch == null ){
-                    layer.msg("开户支行不能为空");
-                    return;
-                }else if(getByteLen(ticketOpeningInfo.accountOpeningBranch) > 50){
-                    layer.msg("开户支行长度超限");
-                    return;
-                }
-                if(ticketOpeningInfo.ticketOpeningAccount == "" || ticketOpeningInfo.ticketOpeningAccount == null ){
-                    layer.msg("开票账户不能为空");
-                    return;
-                }else if(getByteLen(ticketOpeningInfo.ticketOpeningAccount) > 30){
-                    layer.msg("开票账户长度超限");
-                    return;
-                }
-                if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
-                    layer.msg("企业名称不能为空");
-                    return;
-                }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
-                    layer.msg("企业名称长度超限");
-                    return;
-                }
-                if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
-                    layer.msg("纳税人识别号不能为空");
-                    return;
-                }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
-                    layer.msg("纳税人识别号长度超限");
-                    return;
-                }
-                if(ticketOpeningInfo.ticketOpeningPhone == "" || ticketOpeningInfo.ticketOpeningPhone == null ){
-                    layer.msg("开票电话不能为空");
-                    return;
+        if(customerBasicInfo.cooperativeState === "2" || customerBasicInfo.cooperativeState === "3"){
+            if(isOpenTicket == "0"){
+                ticketOpeningInfo.ticketType = $("[name='ticketType']").val();
+                ticketOpeningInfo.accountOpeningBranch = $("[name='ticketAccountOpeningBranch']").val();
+                ticketOpeningInfo.ticketOpeningAccount = $("[name='ticketOpeningAccount']").val();
+                ticketOpeningInfo.enterpriseName = $("[name='enterpriseName']").val();
+                ticketOpeningInfo.taxpayerIdentificationNum = $("[name='taxpayerIdentificationNum']").val();
+                ticketOpeningInfo.ticketOpeningPhone = $("[name='ticketOpeningPhone']").val();
+                ticketOpeningInfo.enterpriseAddress = $("[name='enterpriseAddress']").val();
+                if(ticketOpeningInfo.ticketType == "1" ){
+                    if(ticketOpeningInfo.accountOpeningBranch == "" || ticketOpeningInfo.accountOpeningBranch == null ){
+                        layer.msg("开户支行不能为空");
+                        return;
+                    }else if(getByteLen(ticketOpeningInfo.accountOpeningBranch) > 50){
+                        layer.msg("开户支行长度超限");
+                        return;
+                    }
+                    if(ticketOpeningInfo.ticketOpeningAccount == "" || ticketOpeningInfo.ticketOpeningAccount == null ){
+                        layer.msg("开票账户不能为空");
+                        return;
+                    }else if(getByteLen(ticketOpeningInfo.ticketOpeningAccount) > 30){
+                        layer.msg("开票账户长度超限");
+                        return;
+                    }
+                    if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
+                        layer.msg("企业名称不能为空");
+                        return;
+                    }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
+                        layer.msg("企业名称长度超限");
+                        return;
+                    }
+                    if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
+                        layer.msg("纳税人识别号不能为空");
+                        return;
+                    }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
+                        layer.msg("纳税人识别号长度超限");
+                        return;
+                    }
+                    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;
+                    }else if(getByteLen(ticketOpeningInfo.enterpriseAddress) > 30){
+                        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});
+                    if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
+                        layer.msg("企业名称不能为空");
+                        return;
+                    }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
+                        layer.msg("企业名称长度超限");
+                        return;
+                    }
+                    if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
+                        layer.msg("纳税人识别号不能为空");
+                        return;
+                    }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
+                        layer.msg("纳税人识别号长度超限");
                         return;
                     }
-                }
-                if(ticketOpeningInfo.enterpriseAddress == "" || ticketOpeningInfo.enterpriseAddress == null ){
-                    layer.msg("企业地址不能为空");
-                    return;
-                }else if(getByteLen(ticketOpeningInfo.enterpriseAddress) > 30){
-                    layer.msg("企业地址长度超限");
-                    return;
-                }
-            }else{
-                if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
-                    layer.msg("企业名称不能为空");
-                    return;
-                }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
-                    layer.msg("企业名称长度超限");
-                    return;
-                }
-                if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
-                    layer.msg("纳税人识别号不能为空");
-                    return;
-                }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
-                    layer.msg("纳税人识别号长度超限");
-                    return;
                 }
             }
         }