...
|
...
|
@@ -11,8 +11,11 @@ var $ = require('yoho.jquery'), |
|
|
$eReceiptBtn = $('.receipt-type .e-receipt'),
|
|
|
$paperReceiptBtn = $('.receipt-type .paper-receipt');
|
|
|
|
|
|
|
|
|
var address = require('./address'),
|
|
|
receiptTitle = "个人";
|
|
|
receiptTitle = "个人",
|
|
|
receiptMobile = $('#input-mobile').val(),
|
|
|
receiptMobileStar;
|
|
|
|
|
|
var dialog = require('../common/dialog');
|
|
|
|
...
|
...
|
@@ -876,17 +879,20 @@ $invoiceCheck.click(function(){ |
|
|
});
|
|
|
|
|
|
//电子发票
|
|
|
|
|
|
(function receiptMobileToStarString(numb) {
|
|
|
receiptMobileStar = numb.substr(0, 3) + '****' + numb.substr(7);
|
|
|
$('#input-mobile').val(receiptMobileStar);
|
|
|
}(receiptMobile));
|
|
|
|
|
|
function saveReceiptInfo() {
|
|
|
var passInfoVerify = true,
|
|
|
receiptType,
|
|
|
receiptContent,
|
|
|
receiptMobile,
|
|
|
verifymobile,
|
|
|
invoiceType,
|
|
|
receiptTypeID,
|
|
|
invoiceTypeInt;
|
|
|
|
|
|
invoiceType = '个人';
|
|
|
invoiceTypeInt,
|
|
|
finalReceiptMobile;
|
|
|
|
|
|
if ($eReceiptBtn.hasClass('receipt-type-selected')) {
|
|
|
receiptType = "电子发票";
|
...
|
...
|
@@ -896,39 +902,49 @@ function saveReceiptInfo() { |
|
|
invoiceTypeInt = '1';
|
|
|
}
|
|
|
|
|
|
if (receiptTitle !== "个人") {
|
|
|
invoiceType = '单位';
|
|
|
if (receiptTitle === "单位") {
|
|
|
$('.input-line').each(function(){
|
|
|
if ($(this).find('input').val() === '') {
|
|
|
$(this).find('.enpty-input').removeClass('hide');
|
|
|
passInfoVerify = false;
|
|
|
};
|
|
|
})
|
|
|
receiptMobile = $('#input-mobile').val();
|
|
|
verifymobile = /[*0-9]{11}/;
|
|
|
if (!verifymobile.test(receiptMobile)) {
|
|
|
};
|
|
|
|
|
|
finalReceiptMobile = $('#input-mobile').val();
|
|
|
if (finalReceiptMobile === receiptMobileStar) {
|
|
|
finalReceiptMobile = receiptMobile;
|
|
|
} else {
|
|
|
verifymobile = /[0-9]{11}/;
|
|
|
if (!verifymobile.test(finalReceiptMobile)) {
|
|
|
$('.invoice-phone .enpty-input').removeClass('hide');
|
|
|
if (finalReceiptMobile.length === 0) {
|
|
|
$('.invoice-phone .enpty-input').html(' 请填写手机号码');
|
|
|
} else {
|
|
|
$('.invoice-phone .enpty-input').html(' 手机号码不正确');
|
|
|
}
|
|
|
passInfoVerify = false;
|
|
|
};
|
|
|
if (!passInfoVerify) {
|
|
|
return;
|
|
|
} else {
|
|
|
$('.invoice-title .enpty-input').addClass('hide');
|
|
|
$('.invoice-phone .enpty-input').addClass('hide');
|
|
|
receiptTitle = $('#input-organization-name').val();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (!passInfoVerify) {
|
|
|
return;
|
|
|
} else {
|
|
|
$('.invoice-title .enpty-input').addClass('hide');
|
|
|
$('.invoice-phone .enpty-input').addClass('hide');
|
|
|
receiptTitle = $('#input-organization-name').val();
|
|
|
}
|
|
|
|
|
|
receiptContent = $('input[name="content"]:checked').val();
|
|
|
receiptTypeID = $('input[name="content"]:checked').data('receiptid');
|
|
|
|
|
|
$('.invoice-type').html(receiptType);
|
|
|
$('.invoice-partment').html(invoiceType);
|
|
|
$('.invoice-partment').html(receiptTitle);
|
|
|
$('.invoice-kind').html(receiptContent);
|
|
|
|
|
|
$('.invoice-upload-type').html(invoiceTypeInt);
|
|
|
$('.invoice-upload-content').html(receiptTypeID);
|
|
|
$('.invoice-upload-mobile').html(receiptMobile);
|
|
|
$('.invoice-upload-mobile').html(finalReceiptMobile);
|
|
|
$('.invoice-upload-title').html(receiptTitle);
|
|
|
|
|
|
$receiptInfo.addClass('hide');
|
...
|
...
|
@@ -971,11 +987,9 @@ $('.invoice-title').change(function(){ |
|
|
receiptTitle = "个人";
|
|
|
$('.invoice-title').addClass('invoice-title-personal-hight');
|
|
|
$('.invoice-title .input-line').addClass('hide');
|
|
|
$('.invoice-phone').addClass('hide');
|
|
|
} else {
|
|
|
receiptTitle = "单位";
|
|
|
$('.invoice-title').removeClass('invoice-title-personal-hight');
|
|
|
$('.invoice-title .input-line').removeClass('hide');
|
|
|
$('.invoice-phone').removeClass('hide');
|
|
|
}
|
|
|
}) |
...
|
...
|
|