...
|
...
|
@@ -59,6 +59,7 @@ function validateInvoice($el, info) { |
|
|
|
|
|
function bindInvoiceEvent($el) {
|
|
|
var $titleWrap = $('.invoice-title', $el),
|
|
|
$personalRow = $('.personal-row', $el),
|
|
|
$companyRow = $('.company-row', $el);
|
|
|
|
|
|
$titleWrap.on('click', '.radio-btn', function() {
|
...
|
...
|
@@ -71,8 +72,10 @@ function bindInvoiceEvent($el) { |
|
|
|
|
|
if (id * 1 === 2) {
|
|
|
$companyRow.removeClass('hide');
|
|
|
$personalRow.addClass('hide');
|
|
|
} else {
|
|
|
$companyRow.addClass('hide');
|
|
|
$personalRow.removeClass('hide');
|
|
|
}
|
|
|
|
|
|
$titleWrap.find('.on').removeClass('on');
|
...
|
...
|
@@ -93,6 +96,8 @@ function bindInvoiceInfo($el, info) { |
|
|
if (info.titleId === 2) {
|
|
|
$('#company-name', $el).val(info.titleName || '');
|
|
|
$('#company-tax-num', $el).val(info.taxNumber || '');
|
|
|
} else {
|
|
|
$('#personal-name', $el).val(info.titleName || '');
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -110,10 +115,10 @@ function packInvoiceInfo($el) { |
|
|
resData.titleId = $('.invoice-title .on', $el).data('id') || 1;
|
|
|
|
|
|
if (resData.titleId * 1 === 1) {
|
|
|
resData.titleName = '个人';
|
|
|
resData.titleName = $.trim($('#personal-name', $el).val()) || '个人';
|
|
|
} else {
|
|
|
resData.titleName = $('#company-name', $el).val();
|
|
|
resData.taxNumber = $('#company-tax-num', $el).val();
|
|
|
resData.titleName = $.trim($('#company-name', $el).val());
|
|
|
resData.taxNumber = $.trim($('#company-tax-num', $el).val());
|
|
|
}
|
|
|
|
|
|
if (receiver) {
|
...
|
...
|
|