Ver código fonte

fix:开发票

yangfeng 3 anos atrás
pai
commit
cfedc81928

+ 1 - 0
src/jfw/modules/app/src/web/templates/invoice/invoicing.html

@@ -332,6 +332,7 @@
                 }
             })
               }
+            })
           }
         })
         var invoice = {

+ 0 - 64
src/web/templates/pc/invoice.html

@@ -249,70 +249,6 @@
             }
           }
         })
-        
-        
-			  var order_mail = {{.T.mail}};
-			  var order_phone = {{.T.phone}};
-			  if(order_mail!==""&&order_mail!==null&&order_mail!==undefined){
-				$(".email").val(order_mail)
-				$(".email").parent().siblings('.success').show();
-			  }
-			  if(order_phone!==""&&order_phone!==null&&order_phone!==undefined){
-			  	$(".tel").val(order_phone)
-				$(".tel").parent().siblings('.success').show();
-			  }
-			  var orderCode = {{.T.order_code}};
-			  var isSys = getParam("isSys");
-			  if(isSys === "true"){
-			  	  $.ajax({
-			  	  	type: 'POST',
-			  	  	url: '/jypay/invoice/show',
-			  	  	data: {"order_code":orderCode},
-					success: function(r){
-						if(r.status === "processing"){
-							if(r.data.invoice_type === "个人"){
-								$(".email").val(r.data.mail);
-								$(".tel").val(r.data.phone);
-								$(".email").parent().siblings('.success').show();
-								$(".tel").parent().siblings('.success').show();
-							}else{
-								$(".email").val(r.data.mail);
-								$(".tel").val(r.data.phone);
-								$(".unit_name").val(r.data.company_name);
-								$(".taxpayer_number").val(r.data.taxpayer_identnum);
-								$(".email").parent().siblings('.success').show();
-								$(".tel").parent().siblings('.success').show();
-								$(".unit_name").parent().siblings('.success').show();
-								$(".taxpayer_number").parent().siblings('.success').show();
-								$("#invoice_title > button").text("单位")
-								$(".unit_invoice").show();
-							}
-						}
-					}
-			  	  });
-			  }
-			  checkForm();
-
-			  var order_code = {{.T.order_code}};
-			  $(".order_code").text(order_code);
-			  $(".cancel_btn").on("click",function(){
-					window.history.go(-1);
-			  })
-
-			  $('#ruleModal').on('show.bs.modal', function () {
-			      var $this = $(this);
-			      var $modal_dialog = $this.find('.modal-dialog');
-			      $this.css('display', 'block');
-			      $modal_dialog.css({
-			          'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2)
-			      });
-			  });
-
-			  $("#public-nav").css("background","#fff");
-			  $(".public-nav").css("border-bottom", "1px solid #e0e0e0");
-			  $("section[id='drder']").css("padding-top", "80px");
-			  haslogin({{.T.logid}});
-		  })
 	</script>
 </body>
 

+ 157 - 156
src/web/templates/weixin/invoice/invoicing.html

@@ -142,92 +142,129 @@
         var applybill_status = {{.T.applybill_status}}
         var sys_err = ""
         var c = {{.T.c}}
