ソースを参照

加入键盘交互,输入完后按Enter触发搜索动作

zengchao 8 年 前
コミット
4d976b0642

+ 6 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_invoice_ctrl.js

@@ -101,6 +101,12 @@ define([ 'app/app' ], function(app) {
             initTable();
         }
 
+        $scope.enterEvent = function(e) {
+            var keycode = window.event ? e.keyCode : e.which;
+            if(keycode==13){
+                $scope.searchByKey();
+            }
+        }
         //全选状态
         $scope.isAllCheck = false
         //全选

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html

@@ -256,7 +256,7 @@
         </div>
         <div class="invoice-search">
             <div class="fr">
-                <input type="text" class="form-control" ng-model="keyword" placeholder="订单号/发票抬头/收票人/联系电话"/>
+                <input type="text" class="form-control" ng-keyup="enterEvent($event)" ng-model="keyword" placeholder="订单号/发票抬头/收票人/联系电话"/>
                 <button ng-click="searchByKey()">搜索</button>
             </div>
         </div>