Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js =================================================================== diff -u -r22832 -r22921 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 22832) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 22921) @@ -1632,23 +1632,65 @@ },{ layout : 'form', labelWidth :70, - columnWidth :.67, + columnWidth :.33, items : [{ xtype : 'textfield', + fieldLabel : '发货员条码', + maxLength : '16', + id : 'deliveryPersonBarcode', + name : 'deliveryPersonBarcode', + anchor : '99%', + listeners : { + render : function(p) { + p.getEl().on('keypress',function(e) { + if (e.getKey() == 13) {//回车键 + InvoiceTableManager.getUserNameOfCurrentLoginUserOrgsByBarcode( + top.Ext.getCmp('deliveryPersonBarcode').getValue(),function(userName) { + if (userName != null) { + var resultArray = userName.split(":"); + if(resultArray[0] == "success"){ + top.Ext.getCmp('deliveryPerson').setValue(resultArray[1]); + Ext.state.Manager.getProvider().set('cookieDeliveryPerson',resultArray[1]); + }else{ + showResult(resultArray[1] , null , sstsConfig.messagePauseTimeOnInvoiceplanPage); + top.Ext.getCmp('deliveryPerson').setValue(""); + } + } + top.Ext.getCmp('deliveryPersonBarcode').setValue(""); + if(getSystemSetConfig('showInvoiceAssistantSender',true)){ + top.Ext.getCmp('senderBarcode').focus(); + }else if(getSystemSetConfig('showInvoicePersonInCharge',true)){ + top.Ext.getCmp('personInChargeBarcode').focus(); + }else{ + top.Ext.getCmp('scanText').focus(); + } + }); + } + }); + } + } + }] + },{ + layout : 'form', + labelWidth :70, + columnWidth :.33, + items : [{ + xtype : 'textfield', fieldLabel : '发货员', maxLength : '41', id : 'deliveryPerson', name : 'deliveryPerson', readOnly:true, allowBlank : false, anchor : '99%', - value:$Id('userName').value, + value: getSystemSetConfig('invoiceSenderUseLoginUser',true)?$Id('userName').value:'', cls:'fieldReadOnlyNoRemove' }] },{ layout : 'form', labelWidth :70, columnWidth :.33, + hidden: !getSystemSetConfig('showInvoiceAssistantSender',true), items : [{ xtype : 'textfield', fieldLabel : '核对员条码', @@ -1673,7 +1715,11 @@ } } top.Ext.getCmp('senderBarcode').setValue(""); - top.Ext.getCmp('personInChargeBarcode').focus(); + if(getSystemSetConfig('showInvoicePersonInCharge',true)){ + top.Ext.getCmp('personInChargeBarcode').focus(); + }else{ + top.Ext.getCmp('scanText').focus(); + } }); } }); @@ -1684,21 +1730,23 @@ layout : 'form', labelWidth :70, columnWidth :.33, + hidden: !getSystemSetConfig('showInvoiceAssistantSender',true), items : [{ xtype : 'textfield', fieldLabel : '核对员', maxLength : '41', id : 'sender', name : 'sender', readOnly:true, - allowBlank : false, + allowBlank : !getSystemSetConfig('invoiceAssistantSenderRequired',true), anchor : '99%', cls:'x-item-disabled' }] },{ layout : 'form', labelWidth :90, columnWidth :.33, + hidden: !getSystemSetConfig('showInvoicePersonInCharge',true), items : [{ xtype : 'textfield', fieldLabel : '下送责任人条码', @@ -1737,13 +1785,15 @@ layout : 'form', labelWidth :70, columnWidth :.33, + hidden: !getSystemSetConfig('showInvoicePersonInCharge',true), items : [{ xtype : 'textfield', fieldLabel : '下送责任人', maxLength : '41', id : 'personInCharge', name : 'personInCharge', readOnly:true, + allowBlank : !getSystemSetConfig('invoicePersonInChargeRequired',false), anchor : '99%', cls:'x-item-disabled' }] @@ -2158,18 +2208,27 @@ // failure : function(form, action) { // } // }); + // 发货员 + var cookieDeliveryPerson = Ext.state.Manager.getProvider().get('cookieDeliveryPerson'); + if(getSystemSetConfig('rememberLastInvoiceSender',false) && cookieDeliveryPerson){ + top.Ext.getCmp('deliveryPerson').setValue(cookieDeliveryPerson); + } + // 核对员 var cookieSender = Ext.state.Manager.getProvider().get('cookieSender'); - if(cookieSender){ + if(getSystemSetConfig('rememberLastInvoiceAssistantSender',false) && cookieSender){ top.Ext.getCmp('sender').setValue(cookieSender); } var cookiePersonInCharge = Ext.state.Manager.getProvider().get('cookiePersonInCharge'); var cookiePersonInChargeCode = Ext.state.Manager.getProvider().get('cookiePersonInChargeCode'); - if(cookiePersonInCharge){ - top.Ext.getCmp('personInCharge').setValue(cookiePersonInCharge); + var rememberLastInvoicePersonInCharge = getSystemSetConfig('rememberLastInvoicePersonInCharge',false); + if(rememberLastInvoicePersonInCharge){ + if(cookiePersonInCharge){ + top.Ext.getCmp('personInCharge').setValue(cookiePersonInCharge); + } + if(cookiePersonInChargeCode){ + top.Ext.getCmp('personInChargeCode').setValue(cookiePersonInChargeCode); + } } - if(cookiePersonInChargeCode){ - top.Ext.getCmp('personInChargeCode').setValue(cookiePersonInChargeCode); - } ///// Index: ssts-web/src/main/webapp/js/configUtils.js =================================================================== diff -u -r14131 -r22921 --- ssts-web/src/main/webapp/js/configUtils.js (.../configUtils.js) (revision 14131) +++ ssts-web/src/main/webapp/js/configUtils.js (.../configUtils.js) (revision 22921) @@ -72,4 +72,16 @@ } // alert('retValue='+retValue); return retValue; +} +/** + * 获取config.js文件中的配置项。如果没有配置,返回默认值 + * @param key + * @param def + * @returns + */ +function getSystemSetConfig(key,def){ + if(sstsConfig && sstsConfig.hasOwnProperty(key)){ + return sstsConfig[key]; + } + return def; } \ No newline at end of file