Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java =================================================================== diff -u -r21482 -r21519 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 21482) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/tousse/toussedefinition/action/TousseDefinitionAction.java (.../TousseDefinitionAction.java) (revision 21519) @@ -2128,18 +2128,18 @@ BindGoodVo bindGoodVo = buildBindGoodVo(); //处理科室的科室编码 String handleDepartCode = StrutsParamUtils.getPraramValue("handleDepartCode", ""); - JSONArray jsonArray = tousseDefinitionManager.getBindGoods(bindGoodVo, handleDepartCode); - if (jsonArray != null) { - try { - JSONObject jsonObject = new JSONObject(); + try { + JSONArray jsonArray = tousseDefinitionManager.getBindGoods(bindGoodVo, handleDepartCode); + if (jsonArray != null) { + JSONObject jsonObject = new JSONObject(); jsonObject.put("success", true); jsonObject.put("data", jsonArray); StrutsResponseUtils.output(jsonObject); - } catch (Exception e) { - logger.error(e, e); - StrutsResponseUtils.output(false, "绑定失败!\n" + e.getMessage()); - } - } + } + } catch (Exception e) { + logger.error(e, e); + StrutsResponseUtils.output(false, "绑定失败!\n" + e.getMessage()); + } } /** Index: ssts-web/src/main/webapp/disinfectsystem/goodsBindingConfig/goodsBindHandler.js =================================================================== diff -u -r21483 -r21519 --- ssts-web/src/main/webapp/disinfectsystem/goodsBindingConfig/goodsBindHandler.js (.../goodsBindHandler.js) (revision 21483) +++ ssts-web/src/main/webapp/disinfectsystem/goodsBindingConfig/goodsBindHandler.js (.../goodsBindHandler.js) (revision 21519) @@ -64,31 +64,32 @@ goodType: curSelectedGoods.type }; } - - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getBindGoods.do', - params: params, - timeout: 600000, - method: 'POST', - success: function (response, options) { - try { - var result = Ext.decode(response.responseText); - if (!isUndefinedOrNullOrEmpty(result)) { - if (result.success) { - var records = result.data; - if (records.length > 0) { - me.addBindGood(records); - } - } else { - //绑定失败,不提示 - } + if (params.bindCount && params.goodId) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getBindGoods.do', + params: params, + timeout: 600000, + method: 'POST', + success: function (response, options) { + try { + var result = Ext.decode(response.responseText); + if (!isUndefinedOrNullOrEmpty(result)) { + if (result.success) { + var records = result.data; + if (records.length > 0) { + me.addBindGood(records); + } + } else { + //绑定失败,不提示 + } + } + } catch (e) { + alert("Exception : " + e); } - } catch (e) { - alert("Exception : " + e); + }, + failure: function (response, options) { + showResult(response.responseText); } - }, - failure: function (response, options) { - showResult(response.responseText); - } - }); + }); + } }