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
b6ae5746
Commit
b6ae5746
authored
Jul 20, 2023
by
anxiaohe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物资领用模块添加明细
parent
163c5cb9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
337 additions
and
110 deletions
+337
-110
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
+0
-0
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
+0
-0
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 @
b6ae5746
...
...
@@ -354,7 +354,7 @@ function delRow(obj, prefix){
openGridSelectDialog
:
function
(
params
,
yesFuc
){
top
.
layer
.
open
({
type
:
2
,
area
:
[
'
800px'
,
'5
00px'
],
area
:
[
'
1200px'
,
'6
00px'
],
title
:
params
.
title
,
auto
:
true
,
name
:
'friend'
,
...
...
@@ -367,7 +367,8 @@ function delRow(obj, prefix){
jp
.
warning
(
"必须选择一条数据!"
);
return
;
}
yesFuc
(
items
);
var
result
=
yesFuc
(
items
);
if
(
result
===
false
)
return
;
top
.
layer
.
close
(
index
);
//关闭对话框。
},
cancel
:
function
(
index
){
...
...
src/main/webapp/static/plugin/jquery-validation/1.14.0/validation-methods.js
View file @
b6ae5746
...
...
@@ -180,7 +180,9 @@ $(function(){
return
this
.
optional
(
element
)
||
/^
[
A-Za-z0-9_-
]
+$/
.
test
(
value
);
},
"判断是否为合法字符(a-zA-Z0-9-_)"
);
jQuery
.
validator
.
addMethod
(
'positiveInteger'
,
function
(
value
,
element
)
{
return
this
.
optional
(
element
)
||
/^
[
1-9
]\d
*$/
.
test
(
value
);
})
//身份证号码的验证规则
function
isIdCardNo
(
num
){
...
...
@@ -232,4 +234,4 @@ function isPlateNo(plateNo){
return
true
;
}
return
false
;
}
\ No newline at end of file
}
src/main/webapp/webpage/include/scan.jsp
0 → 100644
View file @
b6ae5746
<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 @
b6ae5746
...
...
@@ -66,7 +66,16 @@ $(document).ready(function() {
,{
field
:
'${fieldKeys[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
>
...
...
@@ -100,7 +109,7 @@ $(document).ready(function() {
return
row
});
}
</script>
</head>
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
View file @
b6ae5746
This diff is collapsed.
Click to expand it.
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.js
View file @
b6ae5746
...
...
@@ -107,14 +107,14 @@
sortName
:
'type.name'
},
// {
// field: 'model',
// title: '型号',
// sortable: true,
// sortName: 'model'
//
// }
{
field
:
'model'
,
title
:
'型号'
,
sortable
:
true
,
sortName
:
'model'
}
,{
field
:
'sum'
,
title
:
'总价'
,
sortable
:
true
,
...
...
@@ -303,9 +303,9 @@ function getScanIpt () {
return
document
.
getElementById
(
"scanIpt"
);
}
// 判断是否是中文输入法
var
inputMethodCnType
=
false
;
// input持续获取焦点
var
scanIptFocusTimer
=
null
;
//
var inputMethodCnType = false;
//
//
input持续获取焦点
//
var scanIptFocusTimer = null;
function
viewScanData
()
{
layer
.
open
({
...
...
@@ -315,74 +315,99 @@ function viewScanData () {
area
:
[
'1200'
,
'600'
],
content
:
$
(
"#scanTpl"
).
html
(),
success
:
function
()
{
var
ipt
=
getScanIpt
();
ipt
.
addEventListener
(
'change'
,
scanDataChange
);
// ipt.addEventListener('blur', allFocus);
ipt
.
addEventListener
(
'compositionstart'
,
iptCompositionstart
);
ipt
.
addEventListener
(
'compositionend'
,
iptCompositionend
);
scanIptGetFocusStart
();
$
(
"#scanIpt"
).
focus
();
// var ipt = getScanIpt();
// ipt.addEventListener('change', scanDataChange);
// // ipt.addEventListener('blur', allFocus);
// ipt.addEventListener('compositionstart', iptCompositionstart);
// ipt.addEventListener('compositionend', iptCompositionend);
// scanIptGetFocusStart();
// $("#scanIpt").focus();
scanStart
();
renderScanTable
();
document
.
addEventListener
(
'visibilitychange'
,
pageVisible
);
//
document.addEventListener('visibilitychange', pageVisible);
},
cancel
:
function
()
{
var
ipt
=
getScanIpt
();
ipt
.
removeEventListener
(
'change'
,
scanDataChange
);
// ipt.removeEventListener('blur', allFocus);
ipt
.
removeEventListener
(
'compositionstart'
,
iptCompositionstart
);
scanIptGetFocusStop
();
document
.
removeEventListener
(
'visibilitychange'
,
pageVisible
);
// var ipt = getScanIpt();
// ipt.removeEventListener('change', scanDataChange);
// // ipt.removeEventListener('blur', allFocus);
// ipt.removeEventListener('compositionstart', iptCompositionstart);
// scanIptGetFocusStop();
// document.removeEventListener('visibilitychange', pageVisible);
scanStop
();
},
btn
:[
'关闭'
]
})
}
function
scanDataChange
()
{
var
elem
=
getScanIpt
();
var
val
=
$
(
elem
).
val
();
if
(
!
val
)
{
return
;
}
try
{
var
json
=
JSON
.
parse
(
val
);
var
params
=
"qrId="
+
json
.
code
;
getScanData
(
{
qrId
:
json
.
code
},
function
(
list
)
{
var
table
=
getTable
();
var
tableData
=
table
.
bootstrapTable
(
'getData'
);
list
=
list
.
filter
(
function
(
item
)
{
var
i
=
tableData
.
find
(
function
(
e
)
{
return
e
.
id
===
item
.
id
;
})
return
!
i
;
});
if
(
!
list
.
length
)
{
jp
.
alert
(
'请勿重复扫码'
);
return
;
}
table
.
bootstrapTable
(
'append'
,
list
);
function
scanIptChangeCallback
(
val
)
{
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
;
}
);
}
catch
(
e
)
{}
setTimeout
(
function
()
{
$
(
elem
).
val
(
''
);
$
(
elem
).
blur
();
},
100
)
}
function
iptCompositionstart
()
{
inputMethodCnType
=
true
;
table
.
bootstrapTable
(
'append'
,
list
);
}
);
}
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 {
// var json = JSON.parse(val);
// var params = "qrId=" + json.code;
// getScanData(
// { qrId: json.code },
// function (list) {
// var table = getTable();
// var tableData = table.bootstrapTable('getData');
// list = list.filter(function (item) {
// var i = tableData.find(function (e) {
// return e.id === item.id;
// })
// return !i;
// });
// if (!list.length) {
// jp.alert('请勿重复扫码');
// return;
// }
// table.bootstrapTable('append', list);
// }
// );
// } catch (e) {}
// setTimeout(function () {
// $(elem).val('');
// $(elem).blur();
// }, 100)
// }
// function iptCompositionstart () {
// inputMethodCnType = true;
// }
//
// function iptCompositionend () {
// var ipt = getScanIpt();
// if (inputMethodCnType) {
// jp.alert('请将输入法设置为英文');
// inputMethodCnType = false;
// ipt.value = '';
// }
// }
function
iptFocus
(
ipt
)
{
var
timer
=
setInterval
(
function
()
{
...
...
@@ -393,21 +418,21 @@ function iptFocus (ipt) {
return
timer
;
}
function
debounce
(
callback
,
timeout
=
500
)
{
let
timer
=
null
;
return
function
(...
arg
)
{
const
content
=
this
;
if
(
timer
)
{
clearTimeout
(
timer
);
}
else
{
callback
.
apply
(
content
,
arg
);
}
timer
=
setTimeout
(
function
()
{
clearTimeout
(
timer
);
timer
=
null
;
},
timeout
)
}
}
//
function debounce (callback, timeout = 500) {
//
let timer = null;
//
return function (...arg) {
//
const content = this;
//
if (timer) {
//
clearTimeout(timer);
//
} else {
//
callback.apply(content, arg);
//
}
//
timer = setTimeout(function () {
//
clearTimeout(timer);
//
timer = null;
//
}, timeout)
//
}
//
}
function
renderScanTable
()
{
getTable
().
bootstrapTable
(
'destroy'
).
bootstrapTable
({
...
...
@@ -499,27 +524,27 @@ function getScanData (params, callback) {
})
}
function
pageVisible
()
{
var
state
=
document
.
visibilityState
;
if
(
state
===
'visible'
)
{
scanIptGetFocusStart
();
}
else
if
(
state
===
'hidden'
)
{
scanIptGetFocusStop
();
}
}
function
scanIptGetFocusStart
()
{
var
ipt
=
getScanIpt
();
if
(
ipt
)
{
scanIptFocusTimer
=
iptFocus
(
ipt
);
}
}
function
scanIptGetFocusStop
()
{
if
(
scanIptFocusTimer
)
{
clearInterval
(
scanIptFocusTimer
);
scanIptFocusTimer
=
null
;
}
}
//
function pageVisible () {
//
var state = document.visibilityState;
//
if (state === 'visible') {
//
scanIptGetFocusStart();
//
} else if (state === 'hidden') {
//
scanIptGetFocusStop();
//
}
//
}
//
function scanIptGetFocusStart () {
//
var ipt = getScanIpt();
//
if (ipt) {
//
scanIptFocusTimer = iptFocus(ipt);
//
}
//
}
//
function scanIptGetFocusStop () {
//
if (scanIptFocusTimer) {
//
clearInterval(scanIptFocusTimer);
//
scanIptFocusTimer = null;
//
}
//
}
<
/script
>
<
script
type
=
"text/template"
id
=
"ledgerChildrenTpl"
>
//<!--
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.jsp
View file @
b6ae5746
...
...
@@ -8,6 +8,7 @@
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<
%@
include
file=
"ledgerList.js"
%
>
<
%@
include
file=
"../../../include/scan.jsp"
%
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
<style>
#scanIpt
{
...
...
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionDetail.jsp
View file @
b6ae5746
This diff is collapsed.
Click to expand it.
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionForm.jsp
View file @
b6ae5746
...
...
@@ -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-zh-CN.js"
></script>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
<
%@
include
file=
"../../../include/scan.jsp"
%
>
<style>
.sign-result
{
width
:
80px
;
...
...
@@ -30,6 +31,10 @@
.sign
:focus-visible
{
outline
:
none
;
}
.scan-data-content
{
padding
:
10px
;
}
</style>
</head>
<body>
...
...
@@ -146,5 +151,30 @@
}
</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>
</html>
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
b6ae5746
...
...
@@ -204,6 +204,10 @@
return res;
}
window.onbeforeunload = function () {
delete top.selectStorageData;
}
/**
* 手动添加明细
* @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