Authored by yyq

error tip

@@ -5,7 +5,10 @@ @@ -5,7 +5,10 @@
5 */ 5 */
6 6
7 var $ = require('yoho-jquery'); 7 var $ = require('yoho-jquery');
8 -var Dialog = require('../common/dialog').Dialog; 8 +var dialog = require('../common/dialog');
  9 +
  10 +var Dialog = dialog.Dialog,
  11 + Alert = dialog.Alert;
9 12
10 var $hideDg = $('#invoice-hide-dg'); 13 var $hideDg = $('#invoice-hide-dg');
11 14
@@ -180,6 +183,7 @@ $('#me-invoice-orders').on('click', '.supply-invoice', function() { @@ -180,6 +183,7 @@ $('#me-invoice-orders').on('click', '.supply-invoice', function() {
180 btnClass: ['sure-apply'], 183 btnClass: ['sure-apply'],
181 cb: function() { 184 cb: function() {
182 var info = packInvoiceInfo(dg.$el); 185 var info = packInvoiceInfo(dg.$el);
  186 + var errAlert;
183 187
184 if (!validateInvoice(dg.$el, info)) { 188 if (!validateInvoice(dg.$el, info)) {
185 return; 189 return;
@@ -188,6 +192,13 @@ $('#me-invoice-orders').on('click', '.supply-invoice', function() { @@ -188,6 +192,13 @@ $('#me-invoice-orders').on('click', '.supply-invoice', function() {
188 info.orderCode = $(this).data('id'); 192 info.orderCode = $(this).data('id');
189 supplyInvoice(info, function(data) { 193 supplyInvoice(info, function(data) {
190 if (data.code !== 200) { 194 if (data.code !== 200) {
  195 + dg.$el.hide();
  196 + errAlert = new Alert(data.message).show();
  197 + errAlert.$el.on('click', '.close', function() {
  198 + dg.$el.show();
  199 + }).on('click', '.alert-sure', function() {
  200 + dg.$el.show();
  201 + });
191 return; 202 return;
192 } 203 }
193 204