...
|
...
|
@@ -3,16 +3,23 @@ |
|
|
* @time: 2015/12/21
|
|
|
*/
|
|
|
|
|
|
var $ = require('yoho.jquery');
|
|
|
var $ = require('yoho.jquery'),
|
|
|
$invoiceCheck = $('.invoice'),
|
|
|
$receiptInfo = $('.receipt-info'),
|
|
|
$receiptInfoSaveBtn = $('.receipt-info .save-receipt'),
|
|
|
$receiptInfoCancelBtn = $('.receipt-info .cancel-receipt'),
|
|
|
$eReceiptBtn = $('.receipt-type .e-receipt'),
|
|
|
$paperReceiptBtn = $('.receipt-type .paper-receipt');
|
|
|
|
|
|
var address = require('./address');
|
|
|
var address = require('./address'),
|
|
|
receiptTitle = "个人";
|
|
|
|
|
|
var dialog = require('../common/dialog');
|
|
|
|
|
|
var accMul = function(arg1, arg2) {
|
|
|
var m = 0,
|
|
|
s1 = arg1.toString(),
|
|
|
s2 = arg2.toString();
|
|
|
s1 = arg1.toString(),
|
|
|
s2 = arg2.toString();
|
|
|
|
|
|
try {
|
|
|
m += s1.split('.')[1].length;
|
...
|
...
|
@@ -852,3 +859,123 @@ $('.bag').find('ul').each(function() { |
|
|
$next.hide();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$invoiceCheck.click(function(){
|
|
|
|
|
|
if ($invoiceCheck.hasClass('active')) {
|
|
|
$invoiceCheck.removeAttr('checked');
|
|
|
$invoiceCheck.removeClass('active');
|
|
|
}
|
|
|
|
|
|
if ($invoiceCheck.attr('checked')) {
|
|
|
$invoiceCheck.addClass('active');
|
|
|
if ($('.invoice-content').hasClass('hide')) {
|
|
|
$receiptInfo.removeClass('hide');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//电子发票
|
|
|
function saveReceiptInfo() {
|
|
|
var passInfoVerify = true,
|
|
|
receiptType,
|
|
|
receiptContent,
|
|
|
receiptMobile,
|
|
|
verifymobile,
|
|
|
invoiceType,
|
|
|
receiptTypeID,
|
|
|
invoiceTypeInt;
|
|
|
|
|
|
invoiceType = '个人';
|
|
|
|
|
|
if ($eReceiptBtn.hasClass('receipt-type-selected')) {
|
|
|
receiptType = "电子发票";
|
|
|
invoiceTypeInt = '2';
|
|
|
} else {
|
|
|
receiptType = "纸质发票";
|
|
|
invoiceTypeInt = '1';
|
|
|
}
|
|
|
|
|
|
if (receiptTitle !== "个人") {
|
|
|
invoiceType = '单位';
|
|
|
$('.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)) {
|
|
|
$('.invoice-phone .enpty-input').removeClass('hide');
|
|
|
passInfoVerify = false;
|
|
|
};
|
|
|
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-kind').html(receiptContent);
|
|
|
|
|
|
$('.invoice-upload-type').html(invoiceTypeInt);
|
|
|
$('.invoice-upload-content').html(receiptTypeID);
|
|
|
$('.invoice-upload-mobile').html(receiptMobile);
|
|
|
$('.invoice-upload-title').html(receiptTitle);
|
|
|
|
|
|
$receiptInfo.addClass('hide');
|
|
|
$('.invoice-content').removeClass('hide');
|
|
|
}
|
|
|
$receiptInfoSaveBtn.click(function(){
|
|
|
saveReceiptInfo();
|
|
|
});
|
|
|
|
|
|
$receiptInfoCancelBtn.click(function(){
|
|
|
$receiptInfo.addClass('hide');
|
|
|
|
|
|
if ($('.invoice-content').hasClass('hide')) {
|
|
|
$invoiceCheck.removeAttr('checked');
|
|
|
$invoiceCheck.removeClass('active');
|
|
|
} else {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.revise').click(function(){
|
|
|
$receiptInfo.removeClass('hide');
|
|
|
});
|
|
|
|
|
|
$eReceiptBtn.click(function(){
|
|
|
$eReceiptBtn.addClass('receipt-type-selected');
|
|
|
$paperReceiptBtn.removeClass('receipt-type-selected');
|
|
|
$('.e-receipt-desc').removeClass('hide');
|
|
|
});
|
|
|
|
|
|
$paperReceiptBtn.click(function(){
|
|
|
$paperReceiptBtn.addClass('receipt-type-selected');
|
|
|
$eReceiptBtn.removeClass('receipt-type-selected');
|
|
|
$('.e-receipt-desc').addClass('hide');
|
|
|
});
|
|
|
|
|
|
$('.invoice-title').change(function(){
|
|
|
var selectType = $('input[name="title"]:checked').val();
|
|
|
if (selectType === "1") {
|
|
|
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');
|
|
|
}
|
|
|
}) |
...
|
...
|
|