Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js =================================================================== diff -u -r15261 -r15437 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js (.../invoicePlanExtractedView.js) (revision 15261) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js (.../invoicePlanExtractedView.js) (revision 15437) @@ -56,6 +56,35 @@ var depart = records[0].data['depart']; addAndEditInvoicePlan(departCode,depart); } +/** + * 通过扫描条码打开发货计划单。条码可以是科室条码(不是科室编码),也可以是单号 + */ +function openInvoicePlanByBarcode(barcode){ + if(isUndefinedOrNullOrEmpty(barcode)){ + showResult("请扫描科室条码或申请单条码"); + return; + } + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/invoicePlanAction!getScanResult.do', + params : {barcode : barcode}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + if(result){ + if(result.success){ + addAndEditInvoicePlan(result.data.departCode,result.data.depart,result.data.invoicePlanId); + showResult(result.data.depart + "的发货单"); + }else{ + showResult(result.message); + } + } + }, + failure : function(form, action) { + if(action.result && action.result.message){ + showResult(action.result.message); + } + } + }); +} Ext.onReady(function() { Ext.QuickTips.init(); @@ -235,5 +264,6 @@ items:grid }] }); - + globalOnKeyDown(openInvoicePlanByBarcode); + window.focus(); }); \ No newline at end of file