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
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
351 additions
and
318 deletions
+351
-318
LedgerController.java
...eeplus/modules/warehouse/ledger/web/LedgerController.java
+10
-9
gridselect.tag
src/main/webapp/WEB-INF/tags/sys/gridselect.tag
+9
-0
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
+67
-100
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
+172
-88
materialRequisitionForm.jsp
...warehouse/materialrequisition/materialRequisitionForm.jsp
+27
-79
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;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -255,8 +257,7 @@ public class LedgerController extends BaseController {
*/
@ResponseBody
@RequestMapping
(
value
=
"findByQrOrCode"
)
public
AjaxJson
findByQrOrCode
(
String
qrId
,
String
code
)
{
AjaxJson
j
=
new
AjaxJson
();
public
Map
<
String
,
Object
>
findByQrOrCode
(
String
qrId
,
String
code
)
{
boolean
b
=
false
;
if
(
StringUtils
.
isNotBlank
(
qrId
))
{
b
=
true
;
...
...
@@ -264,6 +265,8 @@ public class LedgerController extends BaseController {
if
(
StringUtils
.
isNotBlank
(
code
))
{
b
=
true
;
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
LedgerInfo
>
ledgerInfoList
=
new
ArrayList
<>();
if
(
b
)
{
LedgerInfo
temLi
=
new
LedgerInfo
();
QrCode
qrCode
=
new
QrCode
();
...
...
@@ -271,13 +274,10 @@ public class LedgerController extends BaseController {
temLi
.
setQr
(
qrCode
);
temLi
.
setCode
(
code
);
LedgerInfo
ledgerInfo
=
ledgerService
.
findByQrOrCode
(
temLi
);
j
.
put
(
"ledgerInfo"
,
ledgerInfo
);
j
.
setSuccess
(
true
);
j
.
setMsg
(
"查询成功"
);
}
else
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"查询失败"
);
ledgerInfoList
.
add
(
ledgerInfo
);
map
.
put
(
"rows"
,
ledgerInfoList
);
map
.
put
(
"total"
,
ledgerInfoList
.
size
());
}
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 @@
<%@ attribute name="url" type="java.lang.String" required="true" description="数据地址"%>
<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
<%@ 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="callback" type="java.lang.String" required="false" description="选择回调"%>
<input id="${id}Id" name="${name}" type="hidden" value="${value}"/>
...
...
@@ -34,6 +37,12 @@ $(document).ready(function(){
return true;
}
if('${validate}' && '${validateSelector}'){
if(!$("${validateSelector}").val()){
jp.warning('${validateMsg}');
return;
}
}
top.layer.open({
type: 2,
area: ['800px', '500px'],
...
...
src/main/webapp/static/common/js/jeeplus.js
View file @
c377137b
...
...
@@ -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
)
{
var
_this
=
new
Date
(
timestamp
);
var
o
=
{
...
...
src/main/webapp/webpage/modules/warehouse/goods/goodsDetail.jsp
View file @
c377137b
...
...
@@ -232,5 +232,5 @@
</script>
<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>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
View file @
c377137b
...
...
@@ -10,134 +10,126 @@
<table id="detail_table"></table>
<script>
var selector = "#detail_table";
function initTable(){
var data = ${fns:toJson(ledger.ledgerInfoList)};
function initTable() {
var data = [];
$(selector).bootstrapTable({
data: data,
columns:
[
columns:
[
{
field: 'no',
title: '序号',
align: 'center',
width: 60,
formatter: function (value, row, index){
var tpl = $("#hideTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
var html = Mustache.render(tpl, {
idx: index,
row: row
})
return html + '<span>'+(index+1)+'</span>'
}
},
{
field: 'name',
title: '名称',
formatter: function (value,row,index){
return Mustache.render($("#nameTpl").html(),{
row: row,
idx: index
})
formatter: function (value, row, index) {
return '<span>' + (index + 1) + '</span>'
}
},
{
field: 'type.name',
title: '类型',
formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
align: 'center'
},
{
field: 'model',
title: '型号',
formatter: function (value,row,index){
return Mustache.render($("#modelTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
align: 'center'
},
{
field: 'batchNum',
title: '批次号',
formatter: function (value,row,index){
return Mustache.render($("#batchNumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
align: 'center'
},
{
field: 'shelves.name
',
field: 'shelvesNames
',
title: '货架',
formatter: function (value,row,index){
return Mustache.render($("#shelvesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
align: 'center'
},
{
field: 'code',
title: '物资编码',
formatter: function (value,row,index){
return Mustache.render($("#codeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
field: 'warehouseNames',
title: '仓库',
align: 'center'
},
{
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('');
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: ['800', '600'],
content: $("#detailTpl").html(),
success: function (){
$("#table").bootstrapTable({
method: 'get',
url: '${ctx}/warehouse/ledger/ledger/infoDate?batchNum='+ row.batchNum+'&ledger.id=${ledger.id}',
page: true,
columns: [
{field: 'name', title: '物资名称'},
{field: 'type.name', title: '类型'},
{field: 'model', title: '型号'},
{field: 'batchNum', title: '批次号'},
{field: 'shelves.name', title: '货架'},
{field: 'code', title: '物资编码'},
{field: 'amount', title: '单价'},
]
})
},
})
}
}
}
]
});
jp.get("${ctx}/warehouse/ledger/ledger/countLedger?id=${ledger.id}", function (ledger) {
var data = ledger.countLedgerInfoList || [];
$(selector).bootstrapTable('append', data);
})
}
function getSelections()
{
function getSelections()
{
return $(selector).bootstrapTable('getSelections');
}
function removeRow(index, rowId, rowDelFlag)
{
if(rowId)
{
function removeRow(index, rowId, rowDelFlag)
{
if (rowId)
{
var delFlag = rowDelFlag === 1 ? 0 : 1
updateRow(index, {
delFlag: delFlag
})
}else
{
} else
{
$(selector).bootstrapTable("remove", {
field: '$index',
values: [index]
})
}
}
function updateRow(index, row){
function updateRow(index, row) {
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
function onInputChange(rowIndex, elem , field){
function onInputChange(rowIndex, elem, field) {
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function ()
{
timer = setTimeout(function ()
{
updateRow(rowIndex, obj)
}, 0)
}
function onSelectType(nodes, rowIndex)
{
if(Array.isArray(nodes) && nodes.length === 1)
{
function onSelectType(nodes, rowIndex)
{
if (Array.isArray(nodes) && nodes.length === 1)
{
var node = nodes[0];
var obj = {
type: {
...
...
@@ -153,40 +145,14 @@
* 获取所有明细数据
* @returns {*|jQuery}
*/
function getTableData()
{
function getTableData()
{
return $(selector).bootstrapTable('getData');
}
</script>
<script id="hideTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_id" name="ledgerInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input id="ledgerInfoList{{idx}}_delFlag" name="ledgerInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
<input id="ledgerInfoList{{idx}}_goodsInfoId" name="ledgerInfoList[{{idx}}].goodsInfo.id" type="hidden" value="{{row.goodsInfo.id}}"/>
<input id="ledgerInfoList{{idx}}_shelvesId" name="ledgerInfoList[{{idx}}].shelves.id" type="hidden" value="{{row.shelves.id}}" readonly class="form-control" />
<input id="ledgerInfoList{{idx}}_qrCodeId" name="ledgerInfoList[{{idx}}].qr.id" type="hidden" value="{{row.qr.id}}" readonly class="form-control" />
</script>
<script id="nameTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_name" name="ledgerInfoList[{{idx}}].name" type="text" readonly value="{{row.name}}" onchange="onInputChange('{{idx}}', this, 'name')" class="form-control "/>
</script>
<script id="typeTpl" type="text/html">//<!--
<sys:treeselect id="ledgerInfoList{{idx}}_type" name="ledgerInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="storageInfoList{{idx}}.type.name" labelValue="{{row.type.name}}"
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " disabled="disabled" allowClear="true" allowSearch="true" callback="onSelectType" />//-->
</script>
<script id="modelTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_model" name="ledgerInfoList[{{idx}}].model" type="text" value="{{row.model}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="batchNumTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_batchNum" name="ledgerInfoList[{{idx}}].batchNum" type="text" value="{{row.batchNum}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="shelvesTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_shelvesName" name="ledgerInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="codeTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_code" name="ledgerInfoList[{{idx}}].code" type="text" value="{{row.code}}" readonly class="form-control" />
<script id="detailTpl" type="text/html">
<br>
<div class="container-fluid">
<table id="table"></table>
</div>
</script>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/ledger/ledgerForm.jsp
View file @
c377137b
...
...
@@ -32,26 +32,25 @@
title=
"类型"
url=
"/warehouse/materialtype/materialType/treeData"
extId=
"${ledger.id}"
cssClass=
"form-control "
allowClear=
"true"
/>
</td>
</tr>
<tr>
<td>
型号
</td>
<td>
<form:input
path=
"model"
htmlEscape=
"false"
class=
"form-control "
/>
</td>
</tr>
<tr>
<td>
数量
</td>
<td>
<form:input
path=
"num"
htmlEscape=
"false"
class=
"form-control "
/>
</td>
</tr>
<tr>
<td>
总价
</td>
<td>
<form:input
path=
"sum"
htmlEscape=
"false"
class=
"form-control "
/>
</td>
<td
colspan=
"2"
></td>
</tr>
<tr>
<td
colspan=
"
4
"
>
<td
colspan=
"
6
"
>
<
%@
include
file=
"ledgerDetail.jsp"
%
>
</td>
</tr>
...
...
@@ -66,26 +65,6 @@
$
(
document
).
ready
(
function
()
{
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>
</body>
</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() {
<
table
class
=
"ani table"
>
<
thead
>
<
tr
>
<
th
>
物资名称
<
/th
>
<
th
>
类型
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
批次号
<
/th
>
...
...
@@ -324,9 +323,6 @@ $(document).ready(function() {
<
script
type
=
"text/template"
id
=
"ledgerChild1Tpl"
>
//<!--
<
tr
>
<
td
>
{{
row
.
name
}}
<
/td
>
<
td
>
{{
row
.
type
.
name
}}
<
/td
>
<
td
>
...
...
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionDetail.jsp
View file @
c377137b
...
...
@@ -9,59 +9,103 @@
<%@ include file="/webpage/include/taglib.jsp" %>
<div id="toolbar" class="text-left">
<c:if test="${mode == 'add' || mode == 'edit'}">
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 手动添加</a>
<a class="btn btn-primary btn-sm" onclick="addScan('#detail_table')" title="新增"><i class="fa fa-plus"></i> 扫码添加</a>
<a id="editAll" class="btn btn-primary btn-sm" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a>
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i>
手动添加</a>
<a class="btn btn-primary btn-sm" onclick="addScan('#detail_table')" title="新增"><i class="fa fa-plus"></i>
扫码添加</a>
<a id="editAll" class="btn btn-primary btn-sm" onclick="addReceiver('#detail_table')" title="新增"><i
class="fa fa-plus"></i> 批量编辑领用人</a>
</c:if>
</div>
<table id="detail_table" data-toolbar="#toolbar"></table>
<script>
var selector = "#detail_table";
function initTable(){
function initTable() {
var data = ${fns:toJson(materialRequisition.materialRequisitionInfoList)};
$(selector).bootstrapTable({
data: data,
columns:
[{checkbox: true},
columns:
[{checkbox: true},
{
field: 'no',
title: '序号',
align: 'center',
width: 60,
formatter: function (value, row, index)
{
formatter: function (value, row, index)
{
var tpl = $("#hideTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
var html = Mustache.render(tpl, {
idx: index,
row: row
})
return html + '<span>'+(index+1)+'</span>'
return html + '<span>' + (index + 1) + '</span>'
}
},
{
field: 'ledgerInfo.name',
title: '物资名称',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoNameTpl").html(), {
row: row,
idx: index
})
}
},
{
field: 'nam
e',
title: '名称
',
formatter: function (value,row,index)
{
return Mustache.render($("#nameTpl").html(),
{
field: 'ledgerInfo.cod
e',
title: '物资编码
',
formatter: function (value, row, index)
{
return Mustache.render($("#ledgerInfoCodeTpl").html(),
{
row: row,
idx: index
})
}
},
{
field: '
type.name',
field: 'ledgerInfo.
type.name',
title: '类型',
formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoTypeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: 'ledgerInfo.model',
title: '型号',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoModelTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: 'remarks',
title: '备注',
formatter: function (value,row,index){
return Mustache.render($("#remarksTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
field: 'ledgerInfo.amount',
title: '单价',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoAmountTpl").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: 'receiver.name',
title: '领用人',
formatter: function (value, row, index) {
return Mustache.render($("#receiverTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
...
...
@@ -70,9 +114,9 @@
{
field: '',
title: '操作',
formatter: function (value,row,index)
{
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>"
]
var result = ["<a href='javascript:void(0);' onclick=\"removeRow(" + index + ", '" + row.id + "', '" + row.delFlag + "')\">" + text + "</a>"
]
return result.join('');
}
}
...
...
@@ -84,7 +128,7 @@
});
}
function getSelections()
{
function getSelections()
{
return $(selector).bootstrapTable('getSelections');
}
...
...
@@ -92,63 +136,64 @@
* 手动添加明细
* @param selector
*/
function addDetail(selector)
{
// 选择该批次号下的货品明细
if(!$("#batchNum").val()){
jp.warning('请选择批次号!');
return;
}
jp.openStorageSelectDialog({batchNum:$("#batchNum").val(),state: 0, isMultiSelect: true },function (items){
if(Array.isArray(items)){
var data = items.map(function (item)
{
if(item.goodsInfo && !item.goodsInfo.amount)
{
item.goodsInfo.amount = 0;
}
function addDetail(selector)
{
jp.openGridSelectDialog({
title: '选择物资台账明细',
isMultiSelect: true,
url: "${ctx}/warehouse/ledger/ledger/findByQrOrCode",
fieldLabels: "物资编码|物资名称|类型|型号|批次号|单价",
fieldKeys: "code|name|type.name|model|batchNum|amount",
searchLabels: "物资编码",
searchKeys: "code",
}, function (items)
{
if (Array.isArray(items))
{
var data = items.map(function (item) {
item[0] = false;
return {
id: '',
delFlag: 0,
remarks: '',
...
item
ledgerInfo:
item
}
})
$(selector).bootstrapTable('append', data)
}
})
}
function removeRow(index, rowId, rowDelFlag){
if(rowId){
function removeRow(index, rowId, rowDelFlag) {
if (rowId) {
var delFlag = rowDelFlag === 1 ? 0 : 1
updateRow(index, {
delFlag: delFlag
})
}else
{
} else
{
$(selector).bootstrapTable("remove", {
field: '$index',
values: [index]
})
}
}
function updateRow(index, row){
function updateRow(index, row) {
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
function onInputChange(rowIndex, elem , field){
function onInputChange(rowIndex, elem, field) {
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function ()
{
timer = setTimeout(function ()
{
updateRow(rowIndex, obj)
}, 0)
}
function onSelectType(nodes, rowIndex)
{
if(Array.isArray(nodes) && nodes.length === 1)
{
function onSelectType(nodes, rowIndex)
{
if (Array.isArray(nodes) && nodes.length === 1)
{
var node = nodes[0];
var obj = {
type: {
...
...
@@ -164,24 +209,40 @@
* 获取所有明细数据
* @returns {*|jQuery}
*/
function getTableData()
{
function getTableData()
{
return $(selector).bootstrapTable('getData');
}
function addShelve(){
jp.openShelvesSelectDialog(function (items){
var Shelve = items[0];
function addReceiver() {
if (!$("#officeId").val()) {
jp.warning('请选择领用机构!');
return;
}
if(!getSelections().length){
jp.warning('请添加并勾选明细!');
return;
}
jp.openGridSelectDialog({
title: '选择领用人',
isMultiSelect: false,
url: "${ctx}/sys/user/list?office.id=" + $("#officeId").val(),
fieldLabels: "领用人|手机|归属公司|归属部门",
fieldKeys: "name|phone|company.name|office.name",
searchLabels: "领用人",
searchKeys: "name",
}, function (items) {
var receiver = items[0];
// TODO: 获取选中的明细下标
getSelections().forEach(function (item)
{
var index = getTableData().findIndex(function (current)
{
return current.qrCode.id === item.qrCode
.id;
getSelections().forEach(function (item)
{
var index = getTableData().findIndex(function (current)
{
return current.ledgerInfo.id === item.ledgerInfo
.id;
})
updateRow(index,{
shelves: {
id: Shelve.id,
name: Shelve.name
},
warehouse: Shelve.warehouse
updateRow(index, {
receiver: receiver
})
})
...
...
@@ -191,17 +252,17 @@
/**
* 点击扫码显示扫码窗口
*/
function addScan()
{
function addScan()
{
layer.open({
type: 1,
title: '扫码',
auto: true,
area: ['500',
'300'],
area: ['500',
'300'],
content: $("#scanResultTpl").html(),
success: function ()
{
success: function ()
{
$("#scanResult").focus();
},
btn:
['关闭']
btn:
['关闭']
})
}
...
...
@@ -213,56 +274,79 @@
* 四、清空扫码结果
* @param elem
*/
function onScanChange(elem)
{
try
{
function onScanChange(elem)
{
try
{
var json = JSON.parse($(elem).val());
var qrCodeId = json.code;
var goodsInfoId = json.infoId;
jp.get('${ctx}/warehouse/goods/goods/getGIAndQCByTwoId?goodsInfoId='+goodsInfoId+"&qrCodeId="+qrCodeId, function (res){
var qrCode = res.body.qrCode;
$(selector).bootstrapTable('append',[
jp.get('${ctx}/warehouse/ledger/ledger/findByQrOrCode?qrCodeId=' + qrCodeId, function (res) {
var data = res.rows || [];
if (data.length) {
var item = data[0];
$(selector).bootstrapTable('append', [
{
qrCode: qrCode,
goodsInfo: qrCode.goodsInfo,
...qrCode.goodsInfo,
id: '',
delFlag: 0,
remarks: ''
remarks: '',
ledgerInfo: item
}
]);
$(elem).val('').focus();
}else{
jp.warning('未找到任何数据!');
$(elem).val('').focus();
}
})
}catch (e)
{
} catch (e)
{
console.log(e);
}
}
</script>
<script id="hideTpl" type="text/html">
<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="{{row.delFlag}}"/>
<input id="materialRequisitionInfoList{{idx}}_materialRequisition" name="materialRequisitionInfoList[{{idx}}].materialRequisition.id" type="hidden" value="{{row.materialRequisition.id}}"/>
<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="{{row.delFlag}}"/>
<input id="materialRequisitionInfoList{{idx}}_materialRequisition"
name="materialRequisitionInfoList[{{idx}}].materialRequisition.id" type="hidden"
value="{{row.materialRequisition.id}}"/>
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoId"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.id" type="hidden" value="{{row.ledgerInfo.id}}"/>
</script>
<script id="ledgerInfoTpl" type="text/html">//<!--
<sys:gridselect url="${ctx}/warehouse/ledger/ledger/data" id="materialRequisitionInfoList{{idx}}_ledgerInfo" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.id" value="{{row.ledgerInfo.id}}" labelName="materialRequisitionInfoList[{{idx}}].ledgerInfo.name" labelValue="{{row.ledgerInfo.name}}"
title="选择物资" cssClass="form-control required" fieldLabels="物资名称|物资编号" fieldKeys="name|code" searchLabels="仓库名称|仓库编号" searchKeys="name|code" ></sys:gridselect>//-->
<script id="ledgerInfoNameTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoName" readonly
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.name" type="text" class="form-control"
value="{{row.ledgerInfo.name}}"/>
</script>
<script id="typeTpl" type="text/html">//<!--
<sys:treeselect id="storageInfoList{{idx}}_type" name="storageInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="storageInfoList{{idx}}.type.name" labelValue="{{row.type.name}}
"
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " disabled="disabled" allowClear="true" allowSearch="true" callback="onSelectType" />//--
>
<script id="ledgerInfoCodeTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoCode" readonly
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.code" type="text" class="form-control
"
value="{{row.ledgerInfo.code}}"/
>
</script>
<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 "/>
<script id="ledgerInfoTypeTpl" type="text/html">//<!--
<sys:treeselect id="materialRequisitionInfoList{{idx}}_ledgerInfoType" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.type.id" value="{{row.ledgerInfo.type.id}}" labelName="materialRequisitionInfoList{{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="ledgerInfoModelTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoModel"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.model" type="text" class="form-control" readonly
value="{{row.ledgerInfo.model}}"/>
</script>
<script id="ledgerInfoAmountTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoAmount"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.amount" type="text" readonly class="form-control"
value="{{row.ledgerInfo.amount}}"/>
</script>
<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" />
<script id="receiverTpl" type="text/html">//<!--
<sys:gridselect url="${ctx}/sys/user/list" id="materialRequisitionInfoList{{idx}}_receiver" name="materialRequisitionInfoList[{{idx}}].receiver.id" value="{{row.receiver.id}}" labelName="materialRequisitionInfoList[{{idx}}].receiver.name" labelValue="{{row.receiver.name}}"
title="选择领用人" cssClass="form-control required" fieldLabels="领用人|手机|归属公司|归属部门" validate="true" validateSelector="#officeId" validateMsg="请选择领用机构" fieldKeys="name|phone|company.name|office.name" searchLabels="领用人" searchKeys="name" ></sys:gridselect>//-->
</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>
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="2"
onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
<script id="scanResultTpl" type="text/html">
...
...
src/main/webapp/webpage/modules/warehouse/materialrequisition/materialRequisitionForm.jsp
View file @
c377137b
...
...
@@ -55,91 +55,16 @@
</tr>
<tr>
<td>
备注
</td>
<td>
<td
colspan=
"3"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</td>
</tr>
</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>
<td
colspan=
"4"
>
<
%@
include
file=
"materialRequisitionDetail.jsp"
%
>
</td>
</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>
</div>
</div>
...
...
@@ -149,6 +74,7 @@
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
initTable
();
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
...
...
@@ -163,6 +89,27 @@
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>
</body>
</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() {
}
,{
field
:
'warehouse.name'
,
title
:
'仓库
id
'
,
title
:
'仓库'
,
sortable
:
true
,
sortName
:
'warehouse.name'
}
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
c377137b
...
...
@@ -118,10 +118,10 @@
jp.warning('请选择批次号!');
return;
}
jp.openStorageSelectDialog({batchNum:$("#batchNum").val(),state: 0, isMultiSelect: true },function (items){
if(Array.isArray(items)){
var data = items.map(function (item){
item[0] = false;
if(item.goodsInfo && !item.goodsInfo.amount){
item.goodsInfo.amount = 0;
}
...
...
@@ -135,9 +135,14 @@
$(selector).bootstrapTable('append', data)
}
})
}
/**
* 删除明细
* @param index
* @param rowId
* @param rowDelFlag
*/
function removeRow(index, rowId, rowDelFlag){
if(rowId){
var delFlag = rowDelFlag === 1 ? 0 : 1
...
...
@@ -151,12 +156,25 @@
})
}
}
/**
* 更新行
* @param index 下标
* @param row 更新对象
*/
function updateRow(index, row){
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
/**
* 监听input值,并更新行
* @param rowIndex 更新行的下标
* @param elem 元素
* @param field 属性
*/
function onInputChange(rowIndex, elem , field){
var obj = {};
obj[field] = $(elem).val()
...
...
@@ -167,6 +185,11 @@
}, 0)
}
/**
* 监听类型选择回调并更新行
* @param nodes 选中数据
* @param rowIndex 行下标
*/
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
...
...
@@ -188,14 +211,16 @@
return $(selector).bootstrapTable('getData');
}
/**
* 批量添加货架
*/
function addShelve(){
jp.openShelvesSelectDialog(function (items){
var Shelve = items[0];
// TODO: 获取选中的明细下标
var Shelve = items[0]; // 货架对象
getSelections().forEach(function (item){
var index = getTableData().findIndex(function (current){
return current.qrCode.id === item.qrCode.id;
})
})
; // 需更新的行的下标
updateRow(index,{
shelves: {
id: Shelve.id,
...
...
@@ -265,7 +290,6 @@
<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}}_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}}_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" />
...
...
@@ -284,8 +308,9 @@
<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 "/>
</script>
<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" />
<script id="shelvesTpl" type="text/html">//<!--
<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 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>
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageList.js
View file @
c377137b
...
...
@@ -331,7 +331,8 @@ $(document).ready(function() {
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
+
"' />"
);
$
(
"#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
.
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