Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r21770 -r21838 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 21770) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 21838) @@ -56,67 +56,49 @@ /** * 打开对应的表单(添加申请单操作) * @param form 申请表单类型 - * @param tousseType 器械包类型 - * @param tousseGroups 器械包分组(需要显示的器械包分组,为空则显示全部的器械包分组) + * @param tousseGroups 器械包分组(需要显示的器械包分组用分号分隔,为空则显示全部的器械包分组) * @param specifyDisposableTypes是否包含指定的一次性物品类型,格式:{include:是否包含,disposableTypes:'一次性物品类型集合'} */ -function openApplication(tousseType, form, tousseGroups, specifyDisposableTypes) { - //限制同一个科室(供应室除外)只能申请一张申请单 - if (sstsConfig.limitApply && form == comboApplicationForm && !isSupplyRoomUser) { - var existRecyclingApplication = null; - DWREngine.setAsync(false); - RecyclingApplicationTableManager.getRecyclingApplicationByDepartmentCode($Id('departCoding').value, function(result) { - if (result && result != 'null') { - existRecyclingApplication = result; +function openApplication(form, tousseGroups, specifyDisposableTypes) { + if (!isUndefinedOrNullOrEmpty(form)){ + //1、限制同一个科室(供应室除外)只能申请一张申请单 + if (sstsConfig.limitApply && form == comboApplicationForm && !isSupplyRoomUser) { + var existRecyclingApplication = null; + DWREngine.setAsync(false); + RecyclingApplicationTableManager.getRecyclingApplicationByDepartmentCode($Id('departCoding').value, function(result) { + if (result && result != 'null') { + existRecyclingApplication = result; + } + }); + DWREngine.setAsync(true); + if (existRecyclingApplication) { + showResult('本科室已经申请过物品,请确认申请的物品!'); + setRecyclingApplicationForm(existRecyclingApplication); + return; } - }); - DWREngine.setAsync(true); - if (existRecyclingApplication) { - showResult('本科室已经申请过物品,请确认申请的物品!'); - setRecyclingApplicationForm(existRecyclingApplication); - return; } + + //2、设置“提交并新建”按钮重新打开表单的参数对象 + setOpenFormObj(form, tousseGroups, specifyDisposableTypes); + + comboApplication(0,$Id('departCoding').value,false,false,true,form, tousseGroups, specifyDisposableTypes, false, '', null); } - - //新打开申请对话框时,相关参数调整及清除 - handleDepartStore.proxy.extraParams.tousseType = tousseType; - handleDepartStore.proxy.extraParams.applyDepartCode = ""; - comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = ""; - //设置打开表单的对象 - setOpenFormObj(tousseType, form, tousseGroups, specifyDisposableTypes); - if (!isUndefinedOrNullOrEmpty(form)){ - comboApplication(0,$Id('departCoding').value,false,false,true,form, tousseGroups, specifyDisposableTypes, false, '',false); - } } /** * 设置打开表单的对象,用于保存和新建. - * @param tousseType 类型 * @param form 表单类型 * @param tousseGroups 器械包分组(需要显示的器械包分组,为空则显示全部的器械包分组) * @param specifyDisposableTypes格式:{include:是否包含,disposableTypes:'一次性物品类型'} * */ -function setOpenFormObj(tousseType, form, tousseGroups, specifyDisposableTypes) { - openFormObj.tousseType = tousseType; +function setOpenFormObj(form, tousseGroups, specifyDisposableTypes) { openFormObj.form = form; openFormObj.tousseGroups = tousseGroups; openFormObj.specifyDisposableTypes = specifyDisposableTypes; } /** - * 根据处理科室重新加载comboGoodsStore. - */ -function reloadGoodsComboStore(){ - var deptName = top.Ext4.getCmp("handleDepart").getValue(); - var deptCoding = getHandleDepartCoding(handleDepartStore,deptName); - top.Ext4.getCmp("handleDepartCoding").setValue(deptCoding); - - comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = deptCoding; - comboGoodsStore.load(); -} - -/** * 把消毒物品定义的材料的“数量”和“材料定义id”,更新到新的节点(无论拆不拆包申请的的消毒物品). * @param originalNodes 消毒物品定义的所有材料节点 * @param newNode 新的节点(即:在grid列表的) @@ -386,9 +368,22 @@ fields : [ {name : 'cssdOrgUnitCode',mapping : 'cssdOrgUnitCode'}, {name : 'name',mapping : 'cssdOrgUnitName'} - ] + ], + listeners:{ + beforeload : function(store, operation, eOpts){ + //每次加载之前传“申请科室编码”和“物品类型”两个参数 + store.proxy.extraParams.applyDepartCode = top.Ext4.getCmp('departCoding').getValue(); + var tousseType = tousseType_tousse; + var type = top.Ext4.getCmp('type').getValue(); + if (type == comboApplicationForm) { + tousseType = ''; + } else if (type == diposableGoodsApplicationForm) { + tousseType = tousseType_diposableGoods; + } + store.proxy.extraParams.tousseType = tousseType; + } + } }); -handleDepartStore.reload(); var disinfectStore = new Ext4.data.JsonStore({ fields : [ @@ -446,11 +441,13 @@ proxy : goodProxy, fields : goodModel, listeners:{ - beforeload : function(store, options){ - //申请科室部门编号 - options.params = options.params || {}; - options.params['appCode'] = top.Ext4.getCmp('departCoding').getValue(); - if (!isIE6OrIE7){ + beforeload : function(store, operation, eOpts){ + //每次加载之前传“申请科室编码”、“结算科室编码”、“处理科室编码”三个参数 + store.proxy.extraParams.appCode = top.Ext4.getCmp('departCoding').getValue(); + store.proxy.extraParams.settleAccountsDepartCoding = top.Ext4.getCmp('settleAccountsDepartCoding').getValue(); + store.proxy.extraParams.cssdOrgUnitCode = top.Ext4.getCmp('handleDepartCoding').getValue(); + + if (!isIE6OrIE7){ createExt4Mask.call(objMask,'loadMask','数据处理中,请稍候......', applicationWindow); objMask.loadMask.show(); }else { @@ -948,55 +945,6 @@ return isValid; } -///** -// * 根据科室名称获取科室的编码. -// * @param store 数据仓库 -// * @param deptName 科室名称 -// * @returns {String} -// */ -//function getDepartCoding(store,deptName){ -// var deptCoding = ""; -// for(var i = 0;i