فهرست منبع

添加客户基本信息

dujinyan 7 سال پیش
والد
کامیت
2e61d536b6
1فایلهای تغییر یافته به همراه133 افزوده شده و 111 حذف شده
  1. 133 111
      watero-rst-web/src/main/webapp/WEB-INF/views/customer/update_customer_info.ftl

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

@@ -357,23 +357,26 @@
             </div>
         </#if>
         <#--开票信息-->
-        <div class="row cl" style="margin-bottom: 10px;">
-            <label class="form-label col-9 skin-minimal">
-                <span class="tit-2">开票信息</span><span class="c-red">&nbsp;&nbsp;&nbsp;*</span>是否开票
-                <div class="radio-box">
-                    <input type="radio" id="isOpenTicket-1" name="isOpenTicket" value="1" checked="checked"  >
-                    <label for="isOpenTicket-1">开票</label>
-                </div>
-                <div class="radio-box">
-                    <input type="radio" id="isOpenTicket-2" name="isOpenTicket" value="1"   >
-                    <label for="isOpenTicket-2">不开票</label>
-                </div>
+        <div class="row cl">
+            <label class="form-label col-9">
+                <div class="tit-2">开票信息</div>
             </label>
-            <div class="formControls col-3">
+            <div class="formControls col-9">
+            </div>
+        </div>
+        <div class="row cl skin-minimal" style="margin-bottom: 10px;">
+            <label class="form-label col-2 col-sm-2" style="width: 125px;"><span class="c-red">*</span>是否开票:</label>
+            <div class="radio-box">
+                <input type="radio" id="isOpenTicket-1" class="isShowOpenTicket" name="isOpenTicket" value="0" checked="checked"  >
+                <label for="isOpenTicket-1">开票</label>
+            </div>
+            <div class="radio-box">
+                <input type="radio" id="isOpenTicket-2" class="isShowOpenTicket" name="isOpenTicket" value="1"   >
+                <label for="isOpenTicket-2">不开票</label>
             </div>
         </div>
         <#if ticketOpeningInfo??>
-        <div class="row cl" style="margin-bottom: 10px;">
+        <div class="row cl" style="margin-bottom: 10px;" id="isShowOpenTicket">
             <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>发票类型:</label>
             <div class="formControls col-2 col-sm-2">
                 <span class="select-box">
@@ -392,7 +395,7 @@
                     <input type="text" class="input-text trim_input" placeholder="开票账户" id="ticketOpeningAccount" name="ticketOpeningAccount" value="${ticketOpeningInfo.ticketOpeningAccount!''}">
                 </div>
             </div>
-        <div class="row cl" style="margin-bottom: 10px;">
+        <div class="row cl" style="margin-bottom: 10px;" id="isShowEnterprise">
             <label class="form-label col-2 col-sm-2" style="width: 120px;"><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="enterpriseName" name="enterpriseName" value="${ticketOpeningInfo.enterpriseName!''}">
@@ -406,14 +409,14 @@
                 <input type="text" class="input-text trim_input" placeholder="开票电话" id="ticketOpeningPhone" name="ticketOpeningPhone" value="${ticketOpeningInfo.ticketOpeningPhone!''}">
             </div>
         </div>
-        <div class="row cl" style="margin-bottom: 10px;">
+        <div class="row cl" style="margin-bottom: 10px;" id="isShowAddress">
             <label class="form-label col-2 col-sm-2" style="width: 120px;"><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="enterpriseAddress" name="enterpriseAddress" value="${ticketOpeningInfo.enterpriseAddress!''}">
             </div>
         </div>
         <#else >
-            <div class="row cl" style="margin-bottom: 10px;">
+            <div class="row cl" style="margin-bottom: 10px;" id="isShowOpenTicket">
                 <label class="form-label col-2 col-sm-2" style="width: 120px;"><span class="c-red">*</span>发票类型:</label>
                 <div class="formControls col-2 col-sm-2">
                 <span class="select-box">
@@ -432,7 +435,7 @@
                     <input type="text" class="input-text trim_input" placeholder="开票账户" id="ticketOpeningAccount" name="ticketOpeningAccount" value="">
                 </div>
             </div>
-            <div class="row cl" style="margin-bottom: 10px;">
+            <div class="row cl" style="margin-bottom: 10px;" id="isShowEnterprise">
                 <label class="form-label col-2 col-sm-2" style="width: 120px;"><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="enterpriseName" name="enterpriseName" value="">
@@ -446,13 +449,14 @@
                     <input type="text" class="input-text trim_input" placeholder="开票电话" id="ticketOpeningPhone" name="ticketOpeningPhone" value="">
                 </div>
             </div>
-            <div class="row cl" style="margin-bottom: 10px;">
+            <div class="row cl" style="margin-bottom: 10px;" id="isShowAddress">
                 <label class="form-label col-2 col-sm-2" style="width: 120px;"><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="enterpriseAddress" name="enterpriseAddress" value="">
                 </div>
             </div>
         </#if>
+
         <#--客户备注-->
 
         <div class="row cl">
@@ -528,6 +532,19 @@
         $("[name='supplyPrice']").change(function (){
             changeSupplyPrice($(this).val());
         })
