Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r12643 -r12702 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 12643) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 12702) @@ -206,6 +206,28 @@ }); appDepartJsonStore.reload(); +//申请单类型(即申请物品类型,有通用、一次性物品、器械包(含消毒物品)) +var invoicePlanForTousseType; +var invoicePlanForTousseType_Tousse = "器械包"; +var invoicePlanForTousseType_Diposable = "一次性物品"; +//处理科室(即服务的供应室)数据源 +var handleDepartStore = new Ext4.data.JsonStore({ + proxy : { + type : 'ajax', + url : WWWROOT + '/systemmanage/getCssdsByApplyDepartAndType.do', + reader : { + type : 'json', + root : 'data' + } + }, + fields : [ + /*{name : 'cssdOrgUnitId',mapping : 'cssdOrgUnitId'},*/ + {name : 'cssdOrgUnitCode',mapping : 'cssdOrgUnitCode'}, + {name : 'cssdOrgUnitName',mapping : 'cssdOrgUnitName'} + ] +}); +handleDepartStore.reload(); + var disinfectStore = new Ext4.data.JsonStore({ fields : [ {name : 'id'}, @@ -1697,10 +1719,15 @@ name : 'departCoding', itemId : 'departCoding' }, - { + { xtype : 'hidden', name : 'settleAccountsDepartCoding', id : 'settleAccountsDepartCoding' + }, + { + xtype : 'hidden', + name : 'handleDepartName', + id : 'handleDepartName' }, { xtype : 'hidden', name : 'isDiposableGoods', @@ -1774,7 +1801,7 @@ }] }, - // 申请科室、结算科室 + // 申请科室、结算科室、处理的供应室 { xtype : 'container', width : 800, @@ -1803,6 +1830,26 @@ var deptCoding = getDepartCoding(appDepartJsonStore,deptName); top.Ext4.ComponentQuery.query("#recyclingApplicationForm #departCoding")[0].setValue(deptCoding); setSettleAccountsDepartDefaultValue(deptName, deptCoding, departJsonStore); + + //选择申请科室后,根据申请科室及单类型加载处理科室,如果加载后的数量为1,则进行默认处理科室赋值 + handleDepartStore.proxy.extraParams.applyDepartCode = deptCoding; + handleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType; + handleDepartStore.load({ + //params:{applyDepartCode:deptCoding,tousseType:invoicePlanForTousseType}, + callback: function(records, operation, success) { + var record = records; + if (records.length == 1){ + record = records[0]; + top.Ext4.getCmp("handleDepart").setValue(record.data.cssdOrgUnitCode); + //top.Ext4.getCmp("handleDepart").setValue(record.data.cssdOrgUnitName); + top.Ext4.getCmp('handleDepart').setRawValue(record.data.cssdOrgUnitName); + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = record.data.cssdOrgUnitCode; + comboGoodsStore.reload(); + } + } + }); + //如果菜单中已启用申领一次性物品增加项目选项功能并且申请科室为课教项目经费,则该下拉框给予显示(仅中山眼科增加) if(sstsConfig.showProjectNameSelectWhenApplyDiposableGoods == true){ if(deptName == '科教项目经费'){ @@ -1845,6 +1892,35 @@ thiz.selectText(); } } + }, { + xtype : 'combo', + fieldLabel : '处理科室', + id : 'handleDepart', + name : 'handleDepart', + minChars : 0, + valueField : 'cssdOrgUnitCode', + displayField : 'cssdOrgUnitName', + store : handleDepartStore, + forceSelection : true, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : false, + flex : 1, + listeners:{ + select:function(combo, record, index){ + console.log(combo);console.log(record); + //alert(combo.getValue() + '=' + combo.value);alert(combo.getRawValue() + '=' + combo.rawValue); + top.Ext4.getCmp("handleDepartName").setValue(combo.rawValue); + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = combo.value; + comboGoodsStore.reload(); + }, + focus : function(thiz){ + thiz.selectText(); + } + } }] }, { @@ -2133,6 +2209,7 @@ }); } + //处理科室 } function getApplyItemsInfo(treeStore, tousseInstanceInfos, tousseNames){ @@ -2726,6 +2803,11 @@ tooltip : '申请物品', hidden : SSTS_RecycApplication_Create || sstsConfig.applicationFormType != 1, handler : function() { + //新打开申请对话框时,相关参数调整及清除 + handleDepartStore.proxy.extraParams.applyDepartCode = ""; + handleDepartStore.proxy.extraParams.tousseType = ""; + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = ""; comboApplication(0, "true",false,false,true,comboApplicationForm, false); } },{ @@ -2734,6 +2816,12 @@ tooltip : '申请器械包', hidden : SSTS_RecycApplication_Create || sstsConfig.applicationFormType != 2, handler : function() { + invoicePlanForTousseType = invoicePlanForTousseType_Tousse;//器械包 + //新打开申请对话框时,相关参数调整及清除 + handleDepartStore.proxy.extraParams.applyDepartCode = ""; + handleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType; + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = ""; comboApplication(0, "true",false,false,true,tousseApplicationForm, false);//待发货 } },{ @@ -2742,6 +2830,12 @@ tooltip : '申请一次性物品', hidden : SSTS_RecycApplication_Create || sstsConfig.applicationFormType != 2, handler : function() { + invoicePlanForTousseType = invoicePlanForTousseType_Diposable;//一次性物品 + //新打开申请对话框时,相关参数调整及清除 + handleDepartStore.proxy.extraParams.applyDepartCode = ""; + handleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType; + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = ""; comboApplication(0, "true",false,false,true,diposableGoodsApplicationForm, false);//待发货 } },{ @@ -2750,6 +2844,12 @@ iconCls : 'btn_ext_add_foreignTousse', hidden : SSTS_RecycApplication_Create || sstsConfig.applicationFormType != 2, handler : function() { + invoicePlanForTousseType = invoicePlanForTousseType_Tousse;//消毒物品也属器械包的类型 + //新打开申请对话框时,相关参数调整及清除 + handleDepartStore.proxy.extraParams.applyDepartCode = ""; + handleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType; + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = ""; addAndEditUntracableTousse(null,0,"01",function(){}); } },{