Browse Source

报表界面回车事件

zhuth 7 years ago
parent
commit
a4c4d13f9e

+ 16 - 0
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -390,6 +390,22 @@ Ext.define('saas.view.core.report.ReportPanel', {
             if(defaultValue) {
                 viewModel.set('form.' + bind, defaultValue);
             }
+
+            item.enableKeyEvents = true;
+            item.listeners = item.listeners || {};
+            Ext.applyIf(item.listeners, {
+                keydown: {
+                    fn: function(th, e, eOpts) {
+                        if(e.keyCode == 13) {
+                            if(!th.fireEvent('beforequery', th)) {
+                                return;
+                            }else {
+                                me.getController().onQuery()
+                            }
+                        }
+                    }
+                }
+            });
         });
 
         return items;

+ 5 - 0
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -20,6 +20,11 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         fieldLabel: '客户名称',
         columnWidth: 0.2,
         allowBlank: false,
+        listeners: {
+            beforequery: function(f) {
+                return !!f.value;
+            }
+        }
     }, {
         xtype: 'monthdatefield',
         name: 'ym',

+ 6 - 1
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -19,7 +19,12 @@ Ext.define('saas.view.money.report.VendorCheck', {
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
         columnWidth: 0.2,
-        allowBlank:false
+        allowBlank:false,
+        listeners: {
+            beforequery: function(f) {
+                return !!f.value;
+            }
+        }
     }, {
         xtype: 'monthdatefield',
         name: 'ym',