Index: ssts-web/src/main/webapp/disinfectsystem/invoice/selectInvoiceConfig.jsp =================================================================== diff -u -r14660 -r28875 --- ssts-web/src/main/webapp/disinfectsystem/invoice/selectInvoiceConfig.jsp (.../selectInvoiceConfig.jsp) (revision 14660) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/selectInvoiceConfig.jsp (.../selectInvoiceConfig.jsp) (revision 28875) @@ -21,12 +21,14 @@ self.returnValue = obj.alt+"&#;"+obj.value; self.close(); } */ -$(function(){ +$(function(){ $('a').on('click',function(){ var id = $(this).attr('id'); var text = $(this).text(); - self.returnValue = id+"&#;"+text; - self.close(); + + var win = parent.Ext.getCmp('extWindow'); + win.returnValue = id+"&#;"+text; + win.close(); }); }); Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePrintModule.js =================================================================== diff -u -r27312 -r28875 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePrintModule.js (.../invoicePrintModule.js) (revision 27312) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePrintModule.js (.../invoicePrintModule.js) (revision 28875) @@ -13,7 +13,10 @@ * 显示和选择打印发货单的配置 */ function showSelectUser(){//没看到这个方法有被调用过 - return openModalWindow(WWWROOT+"/disinfectsystem/invoice/selectInvoiceConfig.jsp?","选择打印分组", "760", "400"); + var params = {} + + var url = WWWROOT+"/disinfectsystem/invoice/selectInvoiceConfig.jsp"; + return openModalWindowForExt(url,params, "选择打印分组"); } var mask = null; function getMask(){ @@ -107,49 +110,61 @@ if(selectResult == null && selectResult == undefined){ return; } - var id = selectResult.split("&#;")[0]; - if(id == '' || id == null){ - showResult('请选择对应的班次!'); - return; - } -// var mask = new Ext.LoadMask(Ext.getBody(), { -// msg : '正在处理批量打印请求,请稍候...' -// }); - getMask(); - mask.msg='正在处理批量打印请求,请稍候...'; - mask.show(); - var thiz = this; - - Ext.Ajax.timeout=300*000; - Ext.Ajax.request({ - timeout: 300*000, - url : WWWROOT + '/disinfectSystem/invoiceAction!mergeLoadPrintDataByConfig.do', - params : {id : id}, - success : function(response){ - var result = Ext.decode(response.responseText); - if(!result.success){ - if(result.message){ - showResult(result.message); - } - }else{ - if(result.batches.length <= 0){ - showResult("没有打印数据"); - }else{ - for(var i = 0; i < result.batches.length;++i){ - thiz.batchPrintInvoices_result(result.batches[i], 0); - } - refresh(); - } - - //updatePrintStatus(ids); - } - mask.hide(); - }, - failure: function(response){ - showResult("打印失败!"); - mask.hide(); - } - }); + var loop = setInterval(function() { + if(selectResult.hidden) { + clearInterval(loop); + + var returnValue = selectResult.returnValue || ''; + + if(returnValue == ''){ + return ''; + } + + var id = returnValue.split("&#;")[0]; + if(id == '' || id == null){ + showResult('请选择对应的班次!'); + return; + } + // var mask = new Ext.LoadMask(Ext.getBody(), { + // msg : '正在处理批量打印请求,请稍候...' + // }); + getMask(); + mask.msg='正在处理批量打印请求,请稍候...'; + mask.show(); + var thiz = this; + + Ext.Ajax.timeout=300*000; + Ext.Ajax.request({ + timeout: 300*000, + url : WWWROOT + '/disinfectSystem/invoiceAction!mergeLoadPrintDataByConfig.do', + params : {id : id}, + success : function(response){ + var result = Ext.decode(response.responseText); + if(!result.success){ + if(result.message){ + showResult(result.message); + } + }else{ + if(result.batches.length <= 0){ + showResult("没有打印数据"); + }else{ + for(var i = 0; i < result.batches.length;++i){ + thiz.batchPrintInvoices_result(result.batches[i], 0); + } + refresh(); + } + + //updatePrintStatus(ids); + } + mask.hide(); + }, + failure: function(response){ + showResult("打印失败!"); + mask.hide(); + } + }); + } + },500); } this.batchPrintInvoices_result = function(result, printType){ var typeofFunction = typeof(batchPrintInvoices_CurrentProject)