Index: ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js =================================================================== diff -u -r17263 -r17296 --- ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js (.../operationReservationView.js) (revision 17263) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js (.../operationReservationView.js) (revision 17296) @@ -719,6 +719,61 @@ } ); } +function batchPrintOperationReservation(grid){ + var records = grid.getSelectionModel().getSelections(); + + if (records.length == 0) { + showResult("请选择要打印的单据!"); + return false; + } + var ids = ""; + var firstDate = null; + for ( var i = 0, len = records.length; i < len; i++) { + if (ids != "") { + ids += ";"; + } + ids += records[i].data['id']; + var operationDate = records[i].data.operationTime.substr(0,10); + if(!firstDate){ + //未设置第一个时间值,用当前的时间值来设置第一个时间值,后面的单,手术时间必须与这个相等 + if(operationDate){ + firstDate = operationDate; + } + } + if(firstDate){ + var currentDate = firstDate; + if(operationDate){ + currentDate = operationDate; + } + + if(!dateEquals(currentDate,firstDate)){ + showResult("请选择手术日期相同的单据!"); + return false; + } + } + } + top.Ext.MessageBox.confirm("请确认","是否确定要打印选中的手术预约单信息?", + function(button, text) { + if ("yes" == button){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectsystem/operationReservationAction!batchPrintOperationReservation.do', + params : {ids : ids}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if(!result.success){ + showResult(result.message); + }else{ + printOperationReservations(result); + } + }, + failure : function(response, options) { + showResult("打印失败"); + } + }); + } + } + ); +} /** * 批量提交手术预约单 */ @@ -884,6 +939,13 @@ handler : function() { batchSubmintOperationReservation(grid); } + },'-',{ + text : '打印', + hidden : SSTS_OR_Create, + iconCls : 'icon_print', + handler : function() { + batchPrintOperationReservation(grid); + } }]; grid = new Ext.ux.ForgonPageGrid( {