Index: ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js =================================================================== diff -u -r17157 -r17263 --- ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js (.../operationReservationView.js) (revision 17157) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationView.js (.../operationReservationView.js) (revision 17263) @@ -77,7 +77,7 @@ items : jsonArray }; - var operationReservationWindow = top.Ext.getCmp("materialInvoiceWin"); + var operationReservationWindow = top.Ext.getCmp("operationReservationWin"); form.form.submit({ url : WWWROOT + '/disinfectsystem/operationReservationAction!saveOperationReservation.do', method : 'POST', @@ -633,7 +633,7 @@ }); operationReservationWindow = new top.Ext.Window( { - id : 'materialInvoiceWin', + id : 'operationReservationWin', layout : 'fit', title : '手术预约单信息', width : 700, @@ -693,13 +693,12 @@ showResult("请选择要删除的单据!"); return false; } - var ids = null; + var ids = ""; for ( var i = 0, len = records.length; i < len; i++) { - if (ids == null) { - ids = records[i].data['id']; - } else { - ids = ids + ';' + records[i].data['id']; + if (ids != "") { + ids += ";"; } + ids += records[i].data['id']; } top.Ext.MessageBox.confirm("请确认","是否确定要删除选中的手术预约单信息?", function(button, text) { @@ -719,7 +718,46 @@ } } ); +} +/** + * 批量提交手术预约单 + */ +function batchSubmintOperationReservation(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要提交的单据!"); + return false; + } + var ids = ""; + for ( var i = 0, len = records.length; i < len; i++) { + var committedStatus = records[i].data['committedStatus']; + if(committedStatus){ + continue; + } + if (ids != "") { + ids += ";"; + } + ids += records[i].data['id']; + } + top.Ext.MessageBox.confirm("请确认","是否确定要提交选中的手术预约单信息?", + function(button, text) { + if ("yes" == button){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectsystem/operationReservationAction!batchSubmitOperationReservation.do', + params : {ids : ids}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + showResult(result.message); + grid.dwrReload(); + }, + failure : function(response, options) { + showResult(response.responseText); + } + }); + } + } + ); } function editRecord(id,committedStatus){ @@ -821,24 +859,31 @@ var sign = true; var tbar = [{ text : '添加', - hidden : SSTS_Invoice_Update, + hidden : SSTS_OR_Create, iconCls : 'btn_ext_application_add', handler : function() { editOperationReservation("",0); } - }, { + },'-', { text : '删除', - hidden : SSTS_Invoice_Delete, + hidden : SSTS_OR_Delete, iconCls : 'btn_ext_application_del', handler : function() { deleteOperationReservation(grid); } - }, { + },'-', { text : '刷新列表', iconCls : 'btn_ext_refresh1', handler : function() { grid.dwrReload(); } + },'-', { + text : '提交', + hidden : SSTS_OR_Create, + iconCls : 'btn_ext_cog_go', + handler : function() { + batchSubmintOperationReservation(grid); + } }]; grid = new Ext.ux.ForgonPageGrid( {