|
@@ -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}$/,
|