Index: ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.js =================================================================== diff -u -r30363 -r30364 --- ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.js (.../customInvoiceForm.js) (revision 30363) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/customInvoiceForm.js (.../customInvoiceForm.js) (revision 30364) @@ -754,49 +754,32 @@ render : function(p) { p.getEl().on('keypress',function(e) { if (e.getKey() == 13) {//回车键 - top.Ext.getBody().mask("正在加载中,请稍候..."); - InvoiceTableManager.getApplicationOrgByBarcode( - top.Ext.getCmp('departBarcode').getValue(),function(orgStr) { - if (orgStr != null) { - var result = top.Ext.decode(orgStr); - if(!result.success){ - showResult(result.message); - return; - } - top.Ext.getCmp("depart").setValue(result.name); - top.Ext.getCmp("orgUnitCoding").setValue(result.orgUnitCoding); - if(top.Ext.getCmp('assistantSenderBarcode_parent').isVisible()){ - top.Ext.getCmp('assistantSenderBarcode').focus(); - }else if(top.Ext.getCmp('personInChargeBarcode_parent').isVisible()){ - top.Ext.getCmp('personInChargeBarcode').focus(); - }else{ - top.Ext.getCmp('scanText').focus(); - } - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getDefaultSettleAccountDepart.do', - params: { - orgUnitCode: result.orgUnitCoding - }, - success: function (response, options) { - var result = Ext.decode(response.responseText); - if (!result.success) { - showResult(resultObj.errMsg); - return; - } - top.Ext.getBody().unmask(); - var orgUnitCode = result.data.orgUnitCode || ''; - var name = result.data.name || ''; - top.Ext.getCmp('settleAccountsDepartCoding').setValue(orgUnitCode); - top.Ext.getCmp('settleAccountsDepart').setValue(name); - }, - failure:function(){ - top.Ext.getBody().unmask(); + InvoiceTableManager.getApplicationOrgByBarcode( + top.Ext.getCmp('departBarcode').getValue(),function(orgStr) { + if (orgStr != null) { + var result = top.Ext.decode(orgStr); + if(!result.success){ + showResult(result.message); + return; + } + var deptCoding = result.orgUnitCoding; + top.Ext.getCmp("depart").setValue(result.name); + top.Ext.getCmp("orgUnitCoding").setValue(result.orgUnitCoding); + if(top.Ext.getCmp('assistantSenderBarcode_parent').isVisible()){ + top.Ext.getCmp('assistantSenderBarcode').focus(); + }else if(top.Ext.getCmp('personInChargeBarcode_parent').isVisible()){ + top.Ext.getCmp('personInChargeBarcode').focus(); + }else{ + top.Ext.getCmp('scanText').focus(); } - }); - } - - }); - top.Ext.getCmp('departBarcode').setValue(""); + //根据申请科室设置其默认结算科室 + if(deptCoding){ + setDefaultSettleAccountDepartByDeptCoding(deptCoding); + } + } + + }); + top.Ext.getCmp('departBarcode').setValue(""); } }); } @@ -827,23 +810,8 @@ select:function(combo, record, index){ var deptCoding = record.data.departCode; top.Ext.getCmp("orgUnitCoding").setValue(deptCoding); - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getDefaultSettleAccountDepart.do', - params: { - orgUnitCode: deptCoding - }, - success: function (response, options) { - var result = Ext.decode(response.responseText); - if (!result.success) { - showResult(resultObj.errMsg); - return; - } - var orgUnitCode = result.data.orgUnitCode || ''; - var name = result.data.name || ''; - top.Ext.getCmp('settleAccountsDepartCoding').setValue(orgUnitCode); - top.Ext.getCmp('settleAccountsDepart').setValue(name); - } - }); + //根据申请科室设置其默认结算科室 + setDefaultSettleAccountDepartByDeptCoding(deptCoding); }, focus : function(thiz){ thiz.selectText(); @@ -1450,6 +1418,29 @@ top.Ext.getCmp('sendOutGoodsStoreData').setValue(JSON.stringify(submitItems)); } +/** + * 根据申请科室设置其默认结算科室 + * @param deptCoding 申请科室编码 + */ +function setDefaultSettleAccountDepartByDeptCoding(deptCoding){ + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getDefaultSettleAccountDepart.do', + params: { + orgUnitCode: deptCoding + }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (!result.success) { + showResult(resultObj.errMsg); + return; + } + var orgUnitCode = result.data.orgUnitCode || ''; + var name = result.data.name || ''; + top.Ext.getCmp('settleAccountsDepartCoding').setValue(orgUnitCode); + top.Ext.getCmp('settleAccountsDepart').setValue(name); + } + }); +} Ext.onReady(function() { Ext.QuickTips.init();