Authored by yyq

personal invoice

... ... @@ -103,6 +103,12 @@
</span>
</div>
</li>
<li class="invoice-personal-name invoice-row personal-row">
<span class="row-title"></span>
<div class="row-content">
<input id="personal-name" class="personal-name" type="text" placeholder="个人( 可修改 )">
</div>
</li>
<li class="invoice-title-name invoice-row company-row hide">
<span class="row-title">
<em>*</em>
... ...
... ... @@ -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) {
... ...