Index: ssts-web/src/main/webapp/disinfectsystem/packing/rePrintBarcodeWin.js =================================================================== diff -u -r14023 -r14623 --- ssts-web/src/main/webapp/disinfectsystem/packing/rePrintBarcodeWin.js (.../rePrintBarcodeWin.js) (revision 14023) +++ ssts-web/src/main/webapp/disinfectsystem/packing/rePrintBarcodeWin.js (.../rePrintBarcodeWin.js) (revision 14623) @@ -1,6 +1,6 @@ var viewType = 'historyPacking'; var depart = ''; - +var tousseStore = null; /******** 重打标签窗口start ********/ function rePrintBarcodeWinForPacking(packingRecordId,SSTS_HistoryPacking_Update,SSTS_HistoryPacking_Change_Patient) { var loadTousseURL = WWWROOT + '/disinfectSystem/packingAction!loadPackedTousses.do?packingRecordId='+packingRecordId; @@ -16,9 +16,38 @@ hiddentReviewer2 = true; rePrintBarcodeWin(loadTousseURL,SSTS_ForeignProxyDisinfection_Update,true); } +function showSelectTousseDiscardCauseWin(){ + return openModalWindow(WWWROOT+"/disinfectsystem/recyclingApplication/selectTousseDiscardCause.jsp?time="+new Date(), "选择回收员", "760", "400"); +} +// 废弃选中的器械包 +function discardTousseInstances(tousseInstancesIds){ + var remark = showSelectTousseDiscardCauseWin(); + if(remark != undefined && remark != ""){ + top.Ext.MessageBox.wait('正在废弃,请稍候……', '请等待'); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/tousseInstanceAction!deleteTousseGood.do', + params : {ids : tousseInstancesIds,reason:remark}, + success : function(response, options) { + hideMessageBox(true); + showResult("废弃成功!"); + reloadTousseInstances(); + }, + failure : function(response, options) { + hideMessageBox(true); + showResult("废弃失败!"); + } + }); + }else{ + showResult("必须填写废弃原因!"); + } +} +function reloadTousseInstances(){ + tousseStore.removeAll(); + tousseStore.load(); +} function rePrintBarcodeWin(loadTousseURL,SSTS_HistoryPacking_Update,SSTS_HistoryPacking_Change_Patient) { var selectModel = new top.Ext.grid.CheckboxSelectionModel({handleMouseDown:Ext.emptyFn}); - var tousseStore = new Ext.data.Store({ + tousseStore = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({ url : loadTousseURL, method : 'POST' @@ -396,6 +425,33 @@ hideMessageBox(true); } + },'-',{ + text : '废弃', + iconCls : 'btn_ext_application_edit', + hidden : SSTS_HistoryPacking_Update, + handler : function() { + var records = rePrintGrid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要废弃的器械包!"); + return; + } + top.Ext.MessageBox.confirm("请确认",'确定要废弃选中的器械包吗!', + function(button, text) { + if ("yes" == button){ + var tousseInstanceIDs = ''; + for (var i = 0, len = records.length; i < len; i++) { + if(tousseInstanceIDs == ''){ + tousseInstanceIDs = records[i].data.id; + }else{ + tousseInstanceIDs += ';'+records[i].data.id; + } + } + discardTousseInstances(tousseInstanceIDs); + }else{ + + } + }); + } }] });