-            $(function () {
-              switchInvoice()
-               // 发票功能是否开启
-                function switchInvoice() {
+        $(function () {
+          switchInvoice()
+            // 发票功能是否开启
+            function switchInvoice() {
+              $.ajax({
+                  url: '/jypay/invoice/switch?t=' + Date.now(),
+                  type: "GET",
+                  success: function(res) {
+                    if (res.code === '1001') {
+                      $('.j-button-confirm').attr('disabled',true)
+                      return weui.alert(res.messge, {
+                          title: '温馨提醒',
+                          className: 'jy-alert',
+                          buttons: [{
+                            label: '我知道了',
+                            onClick: function(){ 
+                              history.back()
+                            }
+                          }]
+                      })
+                    } else {
+                      showData()
+                    }
+                  },
+                  fail: function(err) {
+                    console.log(err)
+                  }
+              })
+            }
+            function showData () {
+              $.post("/jypay/invoice/available",{order_code:order_code},function(rr){
+                if(rr.status==0){
+                  window.location.replace("/front/invoice/cantInvoice?f=upgrade")
+                }else{
+                  $("body").show();
                   $.ajax({
-                      url: '/jypay/invoice/switch?t=' + Date.now(),
-                      type: "GET",
-                      success: function(res) {
-                        if (res.code === '1001') {
-                          $('.j-button-confirm').attr('disabled',true)
-                          return weui.alert(res.messge, {
-                              title: '温馨提醒',
-                              className: 'jy-alert',
-                              buttons: [{
-                                label: '我知道了',
-                                onClick: function(){ 
-                                  history.back()
-                                }
-                              }]
-                          })
-                        } else {
-                          showData()
-                        }
-                      },
-                      fail: function(err) {
-                        console.log(err)
-                      }
-                  })
-                }
-                function showData () {
-                  $.post("/jypay/invoice/available",{order_code:order_code},function(rr){
-                    if(rr.status==0){
-                      window.location.replace("/front/invoice/cantInvoice?f=upgrade")
-                    }else{
-                      $("body").show();
-                      $.ajax({
-                      url:"/jypay/invoice/show",
-                      type:"POST",
-                      data:{"order_code":order_code},
-                      success:function (r) {
-                          if(r.status == "fail"){
-                              if (r.datas != ""){
-                                  applybill_status = r.datas.applybill_status
-                                  product_name = r.datas.product_type
-                                  if (product_name == "历史数据"){  //历史数据
-                                      $(".user-phone").attr("value",r.datas.user_phone)
-                                      $(".user-mail").attr("value",r.datas.user_mail)
-                                      invoice.phoneStatus = true;
-                                      invoice.emailStatus = true;
-                                      $("#commit").removeAttr("disabled")
-                                  }
-                                  if (r.datas.applybill_status == 1){
-                                      $(".j-footer").hide();
-                                      $(".v-cell-input").attr("disabled","disabled");
-                                      $(".invoice-title").unbind("click");
-                                  }
+                  url:"/jypay/invoice/show",
+                  type:"POST",
+                  data:{"order_code":order_code},
+                  success:function (r) {
+                      if(r.status == "fail"){
+                          if (r.datas != ""){
+                              applybill_status = r.datas.applybill_status
+                              product_name = r.datas.product_type
+                              if (product_name == "历史数据"){  //历史数据
+                                  $(".user-phone").attr("value",r.datas.user_phone)
+                                  $(".user-mail").attr("value",r.datas.user_mail)
+                                  invoice.phoneStatus = true;
+                                  invoice.emailStatus = true;
+                                  $("#commit").removeAttr("disabled")
                               }
-                          }else {
-                              applybill_status = r.data.invoice_status,
-                              product_name = r.data.product_type
-                              if (r.data.invoice_status == -1){
-                                  sys_err = -1
-                                  if (r.data.invoice_type == "单位"){
-                                      $('.company-cell').show()
-                                      $('.invoice-value').text("单位")
-                                      $(".identification_number").attr("value",r.data.taxpayer_identnum)
-                                      $(".company_name").attr("value",r.data.company_name)
-                                      $(".user-phone").attr("value",r.data.phone)
-                                      $(".user-mail").attr("value",r.data.mail)
-                                      invoice.phoneStatus = true;
-                                      invoice.emailStatus = true;
-                                      invoice.cnameStatus = true;
-                                      invoice.codeStatus = true;
-                                      $(".j-button-confirm").removeAttr("disabled")
+                              if (r.datas.applybill_status == 1){
+                                  $(".j-footer").hide();
+                                  $(".v-cell-input").attr("disabled","disabled");
+                                  $(".invoice-title").unbind("click");
+                              }
+                          }
+                      }else {
+                          applybill_status = r.data.invoice_status,
+                          product_name = r.data.product_type
+                          if (r.data.invoice_status == -1){
+                              sys_err = -1
+                              if (r.data.invoice_type == "单位"){
+                                  $('.company-cell').show()
+                                  $('.invoice-value').text("单位")
+                                  $(".identification_number").attr("value",r.data.taxpayer_identnum)
+                                  $(".company_name").attr("value",r.data.company_name)
+                                  $(".user-phone").attr("value",r.data.phone)
+                                  $(".user-mail").attr("value",r.data.mail)
+                                  invoice.phoneStatus = true;
+                                  invoice.emailStatus = true;
+                                  invoice.cnameStatus = true;
+                                  invoice.codeStatus = true;
+                                  $(".j-button-confirm").removeAttr("disabled")
 
-                                  }else{
-                                      $('.invoice-value').text("个人")
-                                      $(".user-phone").attr("value",r.data.phone);
-                                      $(".user-mail").attr("value",r.data.mail);
-                                      invoice.phoneStatus = true;
-                                      invoice.emailStatus = true;
-                                      $("#commit").removeAttr("disabled")
-                                  }
                               }else{
-                                  if (product_name == "历史数据"){
-                                      if (r.data.invoice_changed == 1){
+                                  $('.invoice-value').text("个人")
+                                  $(".user-phone").attr("value",r.data.phone);
+                                  $(".user-mail").attr("value",r.data.mail);
+                                  invoice.phoneStatus = true;
+                                  invoice.emailStatus = true;
+                                  $("#commit").removeAttr("disabled")
+                              }
+                          }else{
+                              if (product_name == "历史数据"){
+                                  if (r.data.invoice_changed == 1){
+                                      if (r.data.invoice_type == "单位"){
+                                          $('.company-cell').show()
+                                          $('.invoice-value').text("单位")
+                                          $(".identification_number").attr("value",r.data.taxpayer_identnum)
+                                          $(".company_name").attr("value",r.data.company_name)
+                                          $(".user-phone").attr("value",r.data.phone)
+                                          $(".user-mail").attr("value",r.data.mail)
+                                          $(".v-cell-input").attr("disabled", "disabled");
+                                          $(".invoice-title").unbind("click");
+                                          $(".j-footer").hide()
+                                      }else{
+                                          $('.invoice-value').text("个人")
+                                          $(".user-phone").attr("value",r.data.phone)
+                                          $(".user-mail").attr("value",r.data.mail)
+                                          $(".v-cell-input").attr("disabled", "disabled");
+                                          $(".invoice-title").unbind("click");
+                                          $(".j-footer").hide()
+                                      }
+                                  }else{
+                                      if (c==1){
+                                          if (r.data.invoice_type == "单位"){
+                                              /*$('.company-cell').show()
+                                              $('.invoice-value').text("单位")
+                                              $(".identification_number").attr("value",r.data.taxpayer_identnum)
+                                              $(".company_name").attr("value",r.data.company_name)
+                                              $(".user-phone").attr("value",r.data.phone)
+                                              $(".user-mail").attr("value",r.data.mail)*/
+                                              $('.invoice-value').text("个人")
+                                              $(".user-phone").attr("value",r.data.phone)
+                                              $(".user-mail").attr("value",r.data.mail)
+                                          }else{
+                                              $('.invoice-value').text("个人")
+                                              $(".user-phone").attr("value",r.data.phone)
+                                              $(".user-mail").attr("value",r.data.mail)
+
+                                          }
+                                      }else{
                                           if (r.data.invoice_type == "单位"){
                                               $('.company-cell').show()
                                               $('.invoice-value').text("单位")
@@ -239,6 +276,7 @@
                                               $(".invoice-title").unbind("click");
                                               $(".j-footer").hide()
                                           }else{
+
                                               $('.invoice-value').text("个人")
                                               $(".user-phone").attr("value",r.data.phone)
                                               $(".user-mail").attr("value",r.data.mail)
@@ -246,49 +284,39 @@
                                               $(".invoice-title").unbind("click");
                                               $(".j-footer").hide()
                                           }
+                                      }
+
+                                  }
+                              }else{
+                                  if (r.data.invoice_changed == 1){
+                                      if (r.data.invoice_type == "单位"){
+                                          $('.company-cell').show()
+                                          $('.invoice-value').text("单位")
+                                          $(".identification_number").attr("value",r.data.taxpayer_identnum)
+                                          $(".company_name").attr("value",r.data.company_name)
+                                          $(".user-phone").attr("value",r.data.phone)
+                                          $(".user-mail").attr("value",r.data.mail)
+                                          $(".v-cell-input").attr("disabled", "disabled");
+                                          $(".invoice-title").unbind("click");
+                                          $(".j-footer").hide()
                                       }else{
-                                          if (c==1){
-                                              if (r.data.invoice_type == "单位"){
-                                                  /*$('.company-cell').show()
-                                                  $('.invoice-value').text("单位")
-                                                  $(".identification_number").attr("value",r.data.taxpayer_identnum)
-                                                  $(".company_name").attr("value",r.data.company_name)
-                                                  $(".user-phone").attr("value",r.data.phone)
-                                                  $(".user-mail").attr("value",r.data.mail)*/
-                                                  $('.invoice-value').text("个人")
-                                                  $(".user-phone").attr("value",r.data.phone)
-                                                  $(".user-mail").attr("value",r.data.mail)
-                                              }else{
-                                                  $('.invoice-value').text("个人")
-                                                  $(".user-phone").attr("value",r.data.phone)
-                                                  $(".user-mail").attr("value",r.data.mail)
+                                          $('.invoice-value').text("个人")
+                                          $(".user-phone").attr("value",r.data.phone)
+                                          $(".user-mail").attr("value",r.data.mail)
+                                          $(".v-cell-input").attr("disabled", "disabled");
+                                          $(".invoice-title").unbind("click");
+                                          $(".j-footer").hide()
+                                      }
+                                  }else{
+                                      if (c==1){
 
-                                              }
-                                          }else{
-                                              if (r.data.invoice_type == "单位"){
-                                                  $('.company-cell').show()
-                                                  $('.invoice-value').text("单位")
-                                                  $(".identification_number").attr("value",r.data.taxpayer_identnum)
-                                                  $(".company_name").attr("value",r.data.company_name)
-                                                  $(".user-phone").attr("value",r.data.phone)
-                                                  $(".user-mail").attr("value",r.data.mail)
-                                                  $(".v-cell-input").attr("disabled", "disabled");
-                                                  $(".invoice-title").unbind("click");
-                                                  $(".j-footer").hide()
-                                              }else{
+                                          $('.company-cell').show()
+                                          $('.invoice-value').text("个人")
+                                          $('.company-cell').hide()
 
-                                                  $('.invoice-value').text("个人")
-                                                  $(".user-phone").attr("value",r.data.phone)
-                                                  $(".user-mail").attr("value",r.data.mail)
-                                                  $(".v-cell-input").attr("disabled", "disabled");
-                                                  $(".invoice-title").unbind("click");
-                                                  $(".j-footer").hide()
-                                              }
-                                          }
 
-                                      }
-                                  }else{
-                                      if (r.data.invoice_changed == 1){
+
+                                      }else{
                                           if (r.data.invoice_type == "单位"){
                                               $('.company-cell').show()
                                               $('.invoice-value').text("单位")
@@ -307,48 +335,21 @@
                                               $(".invoice-title").unbind("click");
                                               $(".j-footer").hide()
                                           }
-                                      }else{
-                                          if (c==1){
-
-                                              $('.company-cell').show()
-                                              $('.invoice-value').text("个人")
-                                              $('.company-cell').hide()
-
-
-
-                                          }else{
-                                              if (r.data.invoice_type == "单位"){
-                                                  $('.company-cell').show()
-                                                  $('.invoice-value').text("单位")
-                                                  $(".identification_number").attr("value",r.data.taxpayer_identnum)
-                                                  $(".company_name").attr("value",r.data.company_name)
-                                                  $(".user-phone").attr("value",r.data.phone)
-                                                  $(".user-mail").attr("value",r.data.mail)
-                                                  $(".v-cell-input").attr("disabled", "disabled");
-                                                  $(".invoice-title").unbind("click");
-                                                  $(".j-footer").hide()
-                                              }else{
-                                                  $('.invoice-value').text("个人")
-                                                  $(".user-phone").attr("value",r.data.phone)
-                                                  $(".user-mail").attr("value",r.data.mail)
-                                                  $(".v-cell-input").attr("disabled", "disabled");
-                                                  $(".invoice-title").unbind("click");
-                                                  $(".j-footer").hide()
-                                              }
-                                          }
-
                                       }
 
                                   }
-                                  invoice.checkCName();
-                                  invoice.checkCode();
+
                               }
+                              invoice.checkCName();
+                              invoice.checkCode();
                           }
                       }
-                  })
-                    }
+                  }
+              })
                 }
-            })
+              })
+            }
+        })
         var invoice = {
             reg:{
                 tel:/^1[3456789]{1}\d{9}$/,