Authored by 张丽霞

电子发票

@@ -441,7 +441,7 @@ @@ -441,7 +441,7 @@
441 </div> 441 </div>
442 </div> 442 </div>
443 443
444 - <div class="invoice-list invoice-phone hide"> 444 + <div class="invoice-list invoice-phone">
445 <span class="invoice-star">*</span> 445 <span class="invoice-star">*</span>
446 <span class="invoice-list-type">收票人手机</span> 446 <span class="invoice-list-type">收票人手机</span>
447 <div class="invoice-line first-line input-line"> 447 <div class="invoice-line first-line input-line">
@@ -890,12 +890,9 @@ function saveReceiptInfo() { @@ -890,12 +890,9 @@ function saveReceiptInfo() {
890 receiptType, 890 receiptType,
891 receiptContent, 891 receiptContent,
892 verifymobile, 892 verifymobile,
893 - invoiceType,  
894 receiptTypeID, 893 receiptTypeID,
895 invoiceTypeInt, 894 invoiceTypeInt,
896 finalReceiptMobile; 895 finalReceiptMobile;
897 -  
898 - invoiceType = '个人';  
899 896
900 if ($eReceiptBtn.hasClass('receipt-type-selected')) { 897 if ($eReceiptBtn.hasClass('receipt-type-selected')) {
901 receiptType = "电子发票"; 898 receiptType = "电子发票";
@@ -905,40 +902,44 @@ function saveReceiptInfo() { @@ -905,40 +902,44 @@ function saveReceiptInfo() {
905 invoiceTypeInt = '1'; 902 invoiceTypeInt = '1';
906 } 903 }
907 904
908 - if (receiptTitle !== "个人") {  
909 - invoiceType = '单位'; 905 + if (receiptTitle === "单位") {
910 $('.input-line').each(function(){ 906 $('.input-line').each(function(){
911 if ($(this).find('input').val() === '') { 907 if ($(this).find('input').val() === '') {
912 $(this).find('.enpty-input').removeClass('hide'); 908 $(this).find('.enpty-input').removeClass('hide');
913 passInfoVerify = false; 909 passInfoVerify = false;
914 }; 910 };
915 }) 911 })
916 - finalReceiptMobile = $('#input-mobile').val();  
917 - if (finalReceiptMobile === receiptMobileStar) {  
918 - finalReceiptMobile = receiptMobile;  
919 - } else {  
920 - verifymobile = /[0-9]{11}/;  
921 - if (!verifymobile.test(finalReceiptMobile)) {  
922 - $('.invoice-phone .enpty-input').removeClass('hide');  
923 - passInfoVerify = false; 912 + };
  913 +
  914 + finalReceiptMobile = $('#input-mobile').val();
  915 + if (finalReceiptMobile === receiptMobileStar) {
  916 + finalReceiptMobile = receiptMobile;
  917 + } else {
  918 + verifymobile = /[0-9]{11}/;
  919 + if (!verifymobile.test(finalReceiptMobile)) {
  920 + $('.invoice-phone .enpty-input').removeClass('hide');
  921 + if (finalReceiptMobile.length === 0) {
  922 + $('.invoice-phone .enpty-input').html('&#xe626; 请填写手机号码');
  923 + } else {
  924 + $('.invoice-phone .enpty-input').html('&#xe626; 手机号码不正确');
924 } 925 }
  926 + passInfoVerify = false;
925 } 927 }
926 -  
927 - if (!passInfoVerify) {  
928 - return;  
929 - } else {  
930 - $('.invoice-title .enpty-input').addClass('hide');  
931 - $('.invoice-phone .enpty-input').addClass('hide');  
932 - receiptTitle = $('#input-organization-name').val();  
933 - }  
934 - 928 + }
  929 +
  930 + if (!passInfoVerify) {
  931 + return;
  932 + } else {
  933 + $('.invoice-title .enpty-input').addClass('hide');
  934 + $('.invoice-phone .enpty-input').addClass('hide');
  935 + receiptTitle = $('#input-organization-name').val();
935 } 936 }
936 937
937 receiptContent = $('input[name="content"]:checked').val(); 938 receiptContent = $('input[name="content"]:checked').val();
938 receiptTypeID = $('input[name="content"]:checked').data('receiptid'); 939 receiptTypeID = $('input[name="content"]:checked').data('receiptid');
939 940
940 $('.invoice-type').html(receiptType); 941 $('.invoice-type').html(receiptType);
941 - $('.invoice-partment').html(invoiceType); 942 + $('.invoice-partment').html(receiptTitle);
942 $('.invoice-kind').html(receiptContent); 943 $('.invoice-kind').html(receiptContent);
943 944
944 $('.invoice-upload-type').html(invoiceTypeInt); 945 $('.invoice-upload-type').html(invoiceTypeInt);
@@ -986,11 +987,9 @@ $('.invoice-title').change(function(){ @@ -986,11 +987,9 @@ $('.invoice-title').change(function(){
986 receiptTitle = "个人"; 987 receiptTitle = "个人";
987 $('.invoice-title').addClass('invoice-title-personal-hight'); 988 $('.invoice-title').addClass('invoice-title-personal-hight');
988 $('.invoice-title .input-line').addClass('hide'); 989 $('.invoice-title .input-line').addClass('hide');
989 - $('.invoice-phone').addClass('hide');  
990 } else { 990 } else {
991 receiptTitle = "单位"; 991 receiptTitle = "单位";
992 $('.invoice-title').removeClass('invoice-title-personal-hight'); 992 $('.invoice-title').removeClass('invoice-title-personal-hight');
993 $('.invoice-title .input-line').removeClass('hide'); 993 $('.invoice-title .input-line').removeClass('hide');
994 - $('.invoice-phone').removeClass('hide');  
995 } 994 }
996 }) 995 })