Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warehouse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡懿
warehouse
Commits
a220dfb9
Commit
a220dfb9
authored
Feb 21, 2023
by
yyq1988
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接货品和入库单模块
parent
e1c2204f
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1180 additions
and
363 deletions
+1180
-363
ShelvesController.java
...plus/modules/warehouse/shelves/web/ShelvesController.java
+9
-0
gridselect.tag
src/main/webapp/WEB-INF/tags/sys/gridselect.tag
+6
-0
treeselect.tag
src/main/webapp/WEB-INF/tags/sys/treeselect.tag
+6
-0
form.css
src/main/webapp/static/common/css/form.css
+10
-0
LodopFuncs.js
src/main/webapp/static/common/js/LodopFuncs.js
+188
-0
jeeplus.js
src/main/webapp/static/common/js/jeeplus.js
+98
-1
bootstrap-table.min.css
...bapp/static/plugin/bootstrapTable/bootstrap-table.min.css
+11
-0
bootstrap-table.min.js
...ebapp/static/plugin/bootstrapTable/bootstrap-table.min.js
+0
-0
taglib.jsp
src/main/webapp/webpage/include/taglib.jsp
+2
-0
gridselect.jsp
src/main/webapp/webpage/modules/common/gridselect.jsp
+15
-0
shelvesSelect.jsp
src/main/webapp/webpage/modules/common/shelvesSelect.jsp
+215
-0
goodsDetail.jsp
...in/webapp/webpage/modules/warehouse/goods/goodsDetail.jsp
+184
-0
goodsForm.jsp
...main/webapp/webpage/modules/warehouse/goods/goodsForm.jsp
+83
-166
goodsList.js
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
+35
-7
goodsList.jsp
...main/webapp/webpage/modules/warehouse/goods/goodsList.jsp
+23
-11
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+203
-0
storageForm.jsp
.../webapp/webpage/modules/warehouse/storage/storageForm.jsp
+91
-177
storageList.js
...n/webapp/webpage/modules/warehouse/storage/storageList.js
+1
-1
No files found.
src/main/java/com/jeeplus/modules/warehouse/shelves/web/ShelvesController.java
View file @
a220dfb9
...
...
@@ -231,5 +231,13 @@ public class ShelvesController extends BaseController {
}
return
j
;
}
/**
* 货架信息列表页面
*/
@RequestMapping
(
value
=
"shelvesSelect"
)
public
String
shelvesSelect
(
Shelves
shelves
,
Model
model
)
{
model
.
addAttribute
(
"shelves"
,
shelves
);
return
"modules/common/shelvesSelect"
;
}
}
\ No newline at end of file
src/main/webapp/WEB-INF/tags/sys/gridselect.tag
View file @
a220dfb9
...
...
@@ -14,6 +14,7 @@
<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
<%@ attribute name="isMultiSelected" type="java.lang.Boolean" required="false" description="是否允许多选"%>
<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
<%@ attribute name="callback" type="java.lang.String" required="false" description="选择回调"%>
<input id="${id}Id" name="${name}" type="hidden" value="${value}"/>
<div class="input-group" style="width: 100%">
<input id="${id}Name" name="${labelName }" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
...
...
@@ -57,6 +58,11 @@ $(document).ready(function(){
}
$("#${id}Id").val(ids.join(","));
$("#${id}Name").val(names.join(","));
if('${callback}' && window['${callback}']){
window['${callback}'](items);
}
top.layer.close(index);//关闭对话框。
},
cancel: function(index){
...
...
src/main/webapp/WEB-INF/tags/sys/treeselect.tag
View file @
a220dfb9
...
...
@@ -20,6 +20,7 @@
<%@ attribute name="hideBtn" type="java.lang.Boolean" required="false" description="是否显示按钮"%>
<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
<%@ attribute name="callback" type="java.lang.String" required="false" description="回调"%>
<input id="${id}Id" name="${name}" class="${cssClass} form-control" type="hidden" value="${value}"/>
<div class="input-group" style="width:100%">
<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
...
...
@@ -78,6 +79,11 @@ $(document).ready(function(){
$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
$("#${id}Name").val(names.join(","));
$("#${id}Name").focus();
if(typeof '${callback}' !== 'undefined' && window['${callback}']){
window['${callback}'](nodes, '${id}'.match(/\d+/g)[0]);
}
top.layer.close(index);
},
cancel: function(index){ //或者使用btn2
...
...
src/main/webapp/static/common/css/form.css
0 → 100644
View file @
a220dfb9
.table
td
{
background-color
:
#f2f2f2
;
}
.main-table
td
{
text-align
:
right
;
}
.detail-table
th
{
text-align
:
center
;
}
\ No newline at end of file
src/main/webapp/static/common/js/LodopFuncs.js
0 → 100644
View file @
a220dfb9
//==本JS是加载Lodop插件或Web打印服务CLodop/Lodop7的综合示例,可直接使用,建议理解后融入自己程序==
//用双端口加载主JS文件Lodop.js(或CLodopfuncs.js兼容老版本)以防其中某端口被占:
var
MainJS
=
"CLodopfuncs.js"
,
URL_WS1
=
"ws://localhost:8000/"
+
MainJS
,
//ws用8000/18000
URL_WS2
=
"ws://localhost:18000/"
+
MainJS
,
URL_HTTP1
=
"http://localhost:8000/"
+
MainJS
,
//http用8000/18000
URL_HTTP2
=
"http://localhost:18000/"
+
MainJS
,
URL_HTTP3
=
"https://localhost.lodop.net:8443/"
+
MainJS
;
//https用8000/8443
var
CreatedOKLodopObject
,
CLodopIsLocal
,
LoadJsState
;
//==判断是否需要CLodop(那些不支持插件的浏览器):==
function
needCLodop
()
{
try
{
var
ua
=
navigator
.
userAgent
;
if
(
ua
.
match
(
/Windows
\s
Phone/i
)
||
ua
.
match
(
/iPhone|iPod|iPad/i
)
||
ua
.
match
(
/Android/i
)
||
ua
.
match
(
/Edge
\D?\d
+/i
))
return
true
;
var
verTrident
=
ua
.
match
(
/Trident
\D?\d
+/i
);
var
verIE
=
ua
.
match
(
/MSIE
\D?\d
+/i
);
var
verOPR
=
ua
.
match
(
/OPR
\D?\d
+/i
);
var
verFF
=
ua
.
match
(
/Firefox
\D?\d
+/i
);
var
x64
=
ua
.
match
(
/x64/i
);
if
((
!
verTrident
)
&&
(
!
verIE
)
&&
(
x64
))
return
true
;
else
if
(
verFF
)
{
verFF
=
verFF
[
0
].
match
(
/
\d
+/
);
if
((
verFF
[
0
]
>=
41
)
||
(
x64
))
return
true
;
}
else
if
(
verOPR
)
{
verOPR
=
verOPR
[
0
].
match
(
/
\d
+/
);
if
(
verOPR
[
0
]
>=
32
)
return
true
;
}
else
if
((
!
verTrident
)
&&
(
!
verIE
))
{
var
verChrome
=
ua
.
match
(
/Chrome
\D?\d
+/i
);
if
(
verChrome
)
{
verChrome
=
verChrome
[
0
].
match
(
/
\d
+/
);
if
(
verChrome
[
0
]
>=
41
)
return
true
;
}
}
return
false
;
}
catch
(
err
)
{
return
true
;
}
}
//==检查加载成功与否,如没成功则用http(s)再试==
//==低版本CLODOP6.561/Lodop7.043及前)用本方法==
function
checkOrTryHttp
()
{
if
(
window
.
getCLodop
)
{
LoadJsState
=
"complete"
;
return
true
;
}
if
(
LoadJsState
==
"loadingB"
||
LoadJsState
==
"complete"
)
return
;
LoadJsState
=
"loadingB"
;
var
head
=
document
.
head
||
document
.
getElementsByTagName
(
"head"
)[
0
]
||
document
.
documentElement
;
var
JS1
=
document
.
createElement
(
"script"
)
,
JS2
=
document
.
createElement
(
"script"
)
,
JS3
=
document
.
createElement
(
"script"
);
JS1
.
src
=
URL_HTTP1
;
JS2
.
src
=
URL_HTTP2
;
JS3
.
src
=
URL_HTTP3
;
JS1
.
onload
=
JS2
.
onload
=
JS3
.
onload
=
JS2
.
onerror
=
JS3
.
onerror
=
function
(){
LoadJsState
=
"complete"
;}
JS1
.
onerror
=
function
(
e
)
{
if
(
window
.
location
.
protocol
!==
'https:'
)
head
.
insertBefore
(
JS2
,
head
.
firstChild
);
else
head
.
insertBefore
(
JS3
,
head
.
firstChild
);
}
head
.
insertBefore
(
JS1
,
head
.
firstChild
);
}
//==加载Lodop对象的主过程:==
(
function
loadCLodop
(){
if
(
!
needCLodop
())
return
;
CLodopIsLocal
=
!!
((
URL_WS1
+
URL_WS2
).
match
(
/
\/\/
localho|
\/\/
127.0.0./i
));
LoadJsState
=
"loadingA"
;
if
(
!
window
.
WebSocket
&&
window
.
MozWebSocket
)
window
.
WebSocket
=
window
.
MozWebSocket
;
//ws方式速度快(小于200ms)且可避免CORS错误,但要求Lodop版本足够新:
try
{
var
WSK1
=
new
WebSocket
(
URL_WS1
);
WSK1
.
onopen
=
function
(
e
)
{
setTimeout
(
"checkOrTryHttp();"
,
200
);
}
WSK1
.
onmessage
=
function
(
e
)
{
if
(
!
window
.
getCLodop
)
eval
(
e
.
data
);}
WSK1
.
onerror
=
function
(
e
)
{
var
WSK2
=
new
WebSocket
(
URL_WS2
);
WSK2
.
onopen
=
function
(
e
)
{
setTimeout
(
"checkOrTryHttp();"
,
200
);}
WSK2
.
onmessage
=
function
(
e
)
{
if
(
!
window
.
getCLodop
)
eval
(
e
.
data
);}
WSK2
.
onerror
=
function
(
e
)
{
checkOrTryHttp
();}
}
}
catch
(
e
){
checkOrTryHttp
();
}
})();
//==获取LODOP对象主过程,判断是否安装、需否升级:==
function
getLodop
(
oOBJECT
,
oEMBED
)
{
var
strFontTag
=
"<br><font color='#FF00FF'>打印控件"
;
var
strLodopInstall
=
strFontTag
+
"未安装!点击这里<a href='install_lodop32.zip' target='_self'>执行安装</a>"
;
var
strLodopUpdate
=
strFontTag
+
"需要升级!点击这里<a href='install_lodop32.zip' target='_self'>执行升级</a>"
;
var
strLodop64Install
=
strFontTag
+
"未安装!点击这里<a href='install_lodop64.zip' target='_self'>执行安装</a>"
;
var
strLodop64Update
=
strFontTag
+
"需要升级!点击这里<a href='install_lodop64.zip' target='_self'>执行升级</a>"
;
var
strCLodopInstallA
=
"<br><font color='#FF00FF'>Web打印服务CLodop未安装启动,点击这里<a href='"
+
projectName
+
"/common/file/CLodop_Setup_for_Win64NT_6.571EN.zip' target='_self'>下载执行安装</a>"
;
var
strCLodopInstallB
=
"<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)"
;
var
strCLodopUpdate
=
"<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.zip' target='_self'>执行升级</a>"
;
var
strLodop7FontTag
=
"<br><font color='#FF00FF'>Web打印服务Lodop7"
;
var
strLodop7HrefX86
=
"点击这里<a href='Lodop7_Linux_X86_64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)"
;
var
strLodop7HrefARM
=
"点击这里<a href='Lodop7_Linux_ARM64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)"
;
var
strLodop7Install_X86
=
strLodop7FontTag
+
"未安装启动,"
+
strLodop7HrefX86
;
var
strLodop7Install_ARM
=
strLodop7FontTag
+
"未安装启动,"
+
strLodop7HrefARM
;
var
strLodop7Update_X86
=
strLodop7FontTag
+
"需升级,"
+
strLodop7HrefX86
;
var
strLodop7Update_ARM
=
strLodop7FontTag
+
"需升级,"
+
strLodop7HrefARM
;
var
strInstallOK
=
",成功后请刷新本页面或重启浏览器。</font>"
;
var
LODOP
;
try
{
var
isWinIE
=
(
/MSIE/i
.
test
(
navigator
.
userAgent
))
||
(
/Trident/i
.
test
(
navigator
.
userAgent
));
var
isWinIE64
=
isWinIE
&&
(
/x64/i
.
test
(
navigator
.
userAgent
));
var
isLinuxX86
=
(
/Linux/i
.
test
(
navigator
.
platform
))
&&
(
/x86/i
.
test
(
navigator
.
platform
));
var
isLinuxARM
=
(
/Linux/i
.
test
(
navigator
.
platform
))
&&
(
/aarch/i
.
test
(
navigator
.
platform
));
if
(
needCLodop
()
||
isLinuxX86
||
isLinuxARM
)
{
try
{
LODOP
=
window
.
getCLodop
();
}
catch
(
err
)
{}
if
(
!
LODOP
&&
LoadJsState
!==
"complete"
)
{
if
(
!
LoadJsState
)
alert
(
"未曾加载Lodop主JS文件,请先调用loadCLodop过程."
);
else
alert
(
"网页还没下载完毕,请稍等一下再操作."
);
return
;
}
var
strAlertMessage
;
if
(
!
LODOP
)
{
if
(
isLinuxX86
)
strAlertMessage
=
strLodop7Install_X86
;
else
if
(
isLinuxARM
)
strAlertMessage
=
strLodop7Install_ARM
;
else
strAlertMessage
=
strCLodopInstallA
+
(
CLodopIsLocal
?
strCLodopInstallB
:
""
);
document
.
body
.
innerHTML
=
strAlertMessage
+
strInstallOK
+
document
.
body
.
innerHTML
;
return
;
}
else
{
if
(
isLinuxX86
&&
LODOP
.
CVERSION
<
"7.0.4.3"
)
strAlertMessage
=
strLodop7Update_X86
;
else
if
(
isLinuxARM
&&
LODOP
.
CVERSION
<
"7.0.4.3"
)
strAlertMessage
=
strLodop7Update_ARM
;
else
if
(
CLODOP
.
CVERSION
<
"6.5.6.7"
)
strAlertMessage
=
strCLodopUpdate
;
if
(
strAlertMessage
)
document
.
body
.
innerHTML
=
strAlertMessage
+
strInstallOK
+
document
.
body
.
innerHTML
;
}
}
else
{
//==如果页面有Lodop插件就直接使用,否则新建:==
if
(
oOBJECT
||
oEMBED
)
{
if
(
isWinIE
)
LODOP
=
oOBJECT
;
else
LODOP
=
oEMBED
;
}
else
if
(
!
CreatedOKLodopObject
)
{
LODOP
=
document
.
createElement
(
"object"
);
LODOP
.
setAttribute
(
"width"
,
0
);
LODOP
.
setAttribute
(
"height"
,
0
);
LODOP
.
setAttribute
(
"style"
,
"position:absolute;left:0px;top:-100px;width:0px;height:0px;"
);
if
(
isWinIE
)
LODOP
.
setAttribute
(
"classid"
,
"clsid:2105C259-1E0C-4534-8141-A753534CB4CA"
);
else
LODOP
.
setAttribute
(
"type"
,
"application/x-print-lodop"
);
document
.
documentElement
.
appendChild
(
LODOP
);
CreatedOKLodopObject
=
LODOP
;
}
else
LODOP
=
CreatedOKLodopObject
;
//==Lodop插件未安装时提示下载地址:==
if
((
!
LODOP
)
||
(
!
LODOP
.
VERSION
))
{
document
.
body
.
innerHTML
=
(
isWinIE64
?
strLodop64Install
:
strLodopInstall
)
+
strInstallOK
+
document
.
body
.
innerHTML
;
return
LODOP
;
}
if
(
LODOP
.
VERSION
<
"6.2.2.6"
)
{
document
.
body
.
innerHTML
=
(
isWinIE64
?
strLodop64Update
:
strLodopUpdate
)
+
strInstallOK
+
document
.
body
.
innerHTML
;
}
}
//===如下空白位置适合调用统一功能(如注册语句、语言选择等):=======================
LODOP
.
SET_LICENSES
(
""
,
"13528A153BAEE3A0254B9507DCDE2839"
,
"EDE92F75B6A3D917F65910"
,
"D60BC84D7CF2DE18156A6F88987304CB6D8"
);
//===============================================================================
return
LODOP
;
}
catch
(
err
)
{
alert
(
"getLodop出错:"
+
err
);
}
}
src/main/webapp/static/common/js/jeeplus.js
View file @
a220dfb9
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
$
(
list
+
idx
).
find
(
"select"
).
each
(
function
(){
$
(
this
).
val
(
$
(
this
).
attr
(
"data-value"
));
});
$
(
list
+
idx
).
find
(
"input[type='checkbox'], input[type='radio']"
).
each
(
function
(){
var
ss
=
$
(
this
).
attr
(
"data-value"
).
split
(
','
);
for
(
var
i
=
0
;
i
<
ss
.
length
;
i
++
){
if
(
$
(
this
).
val
()
==
ss
[
i
]){
$
(
this
).
attr
(
"checked"
,
"checked"
);
}
}
});
$
(
list
+
idx
).
find
(
".form_datetime"
).
each
(
function
(){
$
(
this
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
}
function
delRow
(
obj
,
prefix
){
var
id
=
$
(
prefix
+
"_id"
);
var
delFlag
=
$
(
prefix
+
"_delFlag"
);
if
(
id
.
val
()
==
""
){
$
(
obj
).
parent
().
parent
().
remove
();
}
else
if
(
delFlag
.
val
()
==
"0"
){
delFlag
.
val
(
"1"
);
$
(
obj
).
html
(
"÷"
).
attr
(
"title"
,
"撤销删除"
);
$
(
obj
).
parent
().
parent
().
addClass
(
"error"
);
}
else
if
(
delFlag
.
val
()
==
"1"
){
delFlag
.
val
(
"0"
);
$
(
obj
).
html
(
"×"
).
attr
(
"title"
,
"删除"
);
$
(
obj
).
parent
().
parent
().
removeClass
(
"error"
);
}
}
/**
* 工具组件 对原有的工具进行封装,自定义某方法统一处理
*
...
...
@@ -226,7 +261,34 @@
}
});
},
/**货架选择框**/
openShelvesSelectDialog
:
function
(
yesFuc
){
top
.
layer
.
open
({
type
:
2
,
area
:
[
'900px'
,
'560px'
],
title
:
"选择货架"
,
auto
:
true
,
maxmin
:
true
,
//开启最大化最小化按钮
content
:
ctx
+
"/warehouse/shelves/shelves/shelvesSelect"
,
btn
:
[
'确定'
,
'关闭'
],
yes
:
function
(
index
,
layero
){
var
ids
=
layero
.
find
(
"iframe"
)[
0
].
contentWindow
.
getIdSelections
();
var
names
=
layero
.
find
(
"iframe"
)[
0
].
contentWindow
.
getNameSelections
();
if
(
ids
.
length
==
0
){
jp
.
warning
(
"请选择至少一个货架!"
);
return
;
}
// 执行保存
yesFuc
(
ids
.
join
(
","
),
names
.
join
(
","
));
top
.
layer
.
close
(
index
);
},
cancel
:
function
(
index
){
//取消默认为空,如需要请自行扩展。
top
.
layer
.
close
(
index
);
}
});
},
/**角色选择框**/
openRoleSelectDialog
:
function
(
isMultiSelect
,
yesFuc
){
var
url
=
ctx
+
"/sys/role/data"
;
...
...
@@ -261,6 +323,41 @@
}
});
},
openStorageSelectDialog
:
function
(
isMultiSelect
,
yesFuc
){
var
url
=
ctx
+
"/warehouse/storage/storage/findByPcTypeModel"
;
var
fieldLabels
=
"名称|类型"
;
var
fieldKeys
=
"name|type.name"
;
var
searchLabels
=
"名称|类型"
;
var
searchKeys
=
"goodsInfo.name|goodsInfo.type"
;
top
.
layer
.
open
({
type
:
2
,
area
:
[
'800px'
,
'500px'
],
title
:
"选择入库明细"
,
auto
:
true
,
name
:
'friend'
,
content
:
ctx
+
"/tag/gridselect?url="
+
encodeURIComponent
(
url
)
+
"&fieldLabels="
+
encodeURIComponent
(
fieldLabels
)
+
"&fieldKeys="
+
encodeURIComponent
(
fieldKeys
)
+
"&searchLabels="
+
encodeURIComponent
(
searchLabels
)
+
"&searchKeys="
+
encodeURIComponent
(
searchKeys
)
+
"&isMultiSelected="
+
isMultiSelect
,
btn
:
[
'确定'
,
'关闭'
],
yes
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
].
contentWindow
;
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
var
items
=
iframeWin
.
getSelections
();
if
(
items
==
""
){
jp
.
warning
(
"必须选择一条数据!"
);
return
;
}
var
ids
=
[];
var
names
=
[];
for
(
var
i
=
0
;
i
<
items
.
length
;
i
++
){
var
item
=
items
[
i
];
ids
.
push
(
item
.
id
);
names
.
push
(
item
.
enname
)
}
yesFuc
(
ids
.
join
(
","
),
names
.
join
(
","
));
top
.
layer
.
close
(
index
);
//关闭对话框。
},
cancel
:
function
(
index
){
}
});
},
dateFormat
:
function
(
timestamp
,
format
)
{
var
_this
=
new
Date
(
timestamp
);
var
o
=
{
...
...
src/main/webapp/static/plugin/bootstrapTable/bootstrap-table.min.css
0 → 100644
View file @
a220dfb9
/**
* bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)
*
* @version v1.18.3
* @homepage https://bootstrap-table.com
* @author wenzhixin <wenzhixin2010@gmail.com> (http://wenzhixin.net.cn/)
* @license MIT
*/
.bootstrap-table
.fixed-table-toolbar
::after
{
content
:
""
;
display
:
block
;
clear
:
both
}
.bootstrap-table
.fixed-table-toolbar
.bs-bars
,
.bootstrap-table
.fixed-table-toolbar
.columns
,
.bootstrap-table
.fixed-table-toolbar
.search
{
position
:
relative
;
margin-top
:
10px
;
margin-bottom
:
10px
}
.bootstrap-table
.fixed-table-toolbar
.columns
.btn-group
>
.btn-group
{
display
:
inline-block
;
margin-left
:
-1px
!important
}
.bootstrap-table
.fixed-table-toolbar
.columns
.btn-group
>
.btn-group
>
.btn
{
border-radius
:
0
}
.bootstrap-table
.fixed-table-toolbar
.columns
.btn-group
>
.btn-group
:first-child
>
.btn
{
border-top-left-radius
:
4px
;
border-bottom-left-radius
:
4px
}
.bootstrap-table
.fixed-table-toolbar
.columns
.btn-group
>
.btn-group
:last-child
>
.btn
{
border-top-right-radius
:
4px
;
border-bottom-right-radius
:
4px
}
.bootstrap-table
.fixed-table-toolbar
.columns
.dropdown-menu
{
text-align
:
left
;
max-height
:
300px
;
overflow
:
auto
;
-ms-overflow-style
:
scrollbar
;
z-index
:
1001
}
.bootstrap-table
.fixed-table-toolbar
.columns
label
{
display
:
block
;
padding
:
3px
20px
;
clear
:
both
;
font-weight
:
400
;
line-height
:
1.428571429
}
.bootstrap-table
.fixed-table-toolbar
.columns-left
{
margin-right
:
5px
}
.bootstrap-table
.fixed-table-toolbar
.columns-right
{
margin-left
:
5px
}
.bootstrap-table
.fixed-table-toolbar
.pull-right
.dropdown-menu
{
right
:
0
;
left
:
auto
}
.bootstrap-table
.fixed-table-container
{
position
:
relative
;
clear
:
both
}
.bootstrap-table
.fixed-table-container
.table
{
width
:
100%
;
margin-bottom
:
0
!important
}
.bootstrap-table
.fixed-table-container
.table
td
,
.bootstrap-table
.fixed-table-container
.table
th
{
vertical-align
:
middle
;
box-sizing
:
border-box
}
.bootstrap-table
.fixed-table-container
.table
thead
th
{
vertical-align
:
bottom
;
padding
:
0
;
margin
:
0
}
.bootstrap-table
.fixed-table-container
.table
thead
th
:focus
{
outline
:
0
solid
transparent
}
.bootstrap-table
.fixed-table-container
.table
thead
th
.detail
{
width
:
30px
}
.bootstrap-table
.fixed-table-container
.table
thead
th
.th-inner
{
padding
:
.75rem
;
vertical-align
:
bottom
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
}
.bootstrap-table
.fixed-table-container
.table
thead
th
.sortable
{
cursor
:
pointer
;
background-position
:
right
;
background-repeat
:
no-repeat
;
padding-right
:
30px
!important
}
.bootstrap-table
.fixed-table-container
.table
thead
th
.both
{
background-image
:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC")
}
.bootstrap-table
.fixed-table-container
.table
thead
th
.asc
{
background-image
:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==")
}
.bootstrap-table
.fixed-table-container
.table
thead
th
.desc
{
background-image
:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ")
}
.bootstrap-table
.fixed-table-container
.table
tbody
tr
.selected
td
{
background-color
:
rgba
(
0
,
0
,
0
,
.075
)}
.bootstrap-table
.fixed-table-container
.table
tbody
tr
.no-records-found
td
{
text-align
:
center
}
.bootstrap-table
.fixed-table-container
.table
tbody
tr
.card-view
{
display
:
flex
}
.bootstrap-table
.fixed-table-container
.table
tbody
tr
.card-view
.card-view-title
{
font-weight
:
700
;
display
:
inline-block
;
min-width
:
30%
;
width
:
auto
!important
;
text-align
:
left
!important
}
.bootstrap-table
.fixed-table-container
.table
tbody
tr
.card-view
.card-view-value
{
width
:
100%
!important
}
.bootstrap-table
.fixed-table-container
.table
.bs-checkbox
{
text-align
:
center
}
.bootstrap-table
.fixed-table-container
.table
.bs-checkbox
label
{
margin-bottom
:
0
}
.bootstrap-table
.fixed-table-container
.table
.bs-checkbox
label
input
[
type
=
checkbox
],
.bootstrap-table
.fixed-table-container
.table
.bs-checkbox
label
input
[
type
=
radio
]
{
margin
:
0
auto
!important
}
.bootstrap-table
.fixed-table-container
.table.table-sm
.th-inner
{
padding
:
.3rem
}
.bootstrap-table
.fixed-table-container.fixed-height
:not
(
.has-footer
)
{
border-bottom
:
1px
solid
#dee2e6
}
.bootstrap-table
.fixed-table-container.fixed-height.has-card-view
{
border-top
:
1px
solid
#dee2e6
;
border-bottom
:
1px
solid
#dee2e6
}
.bootstrap-table
.fixed-table-container.fixed-height
.fixed-table-border
{
border-left
:
1px
solid
#dee2e6
;
border-right
:
1px
solid
#dee2e6
}
.bootstrap-table
.fixed-table-container.fixed-height
.table
thead
th
{
border-bottom
:
1px
solid
#dee2e6
}
.bootstrap-table
.fixed-table-container.fixed-height
.table-dark
thead
th
{
border-bottom
:
1px
solid
#32383e
}
.bootstrap-table
.fixed-table-container
.fixed-table-header
{
overflow
:
hidden
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
{
overflow-x
:
auto
;
overflow-y
:
auto
;
height
:
100%
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
{
align-items
:
center
;
background
:
#fff
;
display
:
flex
;
justify-content
:
center
;
position
:
absolute
;
bottom
:
0
;
width
:
100%
;
z-index
:
1000
;
transition
:
visibility
0s
,
opacity
.15s
ease-in-out
;
opacity
:
0
;
visibility
:
hidden
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading.open
{
visibility
:
visible
;
opacity
:
1
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
{
align-items
:
baseline
;
display
:
flex
;
justify-content
:
center
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
.loading-text
{
margin-right
:
6px
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
.animation-wrap
{
align-items
:
center
;
display
:
flex
;
justify-content
:
center
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
.animation-dot
,
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
.animation-wrap
::after
,
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
.animation-wrap
::before
{
content
:
""
;
animation-duration
:
1.5s
;
animation-iteration-count
:
infinite
;
animation-name
:
LOADING
;
background
:
#212529
;
border-radius
:
50%
;
display
:
block
;
height
:
5px
;
margin
:
0
4px
;
opacity
:
0
;
width
:
5px
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
.animation-dot
{
animation-delay
:
.3s
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading
.loading-wrap
.animation-wrap
::after
{
animation-delay
:
.6s
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading.table-dark
{
background
:
#212529
}
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading.table-dark
.animation-dot
,
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading.table-dark
.animation-wrap
::after
,
.bootstrap-table
.fixed-table-container
.fixed-table-body
.fixed-table-loading.table-dark
.animation-wrap
::before
{
background
:
#fff
}
.bootstrap-table
.fixed-table-container
.fixed-table-footer
{
overflow
:
hidden
}
.bootstrap-table
.fixed-table-pagination
::after
{
content
:
""
;
display
:
block
;
clear
:
both
}
.bootstrap-table
.fixed-table-pagination
>
.pagination
,
.bootstrap-table
.fixed-table-pagination
>
.pagination-detail
{
margin-top
:
10px
;
margin-bottom
:
10px
}
.bootstrap-table
.fixed-table-pagination
>
.pagination-detail
.pagination-info
{
line-height
:
34px
;
margin-right
:
5px
}
.bootstrap-table
.fixed-table-pagination
>
.pagination-detail
.page-list
{
display
:
inline-block
}
.bootstrap-table
.fixed-table-pagination
>
.pagination-detail
.page-list
.btn-group
{
position
:
relative
;
display
:
inline-block
;
vertical-align
:
middle
}
.bootstrap-table
.fixed-table-pagination
>
.pagination-detail
.page-list
.btn-group
.dropdown-menu
{
margin-bottom
:
0
}
.bootstrap-table
.fixed-table-pagination
>
.pagination
ul
.pagination
{
margin
:
0
}
.bootstrap-table
.fixed-table-pagination
>
.pagination
ul
.pagination
li
.page-intermediate
a
{
color
:
#c8c8c8
}
.bootstrap-table
.fixed-table-pagination
>
.pagination
ul
.pagination
li
.page-intermediate
a
::before
{
content
:
'\2B05'
}
.bootstrap-table
.fixed-table-pagination
>
.pagination
ul
.pagination
li
.page-intermediate
a
::after
{
content
:
'\27A1'
}
.bootstrap-table
.fixed-table-pagination
>
.pagination
ul
.pagination
li
.disabled
a
{
pointer-events
:
none
;
cursor
:
default
}
.bootstrap-table.fullscreen
{
position
:
fixed
;
top
:
0
;
left
:
0
;
z-index
:
1050
;
width
:
100%
!important
;
background
:
#fff
;
height
:
calc
(
100vh
);
overflow-y
:
scroll
}
.bootstrap-table.bootstrap4
.pagination-lg
.page-link
,
.bootstrap-table.bootstrap5
.pagination-lg
.page-link
{
padding
:
.5rem
1rem
}
.bootstrap-table.bootstrap5
.float-left
{
float
:
left
}
.bootstrap-table.bootstrap5
.float-right
{
float
:
right
}
div
.fixed-table-scroll-inner
{
width
:
100%
;
height
:
200px
}
div
.fixed-table-scroll-outer
{
top
:
0
;
left
:
0
;
visibility
:
hidden
;
width
:
200px
;
height
:
150px
;
overflow
:
hidden
}
@keyframes
LOADING
{
0
%
{
opacity
:
0
}
50
%
{
opacity
:
1
}
to
{
opacity
:
0
}}
\ No newline at end of file
src/main/webapp/static/plugin/bootstrapTable/bootstrap-table.min.js
0 → 100644
View file @
a220dfb9
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/webapp/webpage/include/taglib.jsp
View file @
a220dfb9
...
...
@@ -10,3 +10,4 @@
<%@ taglib prefix="t" uri="/menu-tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}${fns:getAdminPath()}"/>
<c:set var="ctxStatic" value="${pageContext.request.contextPath}/static"/>
<c:set var="ctxPath" value="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}"/>
\ No newline at end of file
src/main/webapp/webpage/modules/common/gridselect.jsp
View file @
a220dfb9
...
...
@@ -100,10 +100,25 @@ $(document).ready(function() {
<div
class=
"accordion-inner"
>
<form
id=
"searchForm"
class=
"form form-horizontal well clearfix"
>
<c:forEach
items=
"${searchLabels}"
var=
"name"
varStatus=
"status"
>
<c:choose>
<c:when
test=
"${fn:contains('goodsInfo.type', searchKeys[status.index])}"
>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"类型名:"
>
${searchLabels[status.index]}
</label>
<sys:treeselect
id=
"type"
name=
"goodsInfo.type.id"
value=
""
labelName=
"goodsInfo.type.name"
labelValue=
""
title=
"类型"
url=
"/warehouse/materialtype/materialType/treeData"
cssClass=
"form-control "
allowClear=
"true"
allowSearch=
"true"
callback=
"onSelectType"
/>
</div>
</c:when>
<c:otherwise>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"类型名:"
>
${searchLabels[status.index]}
</label>
<input
name=
"${searchKeys[status.index]}"
maxlength=
"64"
class=
" form-control"
/>
</div>
</c:otherwise>
</c:choose>
</c:forEach>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<div
style=
"margin-top:26px"
>
...
...
src/main/webapp/webpage/modules/common/shelvesSelect.jsp
0 → 100644
View file @
a220dfb9
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
货架选择
</title>
<meta
name=
"decorator"
content=
"ani"
/>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
//bootstrap treeview初始化
$
(
'#jstree'
).
jstree
({
'core'
:
{
"multiple"
:
false
,
"animation"
:
0
,
"themes"
:
{
"variant"
:
"large"
,
"icons"
:
true
,
"stripes"
:
true
},
'data'
:
function
(
obj
,
callback
)
{
jp
.
get
(
'${ctx}/warehouse/warehouse/warehouse/data?pageNo=1&pageSize=1000'
,
function
(
res
){
if
(
res
.
rows
){
callback
.
call
(
this
,
res
.
rows
.
map
(
function
(
item
){
return
{
id
:
item
.
id
,
text
:
item
.
name
,
}
}));
}
})
}
},
"conditionalselect"
:
function
(
node
,
event
)
{
return
false
;
},
'plugins'
:
[
'types'
,
'wholerow'
],
"types"
:{
'default'
:
{
'icon'
:
'fa fa-folder'
},
'1'
:
{
'icon'
:
'fa fa-home'
},
'2'
:
{
'icon'
:
'fa fa-umbrella'
},
'3'
:
{
'icon'
:
'fa fa-group'
},
'4'
:
{
'icon'
:
'fa fa-file-text-o'
}
}
}).
bind
(
"activate_node.jstree"
,
function
(
obj
,
e
)
{
// 处理代码
// 获取当前节点
var
treeNode
=
e
.
node
;
var
id
=
treeNode
.
id
==
'0'
?
''
:
treeNode
.
id
;
if
(
treeNode
.
level
==
0
){
//level=0 代表公司
$
(
"#companyId"
).
val
(
id
);
$
(
"#officeId"
).
val
(
""
);
}
else
{
$
(
"#companyId"
).
val
(
""
);
$
(
"#officeId"
).
val
(
id
);
}
$
(
'#table'
).
bootstrapTable
(
'refresh'
);
}).
on
(
'loaded.jstree'
,
function
()
{
$
(
"#jstree"
).
jstree
(
'open_all'
);
});
//初始化表格
$
(
'#table'
).
bootstrapTable
({
//请求方法
method
:
'post'
,
//类型json
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
//是否显示行间隔色
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
//是否显示分页(*)
pagination
:
true
,
//排序方式
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
pageNumber
:
1
,
//每页的记录行数(*)
pageSize
:
5
,
//可供选择的每页的行数(*)
pageList
:
[
5
,
10
,
'ALL'
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/shelves/shelves/data"
,
//默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
//queryParamsType:'',
////查询参数,每次调用是会带上这个参数,可自定义
queryParams
:
function
(
params
)
{
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
params
.
limit
===
undefined
?
"1"
:
params
.
offset
/
params
.
limit
+
1
;
searchParam
.
pageSize
=
params
.
limit
===
undefined
?
-
1
:
params
.
limit
;
searchParam
.
orderBy
=
params
.
sort
===
undefined
?
""
:
params
.
sort
+
" "
+
params
.
order
;
return
searchParam
;
},
//分页方式:client客户端分页,server服务端分页(*)
sidePagination
:
"server"
,
onClickRow
:
function
(
row
,
$el
){
},
columns
:
[{
<
c
:
if
test
=
"${isMultiSelect}"
>
checkbox
:
true
<
/c:if
>
<
c
:
if
test
=
"${!isMultiSelect}"
>
radio
:
true
<
/c:if
>
},
{
field
:
'name'
,
title
:
'货架名称'
,
},
{
field
:
'number'
,
title
:
'货架编号'
,
},
{
field
:
'warehouse.name'
,
title
:
'仓库'
,
}]
});
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端,默认关闭tab
$
(
'#table'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#table'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#table'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#edit'
).
prop
(
'disabled'
,
$
(
'#table'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
});
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#table'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
zTreeObj
.
cancelSelectedNode
();
$
(
'#table'
).
bootstrapTable
(
'refresh'
);
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#table"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
});
}
function
getNameSelections
()
{
return
$
.
map
(
$
(
"#table"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
name
});
}
function
getLoginNameSelections
()
{
return
$
.
map
(
$
(
"#table"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
loginName
});
}
function
getSelections
()
{
return
$
.
map
(
$
(
"#table"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
});
}
</script>
</head>
<body
class=
"bg-white"
>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"col-sm-3 col-md-2"
>
<div
id=
"jstree"
></div>
</div>
<div
class=
"col-sm-9 col-md-10 animated fadeInRight"
>
<!-- 搜索框-->
<div
class=
"accordion-group"
>
<div
id=
"collapseTwo"
class=
"accordion-body"
>
<div
class=
"accordion-inner"
>
<form
id=
"searchForm"
class=
"form form-horizontal well clearfix"
>
<input
type=
"hidden"
id=
"companyId"
name=
"company.id"
/>
<input
type=
"hidden"
id=
"officeId"
name=
"office.id"
/>
<div
class=
"col-sm-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"货架名称:"
>
货架名称:
</label>
<input
type=
"text"
name=
"name"
maxlength=
"100"
class=
" form-control"
/>
</div>
<div
class=
"col-sm-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"货架编号:"
>
货架编号:
</label>
<input
type=
"text"
name=
"number"
maxlength=
"100"
class=
" form-control"
/>
</div>
<div
class=
"col-sm-4"
>
<div
style=
"margin-top:26px"
>
<a
id=
"search"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-search"
></i>
查询
</a>
<a
id=
"reset"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-refresh"
></i>
重置
</a>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- 搜索框结束 -->
<!-- 表格 -->
<table
id=
"table"
data-toolbar=
"#toolbar"
data-minimum-count-columns=
"2"
data-id-field=
"id"
>
</table>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/goods/goodsDetail.jsp
0 → 100644
View file @
a220dfb9
<%--
Created by IntelliJ IDEA.
User: yangzi
Date: 2023/2/21
Time: 10:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<div id="toolbar">
<a class="btn btn-primary btn-sm pull-left" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 新增</a>
</div>
<table id="detail_table" data-toolbar="#toolbar"></table>
<script>
var selector = "#detail_table";
function initTable(){
var data = ${fns:toJson(goods.goodsInfoList)};
$(selector).bootstrapTable({
data: data,
columns:[
{
field: 'no',
title: '序号',
align: 'center',
width: 60,
formatter: function (value, row, index){
var tpl = $("#hideTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
var html = Mustache.render(tpl, {
idx: index,
row: row
})
return html + '<span>'+(index+1)+'</span>'
}
},
{
field: 'name',
title: '名称',
formatter: function (value,row,index){
return Mustache.render($("#nameTpl").html(),{
row: row,
idx: index
})
}
},
{
field: 'type.name',
title: '类型',
formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'model',
title: '型号',
formatter: function (value,row,index){
return Mustache.render($("#modelTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'num',
title: '数量',
formatter: function (value,row,index){
return Mustache.render($("#numTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'remarks',
title: '备注',
formatter: function (value,row,index){
return Mustache.render($("#remarksTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: '',
title: '操作',
formatter: function (value,row,index){
var text = row.delFlag == 1 ? '撤销删除' : '删除';
var result = ["<a href='javascript:void(0);' onclick=\"removeRow(" + index + ", '" + row.id + "', '" + row.delFlag + "')\">"+text+"</a>" ]
return result.join('');
}
}
]
})
}
function addDetail(selector){
var row = {
id: '',
delFlag: 0,
name: '',
type: {
id: '',
name: ''
},
model: '',
num: '',
remarks: ''
}
$(selector).bootstrapTable('append', [
row
])
}
function removeRow(index, rowId, rowDelFlag){
if(rowId){
var delFlag = rowDelFlag === 1 ? 0 : 1
updateRow(index, {
delFlag: delFlag
})
}else{
$(selector).bootstrapTable("remove", {
field: '$index',
values: [index]
})
}
}
function updateRow(index, row){
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
function onInputChange(rowIndex, elem , field){
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function (){
updateRow(rowIndex, obj)
}, 0)
}
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
var obj = {
type: {
id: node.id,
name: node.text
}
};
updateRow(rowIndex, obj)
}
}
</script>
<script id="hideTpl" type="text/html">
<input id="goodsInfoList{{idx}}_id" name="goodsInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input id="goodsInfoList{{idx}}_delFlag" name="goodsInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
</script>
<script id="nameTpl" type="text/html">
<input id="goodsInfoList{{idx}}_name" name="goodsInfoList[{{idx}}].name" type="text" value="{{row.name}}" onchange="onInputChange('{{idx}}', this, 'name')" class="form-control "/>
</script>
<script id="typeTpl" type="text/html">//<!--
<sys:treeselect id="goodsInfoList{{idx}}_type" name="goodsInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="goodsInfoList{{idx}}.type.code" labelValue="{{row.type.name}}"
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control" allowClear="true" allowSearch="true" callback="onSelectType" />//-->
</script>
<script id="modelTpl" type="text/html">
<input id="goodsInfoList{{idx}}_model" name="goodsInfoList[{{idx}}].model" type="text" value="{{row.model}}" onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="numTpl" type="text/html">
<input id="goodsInfoList{{idx}}_num" name="goodsInfoList[{{idx}}].num" type="text" value="{{row.num}}" onchange="onInputChange('{{idx}}', this, 'num')" class="form-control "/>
</script>
<script id="remarksTpl" type="text/html">
<textarea id="goodsInfoList{{idx}}_remarks" name="goodsInfoList[{{idx}}].remarks" rows="4" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/goods/goodsForm.jsp
View file @
a220dfb9
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
货品模块管理
</title>
<meta
name=
"decorator"
content=
"ani"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
jp
.
go
(
"${ctx}/warehouse/goods/goods"
);
}
else
{
jp
.
error
(
data
.
msg
);
$
(
"#inputForm"
).
find
(
"button:submit"
).
button
(
"reset"
);
}
});
$
(
'#time'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
$
(
list
+
idx
).
find
(
"select"
).
each
(
function
(){
$
(
this
).
val
(
$
(
this
).
attr
(
"data-value"
));
});
$
(
list
+
idx
).
find
(
"input[type='checkbox'], input[type='radio']"
).
each
(
function
(){
var
ss
=
$
(
this
).
attr
(
"data-value"
).
split
(
','
);
for
(
var
i
=
0
;
i
<
ss
.
length
;
i
++
){
if
(
$
(
this
).
val
()
==
ss
[
i
]){
$
(
this
).
attr
(
"checked"
,
"checked"
);
}
}
});
$
(
list
+
idx
).
find
(
".form_datetime"
).
each
(
function
(){
$
(
this
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
}
function
delRow
(
obj
,
prefix
){
var
id
=
$
(
prefix
+
"_id"
);
var
delFlag
=
$
(
prefix
+
"_delFlag"
);
if
(
id
.
val
()
==
""
){
$
(
obj
).
parent
().
parent
().
remove
();
}
else
if
(
delFlag
.
val
()
==
"0"
){
delFlag
.
val
(
"1"
);
$
(
obj
).
html
(
"÷"
).
attr
(
"title"
,
"撤销删除"
);
$
(
obj
).
parent
().
parent
().
addClass
(
"error"
);
}
else
if
(
delFlag
.
val
()
==
"1"
){
delFlag
.
val
(
"0"
);
$
(
obj
).
html
(
"×"
).
attr
(
"title"
,
"删除"
);
$
(
obj
).
parent
().
parent
().
removeClass
(
"error"
);
}
}
</script>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/common/css/form.css"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css"
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"
></script>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
<a
class=
"panelButton"
href=
"${ctx}/warehouse/goods/goods"
><i
class=
"ti-angle-left"
></i>
返回
</a>
</h3>
</div>
<div
class=
"panel-body"
>
<form:form
id=
"inputForm"
modelAttribute=
"goods"
action=
"${ctx}/warehouse/goods/goods/save"
method=
"post"
class=
"form-horizontal"
>
<form:form
id=
"inputForm"
modelAttribute=
"goods"
action=
"${ctx}/warehouse/goods/goods/save"
method=
"post"
class=
"form-horizontal"
>
<form:hidden
path=
"id"
/>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><font
color=
"red"
>
*
</font>
批次号:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"batchNum"
htmlEscape=
"false"
class=
"form-control required"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><font
color=
"red"
>
*
</font>
时间:
</label>
<div
class=
"col-sm-10"
>
<h3
class=
"text-center"
>
货品表
</h3>
<
%
--
<
div
class=
"header-buttons"
>
--%>
<
%
--
<
c:if
test=
"${mode == 'add' || mode=='edit'}"
>
--%>
<
%
--
<
div
class=
"form-group text-right"
>
--%>
<
%
--
<
button
class=
"btn btn-primary btn-parsley"
--
%
>
<
%
--
data-loading-text=
"正在提交..."
>
提 交--%>
<
%
--
</
button
>
--%>
<
%
--
</
div
>
--%>
<
%
--
</
c:if
>
--%>
<
%
--
</
div
>
--%>
<table
class=
"table-bordered table main-table"
>
<tr>
<td><font
color=
"red"
>
*
</font>
批次号
</td>
<td>
<form:input
path=
"batchNum"
htmlEscape=
"false"
readonly=
"true"
class=
"form-control required"
/>
</td>
<td><font
color=
"red"
>
*
</font>
时间
</td>
<td>
<div
class=
'input-group form_datetime'
id=
'time'
>
<input
type=
'text'
name=
"time"
class=
"form-control required"
value=
"<fmt:formatDate value="
${
goods
.
time
}"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
"/>
<input
type=
'text'
name=
"time"
class=
"form-control required"
value=
"<fmt:formatDate value="
${
goods
.
time
}"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
"/>
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><font
color=
"red"
>
*
</font>
操作人:
</label>
<div
class=
"col-sm-10"
>
<sys:userselect
id=
"operator"
name=
"operator.id"
value=
"${goods.operator.id}"
labelName=
"operator.name"
labelValue=
"${goods.operator.name}"
cssClass=
"form-control required"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
备注信息:
</label>
<div
class=
"col-sm-10"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</div>
</div>
<div
class=
"tabs-container"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
data-toggle=
"tab"
href=
"#tab-1"
aria-expanded=
"true"
>
货品明细:
</a>
</li>
</ul>
<div
class=
"tab-content"
>
<div
id=
"tab-1"
class=
"tab-pane fade in active"
>
<a
class=
"btn btn-white btn-sm"
onclick=
"addRow('#goodsInfoList', goodsInfoRowIdx, goodsInfoTpl);goodsInfoRowIdx = goodsInfoRowIdx + 1;"
title=
"新增"
><i
class=
"fa fa-plus"
></i>
新增
</a>
<table
class=
"table table-striped table-bordered table-condensed"
>
<thead>
<tr>
<th
class=
"hide"
></th>
<th>
名称
</th>
<th>
类型
</th>
<th>
型号
</th>
<th>
数量
</th>
<th>
备注信息
</th>
<th
width=
"10"
>
</th>
</tr>
</thead>
<tbody
id=
"goodsInfoList"
>
</tbody>
</table>
<script
type=
"text/template"
id=
"goodsInfoTpl"
>
//
<!--
<
tr
id
=
"goodsInfoList{{idx}}"
>
<
td
class
=
"hide"
>
<
input
id
=
"goodsInfoList{{idx}}_id"
name
=
"goodsInfoList[{{idx}}].id"
type
=
"hidden"
value
=
"{{row.id}}"
/>
<
input
id
=
"goodsInfoList{{idx}}_delFlag"
name
=
"goodsInfoList[{{idx}}].delFlag"
type
=
"hidden"
value
=
"0"
/>
<
/td
>
<
td
>
<
input
id
=
"goodsInfoList{{idx}}_name"
name
=
"goodsInfoList[{{idx}}].name"
type
=
"text"
value
=
"{{row.name}}"
class
=
"form-control "
/>
<
/td
>
<
td
>
<
sys
:
treeselect
id
=
"goodsInfoList{{idx}}_type"
name
=
"goodsInfoList[{{idx}}].type.id"
value
=
"{{row.type.id}}"
labelName
=
"goodsInfoList{{idx}}.type.code"
labelValue
=
"{{row.type.code}}"
title
=
"类型"
url
=
"/warehouse/materialtype/materialType/treeData"
cssClass
=
"form-control "
allowClear
=
"true"
/>
<
/td
>
<
td
>
<
input
id
=
"goodsInfoList{{idx}}_model"
name
=
"goodsInfoList[{{idx}}].model"
type
=
"text"
value
=
"{{row.model}}"
class
=
"form-control "
/>
</td>
</tr>
<tr>
<td><font
color=
"red"
>
*
</font>
操作人
</td>
<td>
<
input
id
=
"goodsInfoList{{idx}}_num"
name
=
"goodsInfoList[{{idx}}].num"
type
=
"text"
value
=
"{{row.num}}"
class
=
"form-control "
/>
<sys:userselect
id=
"operator"
name=
"operator.id"
value=
"${goods.operator.id}"
labelName=
"operator.name"
labelValue=
"${goods.operator.name}"
cssClass=
"form-control required"
disabled=
"disabled"
/>
</td>
<td>
备注
</td>
<td>
<
textarea
id
=
"goodsInfoList{{idx}}_remarks"
name
=
"goodsInfoList[{{idx}}].remarks"
rows
=
"4"
class
=
"form-control "
>
{{
row
.
remarks
}}
<
/textarea
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/
>
</td>
<
td
class
=
"text-center"
width
=
"10"
>
{{
#
delBtn
}}
<
span
class
=
"close"
onclick
=
"delRow(this, '#goodsInfoList{{idx}}')"
title
=
"删除"
>&
times
;
<
/span>{{/
delBtn
}}
</tr>
<tr>
<td
colspan=
"4"
>
<
%@
include
file=
"goodsDetail.jsp"
%
>
</td>
<
/tr>/
/-->
</script>
<script
type=
"text/javascript"
>
var
goodsInfoRowIdx
=
0
,
goodsInfoTpl
=
$
(
"#goodsInfoTpl"
).
html
().
replace
(
/
(\/\/
\<!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
$
(
document
).
ready
(
function
()
{
var
data
=
$
{
fns
:
toJson
(
goods
.
goodsInfoList
)};
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
){
addRow
(
'#goodsInfoList'
,
goodsInfoRowIdx
,
goodsInfoTpl
,
data
[
i
]);
goodsInfoRowIdx
=
goodsInfoRowIdx
+
1
;
}
});
</script>
</div>
</div>
</div>
<c:if
test=
"${mode == 'add' || mode=='edit'}"
>
<div
class=
"col-lg-3"
></div>
<div
class=
"col-lg-6"
>
<div
class=
"form-group text-center"
>
<div>
<button
class=
"btn btn-primary btn-block btn-lg btn-parsley"
data-loading-text=
"正在提交..."
>
提 交
</button>
</div>
</div>
</div>
</c:if>
</tr>
</table>
</form:form>
</div>
</div>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
initTable
(
"#detail_table"
);
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
)
{
if
(
data
.
success
)
{
jp
.
success
(
data
.
msg
);
jp
.
go
(
"${ctx}/warehouse/goods/goods"
);
}
else
{
jp
.
error
(
data
.
msg
);
$
(
"#inputForm"
).
find
(
"button:submit"
).
button
(
"reset"
);
}
});
$
(
'#time'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
save
()
{
var
isValidate
=
jp
.
validateForm
(
'#inputForm'
);
//校验表单
if
(
!
isValidate
){
return
false
;
}
else
{
jp
.
loading
();
jp
.
post
(
$
(
"#inputForm"
).
attr
(
'action'
),
$
(
'#inputForm'
).
serialize
(),
function
(
data
){
if
(
data
.
success
){
jp
.
getParent
().
refresh
();
var
dialogIndex
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
// 获取窗口索引
parent
.
layer
.
close
(
dialogIndex
);
jp
.
success
(
data
.
msg
)
}
else
{
jp
.
error
(
data
.
msg
);
}
})
}
}
</script>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
View file @
a220dfb9
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
var
LODOP
;
$
(
document
).
ready
(
function
()
{
$
(
'#goodsTable'
).
bootstrapTable
({
...
...
@@ -241,7 +242,7 @@ $(document).ready(function() {
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
go
(
"${ctx}/warehouse/goods/goods/form/add"
);
jp
.
openSaveDialog
(
'新增货品'
,
"${ctx}/warehouse/goods/goods/form/add"
,
'1200'
,
'800'
)
}
function
edit
(
id
){
...
...
@@ -283,6 +284,10 @@ $(document).ready(function() {
return
html
;
}
function
initLodop
(){
LODOP
=
getLodop
(
document
.
getElementById
(
'LODOP_OB'
),
document
.
getElementById
(
'LODOP_EM'
));
}
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
...
...
@@ -290,14 +295,37 @@ $(document).ready(function() {
}
function
printQr
(
id
)
{
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
r
)
{
console
.
log
(
r
)
jp
.
loading
(
'loading...'
);
initLodop
();
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
list
=
res
.
body
.
goodsInfo
.
qrCodeList
;
LODOP
.
PRINT_INIT
(
"打印货品"
);
LODOP
.
SET_PRINT_PAGESIZE
(
1
,
400
,
600
,
0
)
LODOP
.
SET_PRINT_MODE
(
"FULL_HEIGHT_FOR_OVERFLOW"
,
true
);
LODOP
.
SET_PRINT_MODE
(
"FULL_HEIGHT_FOR_OVERFLOW"
,
true
);
createAllPage
(
list
);
LODOP
.
PREVIEW
();
jp
.
close
();
})
}
function
createAllPage
(
list
){
if
(
!
list
){
return
;
}
list
.
forEach
(
function
(
item
){
LODOP
.
NewPage
();
var
imgUrl
=
"${ctxPath}/"
+
item
.
url
;
LODOP
.
ADD_PRINT_IMAGE
(
'0%'
,
"0%"
,
"100%"
,
"100%"
,
"<img border='0' src='"
+
imgUrl
+
"' />"
);
})
}
function
cleanQr
(
id
)
{
jp
.
get
(
"${ctx}/warehouse/goods/goods/cleanQr?goodsInfoId="
+
id
,
function
(
r
)
{
console
.
log
(
r
)
jp
.
confirm
(
'确认清除二维码吗?'
,
function
(){
jp
.
get
(
"${ctx}/warehouse/goods/goods/cleanQr?goodsInfoId="
+
id
,
function
(
res
)
{
res
.
success
&&
jp
.
success
(
'清除二维码成功!'
);
})
})
}
...
...
@@ -348,10 +376,10 @@ $(document).ready(function() {
{{
row
.
remarks
}}
<
/td
>
<
td
>
<
button
onclick
=
"printQr('{{row.id}}')"
>
<
button
class
=
"btn btn-primary btn-sm"
onclick
=
"printQr('{{row.id}}')"
>
打印二维码
<
/button
>
<
button
onclick
=
"cleanQr('{{row.id}}')"
>
<
button
class
=
"btn btn-danger btn-sm"
onclick
=
"cleanQr('{{row.id}}')"
>
清除二维码
<
/button
>
<
/td
>
...
...
src/main/webapp/webpage/modules/warehouse/goods/goodsList.jsp
View file @
a220dfb9
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
货品模块管理
</title>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
>
<meta
name=
"decorator"
content=
"ani"
/>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<
%@
include
file=
"goodsList.js"
%
>
<script>
var
projectName
=
"${ctxStatic}"
;
</script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/LodopFuncs.js"
></script>
<object
id=
"LODOP_OB"
classid=
"clsid:2105C259-1E0C-4534-8141-A753534CB4CA"
width=
0
height=
0
>
<embed
id=
"LODOP_EM"
type=
"application/x-print-lodop"
width=
0
height=
0
></embed>
</object>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
货品模块列表
</h3>
...
...
@@ -30,8 +37,8 @@
<label
class=
"label-item single-overflow pull-left"
title=
"时间:"
>
时间:
</label>
<div
class=
"col-xs-12"
>
<div
class=
"col-xs-12 col-sm-5"
>
<div
class=
'input-group date'
id=
'beginTime'
style=
"left: -10px;"
>
<input
type=
'text'
name=
"beginTime"
class=
"form-control"
/>
<div
class=
'input-group date'
id=
'beginTime'
style=
"left: -10px;"
>
<input
type=
'text'
name=
"beginTime"
class=
"form-control"
/>
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
...
...
@@ -41,8 +48,8 @@
~
</div>
<div
class=
"col-xs-12 col-sm-5"
>
<div
class=
'input-group date'
id=
'endTime'
style=
"left: -10px;"
>
<input
type=
'text'
name=
"endTime"
class=
"form-control"
/>
<div
class=
'input-group date'
id=
'endTime'
style=
"left: -10px;"
>
<input
type=
'text'
name=
"endTime"
class=
"form-control"
/>
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
...
...
@@ -53,13 +60,16 @@
</div>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"操作人:"
>
操作人:
</label>
<sys:userselect
id=
"operator"
name=
"operator.id"
value=
"${goods.operator.id}"
labelName=
"operator.name"
labelValue=
"${goods.operator.name}"
<sys:userselect
id=
"operator"
name=
"operator.id"
value=
"${goods.operator.id}"
labelName=
"operator.name"
labelValue=
"${goods.operator.name}"
cssClass=
"form-control required"
/>
</div>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<div
style=
"margin-top:26px"
>
<a
id=
"search"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-search"
></i>
查询
</a>
<a
id=
"reset"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-refresh"
></i>
重置
</a>
<a
id=
"search"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-search"
></i>
查询
</a>
<a
id=
"reset"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-refresh"
></i>
重置
</a>
</div>
</div>
</form:form>
...
...
@@ -116,6 +126,7 @@
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
0 → 100644
View file @
a220dfb9
<%--
Created by IntelliJ IDEA.
User: yangzi
Date: 2023/2/21
Time: 10:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<div id="toolbar" class="text-left">
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 新增</a>
<a class="btn btn-primary btn-sm" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a>
</div>
<table id="detail_table" data-toolbar="#toolbar"></table>
<script>
var selector = "#detail_table";
function initTable(){
var data = ${fns:toJson(storage.storageInfoList)};
$(selector).bootstrapTable({
data: data,
columns:[{checkbox: true},
{
field: 'no',
title: '序号',
align: 'center',
width: 60,
formatter: function (value, row, index){
var tpl = $("#hideTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
var html = Mustache.render(tpl, {
idx: index,
row: row
})
return html + '<span>'+(index+1)+'</span>'
}
},
{
field: 'name',
title: '名称',
formatter: function (value,row,index){
return Mustache.render($("#nameTpl").html(),{
row: row,
idx: index
})
}
},
{
field: 'type.name',
title: '类型',
formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'model',
title: '型号',
formatter: function (value,row,index){
return Mustache.render($("#modelTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'num',
title: '货架',
formatter: function (value,row,index){
return Mustache.render($("#shelvesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'remarks',
title: '备注',
formatter: function (value,row,index){
return Mustache.render($("#remarksTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: '',
title: '操作',
formatter: function (value,row,index){
var text = row.delFlag == 1 ? '撤销删除' : '删除';
var result = ["<a href='javascript:void(0);' onclick=\"removeRow(" + index + ", '" + row.id + "', '" + row.delFlag + "')\">"+text+"</a>" ]
return result.join('');
}
}
]
})
}
function getSelections(){
return $(selector).bootstrapTable('getSelections');
}
function addDetail(selector){
jp.openStorageSelectDialog(true,function (){
})
// var row = {
// id: '',
// delFlag: 0,
// name: '',
// type: {
// id: '',
// name: ''
// },
// model: '',
// num: '',
// remarks: ''
// }
//
// $(selector).bootstrapTable('append', [
// row
// ])
}
function removeRow(index, rowId, rowDelFlag){
if(rowId){
var delFlag = rowDelFlag === 1 ? 0 : 1
updateRow(index, {
delFlag: delFlag
})
}else{
$(selector).bootstrapTable("remove", {
field: '$index',
values: [index]
})
}
}
function updateRow(index, row){
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
function onInputChange(rowIndex, elem , field){
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function (){
updateRow(rowIndex, obj)
}, 0)
}
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
var obj = {
type: {
id: node.id,
name: node.text
}
};
updateRow(rowIndex, obj)
}
}
function addShelve(){
jp.openShelvesSelectDialog(function (){
})
}
</script>
<script id="hideTpl" type="text/html">
<input id="storageInfoList{{idx}}_id" name="storageInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input id="storageInfoList{{idx}}_delFlag" name="storageInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
<input id="storageInfoList{{idx}}_goodsInfoId" name="storageInfoList[{{idx}}].goodsInfo.id" type="hidden" value="{{row.goodsInfo.id}}"/>
<input id="storageInfoList{{idx}}_goodsInfoName" name="storageInfoList[{{idx}}].goodsInfo.name" type="hidden" value="{{row.goodsInfo.name}}"/>
<input id="storageInfoList{{idx}}_shelvesId" name="storageInfoList[{{idx}}].shelves.id" type="hidden" value="{{row.shelves.id}}" readonly class="form-control" />
</script>
<script id="nameTpl" type="text/html">
<input id="storageInfoList{{idx}}_name" name="storageInfoList[{{idx}}].name" type="text" value="{{row.name}}" onchange="onInputChange('{{idx}}', this, 'name')" class="form-control "/>
</script>
<script id="typeTpl" type="text/html">//<!--
<sys:treeselect id="storageInfoList{{idx}}_type" name="storageInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="storageInfoList{{idx}}.type.name" labelValue="{{row.type.name}}"
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " allowClear="true" allowSearch="true" callback="onSelectType" />//-->
</script>
<script id="modelTpl" type="text/html">
<input id="storageInfoList{{idx}}_model" name="storageInfoList[{{idx}}].model" type="text" value="{{row.model}}" onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="shelvesTpl" type="text/html">
<input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly class="form-control" />
</script>
<script id="remarksTpl" type="text/html">
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="4" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/storage/storageForm.jsp
View file @
a220dfb9
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
入库信息管理
</title>
<meta
name=
"decorator"
content=
"ani"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
jp
.
go
(
"${ctx}/warehouse/storage/storage"
);
}
else
{
jp
.
error
(
data
.
msg
);
$
(
"#inputForm"
).
find
(
"button:submit"
).
button
(
"reset"
);
}
});
$
(
'#time'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
$
(
list
+
idx
).
find
(
"select"
).
each
(
function
(){
$
(
this
).
val
(
$
(
this
).
attr
(
"data-value"
));
});
$
(
list
+
idx
).
find
(
"input[type='checkbox'], input[type='radio']"
).
each
(
function
(){
var
ss
=
$
(
this
).
attr
(
"data-value"
).
split
(
','
);
for
(
var
i
=
0
;
i
<
ss
.
length
;
i
++
){
if
(
$
(
this
).
val
()
==
ss
[
i
]){
$
(
this
).
attr
(
"checked"
,
"checked"
);
}
}
});
$
(
list
+
idx
).
find
(
".form_datetime"
).
each
(
function
(){
$
(
this
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
}
function
delRow
(
obj
,
prefix
){
var
id
=
$
(
prefix
+
"_id"
);
var
delFlag
=
$
(
prefix
+
"_delFlag"
);
if
(
id
.
val
()
==
""
){
$
(
obj
).
parent
().
parent
().
remove
();
}
else
if
(
delFlag
.
val
()
==
"0"
){
delFlag
.
val
(
"1"
);
$
(
obj
).
html
(
"÷"
).
attr
(
"title"
,
"撤销删除"
);
$
(
obj
).
parent
().
parent
().
addClass
(
"error"
);
}
else
if
(
delFlag
.
val
()
==
"1"
){
delFlag
.
val
(
"0"
);
$
(
obj
).
html
(
"×"
).
attr
(
"title"
,
"删除"
);
$
(
obj
).
parent
().
parent
().
removeClass
(
"error"
);
}
}
</script>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/common/css/form.css"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css"
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"
></script>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
<a
class=
"panelButton"
href=
"${ctx}/warehouse/storage/storage"
><i
class=
"ti-angle-left"
></i>
返回
</a>
</h3>
</div>
<div
class=
"panel-body"
>
<form:form
id=
"inputForm"
modelAttribute=
"storage"
action=
"${ctx}/warehouse/storage/storage/save"
method=
"post"
class=
"form-horizontal"
>
<form:form
id=
"inputForm"
modelAttribute=
"storage"
action=
"${ctx}/warehouse/storage/storage/save"
method=
"post"
class=
"form-horizontal"
>
<h3
class=
"text-center"
>
入库单
</h3>
<form:hidden
path=
"id"
/>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
入库单:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"code"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
操作人:
</label>
<div
class=
"col-sm-10"
>
<sys:userselect
id=
"operator"
name=
"operator.id"
value=
"${storage.operator.id}"
labelName=
"operator.name"
labelValue=
"${storage.operator.name}"
cssClass=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
时间:
</label>
<div
class=
"col-sm-10"
>
<div
class=
'input-group form_datetime'
id=
'time'
>
<input
type=
'text'
name=
"time"
class=
"form-control "
value=
"<fmt:formatDate value="
${
storage
.
time
}"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
"/>
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
批次号:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"batchNum"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
备注信息:
</label>
<div
class=
"col-sm-10"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</div>
</div>
<div
class=
"tabs-container"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
data-toggle=
"tab"
href=
"#tab-1"
aria-expanded=
"true"
>
入库明细:
</a>
</li>
</ul>
<div
class=
"tab-content"
>
<div
id=
"tab-1"
class=
"tab-pane fade in active"
>
<a
class=
"btn btn-white btn-sm"
onclick=
"addRow('#storageInfoList', storageInfoRowIdx, storageInfoTpl);storageInfoRowIdx = storageInfoRowIdx + 1;"
title=
"新增"
><i
class=
"fa fa-plus"
></i>
新增
</a>
<table
class=
"table table-striped table-bordered table-condensed"
>
<thead>
<table
class=
"table table-bordered main-table"
>
<tr>
<th
class=
"hide"
></th>
<th>
名称
</th>
<th>
类型
</th>
<th>
型号
</th>
<th>
货品明细id
</th>
<th>
货架id
</th>
<th>
备注信息
</th>
<th
width=
"10"
>
</th>
</tr>
</thead>
<tbody
id=
"storageInfoList"
>
</tbody>
</table>
<script
type=
"text/template"
id=
"storageInfoTpl"
>
//
<!--
<
tr
id
=
"storageInfoList{{idx}}"
>
<
td
class
=
"hide"
>
<
input
id
=
"storageInfoList{{idx}}_id"
name
=
"storageInfoList[{{idx}}].id"
type
=
"hidden"
value
=
"{{row.id}}"
/>
<
input
id
=
"storageInfoList{{idx}}_delFlag"
name
=
"storageInfoList[{{idx}}].delFlag"
type
=
"hidden"
value
=
"0"
/>
<
/td
>
<td>
<font
color=
"red"
>
*
</font>
入库单
</td>
<td>
<
input
id
=
"storageInfoList{{idx}}_name"
name
=
"storageInfoList[{{idx}}].name"
type
=
"text"
value
=
"{{row.name}}"
class
=
"form-control
"
/>
<form:input
path=
"code"
htmlEscape=
"false"
readonly=
"true"
class=
"form-control required
"
/>
</td>
<td><font
color=
"red"
>
*
</font>
操作人
</td>
<td>
<
sys
:
treeselect
id
=
"storageInfoList{{idx}}_type"
name
=
"storageInfoList[{{idx}}].type.id"
value
=
"{{row.type.id}}"
labelName
=
"storageInfoList{{idx}}.type.name"
labelValue
=
"{{row.type.name}}"
title
=
"类型"
url
=
"/warehouse/materialtype/materialType/treeData"
cssClass
=
"form-control "
allowClear
=
"true"
/>
<sys:userselect
id=
"operator"
name=
"operator.id"
value=
"${storage.operator.id}"
labelName=
"operator.name"
labelValue=
"${storage.operator.name}"
cssClass=
"form-control required"
disabled=
"disabled"
/>
</td>
</tr>
<tr>
<td><font
color=
"red"
>
*
</font>
时间
</td>
<td>
<
input
id
=
"storageInfoList{{idx}}_model"
name
=
"storageInfoList[{{idx}}].model"
type
=
"text"
value
=
"{{row.model}}"
class
=
"form-control "
/>
<div
class=
'input-group form_datetime'
id=
'time'
>
<input
type=
'text'
name=
"time"
class=
"form-control required"
value=
"<fmt:formatDate value="
${
storage
.
time
}"
pattern=
"yyyy-MM-dd HH:mm:ss"
/>
"/>
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
</div>
</td>
<td>
<
input
id
=
"storageInfoList{{idx}}_goodsInfo"
name
=
"storageInfoList[{{idx}}].goodsInfo.id"
type
=
"text"
value
=
"{{row.goodsInfo.id}}"
class
=
"form-control "
/>
<font
color=
"red"
>
*
</font>
批次号
</td>
<td>
<
sys
:
treeselect
id
=
"storageInfoList{{idx}}_shelves"
name
=
"storageInfoList[{{idx}}].shelves.id"
value
=
"{{row.shelves.id}}"
labelName
=
"storageInfoList{{idx}}.shelves.name"
labelValue
=
"{{row.shelves.name}}"
title
=
"货架id"
url
=
"/warehouse/shelves/shelves/data"
cssClass
=
"form-control "
allowClear
=
"true"
/>
<form:hidden
path=
"batchNum"
/>
<sys:gridselect
url=
"${ctx}/warehouse/goods/goods/data"
id=
"goods"
name=
"goods.id"
value=
"${storage.batchNum}"
labelName=
"goods.name"
labelValue=
"${storage.batchNum}"
title=
"选择货品批次"
cssClass=
"form-control required"
fieldLabels=
"批次号"
fieldKeys=
"batchNum"
searchLabels=
"批次号"
searchKeys=
"batchNum"
callback=
"onSelectGoods"
></sys:gridselect>
</td>
<
td
>
<
textarea
id
=
"storageInfoList{{idx}}_remarks"
name
=
"storageInfoList[{{idx}}].remarks"
rows
=
"4"
class
=
"form-control "
>
{{
row
.
remarks
}}
<
/textarea
>
</tr>
<tr>
<td>
备注
</td>
<td
colspan=
"3"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</td>
<
td
class
=
"text-center"
width
=
"10"
>
{{
#
delBtn
}}
<
span
class
=
"close"
onclick
=
"delRow(this, '#storageInfoList{{idx}}')"
title
=
"删除"
>&
times
;
<
/span>{{/
delBtn
}}
</tr>
<tr>
<td
colspan=
"4"
>
<
%@
include
file=
"storageDetail.jsp"
%
>
</td>
<
/tr>/
/-->
</script>
<script
type=
"text/javascript"
>
var
storageInfoRowIdx
=
0
,
storageInfoTpl
=
$
(
"#storageInfoTpl"
).
html
().
replace
(
/
(\/\/
\<!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
$
(
document
).
ready
(
function
()
{
var
data
=
$
{
fns
:
toJson
(
storage
.
storageInfoList
)};
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
){
addRow
(
'#storageInfoList'
,
storageInfoRowIdx
,
storageInfoTpl
,
data
[
i
]);
storageInfoRowIdx
=
storageInfoRowIdx
+
1
;
}
});
</script>
</div>
</div>
</div>
<c:if
test=
"${mode == 'add' || mode=='edit'}"
>
<div
class=
"col-lg-3"
></div>
<div
class=
"col-lg-6"
>
<div
class=
"form-group text-center"
>
<div>
<button
class=
"btn btn-primary btn-block btn-lg btn-parsley"
data-loading-text=
"正在提交..."
>
提 交
</button>
</div>
</div>
</div>
</c:if>
</tr>
</table>
</form:form>
</div>
</div>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
initTable
();
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
)
{
if
(
data
.
success
)
{
jp
.
success
(
data
.
msg
);
jp
.
go
(
"${ctx}/warehouse/storage/storage"
);
}
else
{
jp
.
error
(
data
.
msg
);
$
(
"#inputForm"
).
find
(
"button:submit"
).
button
(
"reset"
);
}
});
$
(
'#time'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
save
()
{
var
isValidate
=
jp
.
validateForm
(
'#inputForm'
);
//校验表单
if
(
!
isValidate
){
return
false
;
}
else
{
jp
.
loading
();
jp
.
post
(
$
(
"#inputForm"
).
attr
(
'action'
),
$
(
'#inputForm'
).
serialize
(),
function
(
data
){
if
(
data
.
success
){
jp
.
getParent
().
refresh
();
var
dialogIndex
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
// 获取窗口索引
parent
.
layer
.
close
(
dialogIndex
);
jp
.
success
(
data
.
msg
)
}
else
{
jp
.
error
(
data
.
msg
);
}
})
}
}
function
onSelectGoods
(
items
){
if
(
Array
.
isArray
(
items
)
&&
items
.
length
>
0
){
var
item
=
items
[
0
];
$
(
"#batchNum"
).
val
(
item
.
batchNum
);
$
(
"#goodsId"
).
val
(
item
.
id
);
$
(
"#goodsName"
).
val
(
item
.
batchNum
);
}
}
</script>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/storage/storageList.js
View file @
a220dfb9
...
...
@@ -248,7 +248,7 @@ $(document).ready(function() {
$
(
'#storageTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
go
(
"${ctx}/warehouse/storage/storage/form/add"
);
jp
.
openSaveDialog
(
"新增入库单"
,
"${ctx}/warehouse/storage/storage/form/add"
,
'1200'
,
'800'
);
}
function
edit
(
id
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment