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
d11ac164
Commit
d11ac164
authored
Jul 19, 2023
by
anxiaohe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
台账信息明细扫码功能
parent
9aff9718
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
586 additions
and
290 deletions
+586
-290
goodsList.js
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
+2
-1
ledgerForm.jsp
...in/webapp/webpage/modules/warehouse/ledger/ledgerForm.jsp
+2
-2
ledgerList.js
...ain/webapp/webpage/modules/warehouse/ledger/ledgerList.js
+532
-282
ledgerList.jsp
...in/webapp/webpage/modules/warehouse/ledger/ledgerList.jsp
+43
-4
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+2
-1
storageForm.jsp
.../webapp/webpage/modules/warehouse/storage/storageForm.jsp
+5
-0
No files found.
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
View file @
d11ac164
...
@@ -316,7 +316,8 @@ $(document).ready(function() {
...
@@ -316,7 +316,8 @@ $(document).ready(function() {
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
if
(
res
.
success
)
{
if
(
res
.
success
)
{
var
row
=
res
.
body
.
goodsInfo
.
qrCode
;
var
row
=
res
.
body
.
goodsInfo
.
qrCode
;
console
.
log
(
row
)
var
imgUrl
=
"${ctxPath}/"
+
row
.
url
;
jp
.
showPic
(
imgUrl
);
}
}
jp
.
close
();
jp
.
close
();
})
})
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerForm.jsp
View file @
d11ac164
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<link
rel=
"stylesheet"
href=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.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.min.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
</head>
</head>
<body>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"wrapper wrapper-content"
>
...
@@ -67,4 +68,4 @@
...
@@ -67,4 +68,4 @@
});
});
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.js
View file @
d11ac164
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
<
script
>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'#ledgerTable'
).
bootstrapTable
({
$
(
'#ledgerTable'
).
bootstrapTable
({
//请求方法
//请求方法
method
:
'post'
,
method
:
'post'
,
//类型json
//类型json
dataType
:
"json"
,
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
contentType
:
"application/x-www-form-urlencoded"
,
//显示检索按钮
//显示检索按钮
showSearch
:
true
,
showSearch
:
true
,
//显示刷新按钮
//显示刷新按钮
showRefresh
:
true
,
showRefresh
:
true
,
//显示切换手机试图按钮
//显示切换手机试图按钮
showToggle
:
true
,
showToggle
:
true
,
//显示 内容列下拉框
//显示 内容列下拉框
showColumns
:
true
,
showColumns
:
true
,
//显示到处按钮
//显示到处按钮
showExport
:
true
,
showExport
:
true
,
//显示切换分页按钮
//显示切换分页按钮
showPaginationSwitch
:
true
,
showPaginationSwitch
:
true
,
//显示详情按钮
//显示详情按钮
detailView
:
true
,
detailView
:
true
,
//显示详细内容函数
//显示详细内容函数
detailFormatter
:
"detailFormatter"
,
detailFormatter
:
"detailFormatter"
,
//最低显示2行
//最低显示2行
minimumCountColumns
:
2
,
minimumCountColumns
:
2
,
//是否显示行间隔色
//是否显示行间隔色
striped
:
true
,
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
cache
:
false
,
//是否显示分页(*)
//是否显示分页(*)
pagination
:
true
,
pagination
:
true
,
//排序方式
//排序方式
sortOrder
:
"asc"
,
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
//初始化加载第一页,默认第一页
pageNumber
:
1
,
pageNumber
:
1
,
//每页的记录行数(*)
//每页的记录行数(*)
pageSize
:
10
,
pageSize
:
10
,
//可供选择的每页的行数(*)
//可供选择的每页的行数(*)
pageList
:
[
10
,
25
,
50
,
100
],
pageList
:
[
10
,
25
,
50
,
100
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/ledger/ledger/data"
,
url
:
"${ctx}/warehouse/ledger/ledger/data"
,
//默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
//默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
//queryParamsType:'',
//queryParamsType:'',
////查询参数,每次调用是会带上这个参数,可自定义
////查询参数,每次调用是会带上这个参数,可自定义
queryParams
:
function
(
params
)
{
queryParams
:
function
(
params
)
{
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
params
.
limit
===
undefined
?
"1"
:
params
.
offset
/
params
.
limit
+
1
;
searchParam
.
pageNo
=
params
.
limit
===
undefined
?
"1"
:
params
.
offset
/
params
.
limit
+
1
;
searchParam
.
pageSize
=
params
.
limit
===
undefined
?
-
1
:
params
.
limit
;
searchParam
.
pageSize
=
params
.
limit
===
undefined
?
-
1
:
params
.
limit
;
searchParam
.
orderBy
=
params
.
sort
===
undefined
?
""
:
params
.
sort
+
" "
+
params
.
order
;
searchParam
.
orderBy
=
params
.
sort
===
undefined
?
""
:
params
.
sort
+
" "
+
params
.
order
;
return
searchParam
;
return
searchParam
;
},
},
//分页方式:client客户端分页,server服务端分页(*)
//分页方式:client客户端分页,server服务端分页(*)
sidePagination
:
"server"
,
sidePagination
:
"server"
,
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenu
:
'#context-menu'
,
contextMenu
:
'#context-menu'
,
onContextMenuItem
:
function
(
row
,
$el
){
onContextMenuItem
:
function
(
row
,
$el
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
edit
(
row
.
id
);
edit
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
view
(
row
.
id
);
view
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
jp
.
confirm
(
'确认要删除该台账信息记录吗?'
,
function
(){
jp
.
confirm
(
'确认要删除该台账信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/ledger/ledger/delete?id="
+
row
.
id
,
function
(
data
){
jp
.
get
(
"${ctx}/warehouse/ledger/ledger/delete?id="
+
row
.
id
,
function
(
data
){
if
(
data
.
success
){
if
(
data
.
success
){
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
jp
.
success
(
data
.
msg
);
}
else
{
}
else
{
jp
.
error
(
data
.
msg
);
jp
.
error
(
data
.
msg
);
}
}
})
})
});
});
}
}
},
},
onClickRow
:
function
(
row
,
$el
){
onClickRow
:
function
(
row
,
$el
){
},
},
onShowSearch
:
function
()
{
onShowSearch
:
function
()
{
$
(
"#search-collapse"
).
slideToggle
();
$
(
"#search-collapse"
).
slideToggle
();
},
},
columns
:
[{
columns
:
[
checkbox
:
true
{
checkbox
:
true
}
,{
}
field
:
'name'
,
,{
title
:
'物资名称'
,
field
:
'type.name'
,
sortable
:
true
,
title
:
'品名'
,
sortName
:
'name'
sortable
:
true
,
,
formatter
:
function
(
value
,
row
,
index
){
sortName
:
'name'
value
=
jp
.
unescapeHTML
(
value
);
,
formatter
:
function
(
value
,
row
,
index
){
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
value
=
jp
.
unescapeHTML
(
value
);
}
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
}
}
,{
}
field
:
'type.name'
,
,{
title
:
'品名代码'
,
field
:
'type.code'
,
sortable
:
true
,
title
:
'代码'
,
sortName
:
'type.name'
sortable
:
true
,
sortName
:
'type.name'
}
,{
},
field
:
'model'
,
{
title
:
'型号'
,
field
:
'model'
,
sortable
:
true
,
title
:
'型号'
,
sortName
:
'model'
sortable
:
true
,
sortName
:
'model'
}
,{
}
field
:
'sum'
,
,{
title
:
'总价'
,
field
:
'sum'
,
sortable
:
true
,
title
:
'总价'
,
sortName
:
'sum'
sortable
:
true
,
sortName
:
'sum'
}
,{
}
field
:
'num'
,
,{
title
:
'数量'
,
field
:
'num'
,
sortable
:
true
,
title
:
'数量'
,
sortName
:
'num'
sortable
:
true
,
sortName
:
'num'
}
,{
}
field
:
'createDate'
,
,{
title
:
'创建时间'
,
field
:
'createDate'
,
sortable
:
true
,
title
:
'创建时间'
,
sortName
:
'createDate'
sortable
:
true
,
sortName
:
'createDate'
}
]
}
]
});
});
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
$
(
'#ledgerTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#ledgerTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#ledgerTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#ledgerTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#ledgerTable'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#ledgerTable'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#view,#edit'
).
prop
(
'disabled'
,
$
(
'#ledgerTable'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
$
(
'#view,#edit'
).
prop
(
'disabled'
,
$
(
'#ledgerTable'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
});
});
$
(
"#btnImport"
).
click
(
function
(){
$
(
"#btnImport"
).
click
(
function
(){
jp
.
open
({
jp
.
open
({
type
:
2
,
type
:
2
,
area
:
[
500
,
200
],
area
:
[
500
,
200
],
auto
:
true
,
auto
:
true
,
title
:
"导入数据"
,
title
:
"导入数据"
,
content
:
"${ctx}/tag/importExcel"
,
content
:
"${ctx}/tag/importExcel"
,
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn1
:
function
(
index
,
layero
){
btn1
:
function
(
index
,
layero
){
jp
.
downloadFile
(
'${ctx}/warehouse/ledger/ledger/import/template'
);
jp
.
downloadFile
(
'${ctx}/warehouse/ledger/ledger/import/template'
);
},
},
btn2
:
function
(
index
,
layero
){
btn2
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/ledger/ledger/import'
,
function
(
data
)
{
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/ledger/ledger/import'
,
function
(
data
)
{
if
(
data
.
success
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
jp
.
success
(
data
.
msg
);
refresh
();
refresh
();
}
else
{
}
else
{
jp
.
error
(
data
.
msg
);
jp
.
error
(
data
.
msg
);
}
}
jp
.
close
(
index
);
jp
.
close
(
index
);
});
//调用保存事件
});
//调用保存事件
return
false
;
return
false
;
},
},
btn3
:
function
(
index
){
btn3
:
function
(
index
){
jp
.
close
(
index
);
jp
.
close
(
index
);
}
}
});
});
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
searchParam
.
pageSize
=
-
1
;
var
sortName
=
$
(
'#ledgerTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortName
=
$
(
'#ledgerTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortOrder
=
$
(
'#ledgerTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
sortOrder
=
$
(
'#ledgerTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
values
=
""
;
var
values
=
""
;
...
@@ -195,97 +196,333 @@ $(document).ready(function() {
...
@@ -195,97 +196,333 @@ $(document).ready(function() {
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
}
}
jp
.
downloadFile
(
'${ctx}/warehouse/ledger/ledger/export?'
+
values
);
jp
.
downloadFile
(
'${ctx}/warehouse/ledger/ledger/export?'
+
values
);
})
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#ledgerTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
});
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#ledgerTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
});
}
function
deleteAll
(){
jp
.
confirm
(
'确认要删除该台账信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/ledger/ledger/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
if
(
data
.
success
){
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
//刷新列表
function
refresh
(){
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
openSaveDialog
(
"新增台账"
,
"${ctx}/warehouse/ledger/ledger/form/add"
,
'1200'
,
'800'
);
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
}
jp
.
openSaveDialog
(
"编辑台账"
,
"${ctx}/warehouse/ledger/ledger/form/edit?id="
+
id
,
'1200'
,
'800'
);
function
deleteAll
(){
}
jp
.
confirm
(
'确认要删除该台账信息记录吗?'
,
function
(){
function
view
(
id
){
//没有权限时,不显示确定按钮
jp
.
loading
();
if
(
id
==
undefined
){
jp
.
get
(
"${ctx}/warehouse/ledger/ledger/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
id
=
getIdSelections
();
if
(
data
.
success
){
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
//刷新列表
function
refresh
(){
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
openSaveDialog
(
"新增台账"
,
"${ctx}/warehouse/ledger/ledger/form/add"
,
'1200'
,
'800'
);
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
openSaveDialog
(
"编辑台账"
,
"${ctx}/warehouse/ledger/ledger/form/edit?id="
+
id
,
'1200'
,
'800'
);
}
function
view
(
id
){
//没有权限时,不显示确定按钮
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
openViewDialog
(
"查看台账"
,
"${ctx}/warehouse/ledger/ledger/form/view?id="
+
id
,
'1200'
,
'800'
);
}
function
detailFormatter
(
index
,
row
)
{
var
htmltpl
=
$
(
"#ledgerChildrenTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/ledger/ledger/countLedger?id="
+
row
.
id
,
function
(
ledger
){
var
ledgerChild1RowIdx
=
0
,
ledgerChild1Tpl
=
$
(
"#ledgerChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
ledger
.
countLedgerInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
data1
[
i
].
dict
=
{};
addRow
(
'#ledgerChild-'
+
row
.
id
+
'-1-List'
,
ledgerChild1RowIdx
,
ledgerChild1Tpl
,
data1
[
i
]);
ledgerChild1RowIdx
=
ledgerChild1RowIdx
+
1
;
}
})
return
html
;
}
}
jp
.
openViewDialog
(
"查看台账"
,
"${ctx}/warehouse/ledger/ledger/form/view?id="
+
id
,
'1200'
,
'800'
);
function
addRow
(
list
,
idx
,
tpl
,
row
){
}
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
}
function
detailFormatter
(
index
,
row
)
{
var
htmltpl
=
$
(
"#ledgerChildrenTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/ledger/ledger/detail?id="
+
row
.
id
,
function
(
ledger
){
var
ledgerChild1RowIdx
=
0
,
ledgerChild1Tpl
=
$
(
"#ledgerChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
ledger
.
ledgerInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
var
item
=
data1
[
i
];
data1
[
i
].
dict
=
{};
item
.
infoSum
=
new
Big
(
item
.
num
).
times
(
item
.
amount
).
toNumber
();
item
.
shelvesNames
=
item
.
shelvesList
.
map
(
function
(
e
)
{
return
e
.
name
}).
join
(
','
);
item
.
warehouseNames
=
item
.
warehouseList
.
map
(
function
(
e
)
{
return
e
.
name
;
}).
join
(
','
);
addRow
(
'#ledgerChild-'
+
row
.
id
+
'-1-List'
,
ledgerChild1RowIdx
,
ledgerChild1Tpl
,
data1
[
i
]);
ledgerChild1RowIdx
=
ledgerChild1RowIdx
+
1
;
}
})
return
html
;
}
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
}
function
getTable
()
{
return
$
(
"#scan_detail_table"
);
}
function
getScanIpt
()
{
return
document
.
getElementById
(
"scanIpt"
);
}
var
inputMethodCnType
=
false
;
// var allFocus = debounce(function () {
// var elem = getScanIpt();
// elem.focus();
// }, 300);
var
scanIptFocusTimer
=
null
;
function
viewScanData
()
{
layer
.
open
({
type
:
1
,
title
:
'扫码'
,
auto
:
true
,
area
:
[
'1200'
,
'600'
],
content
:
$
(
"#scanTpl"
).
html
(),
success
:
function
()
{
var
ipt
=
getScanIpt
();
ipt
.
addEventListener
(
'change'
,
scanDataChange
);
// ipt.addEventListener('blur', allFocus);
ipt
.
addEventListener
(
'compositionstart'
,
iptCompositionstart
);
ipt
.
addEventListener
(
'compositionend'
,
iptCompositionend
);
scanIptGetFocusStart
();
$
(
"#scanIpt"
).
focus
();
renderScanTable
();
document
.
addEventListener
(
'visibilitychange'
,
pageVisible
);
},
cancel
:
function
()
{
var
ipt
=
getScanIpt
();
ipt
.
removeEventListener
(
'change'
,
scanDataChange
);
// ipt.removeEventListener('blur', allFocus);
ipt
.
removeEventListener
(
'compositionstart'
,
iptCompositionstart
);
scanIptGetFocusStop
();
document
.
removeEventListener
(
'visibilitychange'
,
pageVisible
);
},
btn
:[
'关闭'
]
})
}
function
scanDataChange
()
{
var
elem
=
getScanIpt
();
var
val
=
$
(
elem
).
val
();
if
(
!
val
)
{
return
;
}
try
{
var
json
=
JSON
.
parse
(
val
);
var
params
=
"qrId="
+
json
.
code
;
getScanData
(
{
qrId
:
json
.
code
},
function
(
list
)
{
var
table
=
getTable
();
var
tableData
=
table
.
bootstrapTable
(
'getData'
);
list
=
list
.
filter
(
function
(
item
)
{
var
i
=
tableData
.
find
(
function
(
e
)
{
return
e
.
id
===
item
.
id
;
})
return
!
i
;
});
if
(
!
list
.
length
)
{
jp
.
alert
(
'请勿重复扫码'
);
return
;
}
table
.
bootstrapTable
(
'append'
,
list
);
}
);
}
catch
(
e
)
{}
setTimeout
(
function
()
{
$
(
elem
).
val
(
''
);
$
(
elem
).
blur
();
},
100
)
}
function
iptCompositionstart
()
{
inputMethodCnType
=
true
;
}
function
iptCompositionend
()
{
var
ipt
=
getScanIpt
();
if
(
inputMethodCnType
)
{
jp
.
alert
(
'请将输入法设置为英文'
);
inputMethodCnType
=
false
;
ipt
.
value
=
''
;
}
}
function
iptFocus
(
ipt
)
{
var
timer
=
setInterval
(
function
()
{
if
(
ipt
!==
document
.
activeElement
)
{
ipt
.
focus
();
}
},
400
);
return
timer
;
}
function
debounce
(
callback
,
timeout
=
500
)
{
let
timer
=
null
;
return
function
(...
arg
)
{
const
content
=
this
;
if
(
timer
)
{
clearTimeout
(
timer
);
}
else
{
callback
.
apply
(
content
,
arg
);
}
timer
=
setTimeout
(
function
()
{
clearTimeout
(
timer
);
timer
=
null
;
},
timeout
)
}
}
function
renderScanTable
()
{
getTable
().
bootstrapTable
(
'destroy'
).
bootstrapTable
({
data
:
[],
columns
:
[
{
field
:
'type.name'
,
title
:
'品名'
,
sortable
:
true
,
sortName
:
'type.name'
},
{
field
:
'type.code'
,
title
:
'代码'
,
sortable
:
true
,
sortName
:
'type.code'
},
{
field
:
'code'
,
title
:
'入库单'
},
{
field
:
'batchNum'
,
title
:
'批次号'
,
},
{
field
:
'amount'
,
title
:
'单价'
},
{
field
:
"type.unit"
,
title
:
'单位'
},
{
field
:
'model'
,
title
:
'型号'
,
sortable
:
true
,
sortName
:
'model'
},
{
field
:
'num'
,
title
:
'数量'
},
{
field
:
'sum'
,
title
:
'总价'
,
sortName
:
'sum'
,
formatter
(
v
,
row
)
{
return
new
Big
(
row
.
num
).
times
(
row
.
amount
).
toNumber
()
}
},
]
})
}
function
searchScanData
()
{
var
code
=
$
(
"#scan-code"
).
val
();
getScanData
(
{
code
:
code
},
function
(
list
)
{
getTable
().
bootstrapTable
(
'load'
,
list
);
}
)
}
function
refreshScanData
()
{
$
(
"#scan-code"
).
val
(
''
);
searchScanData
();
}
function
getScanData
(
params
,
callback
)
{
var
paramsStr
=
"qrId="
+
(
params
.
qrId
||
''
)
+
"&code="
+
(
params
.
code
||
''
);
jp
.
get
(
"${ctx}/warehouse/ledger/ledger/findByQrOrCode?"
+
paramsStr
,
function
(
result
)
{
if
(
result
&&
result
.
rows
)
{
callback
&&
callback
(
result
.
rows
.
filter
(
Boolean
));
// var list = result.rows.filter(Boolean).filter(function (item) {
// var i = tableData.find(function (e) {
// return e.id === item.id;
// })
// return !i;
// });
// if (!list.length) {
// jp.alert('请勿重复扫码');
// return;
// }
// table.bootstrapTable('append', list);
}
})
}
function
pageVisible
()
{
var
state
=
document
.
visibilityState
;
if
(
state
===
'visible'
)
{
scanIptGetFocusStart
();
}
else
if
(
state
===
'hidden'
)
{
scanIptGetFocusStop
();
}
}
function
scanIptGetFocusStart
()
{
var
ipt
=
getScanIpt
();
if
(
ipt
)
{
scanIptFocusTimer
=
iptFocus
(
ipt
);
}
}
function
scanIptGetFocusStop
()
{
if
(
scanIptFocusTimer
)
{
clearInterval
(
scanIptFocusTimer
);
scanIptFocusTimer
=
null
;
}
}
<
/script
>
<
/script
>
<
script
type
=
"text/template"
id
=
"ledgerChildrenTpl"
>
//<!--
<
script
type
=
"text/template"
id
=
"ledgerChildrenTpl"
>
//<!--
<
div
class
=
"tabs-container"
>
<
div
class
=
"tabs-container"
>
...
@@ -297,13 +534,16 @@ $(document).ready(function() {
...
@@ -297,13 +534,16 @@ $(document).ready(function() {
<
table
class
=
"ani table"
>
<
table
class
=
"ani table"
>
<
thead
>
<
thead
>
<
tr
>
<
tr
>
<
th
>
品名代码
<
/th
>
<
th
>
品名
<
/th
>
<
th
>
代码
<
/th
>
<
th
>
数量
<
/th
>
<
th
>
单位
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
单价
<
/th
>
<
th
>
总价
<
/th
>
<
th
>
批次号
<
/th
>
<
th
>
批次号
<
/th
>
<
th
>
货架
<
/th
>
<
th
>
货架
<
/th
>
<
th
>
仓库
<
/th
>
<
th
>
仓库
<
/th
>
<
th
>
数量
<
/th
>
<
th
>
总价
<
/th
>
<
/tr
>
<
/tr
>
<
/thead
>
<
/thead
>
<
tbody
id
=
"ledgerChild-{{idx}}-1-List"
>
<
tbody
id
=
"ledgerChild-{{idx}}-1-List"
>
...
@@ -311,16 +551,31 @@ $(document).ready(function() {
...
@@ -311,16 +551,31 @@ $(document).ready(function() {
<
/table
>
<
/table
>
<
/div
>
<
/div
>
<
/div>/
/-->
<
/div>/
/-->
<
/script
>
<
/script
>
<
script
type
=
"text/template"
id
=
"ledgerChild1Tpl"
>
//<!--
<
script
type
=
"text/template"
id
=
"ledgerChild1Tpl"
>
//<!--
<
tr
>
<
tr
>
<
td
>
<
td
>
{{
row
.
type
.
name
}}
{{
row
.
type
.
name
}}
<
/td
>
<
/td
>
<
td
>
<
td
>
{{
row
.
type
.
code
}}
<
/td
>
<
td
>
{{
row
.
num
}}
<
/td
>
<
td
>
{{
row
.
type
.
unit
}}
<
/td
>
<
td
>
{{
row
.
model
}}
{{
row
.
model
}}
<
/td
>
<
/td
>
<
td
>
<
td
>
{{
row
.
amount
}}
<
/td
>
<
td
>
{{
row
.
infoSum
}}
<
/td
>
<
td
>
{{
row
.
batchNum
}}
{{
row
.
batchNum
}}
<
/td
>
<
/td
>
<
td
>
<
td
>
...
@@ -330,11 +585,6 @@ $(document).ready(function() {
...
@@ -330,11 +585,6 @@ $(document).ready(function() {
<
td
>
<
td
>
{{
row
.
warehouseNames
}}
{{
row
.
warehouseNames
}}
<
/td
>
<
/td
>
<
td
>
{{
row
.
num
}}
<
/td
>
<
td
>
{{
row
.
sum
}}
<
/td
>
<
/tr>/
/-->
<
/tr>/
/-->
<
/script
>
<
/script
>
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.jsp
View file @
d11ac164
...
@@ -8,6 +8,18 @@
...
@@ -8,6 +8,18 @@
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<
%@
include
file=
"ledgerList.js"
%
>
<
%@
include
file=
"ledgerList.js"
%
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
<style>
#scanIpt
{
position
:
absolute
;
top
:
-10000px
;
left
:
0
;
opacity
:
0
;
}
.scan-content
{
padding
:
10px
;
}
</style>
</head>
</head>
<body>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"wrapper wrapper-content"
>
...
@@ -53,7 +65,7 @@
...
@@ -53,7 +65,7 @@
</div>
</div>
<!-- 工具栏 -->
<!-- 工具栏 -->
<
%
--
<
div
id=
"toolbar"
>
--%
>
<div
id=
"toolbar"
>
<
%
--
<
shiro:hasPermission
name=
"warehouse:ledger:ledger:add"
>
--%>
<
%
--
<
shiro:hasPermission
name=
"warehouse:ledger:ledger:add"
>
--%>
<
%
--
<
button
id=
"add"
class=
"btn btn-primary"
onclick=
"add()"
>
--%>
<
%
--
<
button
id=
"add"
class=
"btn btn-primary"
onclick=
"add()"
>
--%>
<
%
--
<
i
class=
"glyphicon glyphicon-plus"
></i>
新建--%>
<
%
--
<
i
class=
"glyphicon glyphicon-plus"
></i>
新建--%>
...
@@ -82,7 +94,10 @@
...
@@ -82,7 +94,10 @@
<
%
--
<
i
class=
"fa fa-search-plus"
></i>
查看--%>
<
%
--
<
i
class=
"fa fa-search-plus"
></i>
查看--%>
<
%
--
</
button
>
--%>
<
%
--
</
button
>
--%>
<
%
--
</
shiro:hasPermission
>
--%>
<
%
--
</
shiro:hasPermission
>
--%>
<
%
--
</
div
>
--%>
<button
class=
"btn btn-default"
onclick=
"viewScanData()"
>
<i
class=
"fa fa-search-plus"
></i>
查看二维码数据
</button>
</div>
<!-- 表格 -->
<!-- 表格 -->
<table
id=
"ledgerTable"
data-toolbar=
"#toolbar"
></table>
<table
id=
"ledgerTable"
data-toolbar=
"#toolbar"
></table>
...
@@ -102,6 +117,31 @@
...
@@ -102,6 +117,31 @@
</ul>
</ul>
</div>
</div>
</div>
</div>
</div>
<script
type=
"type/template"
id=
"scanTpl"
>
<
div
class
=
"scan-content"
>
<
input
type
=
"text"
id
=
"scanIpt"
/>
<
div
id
=
"scan-searchForm-box"
class
=
"collapse show"
>
<
div
class
=
"accordion-inner"
>
<
form
:
form
id
=
"scan-searchForm"
class
=
"form form-horizontal well clearfix"
>
<
div
class
=
"col-xs-12 col-sm-6 col-md-4"
>
<
label
class
=
"label-item single-overflow pull-left"
title
=
"数量:"
>
编号:
<
/label
>
<%--
<
form
:
input
path
=
"code"
htmlEscape
=
"false"
class
=
" form-control"
/>--%>
<
input
type
=
"text"
id
=
"scan-code"
class
=
"form-control"
onfocus
=
"scanIptGetFocusStop()"
onblur
=
"scanIptGetFocusStart()"
/>
<
/div
>
<
div
class
=
"col-xs-12 col-sm-6 col-md-4"
>
<
div
style
=
"margin-top:26px"
>
<
a
id
=
"scan-search"
class
=
"btn btn-primary btn-rounded btn-bordered btn-sm"
onclick
=
"searchScanData()"
><
i
class
=
"fa fa-search"
><
/i> 查询</
a
>
<
a
id
=
"scan-reset"
class
=
"btn btn-primary btn-rounded btn-bordered btn-sm"
onclick
=
"refreshScanData()"
><
i
class
=
"fa fa-refresh"
><
/i> 重置</
a
>
<
/div
>
<
/div
>
<
/form:form
>
<
/div
>
<
/div
>
<
div
class
=
"scan-data-content"
>
<
table
id
=
"scan_detail_table"
><
/table
>
<
/div
>
<
/div
>
<
/div
>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
d11ac164
...
@@ -450,6 +450,7 @@
...
@@ -450,6 +450,7 @@
* @param elem
* @param elem
*/
*/
function onScanChange(elem){
function onScanChange(elem){
// console.log($(elem).val());
try{
try{
var json = JSON.parse($(elem).val());
var json = JSON.parse($(elem).val());
var qrCodeId = json.code;
var qrCodeId = json.code;
...
@@ -573,7 +574,7 @@
...
@@ -573,7 +574,7 @@
<label>扫码结果:</label>
<label>扫码结果:</label>
</div>
</div>
<div class="col-xs-10">
<div class="col-xs-10">
<input type="text" id="scanResult" class="form-control" onchange="onScanChange(this)">
<input type="text" id="scanResult" class="form-control"
style="ime-mode: active"
onchange="onScanChange(this)">
<span class="text-danger">请切换英文输入法</span>
<span class="text-danger">请切换英文输入法</span>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageForm.jsp
View file @
d11ac164
...
@@ -36,6 +36,11 @@
...
@@ -36,6 +36,11 @@
</style>
</style>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"
></script>
<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>
<script
type=
"text/javascript"
src=
"${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"
></script>
<style>
#scanResult
{
-ms-ime-mode
:
inactive
;
}
</style>
</head>
</head>
<body>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"wrapper wrapper-content"
>
...
...
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