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
115b9d23
Commit
115b9d23
authored
Jul 20, 2023
by
anxiaohe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
台账导出、出库表单修改、物资领用模块(自动、手动)添加明细
parent
642aefed
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1160 additions
and
898 deletions
+1160
-898
scan.jsp
src/main/webapp/webpage/include/scan.jsp
+125
-124
goodsList.js
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
+344
-343
goodsList.jsp
...main/webapp/webpage/modules/warehouse/goods/goodsList.jsp
+2
-2
logic.js
src/main/webapp/webpage/modules/warehouse/goods/logic.js
+154
-22
ledgerList.js
...ain/webapp/webpage/modules/warehouse/ledger/ledgerList.js
+56
-16
ledgerList.jsp
...in/webapp/webpage/modules/warehouse/ledger/ledgerList.jsp
+34
-0
materialRequisitionDetail.jsp
...rehouse/materialrequisition/materialRequisitionDetail.jsp
+61
-59
materialRequisitionForm.jsp
...warehouse/materialrequisition/materialRequisitionForm.jsp
+17
-17
outboundDetail.jsp
...app/webpage/modules/warehouse/outbound/outboundDetail.jsp
+76
-24
outboundList.js
...webapp/webpage/modules/warehouse/outbound/outboundList.js
+278
-282
outboundList.jsp
...ebapp/webpage/modules/warehouse/outbound/outboundList.jsp
+8
-9
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+5
-0
No files found.
src/main/webapp/webpage/include/scan.jsp
View file @
115b9d23
<%@ page contentType="text/html;charset=UTF-8" %>
<style>
#scanIpt_ {
position: absolute;
...
...
@@ -12,145 +13,145 @@
<script>
// function Scan () {
// this.scanIptFocusTimer$ = null;
// this.inputMethodCnType$ = false;
//
// $(document).ready(function () {
// var ipt = getScanIpt();
// document.addEventListener('visibilitychange', pageVisible);
// ipt.addEventListener('change', scanDataChange);
// ipt.addEventListener('compositionstart', iptCompositionstart);
// ipt.addEventListener('compositionend', iptCompositionend);
// scanIptGetFocusStart();
// })
// }
var scanIptFocusTimer$ = null;
var inputMethodCnType$ = false;
var focusStop = true;
$(document).ready(function () {
$(document.body).on('focusin', function (e) {
var dom = e.target;
if (dom.id === 'scanIpt_') return;
scanIptGetFocusStop();
})
$(document.body).on('focusout', function (e) {
var dom = e.target;
if (dom.id === 'scanIpt_') return;
scanIptGetFocusStart();
// function Scan () {
// this.scanIptFocusTimer$ = null;
// this.inputMethodCnType$ = false;
//
// $(document).ready(function () {
// var ipt = getScanIpt();
// document.addEventListener('visibilitychange', pageVisible);
// ipt.addEventListener('change', scanDataChange);
// ipt.addEventListener('compositionstart', iptCompositionstart);
// ipt.addEventListener('compositionend', iptCompositionend);
// scanIptGetFocusStart();
// })
// }
var scanIptFocusTimer$ = null;
var inputMethodCnType$ = false;
var focusStop = true;
$(document).ready(function () {
$(document.body).on('focusin', function (e) {
var dom = e.target;
if (dom.id === 'scanIpt_') return;
scanIptGetFocusStop();
})
$(document.body).on('focusout', function (e) {
var dom = e.target;
if (dom.id === 'scanIpt_') return;
scanIptGetFocusStart();
})
})
})
function scanStart () {
var ipt = getScanIpt();
focusStop = false;
ipt.focus();
document.addEventListener('visibilitychange', pageVisible);
ipt.addEventListener('change', scanDataChange);
ipt.addEventListener('compositionstart', iptCompositionstart);
ipt.addEventListener('compositionend', iptCompositionend);
scanIptGetFocusStart();
// var allFormDom = $("input, select, textarea");
// allFormDom.on('focus', function () {
// if (this.id === 'scanIpt_') return;
// scanIptGetFocusStop();
// })
// allFormDom.on('blur', function () {
// if (this.id === 'scanIpt_') return;
// scanIptGetFocusStart();
// })
}
function scanStop () {
focusStop = true;
var ipt = getScanIpt();
ipt.removeEventListener('change', scanDataChange);
ipt.removeEventListener('compositionstart', iptCompositionstart);
scanIptGetFocusStop();
document.removeEventListener('visibilitychange', pageVisible);
}
window.onbeforeunload = function (e) {
scanStop();
}
// $(document).ready(function () {
// var ipt = getScanIpt();
// document.addEventListener('visibilitychange', pageVisible);
// ipt.addEventListener('change', scanDataChange);
// ipt.addEventListener('compositionstart', iptCompositionstart);
// ipt.addEventListener('compositionend', iptCompositionend);
// })
function getScanIpt () {
return document.getElementById("scanIpt_");
}
function pageVisible () {
var state = document.visibilityState;
if (state === 'visible') {
function scanStart () {
var ipt = getScanIpt();
focusStop = false;
ipt.focus();
document.addEventListener('visibilitychange', pageVisible);
ipt.addEventListener('change', scanDataChange);
ipt.addEventListener('compositionstart', iptCompositionstart);
ipt.addEventListener('compositionend', iptCompositionend);
scanIptGetFocusStart();
} else if (state === 'hidden') {
// var allFormDom = $("input, select, textarea");
// allFormDom.on('focus', function () {
// if (this.id === 'scanIpt_') return;
// scanIptGetFocusStop();
// })
// allFormDom.on('blur', function () {
// if (this.id === 'scanIpt_') return;
// scanIptGetFocusStart();
// })
}
function scanStop () {
focusStop = true;
var ipt = getScanIpt();
ipt.removeEventListener('change', scanDataChange);
ipt.removeEventListener('compositionstart', iptCompositionstart);
scanIptGetFocusStop();
document.removeEventListener('visibilitychange', pageVisible);
}
window.onbeforeunload = function (e) {
scanStop();
}
// $(document).ready(function () {
// var ipt = getScanIpt();
// document.addEventListener('visibilitychange', pageVisible);
// ipt.addEventListener('change', scanDataChange);
// ipt.addEventListener('compositionstart', iptCompositionstart);
// ipt.addEventListener('compositionend', iptCompositionend);
// })
function getScanIpt () {
return document.getElementById("scanIpt_");
}
function pageVisible () {
var state = document.visibilityState;
if (state === 'visible') {
scanIptGetFocusStart();
} else if (state === 'hidden') {
scanIptGetFocusStop();
}
}
}
function scanIptGetFocusStart () {
if (focusStop) return;
var ipt = getScanIpt();
if (ipt) {
scanIptFocusTimer$ = iptFocus(ipt);
function scanIptGetFocusStart () {
if (focusStop) return;
var ipt = getScanIpt();
if (ipt) {
scanIptFocusTimer$ = iptFocus(ipt);
}
}
}
function scanIptGetFocusStop () {
if (scanIptFocusTimer$) {
clearInterval(scanIptFocusTimer$);
scanIptFocusTimer$ = null;
function scanIptGetFocusStop () {
if (scanIptFocusTimer$) {
clearInterval(scanIptFocusTimer$);
scanIptFocusTimer$ = null;
}
}
}
function iptFocus () {
var ipt = getScanIpt();
var timer = setInterval(function () {
if (ipt !== document.activeElement && scanIptFocusTimer$) {
ipt.focus();
function iptFocus () {
var ipt = getScanIpt();
var timer = setInterval(function () {
if (ipt !== document.activeElement && scanIptFocusTimer$) {
ipt.focus();
}
}, 300);
return timer;
}
function iptCompositionstart () {
inputMethodCnType$ = true;
}
function iptCompositionend () {
var ipt = getScanIpt();
if (inputMethodCnType$) {
jp.alert('请将输入法设置为英文');
inputMethodCnType$ = false;
ipt.value = '';
}
}, 300);
return timer;
}
function iptCompositionstart () {
inputMethodCnType = true;
}
function iptCompositionend () {
var ipt = getScanIpt();
if (inputMethodCnType$) {
jp.alert('请将输入法设置为英文');
inputMethodCnType$ = false;
ipt.value = '';
}
}
function scanDataChange () {
var elem = getScanIpt();
var val = $(elem).val();
if (!val) {
return;
function scanDataChange () {
var elem = getScanIpt();
var val = $(elem).val();
if (!val) {
return;
}
try {
window.scanIptChangeCallback && window.scanIptChangeCallback(val);
} catch (e) {}
setTimeout(function () {
$(elem).val('');
$(elem).blur();
}, 100)
}
try {
window.scanIptChangeCallback && window.scanIptChangeCallback(val);
} catch (e) {}
setTimeout(function () {
$(elem).val('');
$(elem).blur();
}, 100)
}
</script>
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
View file @
115b9d23
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
var
LODOP
;
<
script
>
var
LODOP
;
$
(
document
).
ready
(
function
()
{
$
(
'#goodsTable'
).
bootstrapTable
({
//请求方法
method
:
'post'
,
//类型json
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
//显示检索按钮
showSearch
:
true
,
//显示刷新按钮
showRefresh
:
true
,
//显示切换手机试图按钮
showToggle
:
true
,
//显示 内容列下拉框
showColumns
:
true
,
//显示到处按钮
showExport
:
true
,
//显示切换分页按钮
showPaginationSwitch
:
true
,
//显示详情按钮
detailView
:
true
,
//显示详细内容函数
detailFormatter
:
"detailFormatter"
,
//最低显示2行
minimumCountColumns
:
2
,
//是否显示行间隔色
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
//是否显示分页(*)
pagination
:
true
,
//排序方式
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
pageNumber
:
1
,
//每页的记录行数(*)
pageSize
:
10
,
//可供选择的每页的行数(*)
pageList
:
[
10
,
25
,
50
,
100
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/goods/goods/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"
,
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenu
:
'#context-menu'
,
onContextMenuItem
:
function
(
row
,
$el
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
edit
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
view
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
jp
.
confirm
(
'确认要删除该货品模块记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/goods/goods/delete?id="
+
row
.
id
,
function
(
data
){
if
(
data
.
success
){
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
});
}
},
onClickRow
:
function
(
row
,
$el
){
},
onShowSearch
:
function
()
{
$
(
"#search-collapse"
).
slideToggle
();
},
columns
:
[{
checkbox
:
true
}
,{
field
:
'batchNum'
,
title
:
'批次号'
,
sortable
:
true
,
sortName
:
'batchNum'
,
formatter
:
function
(
value
,
row
,
index
){
value
=
jp
.
unescapeHTML
(
value
);
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
}
}
,{
field
:
'time'
,
title
:
'时间'
,
sortable
:
true
,
sortName
:
'time'
}
,{
field
:
'remarks'
,
title
:
'备注信息'
,
sortable
:
true
,
sortName
:
'remarks'
}
,{
field
:
'operator.name'
,
title
:
'操作人'
,
sortable
:
true
,
sortName
:
'operator.name'
}
]
});
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
$
(
'#goodsTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#goodsTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#goodsTable'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#view,#edit'
).
prop
(
'disabled'
,
$
(
'#goodsTable'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
});
$
(
"#btnImport"
).
click
(
function
(){
jp
.
open
({
type
:
2
,
area
:
[
500
,
200
],
auto
:
true
,
title
:
"导入数据"
,
content
:
"${ctx}/tag/importExcel"
,
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn1
:
function
(
index
,
layero
){
jp
.
downloadFile
(
'${ctx}/warehouse/goods/goods/import/template'
);
},
btn2
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/goods/goods/import'
,
function
(
data
)
{
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
refresh
();
}
else
{
jp
.
error
(
data
.
msg
);
}
jp
.
close
(
index
);
});
//调用保存事件
return
false
;
},
btn3
:
function
(
index
){
jp
.
close
(
index
);
}
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
var
sortName
=
$
(
'#goodsTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortOrder
=
$
(
'#goodsTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
values
=
""
;
for
(
var
key
in
searchParam
){
values
=
values
+
key
+
"="
+
searchParam
[
key
]
+
"&"
;
$
(
'#goodsTable'
).
bootstrapTable
({
//请求方法
method
:
'post'
,
//类型json
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
//显示检索按钮
showSearch
:
true
,
//显示刷新按钮
showRefresh
:
true
,
//显示切换手机试图按钮
showToggle
:
true
,
//显示 内容列下拉框
showColumns
:
true
,
//显示到处按钮
showExport
:
true
,
//显示切换分页按钮
showPaginationSwitch
:
true
,
//显示详情按钮
detailView
:
true
,
//显示详细内容函数
detailFormatter
:
"detailFormatter"
,
//最低显示2行
minimumCountColumns
:
2
,
//是否显示行间隔色
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
//是否显示分页(*)
pagination
:
true
,
//排序方式
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
pageNumber
:
1
,
//每页的记录行数(*)
pageSize
:
10
,
//可供选择的每页的行数(*)
pageList
:
[
10
,
25
,
50
,
100
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/goods/goods/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"
,
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenu
:
'#context-menu'
,
onContextMenuItem
:
function
(
row
,
$el
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
edit
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
view
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
jp
.
confirm
(
'确认要删除该货品模块记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/goods/goods/delete?id="
+
row
.
id
,
function
(
data
){
if
(
data
.
success
){
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
});
}
},
onClickRow
:
function
(
row
,
$el
){
},
onShowSearch
:
function
()
{
$
(
"#search-collapse"
).
slideToggle
();
},
columns
:
[{
checkbox
:
true
}
,{
field
:
'batchNum'
,
title
:
'批次号'
,
sortable
:
true
,
sortName
:
'batchNum'
,
formatter
:
function
(
value
,
row
,
index
){
value
=
jp
.
unescapeHTML
(
value
);
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
}
}
,{
field
:
'time'
,
title
:
'时间'
,
sortable
:
true
,
sortName
:
'time'
}
if
(
sortName
!=
undefined
&&
sortOrder
!=
undefined
){
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
,{
field
:
'remarks'
,
title
:
'备注信息'
,
sortable
:
true
,
sortName
:
'remarks'
}
,{
field
:
'operator.name'
,
title
:
'操作人'
,
sortable
:
true
,
sortName
:
'operator.name'
}
]
});
jp
.
downloadFile
(
'${ctx}/warehouse/goods/goods/export?'
+
values
);
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
'#beginTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
$
(
'#endTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#goodsTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
$
(
'#goodsTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#goodsTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#goodsTable'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#view,#edit'
).
prop
(
'disabled'
,
$
(
'#goodsTable'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
});
$
(
"#btnImport"
).
click
(
function
(){
jp
.
open
({
type
:
2
,
area
:
[
500
,
200
],
auto
:
true
,
title
:
"导入数据"
,
content
:
"${ctx}/tag/importExcel"
,
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn1
:
function
(
index
,
layero
){
jp
.
downloadFile
(
'${ctx}/warehouse/goods/goods/import/template'
);
},
btn2
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/goods/goods/import'
,
function
(
data
)
{
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
refresh
();
}
else
{
jp
.
error
(
data
.
msg
);
}
jp
.
close
(
index
);
});
//调用保存事件
return
false
;
},
btn3
:
function
(
index
){
jp
.
close
(
index
);
}
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
var
sortName
=
$
(
'#goodsTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortOrder
=
$
(
'#goodsTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
values
=
""
;
for
(
var
key
in
searchParam
){
values
=
values
+
key
+
"="
+
searchParam
[
key
]
+
"&"
;
}
if
(
sortName
!=
undefined
&&
sortOrder
!=
undefined
){
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
}
jp
.
downloadFile
(
'${ctx}/warehouse/goods/goods/export?'
+
values
);
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
'#beginTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
$
(
'#endTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#goodsTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
});
}
function
deleteAll
(){
jp
.
confirm
(
'确认要删除该货品模块记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/goods/goods/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
if
(
data
.
success
){
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
//刷新列表
function
refresh
(){
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
openSaveDialog
(
'新增货品'
,
"${ctx}/warehouse/goods/goods/form/add"
,
'1200'
,
'800'
)
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
function
deleteAll
(){
jp
.
confirm
(
'确认要删除该货品模块记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/goods/goods/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
if
(
data
.
success
){
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
//刷新列表
function
refresh
(){
$
(
'#goodsTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
openSaveDialog
(
'新增货品'
,
"${ctx}/warehouse/goods/goods/form/add"
,
'1200'
,
'800'
)
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
openSaveDialog
(
"编辑货品"
,
"${ctx}/warehouse/goods/goods/form/edit?id="
+
id
,
'1200'
,
'800'
);
}
function
view
(
id
){
//没有权限时,不显示确定按钮
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
openViewDialog
(
"查看货品"
,
"${ctx}/warehouse/goods/goods/form/view?id="
+
id
,
'1200'
,
'800'
);
}
function
detailFormatter
(
index
,
row
)
{
var
htmltpl
=
$
(
"#goodsChildrenTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/goods/goods/detail?id="
+
row
.
id
,
function
(
goods
){
var
goodsChild1RowIdx
=
0
,
goodsChild1Tpl
=
$
(
"#goodsChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
goods
.
goodsInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
data1
[
i
].
dict
=
{};
data1
[
i
].
dict
.
state
=
jp
.
getDictLabel
(
$
{
fns
:
toJson
(
fns
:
getDictList
(
'wh_stockroom_state'
))},
data1
[
i
].
state
,
"-"
);
addRow
(
'#goodsChild-'
+
row
.
id
+
'-1-List'
,
goodsChild1RowIdx
,
goodsChild1Tpl
,
data1
[
i
]);
goodsChild1RowIdx
=
goodsChild1RowIdx
+
1
;
}
})
return
html
;
jp
.
openSaveDialog
(
"编辑货品"
,
"${ctx}/warehouse/goods/goods/form/edit?id="
+
id
,
'1200'
,
'800'
);
}
function
view
(
id
){
//没有权限时,不显示确定按钮
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
openViewDialog
(
"查看货品"
,
"${ctx}/warehouse/goods/goods/form/view?id="
+
id
,
'1200'
,
'800'
);
}
function
detailFormatter
(
index
,
row
)
{
var
htmltpl
=
$
(
"#goodsChildrenTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/goods/goods/detail?id="
+
row
.
id
,
function
(
goods
){
var
goodsChild1RowIdx
=
0
,
goodsChild1Tpl
=
$
(
"#goodsChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
goods
.
goodsInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
data1
[
i
].
dict
=
{};
data1
[
i
].
dict
.
state
=
jp
.
getDictLabel
(
$
{
fns
:
toJson
(
fns
:
getDictList
(
'wh_stockroom_state'
))},
data1
[
i
].
state
,
"-"
);
addRow
(
'#goodsChild-'
+
row
.
id
+
'-1-List'
,
goodsChild1RowIdx
,
goodsChild1Tpl
,
data1
[
i
]);
goodsChild1RowIdx
=
goodsChild1RowIdx
+
1
;
}
})
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
,
showAction
:
function
()
{
return
row
.
qrCode
?
!
(
row
.
qrCode
.
state
!==
'0'
)
:
true
;
}
}));
}
function
printQr_
(
id
)
{
try
{
if
(
!
LODOP
){
initLodop
();
}
if
(
LODOP
){
jp
.
loading
(
'loading...'
);
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
row
=
res
.
body
.
goodsInfo
.
qrCode
;
LODOP
.
PRINT_INIT
(
"打印货品"
);
LODOP
.
SET_PRINT_PAGESIZE
(
1
,
1600
,
1000
,
0
)
createAllPage
(
row
);
LODOP
.
PREVIEW
();
jp
.
close
();
})
}
}
catch
(
e
){
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
list
=
res
.
body
.
goodsInfo
.
qrCodeList
;
jp
.
close
();
})
}
}
function
printQr
(
id
)
{
jp
.
loading
(
'loading...'
);
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
if
(
res
.
success
)
{
var
row
=
res
.
body
.
goodsInfo
.
qrCode
;
var
imgUrl
=
"${ctxPath}/"
+
row
.
url
;
// jp.showPic(imgUrl);
_thermal_Image_print_
(
imgUrl
);
}
jp
.
close
();
})
}
function
createAllPage
(
item
){
// if(!list){
// return;
// }
// list.forEach(function(item){
// LODOP.NewPage();
// var imgUrl = "${ctxPath}/" + item.url;
// LODOP.ADD_PRINT_IMAGE('0%',"0%","100%","100%","<img width='150' border='0' src='"+imgUrl+"' />");
// })
LODOP
.
NewPage
();
var
imgUrl
=
"${ctxPath}/"
+
item
.
url
;
LODOP
.
ADD_PRINT_IMAGE
(
'0%'
,
"0%"
,
"100%"
,
"100%"
,
"<img width='800' border='0' src='"
+
imgUrl
+
"' />"
);
LODOP
.
SET_PRINT_STYLEA
(
0
,
"Stretch"
,
1
)
}
function
cleanQr
(
id
)
{
jp
.
confirm
(
'确认清除二维码吗?'
,
function
(){
jp
.
get
(
"${ctx}/warehouse/goods/goods/cleanQr?goodsInfoId="
+
id
,
function
(
res
)
{
res
.
success
&&
jp
.
success
(
'清除二维码成功!'
);
})
})
}
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
,
showAction
:
function
()
{
return
row
.
qrCode
?
!
(
row
.
qrCode
.
state
!==
'0'
)
:
true
;
}
}));
}
function
printQr_
(
id
)
{
try
{
if
(
!
LODOP
){
initLodop
();
}
if
(
LODOP
){
jp
.
loading
(
'loading...'
);
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
row
=
res
.
body
.
goodsInfo
.
qrCode
;
LODOP
.
PRINT_INIT
(
"打印货品"
);
LODOP
.
SET_PRINT_PAGESIZE
(
1
,
1600
,
1000
,
0
)
createAllPage
(
row
);
LODOP
.
PREVIEW
();
jp
.
close
();
})
}
}
catch
(
e
){
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
list
=
res
.
body
.
goodsInfo
.
qrCodeList
;
jp
.
close
();
})
}
}
function
printQr
(
id
)
{
jp
.
loading
(
'loading...'
);
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
if
(
res
.
success
)
{
var
row
=
res
.
body
.
goodsInfo
.
qrCode
;
var
imgUrl
=
"${ctxPath}/"
+
row
.
url
;
jp
.
showPic
(
imgUrl
);
}
jp
.
close
();
})
}
function
createAllPage
(
item
){
// if(!list){
// return;
// }
// list.forEach(function(item){
// LODOP.NewPage();
// var imgUrl = "${ctxPath}/" + item.url;
// LODOP.ADD_PRINT_IMAGE('0%',"0%","100%","100%","<img width='150' border='0' src='"+imgUrl+"' />");
// })
LODOP
.
NewPage
();
var
imgUrl
=
"${ctxPath}/"
+
item
.
url
;
LODOP
.
ADD_PRINT_IMAGE
(
'0%'
,
"0%"
,
"100%"
,
"100%"
,
"<img width='800' border='0' src='"
+
imgUrl
+
"' />"
);
LODOP
.
SET_PRINT_STYLEA
(
0
,
"Stretch"
,
1
)
}
function
cleanQr
(
id
)
{
jp
.
confirm
(
'确认清除二维码吗?'
,
function
(){
jp
.
get
(
"${ctx}/warehouse/goods/goods/cleanQr?goodsInfoId="
+
id
,
function
(
res
)
{
res
.
success
&&
jp
.
success
(
'清除二维码成功!'
);
})
})
}
<
/script
>
<
script
type
=
"text/template"
id
=
"goodsChildrenTpl"
>
//<!--
<
div
class
=
"tabs-container"
>
...
...
@@ -374,8 +375,8 @@ $(document).ready(function() {
<
/table
>
<
/div
>
<
/div>/
/-->
<
/script
>
<
script
type
=
"text/template"
id
=
"goodsChild1Tpl"
>
//<!--
<
/script
>
<
script
type
=
"text/template"
id
=
"goodsChild1Tpl"
>
//<!--
<
tr
>
<
td
>
{{
row
.
type
.
name
}}
...
...
@@ -412,4 +413,4 @@ $(document).ready(function() {
{{
/
showAction
}}
<
/td
>
<
/tr>/
/-->
<
/script
>
<
/script
>
src/main/webapp/webpage/modules/warehouse/goods/goodsList.jsp
View file @
115b9d23
...
...
@@ -8,6 +8,7 @@
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<
%@
include
file=
"goodsList.js"
%
>
<
%@
include
file=
"logic.js"
%
>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
...
...
@@ -121,4 +122,4 @@
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
src/main/webapp/webpage/modules/warehouse/goods/logic.js
View file @
115b9d23
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
var
printerProtocolMap
=
{
usb
:
'usb'
,
tcp
:
'tcp'
}
var
printerDirectiveMap
=
{
_thermal_zpl_draw_print_
:
'_thermal_zpl_draw_print_'
,
_thermal_tspl_draw_print_
:
'_thermal_tspl_draw_print_'
,
_thermal_escpos_draw_print_
:
'_thermal_escpos_draw_print_'
}
var
defPrintOption
=
{
// post ws
linkDeviceType
:
'post'
,
// usb tcp
protocol
:
'usb'
protocol
:
printerProtocolMap
.
usb
,
// 打印机指令
printerDirective
:
printerDirectiveMap
.
_thermal_zpl_draw_print_
}
var
device
=
''
;
var
printCallback
=
null
;
var
startLink
=
false
;
const
__io_lnk
=
function
()
{
return
'localhost:8008'
...
...
@@ -23,49 +39,165 @@ const __ws_url = function() {
* @private
*/
function
_thermal_enum_printer_
()
{
if
(
startLink
)
return
;
startLink
=
true
;
var
onBack
=
function
onBack
(
isOk
,
res
)
{
startLink
=
false
;
if
(
!
isOk
)
{
output_control
(
'通讯失败:'
+
JSON
.
stringify
(
res
));
jp
.
warning
(
'通讯失败:'
+
JSON
.
stringify
(
res
));
return
}
if
(
res
.
code
!==
0
)
{
output_control
(
res
.
msg
);
jp
.
warning
(
res
.
msg
);
return
}
let
enum_list
=
document
.
getElementById
(
'enum_list'
)
if
(
enum_list
.
length
>
0
)
{
enum_list
.
clear
()
}
if
(
res
.
device
.
length
>
0
)
{
// for (let i = 0; i < res.device.length; i++) {
// let opt = document.createElement('option')
// opt.text = res.device[i]
// enum_list.options.add(opt)
// }
console
.
log
(
res
);
device
=
res
.
device
[
0
];
printCallback
&&
printCallback
();
}
else
{
output_control
(
res
.
message
)
jp
.
warning
(
res
.
message
)
}
}
let
pack
=
{
command
:
'_thermal_enum_printer_'
,
require
:
require_type
()
,
require
:
defPrintOption
.
protocol
,
}
on_link_device
(
pack
,
onBack
);
}
function
require_type
()
{
return
defPrintOption
.
protocol
;
var
Image_style_letType
=
{
'1'
:
'误差扩撒'
,
'2'
:
'有序抖动'
,
'3'
:
'阈值'
}
var
pageConfig
=
{
// 纸张宽度
draw_w
:
''
,
// 页长
draw_h
:
''
,
// 横向位置
Image_x
:
''
,
// 纵向位置
Image_y
:
''
,
// 图片宽度
Image_w
:
''
,
// 图片高度
Image_h
:
''
,
// 图片阈值
Image_Threshold
:
''
,
// 图片打印模式
Image_style_let
:
'1'
,
}
//绘图打印图片
function
_thermal_Image_print_
(
url
)
{
if
(
!
device
)
{
printCallback
=
printImage
.
bind
(
window
,
url
);
_thermal_enum_printer_
();
}
else
{
printImage
(
url
);
}
}
function
printImage
(
url
)
{
//直接打印( 打印:'true' / 预览:'false' )
var
printdirectly
=
'true'
//获取预览图为base64数据( base64:'true' / 路径:'false' )
var
get_base64_img
=
'false'
var
onBack
=
function
(
isok
,
res
)
{
if
(
!
isok
)
{
jp
.
warning
(
'通讯失败:'
+
JSON
.
stringify
(
res
));
return
}
if
(
res
.
code
!==
0
)
{
jp
.
warning
(
res
.
msg
);
return
}
if
(
printdirectly
===
'true'
)
{
jp
.
success
(
'绘图打印成功'
)
}
else
{
if
(
get_base64_img
===
'true'
)
{
console
.
log
(
res
.
image_base64
)
}
else
{
console
.
log
(
res
.
image_path
)
}
}
}
var
pack
=
{
command
:
defPrintOption
.
printerDirective
,
device
:
device
,
printdirectly
:
'true'
,
measurement_mode
:
'mm'
,
canvas_size
:
{
width
:
pageConfig
.
draw_w
,
height
:
pageConfig
.
draw_h
},
get_base64_img
:
'false'
,
is_label
:
'false'
,
print
:
[
{
func
:
"PDSetAddImageMode"
,
iMode
:
pageConfig
.
Image_style_let
,
iValueThreshold
:
pageConfig
.
Image_Threshold
},
{
func
:
"PDDrawImage"
,
iX
:
pageConfig
.
Image_x
,
iY
:
pageConfig
.
Image_y
,
iWidth
:
pageConfig
.
Image_w
,
iHeight
:
pageConfig
.
Image_h
,
szImageFile
:
url
},
]
}
on_link_device
(
pack
,
onBack
);
}
function
on_link_device
(
pack
,
onBack
)
{
let
radio
=
document
.
getElementsByName
(
'req_model'
)
if
(
radio
!=
null
)
{
if
(
radio
.
length
>
0
)
{
if
(
radio
[
0
].
checked
)
{
jqpost
(
__io_url
(),
pack
,
onback
)
}
if
(
defPrintOption
.
linkDeviceType
===
'post'
)
{
jqPost
(
__io_url
(),
pack
,
onBack
);
}
else
if
(
defPrintOption
.
linkDeviceType
===
'ws'
)
{
jqLink
(
__ws_url
(),
pack
,
onBack
);
}
}
function
jqPost
(
url
,
pack
,
callback
)
{
$
.
ajax
({
url
:
url
,
type
:
'POST'
,
data
:
JSON
.
stringify
(
pack
),
dataType
:
'json'
,
success
:
function
(
data
)
{
callback
(
true
,
data
)
},
error
:
function
(
err
)
{
callback
(
false
,
err
)
}
if
(
radio
.
length
>
1
)
{
if
(
radio
[
1
].
checked
)
{
jqlink
(
__ws_url
(),
pack
,
onback
)
}
})
}
var
ws
=
null
;
function
jqLink
(
url
,
pack
,
callback
)
{
if
(
ws
==
null
)
{
ws
=
new
WebSocket
(
url
);
ws
.
onback
=
callback
;
ws
.
onopen
=
function
(
evt
)
{
ws
.
send
(
JSON
.
stringify
(
pack
))
};
ws
.
onclose
=
function
(
evt
)
{
ws
=
null
};
ws
.
onmessage
=
function
(
evt
)
{
ws
.
onback
(
true
,
eval
(
'('
+
evt
.
data
+
')'
))
};
ws
.
onerror
=
function
(
evt
)
{
ws
.
onback
(
false
,
evt
)
}
}
else
{
ws
.
onback
=
callback
;
ws
.
send
(
JSON
.
stringify
(
pack
))
}
}
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.js
View file @
115b9d23
...
...
@@ -182,22 +182,22 @@
}
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
var
sortName
=
$
(
'#ledgerTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortOrder
=
$
(
'#ledgerTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
values
=
""
;
for
(
var
key
in
searchParam
){
values
=
values
+
key
+
"="
+
searchParam
[
key
]
+
"&"
;
}
if
(
sortName
!=
undefined
&&
sortOrder
!=
undefined
){
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
}
jp
.
downloadFile
(
'${ctx}/warehouse/ledger/ledger/export?'
+
values
);
})
//
$("#export").click(function(){//导出Excel文件
//
var searchParam = $("#searchForm").serializeJSON();
//
searchParam.pageNo = 1;
//
searchParam.pageSize = -1;
//
var sortName = $('#ledgerTable').bootstrapTable("getOptions", "none").sortName;
//
var sortOrder = $('#ledgerTable').bootstrapTable("getOptions", "none").sortOrder;
//
var values = "";
//
for(var key in searchParam){
//
values = values + key + "=" + searchParam[key] + "&";
//
}
//
if(sortName != undefined && sortOrder != undefined){
//
values = values + "orderBy=" + sortName + " "+sortOrder;
//
}
//
//
jp.downloadFile('${ctx}/warehouse/ledger/ledger/export?'+values);
//
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
...
...
@@ -210,6 +210,46 @@
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#export"
).
click
(
function
()
{
jp
.
open
({
type
:
1
,
title
:
'导出'
,
auto
:
true
,
area
:
[
'600'
,
'500'
],
content
:
Mustache
.
render
(
$
(
"#exportTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
),{}),
btn
:
[
'确定'
,
'关闭'
],
success
(
layeor
,
i
)
{
var
beginTime
=
layeor
.
find
(
'#beginTime'
);
var
endTime
=
layeor
.
find
(
'#endTime'
);
beginTime
.
datetimepicker
({
format
:
"YYYY-MM-DD"
});
endTime
.
datetimepicker
({
format
:
"YYYY-MM-DD"
});
},
yes
(
i
,
layeor
)
{
var
form
=
layeor
.
find
(
"#export-searchForm"
);
var
isValidate
=
form
.
validate
().
form
();
if
(
!
isValidate
)
{
return
false
;
}
else
{
var
params
=
form
.
serializeJSON
();
params
.
beginTime
=
params
.
beginTime
+
' 00:00:00'
;
params
.
endTime
=
params
.
endTime
+
' 23:59:59'
;
var
str
=
''
;
for
(
var
key
in
params
)
{
str
+=
'&'
+
key
+
'='
+
params
[
key
]
}
window
.
open
(
"${ctx}/warehouse/ledger/ledger/ledgerStreamWater?"
+
str
.
substr
(
1
));
jp
.
close
(
i
);
}
},
cancel
()
{
}
})
})
});
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.jsp
View file @
115b9d23
...
...
@@ -7,6 +7,8 @@
<meta
name=
"decorator"
content=
"ani"
/>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/plugin/layui/dist/css/layui.css"
>
<script
src=
"${ctxStatic}/plugin/layui/dist/layui.js"
></script>
<
%@
include
file=
"ledgerList.js"
%
>
<
%@
include
file=
"../../../include/scan.jsp"
%
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
...
...
@@ -98,6 +100,9 @@
<button
class=
"btn btn-default"
onclick=
"viewScanData()"
>
<i
class=
"fa fa-search-plus"
></i>
查看二维码数据
</button>
<button
id=
"export"
class=
"btn btn-warning"
>
<i
class=
"fa fa-file-excel-o"
></i>
导出
</button>
</div>
<!-- 表格 -->
...
...
@@ -144,5 +149,34 @@
<
/div
>
<
/div
>
</script>
<script
type=
"text/html"
id=
"exportTpl"
>
<
div
id
=
"export-searchForm-box"
class
=
"collapse show"
>
<
div
class
=
"accordion-inner"
>
<
form
:
form
id
=
"export-searchForm"
class
=
"form-horizontal"
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-2 control-label"
>
品名:
<
/label
>
<
div
class
=
"col-sm-10 control-label text-left"
>
//
<!--<
sys
:
treeselect
id
=
"type"
name
=
"typeId"
title
=
"品名代码"
url
=
"/warehouse/materialtype/materialType/treeData"
notAllowSelectParent
=
"true"
cssClass
=
"form-control required"
allowClear
=
"true"
allowSearch
=
"true"
/>
//-->
<
/div
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-2 control-label"
>
开始时间:
<
/label
>
<
div
class
=
"col-sm-10 control-label text-left"
>
<
input
class
=
"form-control required"
name
=
"beginTime"
id
=
"beginTime"
/>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-2 control-label"
>
结束时间:
<
/label
>
<
div
class
=
"col-sm-10 control-label text-left"
>
<
input
class
=
"form-control required"
name
=
"endTime"
id
=
"endTime"
/>
<
/div
>
<
/div
>
<
/form:form
>
<
/div
>
<
/div
>
</script>
</body>
</html>
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionDetail.jsp
View file @
115b9d23
...
...
@@ -109,27 +109,27 @@
})
}
},
{
field: 'num',
title: '数量',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoNumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: 'infoSum',
title: '总价',
sortName: 'infoSum',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoInfoSumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
//
{
//
field: 'num',
//
title: '数量',
//
formatter: function (value, row, index) {
//
return Mustache.render($("#ledgerInfoNumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
//
row: row,
//
idx: index
//
})
//
}
//
},
//
{
//
field: 'infoSum',
//
title: '总价',
//
sortName: 'infoSum',
//
formatter: function (value, row, index) {
//
return Mustache.render($("#ledgerInfoInfoSumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
//
row: row,
//
idx: index
//
})
//
}
//
},
{
field: 'receiver.name',
title: '领用人',
...
...
@@ -425,6 +425,7 @@
auto: true,
area: ['1200', '600'],
content: $("#scanTpl").html(),
btn: ['确定', '关闭'],
success: function () {
// $("#scanResult").focus();
scanStart();
...
...
@@ -436,8 +437,14 @@
jp.alert('至少选择一条数据');
return;
}
selectDetailHandle(getScanTable(), selectTableData);
top.layer.close(index);
if (selectTableData.some(function (e) {
return !e.selectNum;
})) {
jp.alert('选择的数据必须填写选择数量');
return false;
}
selectDetailHandle($(selector), selectTableData);
layer.close(index);
},
cancel () {
scanStop();
...
...
@@ -449,32 +456,23 @@
var json = JSON.parse(val);
var qrCodeId = json.code;
// var params = "qrId=" + json.code;
console.log(val)
jp.get('${ctx}/warehouse/ledger/ledger/findByQrOrCode?qrCodeId=' + qrCodeId, function (res) {
jp.get('${ctx}/warehouse/ledger/ledger/findByQrOrCode?qrId=' + qrCodeId, function (res) {
var data = res.rows || [];
if (data.length) {
//
var item = data[0];
var item = data[0];
//
// /***
// * 重复的物资编码去重
// */
// var fined = getTableData().find(function(v){
// return v.ledgerInfo.code === item.code
// })
// if(fined){
// jp.warning('有物资重复不能领用');
// return;
// }
// $(selector).bootstrapTable('append', [
// {
// id: '',
// delFlag: 0,
// remarks: '',
// ledgerInfo: item
// }
// ]);
var fined = getSelectScanTable().find(function(v){
return v.ledgerInfo.code === item.code
})
if(fined){
jp.warning('有物资重复不能领用');
return;
}
getScanTable().bootstrapTable('append', item);
// $(elem).val('').focus();
debugger
console.log(data)
}else{
jp.warning('未找到任何数据!');
...
...
@@ -497,21 +495,25 @@
var keyList = addDetailColumns.key.split('|');
table.bootstrapTable('destroy').bootstrapTable({
data: [],
columns: labelList.map(function (el, index) {
var key = keyList[index];
return {
title: el,
field: keyList[index],
formatter (v, r, i) {
var result = v;
if (top.gridSelectColumnFormatterMap[key]) {
result = top.gridSelectColumnFormatterMap[key].formatter(v, r, i)
}
return result;
},
events: top.gridSelectColumnFormatterMap[key] ? top.gridSelectColumnFormatterMap[key].events : {}
}
})
columns: [
{ checkbox: true }
].concat(
labelList.map(function (el, index) {
var key = keyList[index];
return {
title: el,
field: keyList[index],
formatter (v, r, i) {
var result = v;
if (top.gridSelectColumnFormatterMap[key]) {
result = top.gridSelectColumnFormatterMap[key].formatter(v, r, i)
}
return result;
},
events: top.gridSelectColumnFormatterMap[key] ? top.gridSelectColumnFormatterMap[key].events : {}
}
})
)
})
}
...
...
@@ -603,7 +605,7 @@
value="{{row.ledgerInfo.type.code}}"/>
</script>
<script id="ledgerInfoTypeUnitTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoTypeUnit
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoTypeUnit
"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.type.unit" type="text" class="form-control" readonly
value="{{row.ledgerInfo.type.unit}}"/>
</script>
...
...
@@ -632,7 +634,7 @@
{{#row.receiver}}
<div class="sign-result">
<img src="{{row.receiver}}" alt="签名" width="100%" />
<span class="del-sign" onclick="delSign(this,
{{idx}}
)">×</span>
<span class="del-sign" onclick="delSign(this,
'{{idx}}'
)">×</span>
</div>
{{/row.receiver}}
{{^row.receiver}}
...
...
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionForm.jsp
View file @
115b9d23
...
...
@@ -154,23 +154,23 @@
<script
type=
"text/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
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>--%
>
<%--
&
lt
;
%&
ndash
;
<
form
:
input
path
=
"code"
htmlEscape
=
"false"
class
=
" form-control"
/>&
ndash
;
%&
gt
;
--%>
<%--
<
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
>
...
...
src/main/webapp/webpage/modules/warehouse/outbound/outboundDetail.jsp
View file @
115b9d23
...
...
@@ -46,30 +46,50 @@
}
},
{
field: 'ledgerInfo.
nam
e',
title: '物资
名称
',
field: 'ledgerInfo.
cod
e',
title: '物资
编码
',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfo
Nam
eTpl").html(), {
return Mustache.render($("#ledgerInfo
Cod
eTpl").html(), {
row: row,
idx: index
})
}
},
{
field: 'ledgerInfo.
cod
e',
title: '
物资编码
',
field: 'ledgerInfo.
type.nam
e',
title: '
品名
',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfo
CodeTpl").html(
), {
return Mustache.render($("#ledgerInfo
TypeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""
), {
row: row,
idx: index
})
}
},
{
field: 'ledgerInfo.type.
nam
e',
title: '
品名
代码',
field: 'ledgerInfo.type.
cod
e',
title: '代码',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoTypeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
return Mustache.render($("#ledgerInfoTypeCodeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: 'ledgerInfo.amount',
title: '单价',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoAmountTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: "ledgerInfo.type.unit",
title: '单位',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoTypeUnitTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
...
...
@@ -85,11 +105,22 @@
})
}
},
// {
// field: 'ledgerInfo.amount',
// title: '单价',
// formatter: function (value, row, index) {
// return Mustache.render($("#ledgerInfoAmountTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
// row: row,
// idx: index
// })
// }
// },
{
field: 'ledgerInfo.amount',
title: '单价',
field: 'receiver.name',
title: '领用人',
align: 'center',
formatter: function (value, row, index) {
return Mustache.render($("#
ledgerInfoAmount
Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
return Mustache.render($("#
receiver
Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
...
...
@@ -105,15 +136,15 @@
})
}
},
{
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('');
}
}
//
{
//
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('');
//
}
//
}
]
});
}
...
...
@@ -284,6 +315,16 @@
<sys:treeselect id="outboundInfoList{{idx}}_ledgerInfoType" name="outboundInfoList[{{idx}}].ledgerInfo.type.id" value="{{row.ledgerInfo.type.id}}" labelName="outboundInfoList{{idx}}.ledgerInfo.type.name" labelValue="{{row.ledgerInfo.type.name}}"
title="品名代码" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " disabled="disabled" allowClear="true"/>//-->
</script>
<script id="ledgerInfoTypeCodeTpl" type="text/html">
<input id="outboundInfoList{{idx}}_ledgerInfoTypeCode"
name="outboundInfoList[{{idx}}].ledgerInfo.type.code" type="text" class="form-control" readonly
value="{{row.ledgerInfo.type.code}}"/>
</script>
<script id="ledgerInfoTypeUnitTpl" type="text/html">
<input id="outboundInfoList{{idx}}_ledgerInfoTypeUnit"
name="outboundInfoList[{{idx}}].ledgerInfo.type.unit" type="text" class="form-control" readonly
value="{{row.ledgerInfo.type.unit}}"/>
</script>
<script id="ledgerInfoModelTpl" type="text/html">
<input id="outboundInfoList{{idx}}_ledgerInfoModel"
name="outboundInfoList[{{idx}}].ledgerInfo.model" type="text" class="form-control" readonly
...
...
@@ -294,7 +335,19 @@
name="outboundInfoList[{{idx}}].ledgerInfo.amount" type="text" readonly class="form-control"
value="{{row.ledgerInfo.amount}}"/>
</script>
<script id="receiverTpl" type="text/html">
<input type="hidden" name="outboundInfoList[{{idx}}].receiver" value="{{row.receiver}}">
<div class="sign-result">
{{#row.receiver}}
<div class="sign-result">
<img src="{{row.receiver}}" alt="签名" width="100%" />
</div>
{{/row.receiver}}
{{^row.receiver}}
暂无签名
{{/row.receiver}}
</div>
</script>
<script id="remarksTpl" type="text/html">
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="2"
onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
...
...
@@ -314,4 +367,4 @@
</div>
</div>
<br>
</script>
\ No newline at end of file
</script>
src/main/webapp/webpage/modules/warehouse/outbound/outboundList.js
View file @
115b9d23
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
$
(
document
).
ready
(
function
()
{
$
(
'#outboundTable'
).
bootstrapTable
({
//请求方法
method
:
'post'
,
//类型json
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
//显示检索按钮
showSearch
:
true
,
//显示刷新按钮
showRefresh
:
true
,
//显示切换手机试图按钮
showToggle
:
true
,
//显示 内容列下拉框
showColumns
:
true
,
//显示到处按钮
showExport
:
true
,
//显示切换分页按钮
showPaginationSwitch
:
true
,
//显示详情按钮
detailView
:
true
,
//显示详细内容函数
detailFormatter
:
"detailFormatter"
,
//最低显示2行
minimumCountColumns
:
2
,
//是否显示行间隔色
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
//是否显示分页(*)
pagination
:
true
,
//排序方式
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
pageNumber
:
1
,
//每页的记录行数(*)
pageSize
:
10
,
//可供选择的每页的行数(*)
pageList
:
[
10
,
25
,
50
,
100
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/outbound/outbound/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"
,
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenu
:
'#context-menu'
,
onContextMenuItem
:
function
(
row
,
$el
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
edit
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
view
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
jp
.
confirm
(
'确认要删除该出库信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/outbound/outbound/delete?id="
+
row
.
id
,
function
(
data
){
if
(
data
.
success
){
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
});
}
},
onClickRow
:
function
(
row
,
$el
){
},
onShowSearch
:
function
()
{
$
(
"#search-collapse"
).
slideToggle
();
},
columns
:
[{
checkbox
:
true
}
,{
field
:
'number'
,
title
:
'出库单号'
,
sortable
:
true
,
sortName
:
'number'
,
formatter
:
function
(
value
,
row
,
index
){
value
=
jp
.
unescapeHTML
(
value
);
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
}
}
,{
field
:
'outboundTime'
,
title
:
'出库时间'
,
sortable
:
true
,
sortName
:
'outboundTime'
}
,{
field
:
'type'
,
title
:
'出库分类'
,
sortable
:
true
,
sortName
:
'type'
,
formatter
:
function
(
value
,
row
,
index
){
return
jp
.
getDictLabel
(
$
{
fns
:
toJson
(
fns
:
getDictList
(
'wh_delivery_type'
))},
value
,
"-"
);
}
}
,{
field
:
'operator.name'
,
title
:
'操作人'
,
sortable
:
true
,
sortName
:
'operator.name'
}
,{
field
:
'remarks'
,
title
:
'备注信息'
,
sortable
:
true
,
sortName
:
'remarks'
}
]
});
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
$
(
'#outboundTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#outboundTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
<
script
>
$
(
document
).
ready
(
function
()
{
$
(
'#outboundTable'
).
bootstrapTable
({
//请求方法
method
:
'post'
,
//类型json
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
//显示检索按钮
showSearch
:
true
,
//显示刷新按钮
showRefresh
:
true
,
//显示切换手机试图按钮
showToggle
:
true
,
//显示 内容列下拉框
showColumns
:
true
,
//显示到处按钮
showExport
:
true
,
//显示切换分页按钮
showPaginationSwitch
:
true
,
//显示详情按钮
detailView
:
true
,
//显示详细内容函数
detailFormatter
:
"detailFormatter"
,
//最低显示2行
minimumCountColumns
:
2
,
//是否显示行间隔色
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
//是否显示分页(*)
pagination
:
true
,
//排序方式
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
pageNumber
:
1
,
//每页的记录行数(*)
pageSize
:
10
,
//可供选择的每页的行数(*)
pageList
:
[
10
,
25
,
50
,
100
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/outbound/outbound/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"
,
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenu
:
'#context-menu'
,
onContextMenuItem
:
function
(
row
,
$el
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
edit
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
view
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
jp
.
confirm
(
'确认要删除该出库信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/outbound/outbound/delete?id="
+
row
.
id
,
function
(
data
){
if
(
data
.
success
){
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
});
}
},
onClickRow
:
function
(
row
,
$el
){
},
onShowSearch
:
function
()
{
$
(
"#search-collapse"
).
slideToggle
();
},
columns
:
[{
checkbox
:
true
}
,{
field
:
'number'
,
title
:
'出库单号'
,
sortable
:
true
,
sortName
:
'number'
,
formatter
:
function
(
value
,
row
,
index
){
value
=
jp
.
unescapeHTML
(
value
);
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
}
}
,{
field
:
'outboundTime'
,
title
:
'出库时间'
,
sortable
:
true
,
sortName
:
'outboundTime'
}
,{
field
:
'type'
,
title
:
'出库分类'
,
sortable
:
true
,
sortName
:
'type'
,
formatter
:
function
(
value
,
row
,
index
){
return
jp
.
getDictLabel
(
$
{
fns
:
toJson
(
fns
:
getDictList
(
'wh_delivery_type'
))},
value
,
"-"
);
}
}
,{
field
:
'operator.name'
,
title
:
'操作人'
,
sortable
:
true
,
sortName
:
'operator.name'
}
,{
field
:
'remarks'
,
title
:
'备注信息'
,
sortable
:
true
,
sortName
:
'remarks'
}
]
});
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
$
(
'#outboundTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#outboundTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#outboundTable'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#view,#edit'
).
prop
(
'disabled'
,
$
(
'#outboundTable'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
});
$
(
"#btnImport"
).
click
(
function
(){
jp
.
open
({
type
:
2
,
$
(
"#btnImport"
).
click
(
function
(){
jp
.
open
({
type
:
2
,
area
:
[
500
,
200
],
auto
:
true
,
title
:
"导入数据"
,
content
:
"${ctx}/tag/importExcel"
,
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn1
:
function
(
index
,
layero
){
jp
.
downloadFile
(
'${ctx}/warehouse/outbound/outbound/import/template'
);
},
btn2
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/outbound/outbound/import'
,
function
(
data
)
{
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
refresh
();
}
else
{
jp
.
error
(
data
.
msg
);
}
jp
.
close
(
index
);
});
//调用保存事件
return
false
;
},
btn3
:
function
(
index
){
jp
.
close
(
index
);
}
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
title
:
"导入数据"
,
content
:
"${ctx}/tag/importExcel"
,
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn1
:
function
(
index
,
layero
){
jp
.
downloadFile
(
'${ctx}/warehouse/outbound/outbound/import/template'
);
},
btn2
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/outbound/outbound/import'
,
function
(
data
)
{
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
refresh
();
}
else
{
jp
.
error
(
data
.
msg
);
}
jp
.
close
(
index
);
});
//调用保存事件
return
false
;
},
btn3
:
function
(
index
){
jp
.
close
(
index
);
}
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
var
sortName
=
$
(
'#outboundTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortOrder
=
$
(
'#outboundTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
values
=
""
;
...
...
@@ -191,103 +191,103 @@ $(document).ready(function() {
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
}
jp
.
downloadFile
(
'${ctx}/warehouse/outbound/outbound/export?'
+
values
);
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
'#beginOutboundTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
$
(
'#endOutboundTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#outboundTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
jp
.
downloadFile
(
'${ctx}/warehouse/outbound/outbound/export?'
+
values
);
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
'#beginOutboundTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
$
(
'#endOutboundTime'
).
datetimepicker
({
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#outboundTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
});
}
function
deleteAll
(){
jp
.
confirm
(
'确认要删除该出库信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/outbound/outbound/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
if
(
data
.
success
){
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
//刷新列表
function
refresh
(){
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
openSaveDialog
(
"新增出库单"
,
"${ctx}/warehouse/outbound/outbound/form/add"
,
'1200'
,
'800'
);
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
function
deleteAll
(){
jp
.
confirm
(
'确认要删除该出库信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/outbound/outbound/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
if
(
data
.
success
){
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
//刷新列表
function
refresh
(){
$
(
'#outboundTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
openSaveDialog
(
"新增出库单"
,
"${ctx}/warehouse/outbound/outbound/form/add"
,
'1200'
,
'800'
);
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
openSaveDialog
(
"编辑出库单"
,
"${ctx}/warehouse/outbound/outbound/form/edit?id="
+
id
,
'1200'
,
'800'
);
}
function
view
(
id
){
//没有权限时,不显示确定按钮
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
openViewDialog
(
"查看出库单"
,
"${ctx}/warehouse/outbound/outbound/form/view?id="
+
id
,
'1200'
,
'800'
);
}
function
detailFormatter
(
index
,
row
)
{
var
htmltpl
=
$
(
"#outboundChildrenTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/outbound/outbound/detail?id="
+
row
.
id
,
function
(
outbound
){
var
outboundChild1RowIdx
=
0
,
outboundChild1Tpl
=
$
(
"#outboundChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
outbound
.
outboundInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
data1
[
i
].
dict
=
{};
addRow
(
'#outboundChild-'
+
row
.
id
+
'-1-List'
,
outboundChild1RowIdx
,
outboundChild1Tpl
,
data1
[
i
]);
outboundChild1RowIdx
=
outboundChild1RowIdx
+
1
;
}
})
return
html
;
jp
.
openSaveDialog
(
"编辑出库单"
,
"${ctx}/warehouse/outbound/outbound/form/edit?id="
+
id
,
'1200'
,
'800'
);
}
function
view
(
id
){
//没有权限时,不显示确定按钮
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
}
jp
.
openViewDialog
(
"查看出库单"
,
"${ctx}/warehouse/outbound/outbound/form/view?id="
+
id
,
'1200'
,
'800'
);
}
function
detailFormatter
(
index
,
row
)
{
var
htmltpl
=
$
(
"#outboundChildrenTpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/outbound/outbound/detail?id="
+
row
.
id
,
function
(
outbound
){
var
outboundChild1RowIdx
=
0
,
outboundChild1Tpl
=
$
(
"#outboundChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
outbound
.
outboundInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
data1
[
i
].
dict
=
{};
addRow
(
'#outboundChild-'
+
row
.
id
+
'-1-List'
,
outboundChild1RowIdx
,
outboundChild1Tpl
,
data1
[
i
]);
outboundChild1RowIdx
=
outboundChild1RowIdx
+
1
;
}
})
return
html
;
}
function
addRow
(
list
,
idx
,
tpl
,
row
){
$
(
list
).
append
(
Mustache
.
render
(
tpl
,
{
idx
:
idx
,
delBtn
:
true
,
row
:
row
}));
}
<
/script
>
<
script
type
=
"text/template"
id
=
"outboundChildrenTpl"
>
//<!--
<
div
class
=
"tabs-container"
>
...
...
@@ -302,11 +302,11 @@ $(document).ready(function() {
<
th
>
品名
<
/th
>
<
th
>
代码
<
/th
>
<
th
>
物资编码
<
/th
>
<
th
>
数量
<
/th
>
<
th
>
单位
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
单价
<
/th
>
<
th
>
总价
<
/th
>
<
th
>
批次号
<
/th
>
<
th
>
货架
<
/th
>
<
th
>
仓库
<
/th
>
...
...
@@ -318,8 +318,8 @@ $(document).ready(function() {
<
/table
>
<
/div
>
<
/div>/
/-->
<
/script
>
<
script
type
=
"text/template"
id
=
"outboundChild1Tpl"
>
//<!--
<
/script
>
<
script
type
=
"text/template"
id
=
"outboundChild1Tpl"
>
//<!--
<
tr
>
<
td
>
{{
row
.
ledgerInfo
.
code
}}
...
...
@@ -330,9 +330,7 @@ $(document).ready(function() {
<
td
>
{{
row
.
ledgerInfo
.
type
.
code
}}
<
/td
>
<
td
>
{{
row
.
ledgerInfo
.
num
}}
<
/td
>
<
td
>
{{
row
.
ledgerInfo
.
type
.
unit
}}
<
/td
>
...
...
@@ -342,9 +340,7 @@ $(document).ready(function() {
<
td
>
{{
row
.
ledgerInfo
.
amount
}}
<
/td
>
<
td
>
{{
row
.
ledgerInfo
.
infoSum
}}
<
/td
>
<
td
>
{{
row
.
ledgerInfo
.
batchNum
}}
<
/td
>
...
...
@@ -361,4 +357,4 @@ $(document).ready(function() {
{{
row
.
remarks
}}
<
/td
>
<
/tr>/
/-->
<
/script
>
<
/script
>
src/main/webapp/webpage/modules/warehouse/outbound/outboundList.jsp
View file @
115b9d23
...
...
@@ -16,7 +16,7 @@
<h3
class=
"panel-title"
>
出库信息列表
</h3>
</div>
<div
class=
"panel-body"
>
<!-- 搜索 -->
<div
id=
"search-collapse"
class=
"collapse"
>
<div
class=
"accordion-inner"
>
...
...
@@ -39,7 +39,7 @@
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
</div>
</div>
</div>
<div
class=
"col-xs-12 col-sm-1"
>
~
...
...
@@ -50,7 +50,7 @@
<span
class=
"input-group-addon"
>
<span
class=
"glyphicon glyphicon-calendar"
></span>
</span>
</div>
</div>
</div>
</div>
</div>
...
...
@@ -67,11 +67,11 @@
<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>
</div>
</form:form>
</div>
</div>
<!-- 工具栏 -->
<div
id=
"toolbar"
>
<
%
--
<
shiro:hasPermission
name=
"warehouse:outbound:outbound:add"
>
--%>
...
...
@@ -103,7 +103,7 @@
<
%
--
</
button
>
--%>
<
%
--
</
shiro:hasPermission
>
--%>
</div>
<!-- 表格 -->
<table
id=
"outboundTable"
data-toolbar=
"#toolbar"
></table>
...
...
@@ -119,9 +119,9 @@
<li
data-item=
"delete"
><a>
删除
</a></li>
</shiro:hasPermission>
<li
data-item=
"action1"
><a>
取消
</a></li>
</ul>
</ul>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
115b9d23
...
...
@@ -432,6 +432,11 @@
* 点击扫码显示扫码窗口
*/
function addScan(){
// 选择该批次号下的货品明细
if(!$("#batchNum").val()){
jp.warning('请选择批次号!');
return;
}
layer.open({
type: 1,
title: '扫码',
...
...
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