Authored by 王水玲

发票添加单位为空验证

... ... @@ -15,6 +15,7 @@ var $invoiceNotice = $('.invoice-notice'),
$chooseCont = $('.choose-cont'),
$invoiceType = $('.invoice-type'),
$tel = $('.tel'),
$company = $('.company'),
orderInfo = order.orderInfo,
$chooseContLi = $('.invoice-cont').find('.icon-cb-radio').parent();
... ... @@ -85,7 +86,7 @@ function confirmAction() {
var type = $invoiceType.find('.on').data('id'),
title = $('.invoice-top').find('.on').text(),
tel = $tel.attr('data-tel'),
company = $('.company').val(),
company = $company.val(),
cont = $chooseCont.data('id');
if ($editFlag.val() === 'true') {
... ... @@ -93,6 +94,10 @@ function confirmAction() {
tip.show('请输入正确手机号');
$tel.focus();
return false;
} else if (title === '单位' && company.length === 0) {
tip.show('请填写发票抬头');
$company.focus();
return false;
} else {
dialog.showDialog({
dialogText: '确认保存修改内容?',
... ... @@ -172,7 +177,7 @@ $tel.on('input', function() {
$editFlag.val('true');
});
$('.company').on('input', function() {
$company.on('input', function() {
$editFlag.val('true');
});
... ...