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
32c60d61
Commit
32c60d61
authored
Jul 18, 2023
by
anxiaohe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入库信息表单
parent
ac21204b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
72 deletions
+194
-72
goodsList.js
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
+12
-1
logic.js
src/main/webapp/webpage/modules/warehouse/goods/logic.js
+77
-0
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+14
-3
storageForm.jsp
.../webapp/webpage/modules/warehouse/storage/storageForm.jsp
+8
-8
storageList.js
...n/webapp/webpage/modules/warehouse/storage/storageList.js
+81
-58
storageList.jsp
.../webapp/webpage/modules/warehouse/storage/storageList.jsp
+2
-2
No files found.
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
View file @
32c60d61
...
...
@@ -287,7 +287,7 @@ $(document).ready(function() {
}));
}
function
printQr
(
id
)
{
function
printQr
_
(
id
)
{
try
{
if
(
!
LODOP
){
initLodop
();
...
...
@@ -311,6 +311,17 @@ $(document).ready(function() {
}
}
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
;
console
.
log
(
row
)
}
jp
.
close
();
})
}
function
createAllPage
(
item
){
// if(!list){
...
...
src/main/webapp/webpage/modules/warehouse/goods/logic.js
0 → 100644
View file @
32c60d61
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
var
defPrintOption
=
{
// post ws
linkDeviceType
:
'post'
,
// usb tcp
protocol
:
'usb'
}
const
__io_lnk
=
function
()
{
return
'localhost:8008'
}
const
__io_url
=
function
()
{
return
'http://'
+
__io_lnk
()
+
'/thermal.io?data='
}
const
__ws_url
=
function
()
{
return
'ws://'
+
__io_lnk
()
+
'/thermal.ws'
}
/**
* 枚举设备 获取设备
* @private
*/
function
_thermal_enum_printer_
()
{
var
onBack
=
function
onBack
(
isOk
,
res
)
{
if
(
!
isOk
)
{
output_control
(
'通讯失败:'
+
JSON
.
stringify
(
res
));
return
}
if
(
res
.
code
!==
0
)
{
output_control
(
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
);
}
else
{
output_control
(
res
.
message
)
}
}
let
pack
=
{
command
:
'_thermal_enum_printer_'
,
require
:
require_type
(),
}
on_link_device
(
pack
,
onBack
);
}
function
require_type
()
{
return
defPrintOption
.
protocol
;
}
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
(
radio
.
length
>
1
)
{
if
(
radio
[
1
].
checked
)
{
jqlink
(
__ws_url
(),
pack
,
onback
)
}
}
}
}
// 输出信息
function
output_control
(
text
)
{
console
.
log
(
text
);
}
<
/script
>
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
32c60d61
...
...
@@ -25,7 +25,14 @@
if(data.length){
data = data.map(function(item){
item.delFlag = 0;
item.readonly = item.qrCode && item.qrCode.state === '2'
item.readonly = item.qrCode && item.qrCode.state === '2';
item.infoSum = new Big(item.num).times(item.amount).toNumber();
item.shelvesNames = item.shelvesList.map(function (e) {
return e.name;
}).join(',');
item.warehouseNames = item.warehouseList.map(function (e) {
return e.name;
}).join(',');
return item;
})
}
...
...
@@ -315,11 +322,15 @@
shelvesNames: '',
warehouseNames: ''
};
var warehouseIdMap = {};
nodes.forEach(function (item) {
obj.shelvesIds += item.id + ',';
obj.shelvesNames += item.name + ',';
obj.warehouseIds += item.warehouse.id + ',';
obj.warehouseNames += item.warehouse.name + ','
if (!warehouseIdMap[item.warehouse.id]) {
obj.warehouseIds += item.warehouse.id + ',';
obj.warehouseNames += item.warehouse.name + ',';
warehouseIdMap[item.warehouse.id] = true;
}
})
// var node = nodes[0];
// var obj = {
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageForm.jsp
View file @
32c60d61
...
...
@@ -91,13 +91,13 @@
<
%@
include
file=
"storageDetail.jsp"
%
>
</td>
</tr>
<c:if
test=
"${mode == 'view'}"
>
<tr
>
<td
colspan=
"4"
>
<
%@
include
file=
"storageStatistic.jsp"
%
>
</td
>
</tr
>
</c:if
>
<
%
--
<
c:if
test=
"${mode == 'view'}"
>
--%
>
<
%
--
<
tr
>
--%
>
<
%
--
<
td
colspan=
"4"
>
--%
>
<
%
--
<%@
include
file=
"storageStatistic.jsp"
%
>
--
%>
<
%
--
</
td
>
--%
>
<
%
--
</
tr
>
--%
>
<
%
--
</
c:if
>
--%
>
</table>
</form:form>
</div>
...
...
@@ -111,7 +111,7 @@
initTable
();
if
(
'${mode}'
==
'view'
){
getDetail
();
//
getDetail();
initStatisticTable
();
}
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageList.js
View file @
32c60d61
...
...
@@ -264,17 +264,25 @@ $(document).ready(function() {
var
html
=
Mustache
.
render
(
htmltpl
,
{
idx
:
row
.
id
});
$
.
get
(
"${ctx}/warehouse/storage/storage/
countStorage
?id="
+
row
.
id
,
function
(
storage
){
$
.
get
(
"${ctx}/warehouse/storage/storage/
detail
?id="
+
row
.
id
,
function
(
storage
){
var
storageChild1RowIdx
=
0
,
storageChild1Tpl
=
$
(
"#storageChild1Tpl"
).
html
().
replace
(
/
(\/\/\<
!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
var
data1
=
storage
.
countS
torageInfoList
;
var
data1
=
storage
.
s
torageInfoList
;
for
(
var
i
=
0
;
i
<
data1
.
length
;
i
++
){
var
item
=
data1
[
i
];
data1
[
i
].
dict
=
{};
data1
[
i
].
storageId
=
row
.
id
;
data1
[
i
].
batchNum
=
row
.
batchNum
;
data1
[
i
].
jsonStr
=
JSON
.
stringify
(
data1
[
i
]);
data1
[
i
].
isNotStorage
=
data1
[
i
].
state
===
'1
'
;
data1
[
i
].
isNotStorage
=
data1
[
i
].
state
!==
'2
'
;
data1
[
i
].
isStorage
=
data1
[
i
].
state
===
'2'
;
data1
[
i
].
mainRowIndex
=
index
;
item
.
infoSum
=
new
Big
(
item
.
num
).
times
(
item
.
amount
).
toNumber
();
item
.
shelvesNames
=
item
.
shelvesList
.
map
(
function
(
e
)
{
return
e
.
name
}).
join
(
','
);
item
.
warehouseNames
=
item
.
warehouseList
.
map
(
function
(
e
)
{
return
e
.
name
}).
join
(
','
);
addRow
(
'#storageChild-'
+
row
.
id
+
'-1-List'
,
storageChild1RowIdx
,
storageChild1Tpl
,
data1
[
i
]);
storageChild1RowIdx
=
storageChild1RowIdx
+
1
;
}
...
...
@@ -292,52 +300,58 @@ $(document).ready(function() {
}
function
onStorage
(
countStorage
,
goodsInfoId
,
rowIndex
){
debugger
var
main
=
JSON
.
parse
(
countStorage
);
jp
.
get
(
"${ctx}/warehouse/storage/storage/findInfoBycountStorage?goodsInfo.id="
+
goodsInfoId
+
"&storage.id="
+
main
.
storageId
,
function
(
res
){
var
data
=
res
.
body
.
storageInfoList
;
if
(
Array
.
isArray
(
data
)){
var
shelvesIds
=
data
.
map
(
function
(
item
){
return
item
.
shelves
.
id
}).
join
(
','
);
// 构建台账主表
var
name$
=
$
(
"<input type='hidden' name='name' value='"
+
main
.
name
+
"' />"
);
var
typeId$
=
$
(
"<input type='hidden' name='type.id' value='"
+
main
.
type
.
id
+
"' />"
);
var
typeName$
=
$
(
"<input type='hidden' name='type.name' value='"
+
main
.
type
.
name
+
"' />"
);
var
model$
=
$
(
"<input type='hidden' name='model' value='"
+
main
.
model
+
"' />"
);
var
shelvesIds$
=
$
(
"<input type='hidden' name='shelvesIds' value='"
+
shelvesIds
+
"' />"
);
var
num$
=
$
(
"<input type='hidden' name='num' value="
+
main
.
num
+
" />"
);
var
sum$
=
$
(
"<input type='hidden' name='sum' value="
+
main
.
sum
+
" />"
);
$
(
"#ledgerForm"
).
empty
();
$
(
"#ledgerForm"
).
append
(
name$
).
append
(
typeId$
).
append
(
typeName$
).
append
(
model$
).
append
(
shelvesIds$
).
append
(
num$
).
append
(
sum$
);
data
.
forEach
(
function
(
item
,
index
){
// 构建台账附表
var
id$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].id' value='' />"
);
var
delFlag$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].delFlag' value='0' />"
);
var
name$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].name' value='"
+
item
.
name
+
"' />"
);
var
typeId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].type.id' value='"
+
item
.
type
.
id
+
"' />"
);
var
batchNum$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].batchNum' value='"
+
main
.
batchNum
+
"' />"
);
var
model$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].model' value='"
+
item
.
model
+
"' />"
);
var
goodsInfoId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].goodsInfo.id' value='"
+
item
.
goodsInfo
.
id
+
"' />"
);
var
qrId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].qr.id' value='"
+
item
.
qrCode
.
id
+
"' />"
);
var
shelvesId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].shelves.id' value='"
+
item
.
shelves
.
id
+
"' />"
);
var
code$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].code' value='"
+
item
.
qrCode
.
code
+
"' />"
);
var
amount$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].amount' value='"
+
item
.
amount
+
"' />"
);
$
(
"#ledgerForm"
).
append
(
id$
).
append
(
delFlag$
).
append
(
name$
).
append
(
typeId$
).
append
(
batchNum$
).
append
(
model$
).
append
(
goodsInfoId$
).
append
(
qrId$
).
append
(
shelvesId$
).
append
(
code$
).
append
(
amount$
);
})
jp
.
loading
(
'入库中...'
);
jp
.
post
(
"${ctx}/warehouse/ledger/ledger/save"
,
$
(
"#ledgerForm"
).
serialize
(),
function
(
res
){
if
(
res
.
success
){
jp
.
success
(
'入库成功!'
);
$
(
'#storageTable'
).
bootstrapTable
(
'collapseRow'
,
rowIndex
);
setTimeout
(
function
(){
$
(
'#storageTable'
).
bootstrapTable
(
'expandRow'
,
rowIndex
);
},
0
)
}
else
{
jp
.
error
(
'入库失败!'
);
}
})
}
})
var
data
=
[
main
];
// var shelvesIds = data.map(function (item){
// return item.shelves.id
// }).join(',');
// 构建台账主表
var
name$
=
$
(
"<input type='hidden' name='name' value='"
+
main
.
name
+
"' />"
);
var
typeId$
=
$
(
"<input type='hidden' name='type.id' value='"
+
main
.
type
.
id
+
"' />"
);
var
typeName$
=
$
(
"<input type='hidden' name='type.name' value='"
+
main
.
type
.
name
+
"' />"
);
var
model$
=
$
(
"<input type='hidden' name='model' value='"
+
main
.
model
+
"' />"
);
// var shelvesIds$ = $("<input type='hidden' name='shelvesIds' value='"+shelvesIds+"' />");
var
num$
=
$
(
"<input type='hidden' name='num' value="
+
main
.
num
+
" />"
);
var
sum$
=
$
(
"<input type='hidden' name='sum' value="
+
new
Big
(
main
.
num
).
times
(
main
.
amount
).
toNumber
()
+
" />"
);
$
(
"#ledgerForm"
).
empty
();
$
(
"#ledgerForm"
).
append
(
name$
).
append
(
typeId$
).
append
(
typeName$
).
append
(
model$
).
append
(
num$
).
append
(
sum$
);
data
.
forEach
(
function
(
item
,
index
){
// 构建台账附表
var
id$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].id' value='' />"
);
var
delFlag$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].delFlag' value='0' />"
);
var
name$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].name' value='"
+
item
.
name
+
"' />"
);
var
typeId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].type.id' value='"
+
item
.
type
.
id
+
"' />"
);
var
batchNum$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].batchNum' value='"
+
main
.
batchNum
+
"' />"
);
var
model$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].model' value='"
+
item
.
model
+
"' />"
);
var
goodsInfoId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].goodsInfo.id' value='"
+
item
.
goodsInfo
.
id
+
"' />"
);
var
qrId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].qr.id' value='"
+
item
.
qrCode
.
id
+
"' />"
);
// var shelvesId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].shelves.id' value='"+item.shelves.id+"' />");
var
code$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].code' value='"
+
item
.
qrCode
.
code
+
"' />"
);
var
amount$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].amount' value='"
+
item
.
amount
+
"' />"
);
var
shelvesIds$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].shelvesIds' value='"
+
item
.
shelvesIds
+
"' />"
);
var
warehouseIds$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].warehouseIds' value='"
+
item
.
warehouseIds
+
"' />"
);
$
(
"#ledgerForm"
).
append
(
id$
).
append
(
delFlag$
).
append
(
name$
).
append
(
typeId$
).
append
(
batchNum$
).
append
(
model$
)
.
append
(
goodsInfoId$
).
append
(
qrId$
).
append
(
code$
).
append
(
amount$
).
append
(
shelvesIds$
).
append
(
warehouseIds$
);
})
jp
.
loading
(
'入库中...'
);
jp
.
post
(
"${ctx}/warehouse/ledger/ledger/save"
,
$
(
"#ledgerForm"
).
serialize
(),
function
(
res
){
if
(
res
.
success
){
jp
.
success
(
'入库成功!'
);
$
(
'#storageTable'
).
bootstrapTable
(
'collapseRow'
,
rowIndex
);
setTimeout
(
function
(){
$
(
'#storageTable'
).
bootstrapTable
(
'expandRow'
,
rowIndex
);
},
0
)
}
else
{
jp
.
error
(
'入库失败!'
);
}
})
// jp.get("${ctx}/warehouse/storage/storage/findInfoBycountStorage?goodsInfo.id="+goodsInfoId+"&storage.id="+main.storageId, function (res){
// var data = res.body.storageInfoList;
// if(Array.isArray(data)){
//
// }
// })
}
<
/script
>
...
...
@@ -351,13 +365,15 @@ $(document).ready(function() {
<
table
class
=
"ani table"
>
<
thead
>
<
tr
>
<
th
>
名称
<
/th
>
<
th
>
品名代码
<
/th
>
<
th
>
品名
<
/th
>
<
th
>
代码
<
/th
>
<
th
>
单价
<
/th
>
<
th
>
单位
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
数量
<
/th
>
<
th
>
总价
<
/th
>
<
th
>
仓库
<
/th
>
<
th
>
货架
<
/th
>
<
th
>
总价
<
/th
>
<
th
>
数量
<
/th
>
<
th
>
操作
<
/th
>
<
/tr
>
<
/thead
>
...
...
@@ -370,26 +386,33 @@ $(document).ready(function() {
<
script
type
=
"text/template"
id
=
"storageChild1Tpl"
>
//<!--
<
tr
>
<
td
>
{{
row
.
name
}}
{{
row
.
type
.
name
}}
<
/td
>
<
td
>
{{
row
.
type
.
name
}}
{{
row
.
type
.
code
}}
<
/td
>
<
td
>
{{
row
.
amount
}}
<
/td
>
<
td
>
{{
row
.
type
.
unit
}}
<
/td
>
<
td
>
{{
row
.
model
}}
<
/td
>
<
td
>
{{
row
.
warehouseNames
}}
{{
row
.
num
}}
<
/td
>
<
td
>
{{
row
.
shelvesNames
}}
{{
row
.
infoSum
}}
<
/td
>
<
td
>
{{
row
.
sum
}}
{{
row
.
warehouseNames
}}
<
/td
>
<
td
>
{{
row
.
num
}}
{{
row
.
shelvesNames
}}
<
/td
>
{{
#
row
.
isNotStorage
}}
<
td
>
<
a
href
=
"javascript:void(0);"
onclick
=
"onStorage('{{row.jsonStr}}','{{row.goodsInfo.id}}',{{row.mainRowIndex}})"
>
入库
<
/a
>
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageList.jsp
View file @
32c60d61
...
...
@@ -7,6 +7,7 @@
<meta
name=
"decorator"
content=
"ani"
/>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<script
type=
"text/javascript"
src=
"${ctxStatic}/common/js/big.js"
></script>
<
%@
include
file=
"storageList.js"
%
>
</head>
<body>
...
...
@@ -128,4 +129,4 @@
<form
id=
"ledgerForm"
></form>
</div>
</body>
</html>
\ No newline at end of file
</html>
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