|
@@ -147,9 +147,9 @@
|
|
|
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;
|
|
|
- $(".j-button-confirm").removeAttr("disabled")
|
|
|
+ invoice.phoneStatus = true;
|
|
|
+ invoice.emailStatus = true;
|
|
|
+ $(".j-button-confirm").removeAttr("disabled")
|
|
|
}
|
|
|
if (r.datas.applybill_status == 1){
|
|
|
$(".j-footer").hide();
|
|
@@ -268,9 +268,6 @@
|
|
|
if (c==1){
|
|
|
$('.invoice-value').text("个人")
|
|
|
$('.company-cell').hide()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}else{
|
|
|
if (r.data.invoice_type == "单位"){
|
|
|
$('.company-cell').show()
|
|
@@ -328,6 +325,7 @@
|
|
|
this.checkCode();
|
|
|
this.checkInput();
|
|
|
this.submitHandle()
|
|
|
+ this.switchInvoice(); // 是否可以开发票
|
|
|
},
|
|
|
// 控制单位和个人填写
|
|
|
isShowForm:function(){
|
|
@@ -518,7 +516,6 @@
|
|
|
// 社会信用代码校验
|
|
|
checkCode:function(){
|
|
|
var that = this;
|
|
|
-
|
|
|
$('input[name="code"]').on('blur',function(){
|
|
|
if ($(this).val() == ''){
|
|
|
that.codeStatus = false;
|
|
@@ -549,8 +546,32 @@
|
|
|
$('#rules_dialog').hide()
|
|
|
})
|
|
|
},
|
|
|
+ // 发票功能是否开启
|
|
|
+ switchInvoice: function() {
|
|
|
+ $.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()
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function(err) {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 提交
|
|
|
-
|
|
|
submitHandle:function(){
|
|
|
var that = this
|
|
|
$('.j-button-confirm').on('click',function(){
|
|
@@ -591,7 +612,6 @@
|
|
|
|
|
|
}
|
|
|
// 个人发票提交
|
|
|
-
|
|
|
if (isHidden) {
|
|
|
if(that.phoneStatus && that.emailStatus){
|
|
|
$.ajax({
|
|
@@ -626,14 +646,13 @@
|
|
|
className: 'j-toast-icon',
|
|
|
callback: function(){
|
|
|
if(c!=""){
|
|
|
- window.location.href = '/jyapp/front/invoice/check_invoice.html?cc=replaceInv&order_code='+order_code
|
|
|
+ window.location.href = '/jyapp/front/invoice/check_invoice.html?cc=replaceInv&order_code='+order_code
|
|
|
}else{
|
|
|
window.location.href = '/jyapp/front/invoice/check_invoice.html?order_code='+order_code
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
}
|