Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
SmdBox
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f9cecdb2
由
张少辉
编写于
2026-04-10 14:55:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.中转仓入库,2003退库,2006退库 拆分成不同的网页
1 个父辈
aaa753c4
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
325 行增加
和
195 行删除
myproject/src/main/java/com/myproject/webapp/controller/storage/AccShelfController.java
myproject/src/main/java/com/myproject/webapp/controller/storage/NLPShelfController.java
myproject/src/main/resources/ApplicationResources_zh.properties
myproject/src/main/webapp/WEB-INF/pages/storage/accShelf.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/accShelfIndex.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/allBoxView.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/nlpShelf.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/nlpShelfIndex.jsp
myproject/src/main/java/com/myproject/webapp/controller/storage/AccShelfController.java
查看文件 @
f9cecdb
...
@@ -60,10 +60,25 @@ public class AccShelfController extends BaseController {
...
@@ -60,10 +60,25 @@ public class AccShelfController extends BaseController {
@RequestMapping
(
"/storage/accShelf/{cid}"
)
@RequestMapping
(
"/storage/accShelf/{cid}"
)
public
String
cabinetView
(
@PathVariable
String
cid
,
HttpServletRequest
request
){
public
String
cabinetView
(
@PathVariable
String
cid
,
HttpServletRequest
request
){
String
type
=
request
.
getParameter
(
"type"
);
if
(
type
!=
null
&&
!
type
.
isEmpty
())
{
// 有type参数,直接跳转到业务页面
request
.
getSession
().
setAttribute
(
"show"
,
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
request
.
setAttribute
(
"storage"
,
storage
);
return
"storage/accShelf"
;
}
else
{
// 没有type参数,跳转到导航页面
return
"redirect:/storage/accShelf/"
+
cid
+
"/index"
;
}
}
@RequestMapping
(
"/storage/accShelf/{cid}/index"
)
public
String
indexView
(
@PathVariable
String
cid
,
HttpServletRequest
request
){
request
.
getSession
().
setAttribute
(
"show"
,
cid
);
request
.
getSession
().
setAttribute
(
"show"
,
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
request
.
setAttribute
(
"storage"
,
storage
);
request
.
setAttribute
(
"storage"
,
storage
);
return
"storage/accShelf"
;
return
"storage/accShelf
Index
"
;
}
}
/**
/**
...
...
myproject/src/main/java/com/myproject/webapp/controller/storage/NLPShelfController.java
查看文件 @
f9cecdb
...
@@ -64,10 +64,25 @@ public class NLPShelfController extends BaseController {
...
@@ -64,10 +64,25 @@ public class NLPShelfController extends BaseController {
@RequestMapping
(
"/storage/nlp/{cid}"
)
@RequestMapping
(
"/storage/nlp/{cid}"
)
public
String
cabinetView
(
@PathVariable
String
cid
,
HttpServletRequest
request
){
public
String
cabinetView
(
@PathVariable
String
cid
,
HttpServletRequest
request
){
String
type
=
request
.
getParameter
(
"type"
);
if
(
type
!=
null
&&
!
type
.
isEmpty
())
{
// 有type参数,直接跳转到业务页面
request
.
getSession
().
setAttribute
(
"show"
,
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
request
.
setAttribute
(
"storage"
,
storage
);
return
"storage/nlpShelf"
;
}
else
{
// 没有type参数,跳转到导航页面
return
"redirect:/storage/nlp/"
+
cid
+
"/index"
;
}
}
@RequestMapping
(
"/storage/nlp/{cid}/index"
)
public
String
indexView
(
@PathVariable
String
cid
,
HttpServletRequest
request
){
request
.
getSession
().
setAttribute
(
"show"
,
cid
);
request
.
getSession
().
setAttribute
(
"show"
,
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
request
.
setAttribute
(
"storage"
,
storage
);
request
.
setAttribute
(
"storage"
,
storage
);
return
"storage/nlpShelf"
;
return
"storage/nlpShelf
Index
"
;
}
}
...
...
myproject/src/main/resources/ApplicationResources_zh.properties
查看文件 @
f9cecdb
...
@@ -378,4 +378,5 @@ storagePosFind.workOrderNo=\u5DE5\u5355\u53F7
...
@@ -378,4 +378,5 @@ storagePosFind.workOrderNo=\u5DE5\u5355\u53F7
storagePosFind.enterWorkOrderNo
=
\u
8BF7
\u
8F93
\u5165\u
5DE5
\u5355\u
53F7
storagePosFind.enterWorkOrderNo
=
\u
8BF7
\u
8F93
\u5165\u
5DE5
\u5355\u
53F7
tab.zhongzhuanIn
=
\u
4E2D
\u
8F6C
\u
4ED3
\u5165\u
5E93
tab.zhongzhuanIn
=
\u
4E2D
\u
8F6C
\u
4ED3
\u5165\u
5E93
tab.return2003
=
2003
\u9000\u
5E93
tab.return2003
=
2003
\u9000\u
5E93
tab.return2006
=
2006
\u9000\u
5E93
\ No newline at end of file
\ No newline at end of file
tab.return2006
=
2006
\u9000\u
5E93
button.back
=
\u
8FD4
\u
56DE
\ No newline at end of file
\ No newline at end of file
myproject/src/main/webapp/WEB-INF/pages/storage/accShelf.jsp
查看文件 @
f9cecdb
...
@@ -24,43 +24,12 @@
...
@@ -24,43 +24,12 @@
overflow-y: auto;
overflow-y: auto;
}
}
/* 核心修改:标签页容器恢复为块级布局,支持上下排列 */
/* 工单号输入框容器样式 */
.main-tabs {
margin-bottom: 15px;
border-bottom: 1px solid #e7ecf1;
padding-bottom: 8px;
display: block; /* 取消flex,改为块级布局,支持上下排列 */
}
/* 标签列表样式(保持原有,仅微调底部间距) */
.main-tabs > .nav-tabs {
margin-bottom: 10px; /* 标签列表和下方输入框的间距 */
}
.main-tabs > .nav-tabs > li {
margin-bottom: -1px;
}
.main-tabs > .nav-tabs > li > a {
padding: 10px 18px;
font-size: 14px;
color: #666;
border: none;
border-bottom: 2px solid transparent;
}
.main-tabs > .nav-tabs > li.active > a,
.main-tabs > .nav-tabs > li.active > a:hover {
color: #4b8df8;
border-bottom: 2px solid #4b8df8;
background: transparent;
}
.main-tabs > .nav-tabs > li > a:hover {
background: transparent;
border-bottom: 2px solid #eee;
}
/* 工单号输入框容器样式(放在标签页下方,左对齐) */
.work-order-box {
.work-order-box {
display: flex;
display: flex;
align-items: center;
align-items: center;
gap: 8px;
/* 文字和输入框间距 */
gap: 8px;
margin-
left: 8px; /* 和标签页左对齐(微调) */
margin-
bottom: 15px;
}
}
/* 工单号输入框样式(和scan-code统一) */
/* 工单号输入框样式(和scan-code统一) */
#work-order-input {
#work-order-input {
...
@@ -69,43 +38,46 @@
...
@@ -69,43 +38,46 @@
font-size: 14px;
font-size: 14px;
border: 1px solid #ccc;
border: 1px solid #ccc;
border-radius: 4px;
border-radius: 4px;
width: 200px;
/* 可自定义宽度 */
width: 200px;
}
}
/* 页面标题样式 */
.page-header {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #e7ecf1;
}
.page-header h2 {
margin: 0;
color: #333;
}
.back-link {
margin-bottom: 10px;
}
</style>
</style>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<!-- 2. 定义国际化变量(可放在页面任意位置,建议在标签页上方) -->
<!-- 定义国际化变量 -->
<fmt:message key="tab.zhongzhuanIn" var="tab_zhongzhuanIn"/> <!-- 中转仓入库 -->
<fmt:message key="tab.zhongzhuanIn" var="tab_zhongzhuanIn"/>
<fmt:message key="tab.return2003" var="tab_return2003"/> <!-- 2003退库 -->
<fmt:message key="tab.return2003" var="tab_return2003"/>
<fmt:message key="tab.return2006" var="tab_return2006"/> <!-- 2006退库 -->
<fmt:message key="tab.return2006" var="tab_return2006"/>
<fmt:message key="storagePosFind.workOrderNo" var="workOrder_label"/>
<fmt:message key="storagePosFind.workOrderNo" var="workOrder_label"/> <!-- 工单号(标签文字) -->
<fmt:message key="storagePosFind.enterWorkOrderNo" var="workOrder_placeholder"/>
<fmt:message key="storagePosFind.enterWorkOrderNo" var="workOrder_placeholder"/> <!-- 请输入工单号(占位符) -->
<fmt:message key="button.back" var="back_label"/>
<!-- 3. 标签页主体(data-tab标识与type参数值一致) -->
<!-- 页面头部:返回链接和标题 -->
<div class="main-tabs">
<div class="page-header">
<ul class="nav nav-tabs" id="businessTab">
<a href="${ctx}/storage/accShelf/${show}/index" class="btn btn-default back-link">
<!-- 中转仓入库:data-tab=zhongzhuanIn 对应type=zhongzhuanIn -->
<i class="fa fa-arrow-left"></i> ${back_label}
<li class="tab-item" data-tab="zhongzhuanIn" data-url="${ctx}/storage/accShelf/${show}?type=zhongzhuanIn">
</a>
<a href="javascript:;">${tab_zhongzhuanIn}</a>
<h2 id="page-title">${storage.name}</h2>
</li>
</div>
<!-- 2003退库:data-tab=return2003 对应type=return2003 -->
<li class="tab-item" data-tab="return2003" data-url="${ctx}/storage/accShelf/${show}?type=return2003">
<!-- 工单号输入框 -->
<a href="javascript:;">${tab_return2003}</a>
<div class="work-order-box">
</li>
<span>${workOrder_label}:</span>
<!-- 2006退库:data-tab=return2006 对应type=return2006 -->
<input type="text" id="work-order-input" class="form-control" placeholder="${workOrder_placeholder}">
<li class="tab-item" data-tab="return2006" data-url="${ctx}/storage/accShelf/${show}?type=return2006">
<a href="javascript:;">${tab_return2006}</a>
</li>
</ul>
<!-- 工单号输入框(移至标签列表下方) -->
<div class="work-order-box">
<span>${workOrder_label}:</span>
<input type="text" id="work-order-input" class="form-control" placeholder="${workOrder_placeholder}">
</div>
</div>
</div>
<div class="row" id="codeBox">
<div class="row" id="codeBox">
...
@@ -249,19 +221,20 @@
...
@@ -249,19 +221,20 @@
return paramValue ? decodeURIComponent(paramValue[2]) : null;
return paramValue ? decodeURIComponent(paramValue[2]) : null;
}
}
// ========== 新增:初始化标签选中状态(根据type参数) ==========
// ========== 新增:初始化页面标题(根据type参数) ==========
function initActiveTab() {
function initPageTitle() {
// 1. 获取URL中的type参数,无参数默认选中zhongzhuanIn(中转仓入库)
var type = getUrlParam("type") || "${tab_zhongzhuanIn}";
var targetType = getUrlParam("type") || "zhongzhuanIn";
var titleText = "${storage.name}";
// 2. 匹配标签并设置选中状态
$(".tab-item").each(function() {
if(type === "${tab_zhongzhuanIn}") {
var currentTabKey = $(this).data("tab");
titleText += " - ${tab_zhongzhuanIn}";
if (currentTabKey === targetType) {
} else if(type === "${tab_return2003}") {
$(this).addClass("active");
titleText += " - ${tab_return2003}";
} else {
} else if(type === "${tab_return2006}") {
$(this).removeClass("active");
titleText += " - ${tab_return2006}";
}
}
});
$("#page-title").text(titleText);
}
}
function showMsg(msg){
function showMsg(msg){
...
@@ -294,7 +267,7 @@
...
@@ -294,7 +267,7 @@
$("#scan-code").change(function () {
$("#scan-code").change(function () {
var codeValue = $(this).val();
var codeValue = $(this).val();
var workOrder = $.trim($("#work-order-input").val());
var workOrder = $.trim($("#work-order-input").val());
var checkType =
$(".tab-item.active").find("a").text()
;
var checkType =
getUrlParam("type") || "${tab_zhongzhuanIn}"
;
$(this).val("");
$(this).val("");
showMsg("");
showMsg("");
$(this).attr("placeholder", codeValue);
$(this).attr("placeholder", codeValue);
...
@@ -334,21 +307,10 @@
...
@@ -334,21 +307,10 @@
}, 1000);
}, 1000);
// ==========
新增:标签点击事件(页面元素加载后绑定)
==========
// ==========
页面加载完成后初始化
==========
$(document).ready(function() {
$(document).ready(function() {
// 初始化标签选中状态
// 初始化页面标题
initActiveTab();
initPageTitle();
// 标签点击跳转(带type参数,替换历史记录+刷新页面,避免回退到上一个标签)
$(".tab-item").click(function() {
var targetUrl = $(this).data("url");
if(targetUrl){
// 核心:替换当前历史记录,回退时不会保留本次点击的历史
history.replaceState(null, document.title, targetUrl);
// 刷新当前页面(加载新的type参数对应的内容)
window.location.reload();
}
});
});
});
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/accShelfIndex.jsp
0 → 100644
查看文件 @
f9cecdb
<%@ page import="com.myproject.util.StorageConstants" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<style type="text/css">
.nav-buttons {
margin-top: 50px;
}
.nav-button {
height: 200px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-decoration: none;
border-radius: 10px;
transition: all 0.3s ease;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.nav-button:hover {
transform: translateY(-5px);
box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}
.nav-button i {
font-size: 48px;
margin-bottom: 15px;
}
.nav-button span {
font-size: 20px;
font-weight: bold;
}
.btn-primary {
background-color: #4b8df8;
border-color: #4b8df8;
color: white;
}
.btn-warning {
background-color: #f1c40f;
border-color: #f1c40f;
color: white;
}
.btn-info {
background-color: #3498db;
border-color: #3498db;
color: white;
}
.storage-info {
text-align: center;
margin-bottom: 30px;
padding: 20px;
background-color: #f8f9fa;
border-radius: 5px;
}
</style>
<fmt:message key="tab.zhongzhuanIn" var="tab_zhongzhuanIn"/>
<fmt:message key="tab.return2003" var="tab_return2003"/>
<fmt:message key="tab.return2006" var="tab_return2006"/>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="storage-info">
<h2>${storage.name}</h2>
</div>
</div>
</div>
<div class="row nav-buttons">
<div class="col-md-4">
<a href="${ctx}/storage/accShelf/${show}?type=${tab_zhongzhuanIn}" class="nav-button btn-primary">
<i class="fa fa-warehouse"></i>
<span>${tab_zhongzhuanIn}</span>
</a>
</div>
<div class="col-md-4">
<a href="${ctx}/storage/accShelf/${show}?type=${tab_return2003}" class="nav-button btn-warning">
<i class="fa fa-undo"></i>
<span>${tab_return2003}</span>
</a>
</div>
<div class="col-md-4">
<a href="${ctx}/storage/accShelf/${show}?type=${tab_return2006}" class="nav-button btn-info">
<i class="fa fa-undo"></i>
<span>${tab_return2006}</span>
</a>
</div>
</div>
</div>
myproject/src/main/webapp/WEB-INF/pages/storage/allBoxView.jsp
查看文件 @
f9cecdb
...
@@ -169,10 +169,10 @@
...
@@ -169,10 +169,10 @@
</c:if>
</c:if>
<c:if test="${storage.shelf}">
<c:if test="${storage.shelf}">
<c:set var="detailUrl" value="${ctx}/storage/nlp/${storage.cid}
?type=zhongzhuanIn
"/>
<c:set var="detailUrl" value="${ctx}/storage/nlp/${storage.cid}"/>
</c:if>
</c:if>
<c:if test="${storage.accShelf}">
<c:if test="${storage.accShelf}">
<c:set var="detailUrl" value="${ctx}/storage/accShelf/${storage.cid}
?type=zhongzhuanIn
"/>
<c:set var="detailUrl" value="${ctx}/storage/accShelf/${storage.cid}"/>
</c:if>
</c:if>
<c:if test="${storage.codeShelf}">
<c:if test="${storage.codeShelf}">
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/nlpShelf.jsp
查看文件 @
f9cecdb
...
@@ -24,43 +24,12 @@
...
@@ -24,43 +24,12 @@
overflow-y: auto;
overflow-y: auto;
}
}
/* 核心修改:标签页容器恢复为块级布局,支持上下排列 */
/* 工单号输入框容器样式 */
.main-tabs {
margin-bottom: 15px;
border-bottom: 1px solid #e7ecf1;
padding-bottom: 8px;
display: block; /* 取消flex,改为块级布局,支持上下排列 */
}
/* 标签列表样式(保持原有,仅微调底部间距) */
.main-tabs > .nav-tabs {
margin-bottom: 10px; /* 标签列表和下方输入框的间距 */
}
.main-tabs > .nav-tabs > li {
margin-bottom: -1px;
}
.main-tabs > .nav-tabs > li > a {
padding: 10px 18px;
font-size: 14px;
color: #666;
border: none;
border-bottom: 2px solid transparent;
}
.main-tabs > .nav-tabs > li.active > a,
.main-tabs > .nav-tabs > li.active > a:hover {
color: #4b8df8;
border-bottom: 2px solid #4b8df8;
background: transparent;
}
.main-tabs > .nav-tabs > li > a:hover {
background: transparent;
border-bottom: 2px solid #eee;
}
/* 工单号输入框容器样式(放在标签页下方,左对齐) */
.work-order-box {
.work-order-box {
display: flex;
display: flex;
align-items: center;
align-items: center;
gap: 8px;
/* 文字和输入框间距 */
gap: 8px;
margin-
left: 8px; /* 和标签页左对齐(微调) */
margin-
bottom: 15px;
}
}
/* 工单号输入框样式(和scan-code统一) */
/* 工单号输入框样式(和scan-code统一) */
#work-order-input {
#work-order-input {
...
@@ -69,44 +38,47 @@
...
@@ -69,44 +38,47 @@
font-size: 14px;
font-size: 14px;
border: 1px solid #ccc;
border: 1px solid #ccc;
border-radius: 4px;
border-radius: 4px;
width: 200px; /* 可自定义宽度 */
width: 200px;
}
/* 页面标题样式 */
.page-header {
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #e7ecf1;
}
.page-header h2 {
margin: 0;
color: #333;
}
.back-link {
margin-bottom: 10px;
}
}
</style>
</style>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<!-- 定义国际化变量 -->
<fmt:message key="tab.zhongzhuanIn" var="tab_zhongzhuanIn"/>
<fmt:message key="tab.return2003" var="tab_return2003"/>
<fmt:message key="tab.return2006" var="tab_return2006"/>
<fmt:message key="storagePosFind.workOrderNo" var="workOrder_label"/>
<fmt:message key="storagePosFind.enterWorkOrderNo" var="workOrder_placeholder"/>
<fmt:message key="button.back" var="back_label"/>
<!-- 页面头部:返回链接和标题 -->
<div class="page-header">
<a href="${ctx}/storage/nlp/${show}/index" class="btn btn-default back-link">
<i class="fa fa-arrow-left"></i> ${back_label}
</a>
<h2 id="page-title">${storage.name}</h2>
</div>
<!-- 2. 定义国际化变量(可放在页面任意位置,建议在标签页上方) -->
<!-- 工单号输入框 -->
<fmt:message key="tab.zhongzhuanIn" var="tab_zhongzhuanIn"/> <!-- 中转仓入库 -->
<div class="work-order-box">
<fmt:message key="tab.return2003" var="tab_return2003"/> <!-- 2003退库 -->
<span>${workOrder_label}:</span>
<fmt:message key="tab.return2006" var="tab_return2006"/> <!-- 2006退库 -->
<input type="text" id="work-order-input" class="form-control" placeholder="${workOrder_placeholder}">
<fmt:message key="storagePosFind.workOrderNo" var="workOrder_label"/> <!-- 工单号(标签文字) -->
<fmt:message key="storagePosFind.enterWorkOrderNo" var="workOrder_placeholder"/> <!-- 请输入工单号(占位符) -->
<!-- 3. 标签页主体(data-tab标识与type参数值一致) -->
<div class="main-tabs">
<ul class="nav nav-tabs" id="businessTab">
<!-- 中转仓入库:data-tab=zhongzhuanIn 对应type=zhongzhuanIn -->
<li class="tab-item" data-tab="zhongzhuanIn" data-url="${ctx}/storage/nlp/${show}?type=zhongzhuanIn">
<a href="javascript:;">${tab_zhongzhuanIn}</a>
</li>
<!-- 2003退库:data-tab=return2003 对应type=return2003 -->
<li class="tab-item" data-tab="return2003" data-url="${ctx}/storage/nlp/${show}?type=return2003">
<a href="javascript:;">${tab_return2003}</a>
</li>
<!-- 2006退库:data-tab=return2006 对应type=return2006 -->
<li class="tab-item" data-tab="return2006" data-url="${ctx}/storage/nlp/${show}?type=return2006">
<a href="javascript:;">${tab_return2006}</a>
</li>
</ul>
<!-- 工单号输入框(移至标签列表下方) -->
<div class="work-order-box">
<span>${workOrder_label}:</span>
<input type="text" id="work-order-input" class="form-control" placeholder="${workOrder_placeholder}">
</div>
</div>
</div>
<div class="row" id="codeBox">
<div class="row" id="codeBox">
...
@@ -243,31 +215,29 @@
...
@@ -243,31 +215,29 @@
<c:set var="scripts" scope="request">
<c:set var="scripts" scope="request">
<script type="text/javascript">
<script type="text/javascript">
// URL参数解析函数(用于获取type参数)
// ========== 新增:URL参数解析函数(用于获取type参数) ==========
function getUrlParam(paramName) {
function getUrlParam(paramName) {
var reg = new RegExp("(^|&)" + paramName + "=([^&]*)(&|$)");
var reg = new RegExp("(^|&)" + paramName + "=([^&]*)(&|$)");
var paramValue = window.location.search.substr(1).match(reg);
var paramValue = window.location.search.substr(1).match(reg);
return paramValue ? decodeURIComponent(paramValue[2]) : null;
return paramValue ? decodeURIComponent(paramValue[2]) : null;
}
}
// ========== 新增:初始化标签选中状态(根据type参数) ==========
// 初始化页面标题(根据type参数)
function initActiveTab() {
function initPageTitle() {
// 1. 获取URL中的type参数,无参数默认选中zhongzhuanIn(中转仓入库)
var type = getUrlParam("type") || "${tab_zhongzhuanIn}";
var targetType = getUrlParam("type") || "zhongzhuanIn";
var titleText = "${storage.name}";
// 2. 匹配标签并设置选中状态
$(".tab-item").each(function() {
if(type === "${tab_zhongzhuanIn}") {
var currentTabKey = $(this).data("tab");
titleText += " - ${tab_zhongzhuanIn}";
if (currentTabKey === targetType) {
} else if(type === "${tab_return2003}") {
$(this).addClass("active");
titleText += " - ${tab_return2003}";
} else {
} else if(type === "${tab_return2006}") {
$(this).removeClass("active");
titleText += " - ${tab_return2006}";
}
}
});
$("#page-title").text(titleText);
}
}
function showMsg(msg){
function showMsg(msg){
if(msg == ""){
if(msg == ""){
$("#msg").attr("class","");
$("#msg").attr("class","");
...
@@ -298,7 +268,7 @@
...
@@ -298,7 +268,7 @@
$("#scan-code").change(function () {
$("#scan-code").change(function () {
var codeValue = $(this).val();
var codeValue = $(this).val();
var workOrder = $.trim($("#work-order-input").val());
var workOrder = $.trim($("#work-order-input").val());
var checkType =
$(".tab-item.active").find("a").text()
;
var checkType =
getUrlParam("type") || "${tab_zhongzhuanIn}"
;
$(this).val("");
$(this).val("");
showMsg("");
showMsg("");
$(this).attr("placeholder", codeValue);
$(this).attr("placeholder", codeValue);
...
@@ -337,21 +307,10 @@
...
@@ -337,21 +307,10 @@
}
}
}, 1000);
}, 1000);
//
========== 新增:标签点击事件(页面元素加载后绑定) ==========
//
页面加载完成后初始化
$(document).ready(function() {
$(document).ready(function() {
// 初始化标签选中状态
// 初始化页面标题
initActiveTab();
initPageTitle();
// 标签点击跳转(带type参数,替换历史记录+刷新页面,避免回退到上一个标签)
$(".tab-item").click(function() {
var targetUrl = $(this).data("url");
if(targetUrl){
// 核心:替换当前历史记录,回退时不会保留本次点击的历史
history.replaceState(null, document.title, targetUrl);
// 刷新当前页面(加载新的type参数对应的内容)
window.location.reload();
}
});
});
});
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/nlpShelfIndex.jsp
0 → 100644
查看文件 @
f9cecdb
<%@ page import="com.myproject.util.StorageConstants" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<style type="text/css">
.nav-buttons {
margin-top: 50px;
}
.nav-button {
height: 200px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-decoration: none;
border-radius: 10px;
transition: all 0.3s ease;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.nav-button:hover {
transform: translateY(-5px);
box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}
.nav-button i {
font-size: 48px;
margin-bottom: 15px;
}
.nav-button span {
font-size: 20px;
font-weight: bold;
}
.btn-primary {
background-color: #4b8df8;
border-color: #4b8df8;
color: white;
}
.btn-warning {
background-color: #f1c40f;
border-color: #f1c40f;
color: white;
}
.btn-info {
background-color: #3498db;
border-color: #3498db;
color: white;
}
.storage-info {
text-align: center;
margin-bottom: 30px;
padding: 20px;
background-color: #f8f9fa;
border-radius: 5px;
}
</style>
<fmt:message key="tab.zhongzhuanIn" var="tab_zhongzhuanIn"/>
<fmt:message key="tab.return2003" var="tab_return2003"/>
<fmt:message key="tab.return2006" var="tab_return2006"/>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="storage-info">
<h2>${storage.name}</h2>
</div>
</div>
</div>
<div class="row nav-buttons">
<div class="col-md-4">
<a href="${ctx}/storage/nlp/${show}?type=${tab_zhongzhuanIn}" class="nav-button btn-primary">
<i class="fa fa-warehouse"></i>
<span>${tab_zhongzhuanIn}</span>
</a>
</div>
<div class="col-md-4">
<a href="${ctx}/storage/nlp/${show}?type=${tab_return2003}" class="nav-button btn-warning">
<i class="fa fa-undo"></i>
<span>${tab_return2003}</span>
</a>
</div>
<div class="col-md-4">
<a href="${ctx}/storage/nlp/${show}?type=${tab_return2006}" class="nav-button btn-info">
<i class="fa fa-undo"></i>
<span>${tab_return2006}</span>
</a>
</div>
</div>
</div>
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论