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
c377137b
Commit
c377137b
authored
Feb 23, 2023
by
zhanglt
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.yqdchina.com/huyi/warehouse
into zlt
parents
2c86de2d
4e1e4465
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
115 additions
and
133 deletions
+115
-133
LedgerController.java
...eeplus/modules/warehouse/ledger/web/LedgerController.java
+10
-9
gridselect.tag
src/main/webapp/WEB-INF/tags/sys/gridselect.tag
+10
-1
jeeplus.js
src/main/webapp/static/common/js/jeeplus.js
+23
-0
goodsDetail.jsp
...in/webapp/webpage/modules/warehouse/goods/goodsDetail.jsp
+2
-1
ledgerDetail.jsp
.../webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
+0
-0
ledgerForm.jsp
...in/webapp/webpage/modules/warehouse/ledger/ledgerForm.jsp
+4
-26
ledgerList.js
...ain/webapp/webpage/modules/warehouse/ledger/ledgerList.js
+0
-4
materialRequisitionDetail.jsp
...rehouse/materialrequisition/materialRequisitionDetail.jsp
+0
-0
materialRequisitionForm.jsp
...warehouse/materialrequisition/materialRequisitionForm.jsp
+29
-81
shelvesList.js
...n/webapp/webpage/modules/warehouse/shelves/shelvesList.js
+1
-1
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+34
-9
storageList.js
...n/webapp/webpage/modules/warehouse/storage/storageList.js
+2
-1
No files found.
src/main/java/com/jeeplus/modules/warehouse/ledger/web/LedgerController.java
View file @
c377137b
...
@@ -5,6 +5,8 @@ package com.jeeplus.modules.warehouse.ledger.web;
...
@@ -5,6 +5,8 @@ package com.jeeplus.modules.warehouse.ledger.web;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.net.URLDecoder
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -255,8 +257,7 @@ public class LedgerController extends BaseController {
...
@@ -255,8 +257,7 @@ public class LedgerController extends BaseController {
*/
*/
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"findByQrOrCode"
)
@RequestMapping
(
value
=
"findByQrOrCode"
)
public
AjaxJson
findByQrOrCode
(
String
qrId
,
String
code
)
{
public
Map
<
String
,
Object
>
findByQrOrCode
(
String
qrId
,
String
code
)
{
AjaxJson
j
=
new
AjaxJson
();
boolean
b
=
false
;
boolean
b
=
false
;
if
(
StringUtils
.
isNotBlank
(
qrId
))
{
if
(
StringUtils
.
isNotBlank
(
qrId
))
{
b
=
true
;
b
=
true
;
...
@@ -264,6 +265,8 @@ public class LedgerController extends BaseController {
...
@@ -264,6 +265,8 @@ public class LedgerController extends BaseController {
if
(
StringUtils
.
isNotBlank
(
code
))
{
if
(
StringUtils
.
isNotBlank
(
code
))
{
b
=
true
;
b
=
true
;
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
LedgerInfo
>
ledgerInfoList
=
new
ArrayList
<>();
if
(
b
)
{
if
(
b
)
{
LedgerInfo
temLi
=
new
LedgerInfo
();
LedgerInfo
temLi
=
new
LedgerInfo
();
QrCode
qrCode
=
new
QrCode
();
QrCode
qrCode
=
new
QrCode
();
...
@@ -271,13 +274,10 @@ public class LedgerController extends BaseController {
...
@@ -271,13 +274,10 @@ public class LedgerController extends BaseController {
temLi
.
setQr
(
qrCode
);
temLi
.
setQr
(
qrCode
);
temLi
.
setCode
(
code
);
temLi
.
setCode
(
code
);
LedgerInfo
ledgerInfo
=
ledgerService
.
findByQrOrCode
(
temLi
);
LedgerInfo
ledgerInfo
=
ledgerService
.
findByQrOrCode
(
temLi
);
j
.
put
(
"ledgerInfo"
,
ledgerInfo
);
ledgerInfoList
.
add
(
ledgerInfo
);
j
.
setSuccess
(
true
);
map
.
put
(
"rows"
,
ledgerInfoList
);
j
.
setMsg
(
"查询成功"
);
map
.
put
(
"total"
,
ledgerInfoList
.
size
());
}
else
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"查询失败"
);
}
}
return
j
;
return
map
;
}
}
}
}
\ No newline at end of file
src/main/webapp/WEB-INF/tags/sys/gridselect.tag
View file @
c377137b
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
<%@ attribute name="isMultiSelected" type="java.lang.Boolean" required="false" description="是否允许多选"%>
<%@ attribute name="isMultiSelected" type="java.lang.Boolean" required="false" description="是否允许多选"%>
<%@ attribute name="validate" type="java.lang.Boolean" required="false" description="是否选择前校验"%>
<%@ attribute name="validateSelector" type="java.lang.String" required="false" description="校验的选择器"%>
<%@ attribute name="validateMsg" type="java.lang.String" required="false" description="校验的未通过提示信息"%>
<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
<%@ attribute name="callback" type="java.lang.String" required="false" description="选择回调"%>
<%@ attribute name="callback" type="java.lang.String" required="false" description="选择回调"%>
<input id="${id}Id" name="${name}" type="hidden" value="${value}"/>
<input id="${id}Id" name="${name}" type="hidden" value="${value}"/>
...
@@ -33,7 +36,13 @@ $(document).ready(function(){
...
@@ -33,7 +36,13 @@ $(document).ready(function(){
if ($("#${id}Button").hasClass("disabled")){
if ($("#${id}Button").hasClass("disabled")){
return true;
return true;
}
}
if('${validate}' && '${validateSelector}'){
if(!$("${validateSelector}").val()){
jp.warning('${validateMsg}');
return;
}
}
top.layer.open({
top.layer.open({
type: 2,
type: 2,
area: ['800px', '500px'],
area: ['800px', '500px'],
...
...
src/main/webapp/static/common/js/jeeplus.js
View file @
c377137b
...
@@ -350,6 +350,29 @@ function delRow(obj, prefix){
...
@@ -350,6 +350,29 @@ function delRow(obj, prefix){
}
}
});
});
},
},
openGridSelectDialog
:
function
(
params
,
yesFuc
){
top
.
layer
.
open
({
type
:
2
,
area
:
[
'800px'
,
'500px'
],
title
:
params
.
title
,
auto
:
true
,
name
:
'friend'
,
content
:
ctx
+
"/tag/gridselect?url="
+
encodeURIComponent
(
params
.
url
)
+
"&fieldLabels="
+
encodeURIComponent
(
params
.
fieldLabels
)
+
"&fieldKeys="
+
encodeURIComponent
(
params
.
fieldKeys
)
+
"&searchLabels="
+
encodeURIComponent
(
params
.
searchLabels
)
+
"&searchKeys="
+
encodeURIComponent
(
params
.
searchKeys
)
+
"&isMultiSelected="
+
params
.
isMultiSelect
,
btn
:
[
'确定'
,
'关闭'
],
yes
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
].
contentWindow
;
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
var
items
=
iframeWin
.
getSelections
();
if
(
items
==
""
){
jp
.
warning
(
"必须选择一条数据!"
);
return
;
}
yesFuc
(
items
);
top
.
layer
.
close
(
index
);
//关闭对话框。
},
cancel
:
function
(
index
){
}
});
},
dateFormat
:
function
(
timestamp
,
format
)
{
dateFormat
:
function
(
timestamp
,
format
)
{
var
_this
=
new
Date
(
timestamp
);
var
_this
=
new
Date
(
timestamp
);
var
o
=
{
var
o
=
{
...
...
src/main/webapp/webpage/modules/warehouse/goods/goodsDetail.jsp
View file @
c377137b
...
@@ -232,5 +232,5 @@
...
@@ -232,5 +232,5 @@
</script>
</script>
<script id="remarksTpl" type="text/html">
<script id="remarksTpl" type="text/html">
<textarea id="goodsInfoList{{idx}}_remarks" name="goodsInfoList[{{idx}}].remarks" rows="
4
" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
<textarea id="goodsInfoList{{idx}}_remarks" name="goodsInfoList[{{idx}}].remarks" rows="
2
" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
</script>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
View file @
c377137b
This diff is collapsed.
Click to expand it.
src/main/webapp/webpage/modules/warehouse/ledger/ledgerForm.jsp
View file @
c377137b
...
@@ -32,26 +32,25 @@
...
@@ -32,26 +32,25 @@
title=
"类型"
url=
"/warehouse/materialtype/materialType/treeData"
title=
"类型"
url=
"/warehouse/materialtype/materialType/treeData"
extId=
"${ledger.id}"
cssClass=
"form-control "
allowClear=
"true"
/>
extId=
"${ledger.id}"
cssClass=
"form-control "
allowClear=
"true"
/>
</td>
</td>
</tr>
<tr>
<td>
型号
</td>
<td>
型号
</td>
<td>
<td>
<form:input
path=
"model"
htmlEscape=
"false"
class=
"form-control "
/>
<form:input
path=
"model"
htmlEscape=
"false"
class=
"form-control "
/>
</td>
</td>
</tr>
<tr>
<td>
数量
</td>
<td>
数量
</td>
<td>
<td>
<form:input
path=
"num"
htmlEscape=
"false"
class=
"form-control "
/>
<form:input
path=
"num"
htmlEscape=
"false"
class=
"form-control "
/>
</td>
</td>
</tr>
<tr>
<td>
总价
</td>
<td>
总价
</td>
<td>
<td>
<form:input
path=
"sum"
htmlEscape=
"false"
class=
"form-control "
/>
<form:input
path=
"sum"
htmlEscape=
"false"
class=
"form-control "
/>
</td>
</td>
<td
colspan=
"2"
></td>
<td
colspan=
"2"
></td>
</tr>
</tr>
<tr>
<tr>
<td
colspan=
"
4
"
>
<td
colspan=
"
6
"
>
<
%@
include
file=
"ledgerDetail.jsp"
%
>
<
%@
include
file=
"ledgerDetail.jsp"
%
>
</td>
</td>
</tr>
</tr>
...
@@ -66,26 +65,6 @@
...
@@ -66,26 +65,6 @@
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
initTable
();
initTable
();
});
});
function
save
()
{
var
isValidate
=
jp
.
validateForm
(
'#inputForm'
);
//校验表单
if
(
!
isValidate
){
return
false
;
}
else
{
jp
.
loading
();
jp
.
post
(
$
(
"#inputForm"
).
attr
(
'action'
),
$
(
'#inputForm'
).
serialize
(),
function
(
data
){
if
(
data
.
success
){
jp
.
getParent
().
refresh
();
var
dialogIndex
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
// 获取窗口索引
parent
.
layer
.
close
(
dialogIndex
);
jp
.
success
(
data
.
msg
)
}
else
{
jp
.
error
(
data
.
msg
);
}
})
}
}
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.js
View file @
c377137b
...
@@ -307,7 +307,6 @@ $(document).ready(function() {
...
@@ -307,7 +307,6 @@ $(document).ready(function() {
<
table
class
=
"ani table"
>
<
table
class
=
"ani table"
>
<
thead
>
<
thead
>
<
tr
>
<
tr
>
<
th
>
物资名称
<
/th
>
<
th
>
类型
<
/th
>
<
th
>
类型
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
批次号
<
/th
>
<
th
>
批次号
<
/th
>
...
@@ -324,9 +323,6 @@ $(document).ready(function() {
...
@@ -324,9 +323,6 @@ $(document).ready(function() {
<
script
type
=
"text/template"
id
=
"ledgerChild1Tpl"
>
//<!--
<
script
type
=
"text/template"
id
=
"ledgerChild1Tpl"
>
//<!--
<
tr
>
<
tr
>
<
td
>
<
td
>
{{
row
.
name
}}
<
/td
>
<
td
>
{{
row
.
type
.
name
}}
{{
row
.
type
.
name
}}
<
/td
>
<
/td
>
<
td
>
<
td
>
...
...
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionDetail.jsp
View file @
c377137b
This diff is collapsed.
Click to expand it.
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionForm.jsp
View file @
c377137b
...
@@ -55,91 +55,16 @@
...
@@ -55,91 +55,16 @@
</tr>
</tr>
<tr>
<tr>
<td>
备注
</td>
<td>
备注
</td>
<td>
<td
colspan=
"3"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</td>
</td>
</tr>
</tr>
<tr>
<td
colspan=
"4"
>
<
%@
include
file=
"materialRequisitionDetail.jsp"
%
>
</td>
</tr>
</table>
</table>
<div
class=
"tabs-container"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
data-toggle=
"tab"
href=
"#tab-1"
aria-expanded=
"true"
>
领用明细表:
</a>
</li>
</ul>
<div
class=
"tab-content"
>
<div
id=
"tab-1"
class=
"tab-pane fade in active"
>
<a
class=
"btn btn-white btn-sm"
onclick=
"addRow('#materialRequisitionInfoList', materialRequisitionInfoRowIdx, materialRequisitionInfoTpl);materialRequisitionInfoRowIdx = materialRequisitionInfoRowIdx + 1;"
title=
"新增"
><i
class=
"fa fa-plus"
></i>
新增
</a>
<table
class=
"table table-striped table-bordered table-condensed"
>
<thead>
<tr>
<th
class=
"hide"
></th>
<th>
物资领用主表ID
</th>
<th>
物资台账明细ID
</th>
<th>
领用人
</th>
<th>
备注信息
</th>
<th
width=
"10"
>
</th>
</tr>
</thead>
<tbody
id=
"materialRequisitionInfoList"
>
</tbody>
</table>
<script
type=
"text/template"
id=
"materialRequisitionInfoTpl"
>
//
<!--
<
tr
id
=
"materialRequisitionInfoList{{idx}}"
>
<
td
class
=
"hide"
>
<
input
id
=
"materialRequisitionInfoList{{idx}}_id"
name
=
"materialRequisitionInfoList[{{idx}}].id"
type
=
"hidden"
value
=
"{{row.id}}"
/>
<
input
id
=
"materialRequisitionInfoList{{idx}}_delFlag"
name
=
"materialRequisitionInfoList[{{idx}}].delFlag"
type
=
"hidden"
value
=
"0"
/>
<
/td
>
<
td
>
<
input
id
=
"materialRequisitionInfoList{{idx}}_materialRequisition"
name
=
"materialRequisitionInfoList[{{idx}}].materialRequisition.id"
type
=
"text"
value
=
"{{row.materialRequisition.id}}"
class
=
"form-control "
/>
<
/td
>
<
td
>
<
input
id
=
"materialRequisitionInfoList{{idx}}_ledgerInfo"
name
=
"materialRequisitionInfoList[{{idx}}].ledgerInfo.id"
type
=
"text"
value
=
"{{row.ledgerInfo.id}}"
class
=
"form-control "
/>
<
/td
>
<
td
>
<
input
id
=
"materialRequisitionInfoList{{idx}}_receiver"
name
=
"materialRequisitionInfoList[{{idx}}].receiver"
type
=
"text"
value
=
"{{row.receiver.id}}"
class
=
"form-control "
/>
<
/td
>
<
td
>
<
textarea
id
=
"materialRequisitionInfoList{{idx}}_remarks"
name
=
"materialRequisitionInfoList[{{idx}}].remarks"
rows
=
"4"
class
=
"form-control "
>
{{
row
.
remarks
}}
<
/textarea
>
<
/td
>
<
td
class
=
"text-center"
width
=
"10"
>
{{
#
delBtn
}}
<
span
class
=
"close"
onclick
=
"delRow(this, '#materialRequisitionInfoList{{idx}}')"
title
=
"删除"
>&
times
;
<
/span>{{/
delBtn
}}
<
/td
>
<
/tr>/
/-->
</script>
<script
type=
"text/javascript"
>
var
materialRequisitionInfoRowIdx
=
0
,
materialRequisitionInfoTpl
=
$
(
"#materialRequisitionInfoTpl"
).
html
().
replace
(
/
(\/\/
\<!
\-\-)
|
(\/\/\-\-
>
)
/g
,
""
);
$
(
document
).
ready
(
function
()
{
var
data
=
$
{
fns
:
toJson
(
materialRequisition
.
materialRequisitionInfoList
)};
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
addRow
(
'#materialRequisitionInfoList'
,
materialRequisitionInfoRowIdx
,
materialRequisitionInfoTpl
,
data
[
i
]);
materialRequisitionInfoRowIdx
=
materialRequisitionInfoRowIdx
+
1
;
}
});
</script>
</div>
</div>
</div>
<c:if
test=
"${mode == 'add' || mode=='edit'}"
>
<div
class=
"col-lg-3"
></div>
<div
class=
"col-lg-6"
>
<div
class=
"form-group text-center"
>
<div>
<button
class=
"btn btn-primary btn-block btn-lg btn-parsley"
data-loading-text=
"正在提交..."
>
提 交
</button>
</div>
</div>
</div>
</c:if>
</form:form>
</form:form>
</div>
</div>
</div>
</div>
...
@@ -149,6 +74,7 @@
...
@@ -149,6 +74,7 @@
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
initTable
();
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
if
(
data
.
success
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
jp
.
success
(
data
.
msg
);
...
@@ -163,6 +89,27 @@
...
@@ -163,6 +89,27 @@
format
:
"YYYY-MM-DD HH:mm:ss"
format
:
"YYYY-MM-DD HH:mm:ss"
});
});
});
});
function
save
()
{
var
isValidate
=
jp
.
validateForm
(
'#inputForm'
);
//校验表单
if
(
!
isValidate
){
return
false
;
}
else
{
jp
.
loading
();
jp
.
post
(
$
(
"#inputForm"
).
attr
(
'action'
),
$
(
'#inputForm'
).
serialize
(),
function
(
data
){
if
(
data
.
success
){
jp
.
getParent
().
refresh
();
var
dialogIndex
=
parent
.
layer
.
getFrameIndex
(
window
.
name
);
// 获取窗口索引
parent
.
layer
.
close
(
dialogIndex
);
jp
.
success
(
data
.
msg
)
}
else
{
jp
.
error
(
data
.
msg
);
}
})
}
}
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/shelves/shelvesList.js
View file @
c377137b
...
@@ -114,7 +114,7 @@ $(document).ready(function() {
...
@@ -114,7 +114,7 @@ $(document).ready(function() {
}
}
,{
,{
field
:
'warehouse.name'
,
field
:
'warehouse.name'
,
title
:
'仓库
id
'
,
title
:
'仓库'
,
sortable
:
true
,
sortable
:
true
,
sortName
:
'warehouse.name'
sortName
:
'warehouse.name'
}
}
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
c377137b
...
@@ -118,10 +118,10 @@
...
@@ -118,10 +118,10 @@
jp.warning('请选择批次号!');
jp.warning('请选择批次号!');
return;
return;
}
}
jp.openStorageSelectDialog({batchNum:$("#batchNum").val(),state: 0, isMultiSelect: true },function (items){
jp.openStorageSelectDialog({batchNum:$("#batchNum").val(),state: 0, isMultiSelect: true },function (items){
if(Array.isArray(items)){
if(Array.isArray(items)){
var data = items.map(function (item){
var data = items.map(function (item){
item[0] = false;
if(item.goodsInfo && !item.goodsInfo.amount){
if(item.goodsInfo && !item.goodsInfo.amount){
item.goodsInfo.amount = 0;
item.goodsInfo.amount = 0;
}
}
...
@@ -135,9 +135,14 @@
...
@@ -135,9 +135,14 @@
$(selector).bootstrapTable('append', data)
$(selector).bootstrapTable('append', data)
}
}
})
})
}
}
/**
* 删除明细
* @param index
* @param rowId
* @param rowDelFlag
*/
function removeRow(index, rowId, rowDelFlag){
function removeRow(index, rowId, rowDelFlag){
if(rowId){
if(rowId){
var delFlag = rowDelFlag === 1 ? 0 : 1
var delFlag = rowDelFlag === 1 ? 0 : 1
...
@@ -151,12 +156,25 @@
...
@@ -151,12 +156,25 @@
})
})
}
}
}
}
/**
* 更新行
* @param index 下标
* @param row 更新对象
*/
function updateRow(index, row){
function updateRow(index, row){
$(selector).bootstrapTable('updateRow', {
$(selector).bootstrapTable('updateRow', {
index: index,
index: index,
row: row
row: row
})
})
}
}
/**
* 监听input值,并更新行
* @param rowIndex 更新行的下标
* @param elem 元素
* @param field 属性
*/
function onInputChange(rowIndex, elem , field){
function onInputChange(rowIndex, elem , field){
var obj = {};
var obj = {};
obj[field] = $(elem).val()
obj[field] = $(elem).val()
...
@@ -167,6 +185,11 @@
...
@@ -167,6 +185,11 @@
}, 0)
}, 0)
}
}
/**
* 监听类型选择回调并更新行
* @param nodes 选中数据
* @param rowIndex 行下标
*/
function onSelectType(nodes, rowIndex){
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
var node = nodes[0];
...
@@ -188,14 +211,16 @@
...
@@ -188,14 +211,16 @@
return $(selector).bootstrapTable('getData');
return $(selector).bootstrapTable('getData');
}
}
/**
* 批量添加货架
*/
function addShelve(){
function addShelve(){
jp.openShelvesSelectDialog(function (items){
jp.openShelvesSelectDialog(function (items){
var Shelve = items[0];
var Shelve = items[0]; // 货架对象
// TODO: 获取选中的明细下标
getSelections().forEach(function (item){
getSelections().forEach(function (item){
var index = getTableData().findIndex(function (current){
var index = getTableData().findIndex(function (current){
return current.qrCode.id === item.qrCode.id;
return current.qrCode.id === item.qrCode.id;
})
})
; // 需更新的行的下标
updateRow(index,{
updateRow(index,{
shelves: {
shelves: {
id: Shelve.id,
id: Shelve.id,
...
@@ -265,7 +290,6 @@
...
@@ -265,7 +290,6 @@
<input id="storageInfoList{{idx}}_goodsInfoId" name="storageInfoList[{{idx}}].goodsInfo.id" type="hidden" value="{{row.goodsInfo.id}}"/>
<input id="storageInfoList{{idx}}_goodsInfoId" name="storageInfoList[{{idx}}].goodsInfo.id" type="hidden" value="{{row.goodsInfo.id}}"/>
<input id="storageInfoList{{idx}}_goodsInfoName" name="storageInfoList[{{idx}}].goodsInfo.name" type="hidden" value="{{row.goodsInfo.name}}"/>
<input id="storageInfoList{{idx}}_goodsInfoName" name="storageInfoList[{{idx}}].goodsInfo.name" type="hidden" value="{{row.goodsInfo.name}}"/>
<input id="storageInfoList{{idx}}_goodsInfoAmount" name="storageInfoList[{{idx}}].goodsInfo.amount" type="hidden" value="{{row.goodsInfo.amount}}"/>
<input id="storageInfoList{{idx}}_goodsInfoAmount" name="storageInfoList[{{idx}}].goodsInfo.amount" type="hidden" value="{{row.goodsInfo.amount}}"/>
<input id="storageInfoList{{idx}}_shelvesId" name="storageInfoList[{{idx}}].shelves.id" type="hidden" value="{{row.shelves.id}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_warehouseId" name="storageInfoList[{{idx}}].warehouse.id" type="hidden" value="{{row.warehouse.id}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_warehouseId" name="storageInfoList[{{idx}}].warehouse.id" type="hidden" value="{{row.warehouse.id}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_amount" name="storageInfoList[{{idx}}].amount" type="hidden" value="{{row.amount}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_amount" name="storageInfoList[{{idx}}].amount" type="hidden" value="{{row.amount}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_qrCodeId" name="storageInfoList[{{idx}}].qrCode.id" type="hidden" value="{{row.qrCode.id}}" readonly class="form-control" />
<input id="storageInfoList{{idx}}_qrCodeId" name="storageInfoList[{{idx}}].qrCode.id" type="hidden" value="{{row.qrCode.id}}" readonly class="form-control" />
...
@@ -284,8 +308,9 @@
...
@@ -284,8 +308,9 @@
<script id="modelTpl" type="text/html">
<script id="modelTpl" type="text/html">
<input id="storageInfoList{{idx}}_model" name="storageInfoList[{{idx}}].model" type="text" value="{{row.model}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
<input id="storageInfoList{{idx}}_model" name="storageInfoList[{{idx}}].model" type="text" value="{{row.model}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
</script>
<script id="shelvesTpl" type="text/html">
<script id="shelvesTpl" type="text/html">//<!--
<input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly class="form-control" />
<sys:gridselect url="${ctx}/warehouse/shelves/shelves/data" id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelves.id" value="{{row.shelves.id}}" labelName="storageInfoList[{{idx}}].shelves.name" labelValue="{{row.shelves.name}}"
title="选择货架" cssClass="form-control required" fieldLabels="货架名称|货架编号" fieldKeys="name|code" searchLabels="仓库名称|仓库编号" searchKeys="name|code" ></sys:gridselect>//-->
</script>
</script>
<script id="remarksTpl" type="text/html">
<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>
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="2" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageList.js
View file @
c377137b
...
@@ -331,7 +331,8 @@ $(document).ready(function() {
...
@@ -331,7 +331,8 @@ $(document).ready(function() {
var
qrId$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].qr.id' value='"
+
item
.
qrCode
.
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
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
code$
=
$
(
"<input type='hidden' name='ledgerInfoList["
+
index
+
"].code' value='"
+
item
.
qrCode
.
code
+
"' />"
);
$
(
"#ledgerForm"
).
append
(
id$
).
append
(
delFlag$
).
append
(
name$
).
append
(
typeId$
).
append
(
batchNum$
).
append
(
model$
).
append
(
goodsInfoId$
).
append
(
qrId$
).
append
(
shelvesId$
).
append
(
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
.
loading
(
'入库中...'
);
jp
.
post
(
"${ctx}/warehouse/ledger/ledger/save"
,
$
(
"#ledgerForm"
).
serialize
(),
function
(
res
){
jp
.
post
(
"${ctx}/warehouse/ledger/ledger/save"
,
$
(
"#ledgerForm"
).
serialize
(),
function
(
res
){
...
...
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