Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java =================================================================== diff -u -r16436 -r16673 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 16436) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 16673) @@ -851,14 +851,19 @@ if (tousse != null) { if (tousse.getMaterialInstances() != null) { - for (MaterialInstance instance : tousse - .getMaterialInstances()) { + for (MaterialInstance instance : tousse.getMaterialInstances()) { + MaterialDefinition md = instance.getMaterialDefinition(); + String isImplant = Constants.STR_NO; + if(md != null && StringUtils.isNotBlank(md.getIsImplant())){ + isImplant = md.getIsImplant(); + } String name = CssdUtils.getMaterialName(instance.getMaterialDefinition()); JSONObject obj = new JSONObject(); obj.put("id", instance.getId()); obj.put("name", name); obj.put("type", "器械"); obj.put("count", instance.getApplyAmount()); + obj.put("isImplant", isImplant); array.add(obj); } } @@ -880,6 +885,7 @@ obj.put("name", goodsName); obj.put("type", "器械一次性物品"); obj.put("count", instance.getAmount()); + obj.put("isImplant", ""); array.add(obj); } } Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/materialdefinition/action/MaterialDefinitionAction.java =================================================================== diff -u -r16299 -r16673 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/materialdefinition/action/MaterialDefinitionAction.java (.../MaterialDefinitionAction.java) (revision 16299) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/materialdefinition/action/MaterialDefinitionAction.java (.../MaterialDefinitionAction.java) (revision 16673) @@ -502,9 +502,9 @@ * @return * @throws Exception */ - public String getMaterialDefinitionData() { + public void getMaterialDefinitionData() { if (spell == null) { - return null; + return; } String tousseDefinitionId = StrutsParamUtils.getPraramValue( "tousseDefinitionId", ""); @@ -513,34 +513,23 @@ String jsonStr = ""; try { spell = java.net.URLDecoder.decode(spell, "UTF-8"); - if (StringUtils.isBlank(tousseDefinitionId)) { - jsonStr = materialDefinitionManager - .searchMaterialDefinitionAndDiposableGoods(spell, - selectType).toString(); - } else { - try { - jsonStr = materialInstanceManager - .searchMaterialInstanceByTousseDefinitionIdAndSpell( - tousseDefinitionId, spell, selectType); - } catch (SQLException e) { - e.printStackTrace(); - } - } - HttpServletResponse response = StrutsParamUtils.getResponse(); - response.setCharacterEncoding("UTF-8"); - PrintWriter out; + } catch (UnsupportedEncodingException e1) { + e1.printStackTrace(); + } + if (StringUtils.isBlank(tousseDefinitionId)) { + jsonStr = materialDefinitionManager + .searchMaterialDefinitionAndDiposableGoods(spell, + selectType).toString(); + } else { try { - out = response.getWriter(); - out.print(jsonStr); - out.close(); - } catch (IOException e) { + jsonStr = materialInstanceManager + .searchMaterialInstanceByTousseDefinitionIdAndSpell( + tousseDefinitionId, spell, selectType); + } catch (SQLException e) { e.printStackTrace(); } - - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); } - return null; + StrutsResponseUtils.output(jsonStr); } /** Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/customTousseForm.js =================================================================== diff -u -r16379 -r16673 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/customTousseForm.js (.../customTousseForm.js) (revision 16379) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/tousse/customTousseForm.js (.../customTousseForm.js) (revision 16673) @@ -29,7 +29,8 @@ {name : 'id',mapping : 'id'}, {name : 'spelling',mapping : 'spelling'}, {name : 'type',mapping : 'type'}, - {name : 'name',mapping : 'name'} + {name : 'name',mapping : 'name'}, + {name : 'isImplant',mapping : 'isImplant'} ]) }); @@ -47,6 +48,7 @@ {name : 'id'}, {name : 'name'}, {name : 'type'}, + {name : 'isImplant'}, {name : 'count'} ]); @@ -60,12 +62,13 @@ {name : 'id'}, {name : 'name'}, {name : 'type'}, - {name : 'count'} + {name : 'count'}, + {name : 'isImplant'} ] }) }); -function addMaterial(id,name,type){ +function addMaterial(id,name,type,isImplant){ if(name == ''){ showResult("请先选择材料。"); return false; @@ -85,6 +88,7 @@ id : id, name : name, type : type, + isImplant : isImplant, count : top.Ext.getCmp('count1').getValue() }); configStore.add(p);// 插入到最后一行 @@ -145,34 +149,25 @@ } var cm = new top.Ext.grid.ColumnModel([ - {header : "材料名称",dataIndex : 'name',width : 340}, - { header : "数量", - dataIndex : 'count', - editor : new Ext.grid.GridEditor( - new Ext.form.NumberField({ - allowDecimals: false, - allowBlank: false, - listeners : { - 'focus':function(){ - this.selectText(); - } - } - }) - ) + {header : "材料名称",dataIndex : 'name',width : 250}, + {header : "数量",dataIndex : 'count',editor : new top.Ext.form.NumberField({ + allowDecimals: false, + allowBlank: false, + listeners : { + 'focus':function(){ + this.selectText(); + } + } + }) }, - { - header : '删除', - dataIndex : 'button', - width : 50, - menuDisabled : true, - renderer : function(v, p, record){ - var str = ""; - return str; - } + } } ]); @@ -318,25 +313,25 @@ } }] },{ - columnWidth : .5 - ,layout : 'form' - ,labelWidth : 70 - ,items : [{ - xtype : 'combo' - ,id : 'urgency' - ,name : 'urgency' - ,fieldLabel : "紧急度" - ,value :'普通' - ,valueField : 'displayName' - ,displayField : 'displayName' - ,store : urgencyStore - ,triggerAction : 'all' - ,mode : 'local' - ,editable : false - ,forceSelection : true - ,readOnly:true - ,allowBlank : false - ,anchor : '100%' + columnWidth : .5, + layout : 'form', + labelWidth : 70, + items : [{ + xtype : 'combo', + id : 'urgency', + name : 'urgency', + fieldLabel : "紧急度", + value :'普通', + valueField : 'displayName', + displayField : 'displayName', + store : urgencyStore, + triggerAction : 'all', + mode : 'local', + editable : false, + forceSelection : true, + readOnly:true, + allowBlank : false, + anchor : '100%' }] },{ columnWidth : 1, @@ -430,6 +425,7 @@ id : materialDefinition.id, name : materialName, count : tousseDefinition.materialInstances[i].applyAmount, + isImplant : materialDefinition.isImplant, type : '器械' }); configStore.add(p); @@ -440,6 +436,7 @@ var p = new materialDefinitionConfig({ id : diposableGoods.id, name : diposableGoods.name, + isImplant : '', count : tousseDefinition.diposableGoodsItems[i].amount, type : '一次性物品' }); @@ -498,6 +495,10 @@ name : 'type', id : 'type' },{ + xtype : 'hidden', + name : 'isImplant', + id : 'isImplant' + },{ text : ' ' },{ text : '材料名称:' @@ -523,6 +524,7 @@ combo.setValue(record.data.name); top.Ext.getCmp('materialId').setValue(record.data.id); top.Ext.getCmp('type').setValue(record.data.type); + top.Ext.getCmp('isImplant').setValue(record.data.isImplant); }, specialkey : function(field, ee) { if (ee.getKey() == Ext.EventObject.ENTER) { @@ -548,7 +550,7 @@ listeners : { specialkey : function(field, e) { if (e.getKey() == Ext.EventObject.ENTER) { - addMaterial(top.Ext.getCmp("materialId").getValue(),top.Ext.getCmp("material").getValue(),top.Ext.getCmp("type").getValue()); + addMaterial(top.Ext.getCmp("materialId").getValue(),top.Ext.getCmp("material").getValue(),top.Ext.getCmp("type").getValue(),top.Ext.getCmp("isImplant").getValue()); top.Ext.getCmp("material").focus(); } } @@ -558,7 +560,7 @@ iconCls : 'btn_ext_add', disabled : !fillTousseName, handler : function() { - addMaterial(top.Ext.getCmp("materialId").getValue(),top.Ext.getCmp("material").getValue(),top.Ext.getCmp("type").getValue()); + addMaterial(top.Ext.getCmp("materialId").getValue(),top.Ext.getCmp("material").getValue(),top.Ext.getCmp("type").getValue(),top.Ext.getCmp("isImplant").getValue()); top.Ext.getCmp("material").focus(); } }]