|
@@ -140,178 +140,205 @@
|
|
var sys_err = ""
|
|
var sys_err = ""
|
|
var c = {{.T.c}}
|
|
var c = {{.T.c}}
|
|
$(function () {
|
|
$(function () {
|
|
- $.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");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }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")
|
|
|
|
|
|
+ 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{
|
|
|
|
- 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("单位")
|
|
|
|
- $(".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 {
|
|
|
|
+ showData()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ fail: function(err) {
|
|
|
|
+ console.log(err)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ function showData () {
|
|
|
|
+ $.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");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }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{
|
|
|
|
- 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){
|
|
|
|
|
|
+ }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){
|
|
|
|
+ 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)
|
|
|
|
|
|
- $('.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()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ }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{
|
|
|
|
+ $('.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{
|
|
|
|
- $('.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()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ $('.company-cell').show()
|
|
|
|
+ $('.invoice-value').text("个人")
|
|
|
|
+ $('.company-cell').hide()
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
- }
|
|
|
|
- invoice.checkCName();
|
|
|
|
- invoice.checkCode();
|
|
|
|
- }
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }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();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
var invoice = {
|
|
var invoice = {
|
|
reg:{
|
|
reg:{
|