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
f98316e2
Commit
f98316e2
authored
Jul 20, 2023
by
胡懿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'hy' and 'master' of 47.92.228.5:huyi/warehouse into hy
parents
a40ff95f
b6ae5746
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
667 additions
and
238 deletions
+667
-238
jeeplus.js
src/main/webapp/static/common/js/jeeplus.js
+3
-2
validation-methods.js
...tic/plugin/jquery-validation/1.14.0/validation-methods.js
+4
-3
scan.jsp
src/main/webapp/webpage/include/scan.jsp
+156
-0
gridselect.jsp
src/main/webapp/webpage/modules/common/gridselect.jsp
+11
-2
ledgerDetail.jsp
.../webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
+120
-105
ledgerList.js
...ain/webapp/webpage/modules/warehouse/ledger/ledgerList.js
+128
-103
ledgerList.jsp
...in/webapp/webpage/modules/warehouse/ledger/ledgerList.jsp
+1
-0
materialRequisitionDetail.jsp
...rehouse/materialrequisition/materialRequisitionDetail.jsp
+210
-23
materialRequisitionForm.jsp
...warehouse/materialrequisition/materialRequisitionForm.jsp
+30
-0
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+4
-0
No files found.
src/main/webapp/static/common/js/jeeplus.js
View file @
f98316e2
...
@@ -354,7 +354,7 @@ function delRow(obj, prefix){
...
@@ -354,7 +354,7 @@ function delRow(obj, prefix){
openGridSelectDialog
:
function
(
params
,
yesFuc
){
openGridSelectDialog
:
function
(
params
,
yesFuc
){
top
.
layer
.
open
({
top
.
layer
.
open
({
type
:
2
,
type
:
2
,
area
:
[
'
800px'
,
'5
00px'
],
area
:
[
'
1200px'
,
'6
00px'
],
title
:
params
.
title
,
title
:
params
.
title
,
auto
:
true
,
auto
:
true
,
name
:
'friend'
,
name
:
'friend'
,
...
@@ -367,7 +367,8 @@ function delRow(obj, prefix){
...
@@ -367,7 +367,8 @@ function delRow(obj, prefix){
jp
.
warning
(
"必须选择一条数据!"
);
jp
.
warning
(
"必须选择一条数据!"
);
return
;
return
;
}
}
yesFuc
(
items
);
var
result
=
yesFuc
(
items
);
if
(
result
===
false
)
return
;
top
.
layer
.
close
(
index
);
//关闭对话框。
top
.
layer
.
close
(
index
);
//关闭对话框。
},
},
cancel
:
function
(
index
){
cancel
:
function
(
index
){
...
...
src/main/webapp/static/plugin/jquery-validation/1.14.0/validation-methods.js
View file @
f98316e2
...
@@ -180,7 +180,9 @@ $(function(){
...
@@ -180,7 +180,9 @@ $(function(){
return
this
.
optional
(
element
)
||
/^
[
A-Za-z0-9_-
]
+$/
.
test
(
value
);
return
this
.
optional
(
element
)
||
/^
[
A-Za-z0-9_-
]
+$/
.
test
(
value
);
},
"判断是否为合法字符(a-zA-Z0-9-_)"
);
},
"判断是否为合法字符(a-zA-Z0-9-_)"
);
jQuery
.
validator
.
addMethod
(
'positiveInteger'
,
function
(
value
,
element
)
{
return
this
.
optional
(
element
)
||
/^
[
1-9
]\d
*$/
.
test
(
value
);
})
//身份证号码的验证规则
//身份证号码的验证规则
function
isIdCardNo
(
num
){
function
isIdCardNo
(
num
){
...
@@ -232,4 +234,4 @@ function isPlateNo(plateNo){
...
@@ -232,4 +234,4 @@ function isPlateNo(plateNo){
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
\ No newline at end of file
src/main/webapp/webpage/include/scan.jsp
0 → 100644
View file @
f98316e2
<style>
#scanIpt_ {
position: absolute;
top: -10000px;
left: 0;
opacity: 0;
}
</style>
<input id="scanIpt_" type="text" />
<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 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') {
scanIptGetFocusStart();
} else if (state === 'hidden') {
scanIptGetFocusStop();
}
}
function scanIptGetFocusStart () {
if (focusStop) return;
var ipt = getScanIpt();
if (ipt) {
scanIptFocusTimer$ = iptFocus(ipt);
}
}
function scanIptGetFocusStop () {
if (scanIptFocusTimer$) {
clearInterval(scanIptFocusTimer$);
scanIptFocusTimer$ = null;
}
}
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 = '';
}
}
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)
}
</script>
src/main/webapp/webpage/modules/common/gridselect.jsp
View file @
f98316e2
...
@@ -66,7 +66,16 @@ $(document).ready(function() {
...
@@ -66,7 +66,16 @@ $(document).ready(function() {
,{
,{
field
:
'${fieldKeys[status.index]}'
,
field
:
'${fieldKeys[status.index]}'
,
title
:
'${fieldLabels[status.index]}'
,
title
:
'${fieldLabels[status.index]}'
,
sortable
:
true
sortable
:
true
,
formatter
(
val
,
row
,
index
)
{
var
result
=
val
;
var
key
=
'${fieldKeys[status.index]}'
;
if
(
top
.
gridSelectColumnFormatterMap
&&
top
.
gridSelectColumnFormatterMap
[
key
]
&&
top
.
gridSelectColumnFormatterMap
[
key
].
formatter
)
{
result
=
top
.
gridSelectColumnFormatterMap
[
key
].
formatter
(
val
,
row
,
index
);
}
return
result
;
},
events
:
(
top
.
gridSelectColumnFormatterMap
&&
top
.
gridSelectColumnFormatterMap
[
'${fieldKeys[status.index]}'
])
?
top
.
gridSelectColumnFormatterMap
[
'${fieldKeys[status.index]}'
].
events
:
{}
}
}
<
/c:forEach
>
<
/c:forEach
>
...
@@ -100,7 +109,7 @@ $(document).ready(function() {
...
@@ -100,7 +109,7 @@ $(document).ready(function() {
return
row
return
row
});
});
}
}
</script>
</script>
</head>
</head>
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
View file @
f98316e2
...
@@ -74,115 +74,130 @@
...
@@ -74,115 +74,130 @@
{
{
title: '操作',
title: '操作',
align: 'center',
align: 'center',
formatter
: function ()
{
formatter
()
{
return '<a class="view-
detail">查看明细
</a>'
return '<a class="view-
qrcode">查看</a> <a class="print">打印
</a>'
},
},
events: {
events: {
'click .view-detail': function (e,value,row){
'click .view-qrcode': function (e,value,row){
layer.open({
jp.showPic('${ctxPath}'+row.qr.url)
title: '查看明细',
},
type: 1,
'click .print': function (e,value,row){
auto: true,
onPrint(row);
area: ['1000', '600'],
content: $("#detailTpl").html(),
success: function (){
$("#table").bootstrapTable({
method: 'get',
url: '${ctx}/warehouse/ledger/ledger/infoDate?batchNum='+ row.batchNum+'&ledger.id=${ledger.id}',
//是否显示分页(*)
pagination: true,
//排序方式
sortOrder: "asc",
//初始化加载第一页,默认第一页
pageNumber:1,
//每页的记录行数(*)
pageSize: 10,
//可供选择的每页的行数(*)
pageList: [10, 25, 50, 100],
sidePagination: "server",
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;
},
columns: [
{checkbox:true},
{field: 'code', title: '物资编码'},
{
field: 'type.name',
title: '品名',
},
{
field: 'type.code',
title: '代码',
},
{
field: 'batchNum',
title: '批次号',
},
{
field: 'amount',
title: '单价'
},
{
field: "type.unit",
title: '单位'
},
{
field: 'amount',
title: '单价'
},
{
field: "type.unit",
title: '单位'
},
{field: 'model', title: '型号'},
{field: 'shelves.name', title: '货架'},
// {field: 'amount', title: '单价'},
{
field: 'num',
title: '数量'
},
{
field: 'sum',
title: '总价',
sortName: 'sum',
formatter (v, row) {
return new Big(row.num).times(row.amount).toNumber()
}
},
{
field: 'qr.url',
title: '二维码',
sortable: true,
sortName: 'qr.url',
formatter: function (){
return '<a class="view-qrcode">查看</a> <a class="print">打印</a>';
},
events: {
'click .view-qrcode': function (e,value,row){
jp.showPic('${ctxPath}'+row.qr.url)
},
'click .print': function (e,value,row){
onPrint(row);
}
}
}
]
});
$('#table').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
'check-all.bs.table uncheck-all.bs.table', function () {
$('#batchPrintBtn').prop('disabled', ! $('#table').bootstrapTable('getSelections').length);
});
},
})
}
}
}
}
}
},
<%--{--%>
<%-- title: '操作',--%>
<%-- align: 'center',--%>
<%-- formatter: function (){--%>
<%-- return '<a class="view-detail">查看明细</a>'--%>
<%-- },--%>
<%-- events: {--%>
<%-- 'click .view-detail': function (e,value,row){--%>
<%-- layer.open({--%>
<%-- title: '查看明细',--%>
<%-- type: 1,--%>
<%-- auto: true,--%>
<%-- area: ['1000', '600'],--%>
<%-- content: $("#detailTpl").html(),--%>
<%-- success: function (){--%>
<%-- $("#table").bootstrapTable({--%>
<%-- method: 'get',--%>
<%-- url: '${ctx}/warehouse/ledger/ledger/infoDate?batchNum='+ row.batchNum+'&ledger.id=${ledger.id}',--%>
<%-- //是否显示分页(*)--%>
<%-- pagination: true,--%>
<%-- //排序方式--%>
<%-- sortOrder: "asc",--%>
<%-- //初始化加载第一页,默认第一页--%>
<%-- pageNumber:1,--%>
<%-- //每页的记录行数(*)--%>
<%-- pageSize: 10,--%>
<%-- //可供选择的每页的行数(*)--%>
<%-- pageList: [10, 25, 50, 100],--%>
<%-- sidePagination: "server",--%>
<%-- 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;--%>
<%-- },--%>
<%-- columns: [--%>
<%-- {checkbox:true},--%>
<%-- {field: 'code', title: '物资编码'},--%>
<%-- {--%>
<%-- field: 'type.name',--%>
<%-- title: '品名',--%>
<%-- },--%>
<%-- {--%>
<%-- field: 'type.code',--%>
<%-- title: '代码',--%>
<%-- },--%>
<%-- {--%>
<%-- field: 'batchNum',--%>
<%-- title: '批次号',--%>
<%-- },--%>
<%-- {--%>
<%-- field: 'amount',--%>
<%-- title: '单价'--%>
<%-- },--%>
<%-- {--%>
<%-- field: "type.unit",--%>
<%-- title: '单位'--%>
<%-- },--%>
<%-- {--%>
<%-- field: 'amount',--%>
<%-- title: '单价'--%>
<%-- },--%>
<%-- {--%>
<%-- field: "type.unit",--%>
<%-- title: '单位'--%>
<%-- },--%>
<%-- {field: 'model', title: '型号'},--%>
<%-- {field: 'shelves.name', title: '货架'},--%>
<%-- // {field: 'amount', title: '单价'},--%>
<%-- {--%>
<%-- field: 'num',--%>
<%-- title: '数量'--%>
<%-- },--%>
<%-- {--%>
<%-- field: 'sum',--%>
<%-- title: '总价',--%>
<%-- sortName: 'sum',--%>
<%-- formatter (v, row) {--%>
<%-- return new Big(row.num).times(row.amount).toNumber()--%>
<%-- }--%>
<%-- },--%>
<%-- {--%>
<%-- field: 'qr.url',--%>
<%-- title: '二维码',--%>
<%-- sortable: true,--%>
<%-- sortName: 'qr.url',--%>
<%-- formatter: function (){--%>
<%-- return '<a class="view-qrcode">查看</a> <a class="print">打印</a>';--%>
<%-- },--%>
<%-- events: {--%>
<%-- 'click .view-qrcode': function (e,value,row){--%>
<%-- jp.showPic('${ctxPath}'+row.qr.url)--%>
<%-- },--%>
<%-- 'click .print': function (e,value,row){--%>
<%-- onPrint(row);--%>
<%-- }--%>
<%-- }--%>
<%-- }--%>
<%-- ]--%>
<%-- });--%>
<%-- $('#table').on('check.bs.table uncheck.bs.table load-success.bs.table ' +--%>
<%-- 'check-all.bs.table uncheck-all.bs.table', function () {--%>
<%-- $('#batchPrintBtn').prop('disabled', ! $('#table').bootstrapTable('getSelections').length);--%>
<%-- });--%>
<%-- },--%>
<%-- })--%>
<%-- }--%>
<%-- }--%>
<%--}--%>
].map(function (e) {
].map(function (e) {
e.align = 'center';
e.align = 'center';
return e;
return e;
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.js
View file @
f98316e2
...
@@ -107,14 +107,14 @@
...
@@ -107,14 +107,14 @@
sortName
:
'type.name'
sortName
:
'type.name'
},
},
// {
// field: 'model',
// title: '型号',
// sortable: true,
// sortName: 'model'
//
// }
{
{
field
:
'model'
,
title
:
'型号'
,
sortable
:
true
,
sortName
:
'model'
}
,{
field
:
'sum'
,
field
:
'sum'
,
title
:
'总价'
,
title
:
'总价'
,
sortable
:
true
,
sortable
:
true
,
...
@@ -303,9 +303,9 @@ function getScanIpt () {
...
@@ -303,9 +303,9 @@ function getScanIpt () {
return
document
.
getElementById
(
"scanIpt"
);
return
document
.
getElementById
(
"scanIpt"
);
}
}
// 判断是否是中文输入法
// 判断是否是中文输入法
var
inputMethodCnType
=
false
;
//
var inputMethodCnType = false;
// input持续获取焦点
//
//
input持续获取焦点
var
scanIptFocusTimer
=
null
;
//
var scanIptFocusTimer = null;
function
viewScanData
()
{
function
viewScanData
()
{
layer
.
open
({
layer
.
open
({
...
@@ -315,74 +315,99 @@ function viewScanData () {
...
@@ -315,74 +315,99 @@ function viewScanData () {
area
:
[
'1200'
,
'600'
],
area
:
[
'1200'
,
'600'
],
content
:
$
(
"#scanTpl"
).
html
(),
content
:
$
(
"#scanTpl"
).
html
(),
success
:
function
()
{
success
:
function
()
{
var
ipt
=
getScanIpt
();
// var ipt = getScanIpt();
ipt
.
addEventListener
(
'change'
,
scanDataChange
);
// ipt.addEventListener('change', scanDataChange);
// ipt.addEventListener('blur', allFocus);
// // ipt.addEventListener('blur', allFocus);
ipt
.
addEventListener
(
'compositionstart'
,
iptCompositionstart
);
// ipt.addEventListener('compositionstart', iptCompositionstart);
ipt
.
addEventListener
(
'compositionend'
,
iptCompositionend
);
// ipt.addEventListener('compositionend', iptCompositionend);
scanIptGetFocusStart
();
// scanIptGetFocusStart();
$
(
"#scanIpt"
).
focus
();
// $("#scanIpt").focus();
scanStart
();
renderScanTable
();
renderScanTable
();
document
.
addEventListener
(
'visibilitychange'
,
pageVisible
);
//
document.addEventListener('visibilitychange', pageVisible);
},
},
cancel
:
function
()
{
cancel
:
function
()
{
var
ipt
=
getScanIpt
();
// var ipt = getScanIpt();
ipt
.
removeEventListener
(
'change'
,
scanDataChange
);
// ipt.removeEventListener('change', scanDataChange);
// ipt.removeEventListener('blur', allFocus);
// // ipt.removeEventListener('blur', allFocus);
ipt
.
removeEventListener
(
'compositionstart'
,
iptCompositionstart
);
// ipt.removeEventListener('compositionstart', iptCompositionstart);
scanIptGetFocusStop
();
// scanIptGetFocusStop();
document
.
removeEventListener
(
'visibilitychange'
,
pageVisible
);
// document.removeEventListener('visibilitychange', pageVisible);
scanStop
();
},
},
btn
:[
'关闭'
]
btn
:[
'关闭'
]
})
})
}
}
function
scanDataChange
()
{
function
scanIptChangeCallback
(
val
)
{
var
elem
=
getScanIpt
();
var
json
=
JSON
.
parse
(
val
);
var
val
=
$
(
elem
).
val
();
var
params
=
"qrId="
+
json
.
code
;
if
(
!
val
)
{
getScanData
(
return
;
{
qrId
:
json
.
code
},
}
function
(
list
)
{
try
{
var
table
=
getTable
();
var
json
=
JSON
.
parse
(
val
);
var
tableData
=
table
.
bootstrapTable
(
'getData'
);
var
params
=
"qrId="
+
json
.
code
;
list
=
list
.
filter
(
function
(
item
)
{
getScanData
(
var
i
=
tableData
.
find
(
function
(
e
)
{
{
qrId
:
json
.
code
},
return
e
.
id
===
item
.
id
;
function
(
list
)
{
})
var
table
=
getTable
();
return
!
i
;
var
tableData
=
table
.
bootstrapTable
(
'getData'
);
});
list
=
list
.
filter
(
function
(
item
)
{
if
(
!
list
.
length
)
{
var
i
=
tableData
.
find
(
function
(
e
)
{
jp
.
alert
(
'请勿重复扫码'
);
return
e
.
id
===
item
.
id
;
return
;
})
return
!
i
;
});
if
(
!
list
.
length
)
{
jp
.
alert
(
'请勿重复扫码'
);
return
;
}
table
.
bootstrapTable
(
'append'
,
list
);
}
}
);
table
.
bootstrapTable
(
'append'
,
list
);
}
catch
(
e
)
{}
}
setTimeout
(
function
()
{
);
$
(
elem
).
val
(
''
);
$
(
elem
).
blur
();
},
100
)
}
function
iptCompositionstart
()
{
inputMethodCnType
=
true
;
}
}
function
iptCompositionend
()
{
// function scanDataChange () {
var
ipt
=
getScanIpt
();
// var elem = getScanIpt();
if
(
inputMethodCnType
)
{
// var val = $(elem).val();
jp
.
alert
(
'请将输入法设置为英文'
);
// if (!val) {
inputMethodCnType
=
false
;
// return;
ipt
.
value
=
''
;
// }
}
// 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
)
{
function
iptFocus
(
ipt
)
{
var
timer
=
setInterval
(
function
()
{
var
timer
=
setInterval
(
function
()
{
...
@@ -393,21 +418,21 @@ function iptFocus (ipt) {
...
@@ -393,21 +418,21 @@ function iptFocus (ipt) {
return
timer
;
return
timer
;
}
}
function
debounce
(
callback
,
timeout
=
500
)
{
//
function debounce (callback, timeout = 500) {
let
timer
=
null
;
//
let timer = null;
return
function
(...
arg
)
{
//
return function (...arg) {
const
content
=
this
;
//
const content = this;
if
(
timer
)
{
//
if (timer) {
clearTimeout
(
timer
);
//
clearTimeout(timer);
}
else
{
//
} else {
callback
.
apply
(
content
,
arg
);
//
callback.apply(content, arg);
}
//
}
timer
=
setTimeout
(
function
()
{
//
timer = setTimeout(function () {
clearTimeout
(
timer
);
//
clearTimeout(timer);
timer
=
null
;
//
timer = null;
},
timeout
)
//
}, timeout)
}
//
}
}
//
}
function
renderScanTable
()
{
function
renderScanTable
()
{
getTable
().
bootstrapTable
(
'destroy'
).
bootstrapTable
({
getTable
().
bootstrapTable
(
'destroy'
).
bootstrapTable
({
...
@@ -499,27 +524,27 @@ function getScanData (params, callback) {
...
@@ -499,27 +524,27 @@ function getScanData (params, callback) {
})
})
}
}
function
pageVisible
()
{
//
function pageVisible () {
var
state
=
document
.
visibilityState
;
//
var state = document.visibilityState;
if
(
state
===
'visible'
)
{
//
if (state === 'visible') {
scanIptGetFocusStart
();
//
scanIptGetFocusStart();
}
else
if
(
state
===
'hidden'
)
{
//
} else if (state === 'hidden') {
scanIptGetFocusStop
();
//
scanIptGetFocusStop();
}
//
}
}
//
}
function
scanIptGetFocusStart
()
{
//
function scanIptGetFocusStart () {
var
ipt
=
getScanIpt
();
//
var ipt = getScanIpt();
if
(
ipt
)
{
//
if (ipt) {
scanIptFocusTimer
=
iptFocus
(
ipt
);
//
scanIptFocusTimer = iptFocus(ipt);
}
//
}
}
//
}
function
scanIptGetFocusStop
()
{
//
function scanIptGetFocusStop () {
if
(
scanIptFocusTimer
)
{
//
if (scanIptFocusTimer) {
clearInterval
(
scanIptFocusTimer
);
//
clearInterval(scanIptFocusTimer);
scanIptFocusTimer
=
null
;
//
scanIptFocusTimer = null;
}
//
}
}
//
}
<
/script
>
<
/script
>
<
script
type
=
"text/template"
id
=
"ledgerChildrenTpl"
>
//<!--
<
script
type
=
"text/template"
id
=
"ledgerChildrenTpl"
>
//<!--
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.jsp
View file @
f98316e2
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
<
%@
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"
%
>
<
%@
include
file=
"../../../include/scan.jsp"
%
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
<style>
<style>
#scanIpt
{
#scanIpt
{
...
...
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionDetail.jsp
View file @
f98316e2
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
}
}
$(selector).bootstrapTable({
$(selector).bootstrapTable({
data: data,
data: data,
uniqueId: 'sortId',
columns: [{checkbox: true},
columns: [{checkbox: true},
{
{
field: 'no',
field: 'no',
...
@@ -171,6 +172,11 @@
...
@@ -171,6 +172,11 @@
return $(selector).bootstrapTable('getSelections');
return $(selector).bootstrapTable('getSelections');
}
}
var addDetailColumns = {
label: '物资编码|品名|代码|型号|批次号|单价|单位|数量|选择数量',
key: 'code|type.name|type.code|model|batchNum|amount|type.unit|num|selectNum'
};
/**
/**
* 手动添加明细
* 手动添加明细
* @param selector
* @param selector
...
@@ -180,39 +186,137 @@
...
@@ -180,39 +186,137 @@
title: '选择物资台账明细',
title: '选择物资台账明细',
isMultiSelect: true,
isMultiSelect: true,
url: "${ctx}/warehouse/ledger/ledger/findByQrOrCode",
url: "${ctx}/warehouse/ledger/ledger/findByQrOrCode",
fieldLabels:
"物资编码|物资名称|品名代码|型号|批次号|单价"
,
fieldLabels:
addDetailColumns.label
,
fieldKeys:
"code|name|type.name|model|batchNum|amount"
,
fieldKeys:
addDetailColumns.key
,
searchLabels: "物资编码",
searchLabels: "物资编码",
searchKeys: "code",
searchKeys: "code",
}, function (items) {
}, function (items) {
if (Array.isArray(items)) {
if (Array.isArray(items)) {
if (items.some(function (e) {
return !e.selectNum;
})) {
jp.alert('选择的数据必须填写选择数量');
return false;
}
/***
/***
* 重复的物资编码去重
* 重复的物资编码去重
*/
*/
var newItems = [];
// var newItems = [];
items.forEach(function(item){
// items.forEach(function(item){
var fined = getTableData().find(function(v){
// var fined = getTableData().find(function(v){
return v.ledgerInfo.code === item.code
// return v.ledgerInfo.code === item.code
})
// })
if(!fined){
// if(!fined){
newItems.push(item);
// newItems.push(item);
}else{
// }else{
jp.warning('有物资重复不能领用!');
// jp.warning('有物资重复不能领用!');
}
// }
})
// })
var data = newItems.map(function (item) {
// var data = newItems.map(function (item) {
item[0] = false;
// item[0] = false;
item.infoSum = new Big(item.num).times(item.amount).toNumber();
// item.infoSum = new Big(item.num).times(item.amount).toNumber();
// return {
// id: '',
// delFlag: 0,
// remarks: '',
// ledgerInfo: item,
// sortId: item.code
// }
// })
// $(selector).bootstrapTable('append', data)
selectDetailHandle($(selector), items);
}
})
}
function selectDetailHandle (table, list) {
var tableData = getTableData();
var newTableData = tableData.slice();
if (!tableData.length) {
list.forEach(function (item) {
var selectNum = Number(item.selectNum);
var list = new Array(selectNum).fill(0).map(function (t, index) {
return {
return {
id: '',
id: '',
delFlag: 0,
delFlag: 0,
remarks: '',
remarks: '',
ledgerInfo: item
ledgerInfo: Object.assign({}, item),
sortId: item.code + '_' + index
}
}
})
})
$(selector).bootstrapTable('append', data)
newTableData = newTableData.concat(list);
})
} else {
list.forEach(function (item) {
var list = tableData.filter(function (e) { return e.ledgerInfo.code === item.code });
var selectNum = Number(item.selectNum);
var length = list.length;
var startIndex = newTableData.findIndex(function (e) { return e.ledgerInfo.code === item.code; });
var endIndex = startIndex + length - 1;
if (length > selectNum) {
var delNum = length - selectNum;
var delStartIndex = startIndex + selectNum;
newTableData.splice(delStartIndex, delNum);
} else if (length < selectNum) {
var newAddList = new Array(selectNum - length).fill(0).map(function (t, index) {
return {
id: '',
delFlag: 0,
remarks: '',
ledgerInfo: Object.assign({}, item),
sortId: item.code + '_' + index
}
});
newTableData.splice.apply(newTableData, [endIndex, 0].concat(newAddList));
} else if (length === 0) {
var newAddList = new Array(selectNum).fill(0).map(function (t, index) {
return {
id: '',
delFlag: 0,
remarks: '',
ledgerInfo: Object.assign({}, item),
sortId: item.code + '_' + index
}
});
newTableData = newTableData.concat(newAddList);
}
})
}
table.bootstrapTable('load', newTableData);
}
function positiveInteger (v) {
return /^[1-9]\d*$/.test(v)
}
top.gridSelectColumnFormatterMap = {
selectNum: {
formatter: function (val, row, index) {
return "<input type='number' class='form-control selectNum' />"
},
events: {
'change .selectNum': function (e, v, r, i) {
var dom = e.target;
var selectNum = Number(dom.value);
var num = r.num;
if (!positiveInteger(selectNum)) {
jp.alert('只能输入正整数');
dom.value = '';
return;
} else if (selectNum > num) {
jp.alert('选择的数量不能大于总数量');
dom.value = '';
return;
}
r.selectNum = dom.value;
}
}
}
})
}
}
window.onbeforeunload = function () {
delete top.gridSelectColumnFormatterMap;
}
}
function removeRow(index, rowId, rowDelFlag) {
function removeRow(index, rowId, rowDelFlag) {
...
@@ -319,12 +423,95 @@
...
@@ -319,12 +423,95 @@
type: 1,
type: 1,
title: '扫码',
title: '扫码',
auto: true,
auto: true,
area: ['
500', '3
00'],
area: ['
1200', '6
00'],
content: $("#scan
Result
Tpl").html(),
content: $("#scanTpl").html(),
success: function () {
success: function () {
$("#scanResult").focus();
// $("#scanResult").focus();
scanStart();
renderScanTable();
},
},
btn: ['关闭']
yes: function (index, layero) {
var selectTableData = getSelectScanTable();
if (!selectTableData.length) {
jp.alert('至少选择一条数据');
return;
}
selectDetailHandle(getScanTable(), selectTableData);
top.layer.close(index);
},
cancel () {
scanStop();
}
})
}
function scanIptChangeCallback (val) {
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) {
var data = res.rows || [];
if (data.length) {
// 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
// }
// ]);
// $(elem).val('').focus();
debugger
console.log(data)
}else{
jp.warning('未找到任何数据!');
// $(elem).val('').focus();
}
})
}
function getScanTable () {
return $("#scan_detail_table");
}
function getSelectScanTable () {
return getScanTable().bootstrapTable('getSelections');
}
function renderScanTable () {
var table = getScanTable();
var labelList = addDetailColumns.label.split('|');
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 : {}
}
})
})
})
}
}
...
...
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionForm.jsp
View file @
f98316e2
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
<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>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
<
%@
include
file=
"../../../include/scan.jsp"
%
>
<style>
<style>
.sign-result
{
.sign-result
{
width
:
80px
;
width
:
80px
;
...
@@ -30,6 +31,10 @@
...
@@ -30,6 +31,10 @@
.sign
:focus-visible
{
.sign
:focus-visible
{
outline
:
none
;
outline
:
none
;
}
}
.scan-data-content
{
padding
:
10px
;
}
</style>
</style>
</head>
</head>
<body>
<body>
...
@@ -146,5 +151,30 @@
...
@@ -146,5 +151,30 @@
}
}
</script>
</script>
<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
class
=
"scan-data-content"
>
<
table
id
=
"scan_detail_table"
><
/table
>
<
/div
>
<
/div
>
</script>
</body>
</body>
</html>
</html>
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
f98316e2
...
@@ -204,6 +204,10 @@
...
@@ -204,6 +204,10 @@
return res;
return res;
}
}
window.onbeforeunload = function () {
delete top.selectStorageData;
}
/**
/**
* 手动添加明细
* 手动添加明细
* @param selector
* @param selector
...
...
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