+        /*监听是否开票事件*/
+        $("input[name='isOpenTicket']").change(function (){
+            var isOpenTicket = $("input[name='isOpenTicket']:checked").val();
+            if(isOpenTicket == "1"){
+                $("#isShowOpenTicket").hide();
+                $("#isShowEnterprise").hide();
+                $("#isShowAddress").hide();
+            }else if(isOpenTicket == "0"){
+                $("#isShowOpenTicket").show();
+                $("#isShowEnterprise").show();
+                $("#isShowAddress").show();
+            }
+        });
     })
     /*监听控制退款名称显示事件*/
     $("input[name='accountType']").change(function (){
@@ -1055,117 +1072,122 @@
         //alert("channelSaleInfoList:"+channelSaleInfoList.length);
         //付款/退款信息
         var billingInfo = {};
-        billingInfo.billingId = $("[name='billingId']").val();
-        billingInfo.accountOpeningBranch = $("[name='accountOpeningBranch']").val();
-        billingInfo.accountName = $("[name='accountName']").val();
-        billingInfo.accountNum = $("[name='accountNum']").val();
-        /*billingInfo.receivablesName = $("[name='receivablesName']").val();*/
-        billingInfo.receivablesPhone = $("[name='receivablesPhone']").val();
-        if(billingInfo.accountOpeningBranch == "" || billingInfo.accountOpeningBranch == null ){
-            layer.msg("开户支行不能为空");
-            return;
-        }else if(getByteLen(billingInfo.accountOpeningBranch) > 50){
-            layer.msg("开户支行长度超限");
-            return;
-        }
-        if(billingInfo.accountName == "" || billingInfo.accountName == null ){
-            layer.msg("账号名称不能为空");
-            return;
-        }else if(getByteLen(billingInfo.accountName) > 30){
-            layer.msg("账号名称长度超限");
-            return;
-        }
-        if(billingInfo.accountNum == "" || billingInfo.accountNum == null ){
-            layer.msg("账号不能为空");
-            return;
-        }else if(getByteLen(billingInfo.accountNum) > 20){
-            layer.msg("账号长度超限");
-            return;
-        }
-        /*if(billingInfo.receivablesName == "" || billingInfo.receivablesName == null ){
-            layer.msg("收款人姓名不能为空");
-            return;
-        }*/
-        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 = {};
-        ticketOpeningInfo.ticketOpeningId = $("[name='ticketOpeningId']").val();
-        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 ){
+        if(customerBasicInfo.cooperativeState != "1"){
+            billingInfo.billingId = $("[name='billingId']").val();
+            billingInfo.accountOpeningBranch = $("[name='accountOpeningBranch']").val();
+            billingInfo.accountName = $("[name='accountName']").val();
+            billingInfo.accountNum = $("[name='accountNum']").val();
+            /*billingInfo.receivablesName = $("[name='receivablesName']").val();*/
+            billingInfo.receivablesPhone = $("[name='receivablesPhone']").val();
+            if(billingInfo.accountOpeningBranch == "" || billingInfo.accountOpeningBranch == null ){
                 layer.msg("开户支行不能为空");
                 return;
-            }else if(getByteLen(ticketOpeningInfo.accountOpeningBranch) > 50){
+            }else if(getByteLen(billingInfo.accountOpeningBranch) > 50){
                 layer.msg("开户支行长度超限");
                 return;
             }
-            if(ticketOpeningInfo.ticketOpeningAccount == "" || ticketOpeningInfo.ticketOpeningAccount == null ){
-                layer.msg("开票账户不能为空");
+            if(billingInfo.accountName == "" || billingInfo.accountName == null ){
+                layer.msg("账号名称不能为空");
                 return;
-            }else if(getByteLen(ticketOpeningInfo.ticketOpeningAccount) > 30){
-                layer.msg("开票账户长度超限");
+            }else if(getByteLen(billingInfo.accountName) > 30){
+                layer.msg("账号名称长度超限");
                 return;
             }
-            if(ticketOpeningInfo.enterpriseName == "" || ticketOpeningInfo.enterpriseName == null ){
-                layer.msg("企业名称不能为空");
+            if(billingInfo.accountNum == "" || billingInfo.accountNum == null ){
+                layer.msg("账号不能为空");
                 return;
-            }else if(getByteLen(ticketOpeningInfo.enterpriseName) > 30){
-                layer.msg("企业名称长度超限");
+            }else if(getByteLen(billingInfo.accountNum) > 20){
+                layer.msg("账号长度超限");
                 return;
             }
-            if(ticketOpeningInfo.taxpayerIdentificationNum == "" || ticketOpeningInfo.taxpayerIdentificationNum == null ){
-                layer.msg("纳税人识别号不能为空");
+            /*if(billingInfo.receivablesName == "" || billingInfo.receivablesName == null ){
+                layer.msg("收款人姓名不能为空");
                 return;
-            }else if(getByteLen(ticketOpeningInfo.taxpayerIdentificationNum) > 30){
-                layer.msg("纳税人识别号长度超限");
-                return;
-            }
-            if(ticketOpeningInfo.ticketOpeningPhone == "" || ticketOpeningInfo.ticketOpeningPhone == null ){
-                layer.msg("开票电话不能为空");
+            }*/
+            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(ticketOpeningInfo.ticketOpeningPhone)){
-                    layer.msg("请填写正确的电话号码!", {icon: 5, time: 3000});
+                if(!reg.test(phone)){
+                    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{
-            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;
+        }
+        //开票信息
+        var ticketOpeningInfo = {};
+        var isOpenTicket = $("input[name='isOpenTicket']:checked").val();
+        if(customerBasicInfo.cooperativeState != "1" && isOpenTicket != "1"){
+            ticketOpeningInfo.ticketOpeningId = $("[name='ticketOpeningId']").val();
+            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 {
+                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;
+                }
             }
         }
         //发送保存请求