From 8bf4ce108ab2406259916a62f99a397d72ead1b1 Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: 星期五, 22 十月 2021 10:41:00 +0800
Subject: [PATCH] 备货领取、订单领取 enter查询

---
 src/main/webapp/warehouse_stock_mng.xhtml |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/main/webapp/warehouse_stock_mng.xhtml b/src/main/webapp/warehouse_stock_mng.xhtml
index 9978d02..1be7e1a 100644
--- a/src/main/webapp/warehouse_stock_mng.xhtml
+++ b/src/main/webapp/warehouse_stock_mng.xhtml
@@ -100,7 +100,7 @@
 						<p:outputLabel value="产品编号:"></p:outputLabel>
 						<p:inputText value="#{warehouseStockMngController.productSn}"></p:inputText>
 
-						<p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink>
+						<p:commandLink styleClass="search" process="@form" update="@form" id="first-search" ></p:commandLink>
 					</p:panelGrid>
 				</p:panel>
 				<p:panel styleClass="center-body">
@@ -120,7 +120,7 @@
 						<!--<p:commandButton value="导入" styleClass="import-btn" onclick="importStock()"
 						></p:commandButton>-->
 
-						<script>
+						<script type="text/javascript">
 							function importStock(){
 								$("#warehouseStockMngForm\\:importStockBtn_input").click();
 							}
@@ -133,6 +133,20 @@
 									}
 								}
 							}
+
+							document.onkeydown = function (event) {
+								console.log("按键了")
+								if (event.keyCode === 13) {
+									var $tabView = $("#tabView\\:firstTab");
+									if ($tabView.css("display") !== "none") {
+										PrimeFaces.ab({s:"tabView:warehouseStockMngForm:first-search",p:"tabView:warehouseStockMngForm",u:"tabView:warehouseStockMngForm"});return false;
+									}else{
+										PrimeFaces.ab({s:"tabView:warehouseStockMngFormForPerson:second-search",p:"tabView:warehouseStockMngFormForPerson",u:"tabView:warehouseStockMngFormForPerson"});return false;
+									}
+								}
+							}
+
+
 						</script>
 					</p:panelGrid>
 
@@ -395,7 +409,7 @@
 							<f:selectItem itemLabel="全部" noSelectionOption="true"/>
 						</p:selectOneMenu>
 
-						<p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink>
+						<p:commandLink styleClass="search" process="@form" update="@form" id="second-search"></p:commandLink>
 					</p:panelGrid>
 				</p:panel>
 

--
Gitblit v1.9.2