Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java =================================================================== diff -u -r12638 -r12675 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java (.../TousseDefinitionManager.java) (revision 12638) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManager.java (.../TousseDefinitionManager.java) (revision 12675) @@ -180,4 +180,11 @@ * @return */ public int removeCssdHandleTousseDefinitions(OrgUnit orgUnit , List tousseDefinitionList); + + /** + * 删除科室处理器械包配置 + * @param idList + * @return + */ + public int removeCssdHandleTousseDefinitions(List idList); } Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsForm.js (revision 12675) @@ -0,0 +1,192 @@ +var id; +//仓库表单面板 +var formObj; +//仓库对话框对象 +var cssdServiceDeptsWin; +//新增与修改仓库 +function addAndEditCssdServiceDepts(id) { + this.id = id; + formObj = new top.Ext.FormPanel({ + id : 'cssdServiceDeptsForm', + frame : true, + labelSeparator : ':', + labelAlign:'right', + fileUpload : true, + bodyStyle : 'padding:5px 5px 0px 5px;', + width: 600, + labelWidth : 80, + autoScroll : true, + height : 200, + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'orgUnitId', + id : 'orgUnitId' + },{ + layout : 'column', + labelWidth : 80, + items : [{ + columnWidth : 1, + xtype : "fieldset", + title: '仓库信息', + bodyStyle:'padding:1px;', + layout : 'column', + autoHeight : true, + items : [{ + columnWidth : .4, + layout : 'form', + items:[{ + xtype : 'textfield', + fieldLabel : "仓库名称", + allowBlank : false, + blankText : '请输入名称!', + name : "name", + id : "name", + anchor : '100%', + listeners:{ + change:function(field,nV,oV){ + var value = nV.trim(); + field.setValue(value); + } + } + }] + },{ + columnWidth : .4, + layout : 'form', + items:[{ + xtype : 'combo', + fieldLabel : '所属供应室', + //width:180, + listWidth:200, + id : 'orgUnitName', + name : 'orgUnitName', + editable:false, + valueField : 'departCode', + displayField : 'departName', + store : new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/cssdServiceDeptsAction!getCssds.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'departCode',mapping : 'departCode'}, + {name : 'departName',mapping : 'departName'} + ]) + }), + forceSelection : true, + allowBlank : false, + triggerAction : 'all', + anchor : '100%', + listeners:{ + select:function(combo, record, index){ + combo.setValue(record.data.departName); + top.Ext.getCmp("orgUnitId").setValue(record.data.id); + } + } + }] + }, { + columnWidth : .2, + layout : 'form', + items:[{ + xtype : 'numberfield', + fieldLabel : "顺序", + allowBlank : true, + maxLength : 1, + name : "sequence", + id : "sequence", + anchor : '100%' + }] + },{ + columnWidth : 1, + layout : 'form', + items:[{ + xtype : 'textarea', + fieldLabel : "备注", + allowBlank : true, + name : "remark", + id : "remark", + anchor : '100%' + }] + }] + }] + }], + buttons : [{ + id : 'saveBtn', + text : '保存', + handler : function(){ + saveCssdServiceDepts(this); + } + },{ + text : '取消', + id : 'saveAndNewBtn', + handler : function(){ + cssdServiceDeptsWin.close(); + grid.dwrReload(); + } + }] + }); + + cssdServiceDeptsWin = new top.Ext.Window({ + id : 'cssdServiceDeptsWin', + layout : 'fit', + title : '仓库管理', + width : 600, + border : false, + modal : true, + height : 260, + plain : true, + items : [formObj] + }); + + cssdServiceDeptsWin.show(); + + if(id != 0){ + formObj.form.load({ + url : WWWROOT + '/disinfectSystem/baseData/cssdServiceDeptsAction!loadCssdServiceDepts.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + success : function(form, action) { + var cssdServiceDepts = action.result.data; + }, + failure : function(form, action) {}, + params : {id : id} + }); + } + +} + + +function saveCssdServiceDepts(thiz) { + if (!formObj.form.isValid()) { + showResult('请正确填写表单各值!'); + thiz.enable(); + return false; + } + top.Ext.MessageBox.confirm("请确认","是否确定要保存仓库?", + function(button, text) { + if ("yes" == button){ + formObj.form.submit( { + url : WWWROOT + '/disinfectSystem/baseData/cssdServiceDeptsAction!saveCssdServiceDepts.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + cssdServiceDeptsWin.close(); + showResult('保存成功'); + grid.dwrReload(); + }, + failure : function(form, action) { + showResult('failure = ' + action.result.message,'error'); + top.Ext.getCmp('saveBtn').enable(); + } + }); + } + }); +} \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsView.js (revision 12675) @@ -0,0 +1,167 @@ +var grid; + +// 删除服务科室 +function deleteCssdServiceDepts() { + + 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++) { + 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/baseData/cssdServiceDeptsAction!deleteCssdServiceDepts.do', + params : {ids : ids}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + var success = result.success; + if (true != success) { + showResult(result.cause); + return; + } else { + showResult('删除成功'); + grid.dwrReload(); + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + showResult(result.cause); + } + }); + }); + +} + +var refresh = function() { + grid.dwrReload(); + grid.store.reload(); +}; + +var loadFormData = function(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要修改的服务科室!"); + return false; + } + if (records.length > 1) { + showResult("一次只能修改一个服务科室!"); + return false; + } + id = records[0].data['id']; + addAndEditCssdServiceDepts(id); +}; + +/** + * 修改记录 + * modifyRecord函数 触发modify函数调用,并传入当前列的值以及record.data对象 + * 页面中需要定义 modify(v,data) 函数 + */ +function modify(v,data){ + loadFormData(grid); +} + +Ext.onReady(function() { + Ext.QuickTips.init(); + // 记录cookie(3步) + + var columns = [ + {header : "id",dataIndex : 'id', hidden:true}, + {header : "cssdOrgUnitId",dataIndex : 'cssdOrgUnitId', hidden:true}, + {header : "供应室编码",width : 180,dataIndex : 'cssdOrgUnitCode',renderer : modifyRecord}, + {header : "供应室名称",width : 90,dataIndex : 'cssdOrgUnitName'}, + {header : "器械类型",width : 65,dataIndex : 'tousseType'}, + {header : "clinicOrgUnitId",width : 90,dataIndex : 'clinicOrgUnitId', hidden:true}, + {header : "临床科室编码",width : 90,dataIndex : 'clinicOrgUnitCode'}, + {header : "临床科室名称",width : 90,dataIndex : 'clinicOrgUnitName',id:'clinicOrgUnitName'} + ]; + + var readerDetail = [ + {name : 'id'}, + {name : 'cssdOrgUnitId'}, + {name : 'cssdOrgUnitCode'}, + {name : 'cssdOrgUnitName'}, + {name : 'clinicOrgUnitId'}, + {name : 'clinicOrgUnitCode'}, + {name : 'clinicOrgUnitName'}, + {name : 'tousseType'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters : [ + {type : 'string',dataIndex : 'cssdOrgUnitCode'}, + {type : 'string',dataIndex : 'cssdOrgUnitName'}, + {type : 'numeric',dataIndex : 'clinicOrgUnitCode'}, + {type : 'numeric',dataIndex : 'clinicOrgUnitName'}, + {type : 'string',dataIndex : 'tousseType'} + ] + }); + + + var sign = true; + var tbar = [ { + text : '添加', +// hidden : SSTS_Tousse_Create, + iconCls : 'btn_ext_application_add', + handler : function() { + addAndEditCssdServiceDepts(0,'否'); + } + }/*, '-',{ + text : '修改', + hidden : SSTS_Tousse_Update, + iconCls : 'btn_ext_application_edit', + id : 'editTbar', + handler : function() { + loadFormData(grid); + } + }*/, '-',{ + text : '删除', +// hidden : SSTS_Tousse_Delete, + iconCls : 'btn_ext_application_del', + handler : function() { + deleteCssdServiceDepts(grid); + } + }]; + var dwrCallParams = null; + + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function() { + + }; + + grid = new Ext.ux.ForgonPageGrid( { + title : '服务科室列表', + tbar : tbar, + pageSize : 20, + defaultSortField : 'id', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + columns : columns, + plugins : filters, + autoExpandColumn : 'clinicOrgUnitName', + renderTo : 'formPanel', + frame : false + }, readerDetail, OrgUnitTableManager.findCssdServiceDeptsTableList, dwrCallParams // 这个参数只是占位作用 + ); + + var viewport = new Ext.Viewport( { + layout : 'border', + items : [{ + region : 'center', + margins : '0 0 0 0', + layout : 'fit', + items : grid + }] + }); + }); \ No newline at end of file Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java =================================================================== diff -u -r12672 -r12675 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 12672) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 12675) @@ -1221,6 +1221,29 @@ } /** + * 搜索器械包 + * @return + */ + public void searchComboTousseData() { + if (spell == null) { + spell = ""; + } + try { + spell = java.net.URLDecoder.decode(spell, "UTF-8"); + JSONObject json = tousseDefinitionManager.searchComboGoods(spell, TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DISINFECTION,false); + HttpServletResponse response = StrutsParamUtils.getResponse(); + response.setCharacterEncoding("UTF-8"); + PrintWriter out; + + out = response.getWriter(); + out.print(json); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** * 根据拼音码、五笔码获取内部器械包(器械包和敷料包)NAME和ID * * @return Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java =================================================================== diff -u -r12672 -r12675 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java (.../TousseDefinitionManagerImpl.java) (revision 12672) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/service/TousseDefinitionManagerImpl.java (.../TousseDefinitionManagerImpl.java) (revision 12675) @@ -19,13 +19,15 @@ import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.hibernate.Query; import org.hibernate.Session; import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.directory.model.BarcodeDevice; +import com.forgon.directory.model.CssdHandleTousses; import com.forgon.directory.model.OrgUnit; import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; import com.forgon.disinfectsystem.common.CssdUtils; @@ -37,6 +39,7 @@ import com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseDefinition; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseInstance; +import com.forgon.disinfectsystem.entity.basedatamanager.warehouse.WareHouse; import com.forgon.disinfectsystem.entity.idcardinstance.IDCardInstance; import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.tousse.imagefilemanager.service.ImageFileManager; @@ -1218,9 +1221,14 @@ public JSONObject searchComboGoods(String searchString, String tousseType,boolean showReferencePrice) { List> mapList = new ArrayList>(); - + // 只搜索器械包(包含敷料包和消毒物品) + if (TousseDefinition.PACKAGE_TYPE_INSIDE_AND_DISINFECTION.equals(tousseType)){ + mapList = searchTousseBySimpleCodeAndAnyTousseTypeArr( + searchString, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, + TousseDefinition.PACKAGE_TYPE_DRESSING,TousseDefinition.PACKAGE_TYPE_DISINFECTION },false); + } // 只搜索器械包(包含敷料包,不含消毒物品) - if (TousseDefinition.PACKAGE_TYPE_INSIDE.equals(tousseType)){ + else if (TousseDefinition.PACKAGE_TYPE_INSIDE.equals(tousseType)){ mapList = searchTousseBySimpleCodeAndAnyTousseTypeArr( searchString, new String[]{TousseDefinition.PACKAGE_TYPE_INSIDE, TousseDefinition.PACKAGE_TYPE_DRESSING },false); @@ -1855,21 +1863,85 @@ @Override public List getCssdHandleTousseDefinitionList( OrgUnit orgUnit) { - // TODO Auto-generated method stub return null; } @Override public List saveOrUpdateCssdHandleTousseDefinitions( OrgUnit orgUnit, List tousseDefinitionList) { - // TODO Auto-generated method stub - return null; + List result = new ArrayList(); + if(orgUnit != null && CollectionUtils.isNotEmpty(tousseDefinitionList)){ + CssdHandleTousses cssdHandleTousses = null; + for(TousseDefinition tousseDefinition : tousseDefinitionList){ + cssdHandleTousses = new CssdHandleTousses(); + cssdHandleTousses.setOrgUnitCode(orgUnit.getOrgUnitCoding()); + cssdHandleTousses.setOrgUnitId(orgUnit.getId()); + cssdHandleTousses.setOrgUnitName(orgUnit.getName()); + cssdHandleTousses.setTousseDefinitionId(tousseDefinition.getId()); + cssdHandleTousses.setTousseName(tousseDefinition.getName()); + //判断是否已配置,防止重复插入(根据科室信息相同且器械包信息也相同则表示为已配置) + if(getCssdHandleToussesConfig(cssdHandleTousses) == null){ + objectDao.saveOrUpdate(cssdHandleTousses); + result.add(tousseDefinition); + } + } + } + return result; } + /** + * 判断是否已配置过该供应室处理该器械包 + * @param cssdHandleTousses + * @return + */ + private CssdHandleTousses getCssdHandleToussesConfig(CssdHandleTousses cssdHandleTousses){ + String sql = " where 1=1 "; + if(cssdHandleTousses.getOrgUnitId() != null){ + sql += " and orgUnitId = " + cssdHandleTousses.getOrgUnitId(); + } + + if(StringUtils.isNotBlank(cssdHandleTousses.getOrgUnitCode())){ + sql += " and orgUnitCode = '" + cssdHandleTousses.getOrgUnitId() + "'"; + } + + if(cssdHandleTousses.getTousseDefinitionId() != null){ + sql += " and tousseDefinitionId = " + cssdHandleTousses.getTousseDefinitionId(); + } + + return (CssdHandleTousses)objectDao.getBySql(CssdHandleTousses.class.getSimpleName(), sql); + } + @Override public int removeCssdHandleTousseDefinitions( OrgUnit orgUnit, List tousseDefinitionList) { - // TODO Auto-generated method stub + int result = 0; + if(orgUnit != null && CollectionUtils.isNotEmpty(tousseDefinitionList)){ + CssdHandleTousses cssdHandleTousses = null; + for(TousseDefinition tousseDefinition : tousseDefinitionList){ + cssdHandleTousses = new CssdHandleTousses(); + cssdHandleTousses.setOrgUnitId(orgUnit.getId()); + cssdHandleTousses.setOrgUnitCode(orgUnit.getOrgUnitCoding()); + cssdHandleTousses.setOrgUnitName(orgUnit.getName()); + cssdHandleTousses.setTousseDefinitionId(tousseDefinition.getId()); + cssdHandleTousses.setTousseName(tousseDefinition.getName()); + //判断是否已配置,防止重复插入(根据科室信息相同且器械包信息也相同则表示为已配置) + + cssdHandleTousses = getCssdHandleToussesConfig(cssdHandleTousses); + if(cssdHandleTousses != null){ + objectDao.delete(cssdHandleTousses); + result++; + } + } + } + return result; + } + + @Override + public int removeCssdHandleTousseDefinitions(List idList) { + if(CollectionUtils.isNotEmpty(idList)){ + objectDao.delete(CssdHandleTousses.class.getSimpleName(), idList); + return idList.size(); + } return 0; } } Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdServiceDeptsView.jsp (revision 12675) @@ -0,0 +1,54 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + +供应室服务临床科室配置 + +<%@ include file="/common/includeExtJsAndCss.jsp"%> + + + + + + + + + + + + +
+
+
+
+
+ + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesForm.js (revision 12675) @@ -0,0 +1,202 @@ +var id; +//处理器械包表单面板 +var formObj; +//处理器械包对话框对象 +var cssdHandleToussesWin; + +//新增与修改处理器械包 +function addAndEditCssdHandleTousses(id) { + this.id = id; + formObj = new top.Ext.FormPanel({ + id : 'cssdHandleToussesForm', + frame : true, + labelSeparator : ':', + labelAlign:'right', + fileUpload : true, + bodyStyle : 'padding:5px 5px 0px 5px;', + width: 600, + labelWidth : 80, + autoScroll : true, + height : 200, + items : [{ + xtype : 'hidden', + name : 'id', + id : 'id' + },{ + xtype : 'hidden', + name : 'orgUnitId', + id : 'orgUnitId' + },{ + xtype : 'hidden', + name : 'tousseDefinitionId', + id : 'tousseDefinitionId' + },{ + xtype : 'hidden', + name : 'tousseName', + id : 'tousseName' + },{ + layout : 'column', + labelWidth : 80, + items : [{ + columnWidth : 1, + xtype : "fieldset", + title: '处理器械包信息', + bodyStyle:'padding:1px;', + layout : 'column', + autoHeight : true, + items : [{ + columnWidth : .5, + layout : 'form', + items:[{ + xtype : 'textfield', + fieldLabel : "科室编码", + value:currentOrgUnitCode, + allowBlank : false, + blankText : '请输入名称!', + name : "orgUnitCode", + id : "orgUnitCode", + anchor : '100%' + }] + },{ + columnWidth : .5, + layout : 'form', + items:[{ + xtype : 'textfield', + fieldLabel : "科室名称", + allowBlank : false, + blankText : '请输入名称!', + name : "orgUnitName", + id : "orgUnitName", + value:currentOrgUnitName, + anchor : '100%', + listeners:{ + change:function(field,nV,oV){ + var value = nV.trim(); + field.setValue(value); + } + } + }] + },{ + columnWidth : 1, + layout : 'form', + items:[{ + fieldLabel:'器械包', + xtype : 'combo', + id : 'tousseId', + name : 'tousseId', + queryParam : 'spell', + minChars : 0, + valueField : 'id', + displayField : 'name', + width : 320, + matchFieldWidth: false, + listConfig: {width : 600}, + store : new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchComboTousseData.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ]) + }), + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : true, + listeners : { + select : function(combo, record, index) { + if (record && record.data){ + var curSelectedGoods = record.data; + top.Ext.getCmp('tousseDefinitionId').setValue(curSelectedGoods["id"]); + top.Ext.getCmp('tousseName').setValue(curSelectedGoods["name"]); + } + } + } + }] + }] + }] + }], + buttons : [{ + id : 'saveBtn', + text : '保存', + handler : function(){ + saveCssdHandleTousses(this); + } + },{ + text : '取消', + id : 'saveAndNewBtn', + handler : function(){ + cssdHandleToussesWin.close(); + grid.dwrReload(); + } + }] + }); + + cssdHandleToussesWin = new top.Ext.Window({ + id : 'cssdHandleToussesWin', + layout : 'fit', + title : '处理器械包管理', + width : 600, + border : false, + modal : true, + height : 260, + plain : true, + items : [formObj] + }); + + cssdHandleToussesWin.show(); + + if(id != 0){ + formObj.form.load({ + url : WWWROOT + '/disinfectSystem/baseData/cssdHandleToussesAction!loadCssdHandleTousses.do', + method : 'GET', + waitMsg : '正在加载数据,请稍候', + success : function(form, action) { + var cssdHandleTousses = action.result.data; + }, + failure : function(form, action) {}, + params : {id : id} + }); + } + +} + + +function saveCssdHandleTousses(thiz) { + if (!formObj.form.isValid()) { + showResult('请正确填写表单各值!'); + thiz.enable(); + return false; + } + top.Ext.MessageBox.confirm("请确认","是否确定要保存处理器械包?", + function(button, text) { + if ("yes" == button){ + formObj.form.submit( { + url : WWWROOT + '/disinfectSystem/baseData/cssdHandleToussesAction!saveCssdHandleTousses.do', + method : 'POST', + waitMsg : '正在保存数据,请稍候', + waitTitle : '提交表单', + success : function(form, action) { + if(action.result.success == true){ + cssdHandleToussesWin.close(); + showResult('保存成功'); + grid.dwrReload(); + }else{ + showResult(action.result.message); + } + }, + failure : function(form, action) { + showResult('failure = ' + action.result.message,'error'); + top.Ext.getCmp('saveBtn').enable(); + } + }); + } + }); +} \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesView.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesView.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesView.js (revision 12675) @@ -0,0 +1,163 @@ +var grid; + +// 删除仓库 +function deleteCssdHandleTousses() { + + 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++) { + 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/baseData/cssdHandleToussesAction!deleteCssdHandleToussesByIdList.do', + params : {ids : ids}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + var success = result.success; + if (true != success) { + showResult(result.cause); + return; + } else { + showResult('删除成功'); + grid.dwrReload(); + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + showResult(result.cause); + } + }); + }); + +} + +var refresh = function() { + grid.dwrReload(); + grid.store.reload(); +}; + +var loadFormData = function(grid) { + var records = grid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要修改处理的器械包配置!"); + return false; + } + if (records.length > 1) { + showResult("一次只能修改一条数据!"); + return false; + } + id = records[0].data['id']; + addAndEditCssdHandleTousses(id); +}; + +/** + * 修改记录 + * modifyRecord函数 触发modify函数调用,并传入当前列的值以及record.data对象 + * 页面中需要定义 modify(v,data) 函数 + */ +function modify(v,data){ + loadFormData(grid); +} + +Ext.onReady(function() { + Ext.QuickTips.init(); + // 记录cookie(3步) + + var columns = [ + {header : "id",dataIndex : 'id', hidden:true}, + {header : "tousseDefinitionId",dataIndex : 'tousseDefinitionId', hidden:true}, + {header : "orgUnitId",dataIndex : 'orgUnitId', hidden:true,renderer : modifyRecord,renderer : modifyRecord}, + {header : "科室编码",width : 180,dataIndex : 'orgUnitCode', renderer : modifyRecord}, + {header : "科室名称",width : 180,dataIndex : 'orgUnitName'}, + {header : "tousseDefinitionId",width : 180,dataIndex : 'tousseDefinitionId', hidden:true}, + {header : "器械包名称",width : 180,dataIndex : 'tousseName',id:'tousseName'} + ]; + + var readerDetail = [ + {name : 'id'}, + {name : 'tousseDefinitionId'}, + {name : 'orgUnitId'}, + {name : 'orgUnitCode'}, + {name : 'orgUnitName'}, + {name : 'tousseDefinitionId'}, + {name : 'tousseName'} + ]; + + var filters = new Ext.grid.GridFilters({ + filters : [ + {type : 'string',dataIndex : 'orgUnitCode'}, + {type : 'string',dataIndex : 'orgUnitName'}, + {type : 'string',dataIndex : 'tousseName'} + ] + }); + + + var sign = true; + var tbar = [ { + text : '添加', +// hidden : SSTS_Tousse_Create, + iconCls : 'btn_ext_application_add', + handler : function() { + addAndEditCssdHandleTousses(0,'否'); + } + }/*, '-',{ + text : '修改', + hidden : SSTS_Tousse_Update, + iconCls : 'btn_ext_application_edit', + id : 'editTbar', + handler : function() { + loadFormData(grid); + } + }*/, '-',{ + text : '删除', +// hidden : SSTS_Tousse_Delete, + iconCls : 'btn_ext_application_del', + handler : function() { + deleteCssdHandleTousses(grid); + } + }]; + var dwrCallParams = null; + + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function() { + + }; + + grid = new Ext.ux.ForgonPageGrid( { + title : '处理器械包列表', + tbar : tbar, + pageSize : 20, + defaultSortField : 'id', + defaultSortDirection : 'ASC', + isCheckboxSelectionModel : true, + rememberSelected : false, + isShowSearchField : true, + columns : columns, + plugins : filters, + autoExpandColumn : 'tousseName', + renderTo : 'formPanel', + frame : false + }, readerDetail, OrgUnitTableManager.findCssdHandleToussesTableList, dwrCallParams // 这个参数只是占位作用 + ); + + var viewport = new Ext.Viewport( { + layout : 'border', + items : [{ + region : 'center', + margins : '0 0 0 0', + layout : 'fit', + items : grid + } ] + }); + }); \ No newline at end of file Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/cssdhandletousses/action/CssdHandleToussesAction.java =================================================================== diff -u -r12667 -r12675 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/cssdhandletousses/action/CssdHandleToussesAction.java (.../CssdHandleToussesAction.java) (revision 12667) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/cssdhandletousses/action/CssdHandleToussesAction.java (.../action/CssdHandleToussesAction.java) (revision 12675) @@ -1,4 +1,4 @@ -package com.forgon.disinfectsystem.tousse.cssdhandletousses; +package com.forgon.disinfectsystem.tousse.cssdhandletousses.action; import java.io.IOException; import java.util.ArrayList; @@ -12,21 +12,19 @@ import net.sf.json.JsonConfig; import net.sf.json.util.PropertyFilter; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; -import com.forgon.directory.model.BarcodeDevice; import com.forgon.directory.model.CssdHandleTousses; import com.forgon.directory.model.OrgUnit; -import com.forgon.directory.service.OrgUnitManager; -import com.forgon.disinfectsystem.basedatamanager.cssdservicedepts.CssdServiceDeptsAction; +import com.forgon.disinfectsystem.basedatamanager.cssdservicedepts.action.CssdServiceDeptsAction; import com.forgon.disinfectsystem.entity.basedatamanager.toussedefinition.TousseDefinition; import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseDefinitionManager; -import com.forgon.serialnumber.model.SerialNum; import com.forgon.tools.StrutsParamUtils; +import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.json.JsonPropertyFilter; import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.Preparable; @@ -47,11 +45,22 @@ private TousseDefinitionManager tousseDefinitionManager; private CssdHandleTousses cssdHandleTousses; + + private ObjectDao objectDao; public void setCssdHandleTousses(CssdHandleTousses cssdHandleTousses) { this.cssdHandleTousses = cssdHandleTousses; } + public void setTousseDefinitionManager( + TousseDefinitionManager tousseDefinitionManager) { + this.tousseDefinitionManager = tousseDefinitionManager; + } + + public void setObjectDao(ObjectDao objectDao) { + this.objectDao = objectDao; + } + /** * 加载供应室处理器械包配置 */ @@ -102,7 +111,7 @@ tousseDefinitionManager.saveOrUpdateCssdHandleTousseDefinitions(cssd, tousseDefinitionList); HttpServletResponse httpServletResponse = StrutsParamUtils .getResponse(); - jsonObject.put("success", false); + jsonObject.put("success", true); httpServletResponse.getWriter().print(jsonObject); } catch (Exception e) { jsonObject.put("success", false); @@ -137,7 +146,7 @@ int result = tousseDefinitionManager.removeCssdHandleTousseDefinitions(cssd , tousseDefinitionList); HttpServletResponse httpServletResponse = StrutsParamUtils .getResponse(); - jsonObject.put("success", false); + jsonObject.put("success", true); httpServletResponse.getWriter().print(jsonObject); } catch (Exception e) { jsonObject.put("success", false); @@ -149,14 +158,43 @@ } } - public void prepareSave() { - + /** + * 删除供应室处理的器械包配置 + */ + public void deleteCssdHandleToussesByIdList(){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("success", true); + HttpServletResponse httpServletResponse = StrutsParamUtils + .getResponse(); + httpServletResponse.setCharacterEncoding("UTF-8"); + String ids = StrutsParamUtils.getPraramValue("ids", ""); + if(StringUtils.isNotBlank(ids)){ + String[] str = ids.split(";"); + List idList = new ArrayList(); + try { + for (String id : str) { + idList.add(Long.parseLong(id)); + } + objectDao.delete(CssdHandleTousses.class.getSimpleName(), idList); + httpServletResponse.getWriter().print(jsonObject); + } catch (IOException e) { + logger.error("删除仓库写入响应消息至前端失败:" + e); + } catch (Exception e) { + logger.error("删除仓库写入响应消息至前端失败:" + e); + } + }else{ + + } } - + + @Override public void prepare() throws Exception { - + if(cssdHandleTousses == null){ + cssdHandleTousses = new CssdHandleTousses(); + } } + @Override public CssdHandleTousses getModel() { return cssdHandleTousses; } Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/warehouse/wareHouseView.js =================================================================== diff -u -r12652 -r12675 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/warehouse/wareHouseView.js (.../wareHouseView.js) (revision 12652) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/warehouse/wareHouseView.js (.../wareHouseView.js) (revision 12675) @@ -76,8 +76,8 @@ // 记录cookie(3步) var columns = [ - {header : "仓库id",width : 180,dataIndex : 'id', hidden:true,renderer : modifyRecord}, - {header : "仓库名称",width : 180,dataIndex : 'name'}, + {header : "仓库id",width : 180,dataIndex : 'id', hidden:true}, + {header : "仓库名称",width : 180,dataIndex : 'name',renderer : modifyRecord}, {header : "所属供应室",width : 90,dataIndex : 'orgUnitName'}, {header : "顺序",width : 65,dataIndex : 'sequence'}, {header : "备注",width : 100,dataIndex : 'remark',id:'remark'} Fisheye: Tag 12675 refers to a dead (removed) revision in file `ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/cssdhandletousses/CssdHandleToussesAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesView.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesView.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/supplyroomtype/cssdHandleToussesView.jsp (revision 12675) @@ -0,0 +1,55 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + +供应室处理器械包配置 + +<%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ include file="/common/includeExtJs4_2.jsp"%> + + + + + + + + + + + + +
+
+
+
+
+ + \ No newline at end of file