Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r12934 -r13355 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 12934) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 13355) @@ -2201,24 +2201,26 @@ // departComp.disable(); var departCodingComp = top.Ext4.ComponentQuery.query("#recyclingApplicationForm #departCoding")[0]; departCodingComp.setValue($Id('departCoding').value); - - //选择申请科室后,根据申请科室及单类型加载处理科室,如果加载后的数量为1,则进行默认处理科室赋值 - handleDepartStore.proxy.extraParams.applyDepartCode = $Id('departCoding').value; - 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("handleDepartCoding").setValue(record.data.cssdOrgUnitCode); - top.Ext4.getCmp('handleDepart').setValue(record.data.name); - - comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = record.data.cssdOrgUnitCode; - comboGoodsStore.reload(); + + if(!id || id == 0){ + //选择申请科室后,根据申请科室及单类型加载处理科室,如果加载后的数量为1,则进行默认处理科室赋值 + handleDepartStore.proxy.extraParams.applyDepartCode = $Id('departCoding').value; + handleDepartStore.proxy.extraParams.tousseType = invoicePlanForTousseType; + handleDepartStore.load({ + //params:{applyDepartCode:deptCoding,tousseType:invoicePlanForTousseType}, + callback: function(records, operation, success) { + var record = records; + if (records && records.length == 1){ + record = records[0]; + top.Ext4.getCmp("handleDepartCoding").setValue(record.data.cssdOrgUnitCode); + top.Ext4.getCmp('handleDepart').setValue(record.data.name); + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = record.data.cssdOrgUnitCode; + comboGoodsStore.reload(); + } } - } - }); + }); + } } if(id == ""){//添加 // 设置表单的默认焦点 @@ -2521,10 +2523,28 @@ top.Ext4.getCmp("settleAccountsDepartCoding").setValue(recyclingApplication.settleAccountsDepartCoding); top.Ext4.getCmp("handleDepart").forceSelection = false; - top.Ext4.getCmp("handleDepart").setValue(recyclingApplication.handleDepart); + top.Ext4.getCmp("handleDepart").setValue(recyclingApplication.handleDepart); + top.Ext4.getCmp("handleDepart").setRawValue(recyclingApplication.handleDepart); top.Ext4.getCmp("handleDepart").forceSelection = true; top.Ext4.getCmp("handleDepartCoding").setValue(recyclingApplication.handleDepartCoding); + handleDepartStore.proxy.extraParams.applyDepartCode = recyclingApplication.departCoding;alert(recyclingApplication.departCoding); + //handleDepartStore.proxy.extraParams.tousseType = recyclingApplication.tousseType:invoicePlanForTousseType; + handleDepartStore.load({ + //params:{applyDepartCode:deptCoding,tousseType:invoicePlanForTousseType}, + callback: function(records, operation, success) { + var record = records; + if (records && records.length == 1){ + record = records[0]; + top.Ext4.getCmp("handleDepartCoding").setValue(record.data.cssdOrgUnitCode); + top.Ext4.getCmp('handleDepart').setValue(record.data.name); + + comboGoodsStore.proxy.extraParams.cssdOrgUnitCode = record.data.cssdOrgUnitCode; + comboGoodsStore.reload(); + } + } + }); + if(recyclingApplication.applicationTime){ top.Ext4.getCmp('applicationTimeStr').setValue(Ext.util.Format.date(new Date(recyclingApplication.applicationTime.time),'Y-m-d H:i')); }