Index: ssts-web/src/main/webapp/homepage/supplyRoomsUnfinishedWork.js =================================================================== diff -u -r14030 -r16764 --- ssts-web/src/main/webapp/homepage/supplyRoomsUnfinishedWork.js (.../supplyRoomsUnfinishedWork.js) (revision 14030) +++ ssts-web/src/main/webapp/homepage/supplyRoomsUnfinishedWork.js (.../supplyRoomsUnfinishedWork.js) (revision 16764) @@ -82,6 +82,146 @@ } Ext.onReady(function() { + + /** + * 删除申请单 + */ + function deleteRecyclingApplication(grid) { + var records = grid.getSelectionModel().getSelections(); + + if (records.length == 0) { + showResult("请选择要删除的申请单!"); + return false; + } + var ids = null; + for ( var i = 0, len = records.length; i < len; i++) { + var hasPrint = records[i].data['printed']; + var deliverStatus = records[i].data['deliverStatus']; + var recyclingStatus = records[i].data['recyclingStatus']; + var serialNum = records[i].data['serialNumber']; + var applicationType = records[0].data['type']; + if(hasPrint != unPrint){ + showResult('流水号为【'+serialNum+"】的申请单已经打印,不能删除!"); + return false; + } + if(deliverStatus=='已终止' || recyclingStatus == '已终止' ){ + showResult('流水号为【'+serialNum+"】的申请单已终止,不能删除!"); + return false; + } + if(recyclingStatus == '已回收' || recyclingStatus == '部分回收'){ + showResult('流水号为【'+serialNum+"】的申请单已回收,不能删除!"); + return false; + } + if(deliverStatus =='已发货' || deliverStatus =='部分发货'){ + showResult('流水号为【'+serialNum+"】的申请单已发货或部分发货,不能删除!"); + return false; + } + if(applicationType != null && applicationType!="" && applicationType == "借物单"){ + if(records[i].data['returnStatus'] == "已归还"){ + showResult('流水号为【'+serialNum+"】的借物单已归还,不能删除!"); + return false; + } + } + if (ids == null) { + ids = records[i].data['id']; + } else { + ids = ids + ';' + records[i].data['id']; + } + } + + top.Ext.MessageBox.confirm("请确认","是否确定要删除选中的申请单信息?", + function(button, text) { + if ("yes" == button){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/recyclingApplicationAction!deleteRecyclingApplication.do', + params : {ids : ids}, + success : function(response, options) { + showResult(response.responseText); + grid.getStore().reload(); + }, + failure : function(response, options) { + showResult(response.responseText); + } + }); + } + } + ); + } + function deletePackingTask(ids){ + top.Ext4.MessageBox.confirm("请确认","是否确定要删除选中的装配任务信息?", + function(button, text) { + if ("yes" == button){ + top.Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/packingAction!deletePackingTask.do', + params : { + ids : ids + },success : function(response, options) { + var result = top.Ext4.decode(response.responseText); + var success = result.success; + if (true != success) { + showResult(result.cause); + return; + } else { + showResult('删除成功'); + // 刷新waitPackingTreeGrid + Ext.getCmp('packingGrid').getStore().reload(); + } + }, + failure : function(response, options) { + showResult('删除失败'); + } + }); + } + }); + } + /** + * 显示器械包废弃原因 + */ + function showSelectTousseDiscardCauseWin(){ + return openModalWindow(WWWROOT+"/disinfectsystem/recyclingApplication/selectTousseDiscardCause.jsp?time="+new Date(), "选择回收员", "760", "400"); + } + function addTousseDiscardTbar(grid){ + var tbar = { + text : '废弃', + iconCls : 'Cancel', + hidden:SSTS_SystemWarning_TousseGoods_delete, + handler : function() { + var selectionModel = grid.getSelectionModel(); + var selections = []; + if(!selectionModel.hasSelection()){ + showResult("未选中任何记录!"); + return; + }else{ + selectionModel.each(function(row){ + selections.push(row.data.id); + }); + if(selections.length <= 0){ + showResult("未选中任何记录!"); + return; + } + if(selections.length>0){ + var remark = showSelectTousseDiscardCauseWin(); + if(remark != undefined && remark != ""){ + var ids = selections.join(';'); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/tousseInstanceAction!deleteTousseGood.do', + params : {ids : ids,reason:remark}, + success : function(response, options) { + showResult("废弃成功!"); + grid.getStore().reload(); + }, + failure : function(response, options) {} + }); + } + } + } + } + }; + var tbItem = grid.getTopToolbar(); + tbItem.push(tbar); + grid.doLayout(); + } + Ext.QuickTips.init(); var tousseAndDiposableGoodsStore = new Ext.data.Store({ @@ -213,7 +353,9 @@ }); //申请单信息 + var applicationSm = new Ext.grid.CheckboxSelectionModel(); var applicationColumns = new Ext.grid.ColumnModel([ + applicationSm, {header : "流水号",width : 75,dataIndex : 'serialNumber'}, {header : "申请人",width : 60,dataIndex : 'applicant'}, {header : "申请时间",width : 110,dataIndex : 'applicationTime', renderer : myDateFormatByMinute}, @@ -234,15 +376,19 @@ // {header : "状态",width : 60,dataIndex : 'status'} ]); // 装配记录信息 + var packingSm = new Ext.grid.CheckboxSelectionModel(); var packingColumns = new Ext.grid.ColumnModel([ + packingSm, {header : "器械包名称",width : 250,dataIndex : 'tousseDefinition.name'}, {header : "数量",width : 80,dataIndex : 'amount'}, {header : "待装配数量",width : 80,dataIndex : 'unPackAmount'}, {header : "开始时间",width : 150,dataIndex : 'startTime', renderer : myDateFormatByMinute}, {header : "状态",width : 60,dataIndex : 'status'} ]); //审核信息 + var reviewSm = new Ext.grid.CheckboxSelectionModel(); var reviewColumns = new Ext.grid.ColumnModel([ + reviewSm, {header : "器械包名称",width : 130,dataIndex : 'tousseName',sortable:false}, {header : "条码",width : 65,dataIndex : 'barcode',sortable:false}, {header : "操作员",width : 50,dataIndex : 'operator',sortable:false}, @@ -253,7 +399,9 @@ {header : "包装类型",width : 60,dataIndex : 'packageType',sortable:false} ]); //灭菌信息 + var SterilizationSm = new Ext.grid.CheckboxSelectionModel(); var SterilizationColumns = new Ext.grid.ColumnModel([ + SterilizationSm, {header : "器械包名称",width : 130,dataIndex : 'tousseName',sortable:false}, {header : "条码",width : 65,dataIndex : 'barcode',sortable:false}, {header : "操作员",width : 50,dataIndex : 'operator',sortable:false}, @@ -333,6 +481,7 @@ totalProperty : 'totalCount', root : 'data' },[ + {name:'id'}, {name: 'tousseDefinition.name'}, {name: 'startTime'}, {name: 'amount'}, @@ -357,6 +506,7 @@ totalProperty : 'totalCount', root : 'data' },[ + {name: 'id'}, {name: 'tousseName'}, {name: 'barcode'}, {name: 'operator'}, @@ -384,6 +534,7 @@ totalProperty : 'totalCount', root : 'data' },[ + {name: 'id'}, {name: 'tousseName'}, {name: 'barcode'}, {name: 'operator'}, @@ -468,15 +619,37 @@ displayMsg: '当前显示记录: {0} - {1} 共计: {2}', emptyMsg: "没有记录可以显示" }); - + var applicationTbar = [{ + text: '删除', + iconCls: 'btn_ext_application_del', + hidden: SSTS_RecycApplication_Delete, + handler: function () { + deleteRecyclingApplication(applicationGrid); + } + }, '-', { + text: '终止', + iconCls: 'btn_ext_pause', + id: 'endBtn', + hidden: SSTS_Invoice_End, + handler: function () { + terminateInvoicePlan(applicationGrid,null,function(){applicationGrid.getStore().reload();}); + } + }]; applicationGrid = new Ext.grid.GridPanel({ title:'待回收申请单列表', anchor:'100% 100%', frame : false, autoScroll:true, +// selModel: { +//// injectCheckbox: 0 +//// mode: "SIMPLE", //"SINGLE"/"SIMPLE"/"MULTI" +//// checkOnly: true //只能通过checkbox选择 +// }, store : applicationStore, id : 'applicationGrid', cm : applicationColumns, + sm : applicationSm, + tbar : applicationTbar, bbar:applicationPageBbar, bodyStyle: "overflow:auto;", listeners :{ @@ -512,8 +685,26 @@ store : packingStore, id : 'packingGrid', cm : packingColumns, + sm : packingSm, bodyStyle: "overflow:auto;", bbar:packingPageBbar, + tbar:[{ + text : '删除', + hidden:SSTS_PackingTask_Delete, + iconCls : 'btn_ext_application_del', + handler : function() { + var waitPackingTreeGrid = Ext.getCmp('packingGrid'); + var records = waitPackingTreeGrid.getSelectionModel().getSelections(); + var ids = ""; + for ( var i = 0, len = records.length; i < len; i++) { + if(ids != ""){ + ids += ";"; + } + ids += records[i].data['id'] + } + deletePackingTask(ids); + } + }], listeners :{ beforerender :function(thiz){ var tempGrid = Ext.getCmp('reportFormID'); @@ -529,15 +720,18 @@ id:'reviewGrid', store : reviewStore, cm : reviewColumns, + sm : reviewSm, bodyStyle: "overflow:auto;", bbar:reviewPageBbar, + tbar:[], listeners :{ beforerender :function(thiz){ var tempGrid = Ext.getCmp('reportFormID'); thiz.setHeight(tempGrid.getInnerHeight()); } } }); + addTousseDiscardTbar(reviewGrid); var sterilizationGrid = new Ext.grid.GridPanel({ title:'待灭菌器械包列表', anchor:'100% 100%', @@ -546,15 +740,18 @@ autoScroll:true, store : sterilizationStore, cm : SterilizationColumns, + sm : SterilizationSm, bodyStyle: "overflow:auto;", bbar:sterilizationPageBbar, + tbar:[], listeners :{ beforerender :function(thiz){ var tempGrid = Ext.getCmp('reportFormID'); thiz.setHeight(tempGrid.getInnerHeight()); } } }); + addTousseDiscardTbar(sterilizationGrid); var invoicePlanGrid = new Ext.grid.GridPanel({ title:'待发货器械包', anchor:'100% 100%',