Authored by 王水玲

发票添加单位为空验证

@@ -15,6 +15,7 @@ var $invoiceNotice = $('.invoice-notice'), @@ -15,6 +15,7 @@ var $invoiceNotice = $('.invoice-notice'),
15 $chooseCont = $('.choose-cont'), 15 $chooseCont = $('.choose-cont'),
16 $invoiceType = $('.invoice-type'), 16 $invoiceType = $('.invoice-type'),
17 $tel = $('.tel'), 17 $tel = $('.tel'),
  18 + $company = $('.company'),
18 orderInfo = order.orderInfo, 19 orderInfo = order.orderInfo,
19 $chooseContLi = $('.invoice-cont').find('.icon-cb-radio').parent(); 20 $chooseContLi = $('.invoice-cont').find('.icon-cb-radio').parent();
20 21
@@ -85,7 +86,7 @@ function confirmAction() { @@ -85,7 +86,7 @@ function confirmAction() {
85 var type = $invoiceType.find('.on').data('id'), 86 var type = $invoiceType.find('.on').data('id'),
86 title = $('.invoice-top').find('.on').text(), 87 title = $('.invoice-top').find('.on').text(),
87 tel = $tel.attr('data-tel'), 88 tel = $tel.attr('data-tel'),
88 - company = $('.company').val(), 89 + company = $company.val(),
89 cont = $chooseCont.data('id'); 90 cont = $chooseCont.data('id');
90 91
91 if ($editFlag.val() === 'true') { 92 if ($editFlag.val() === 'true') {
@@ -93,6 +94,10 @@ function confirmAction() { @@ -93,6 +94,10 @@ function confirmAction() {
93 tip.show('请输入正确手机号'); 94 tip.show('请输入正确手机号');
94 $tel.focus(); 95 $tel.focus();
95 return false; 96 return false;
  97 + } else if (title === '单位' && company.length === 0) {
  98 + tip.show('请填写发票抬头');
  99 + $company.focus();
  100 + return false;
96 } else { 101 } else {
97 dialog.showDialog({ 102 dialog.showDialog({
98 dialogText: '确认保存修改内容?', 103 dialogText: '确认保存修改内容?',
@@ -172,7 +177,7 @@ $tel.on('input', function() { @@ -172,7 +177,7 @@ $tel.on('input', function() {
172 $editFlag.val('true'); 177 $editFlag.val('true');
173 }); 178 });
174 179
175 -$('.company').on('input', function() { 180 +$company.on('input', function() {
176 $editFlag.val('true'); 181 $editFlag.val('true');
177 }); 182 });
178 183