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
7515a7b8
Commit
7515a7b8
authored
Feb 22, 2023
by
yyq1988
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接台账功能
parent
830ae006
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
209 additions
and
17 deletions
+209
-17
goodsList.js
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
+16
-9
ledgerDetail.jsp
.../webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
+188
-0
ledgerForm.jsp
...in/webapp/webpage/modules/warehouse/ledger/ledgerForm.jsp
+0
-0
ledgerList.js
...ain/webapp/webpage/modules/warehouse/ledger/ledgerList.js
+4
-8
storageList.js
...n/webapp/webpage/modules/warehouse/storage/storageList.js
+1
-0
No files found.
src/main/webapp/webpage/modules/warehouse/goods/goodsList.js
View file @
7515a7b8
...
...
@@ -296,15 +296,22 @@ $(document).ready(function() {
function
printQr
(
id
)
{
jp
.
loading
(
'loading...'
);
initLodop
();
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
list
=
res
.
body
.
goodsInfo
.
qrCodeList
;
LODOP
.
PRINT_INIT
(
"打印货品"
);
LODOP
.
SET_PRINT_PAGESIZE
(
1
,
400
,
600
,
0
)
createAllPage
(
list
);
LODOP
.
PREVIEW
();
jp
.
close
();
})
try
{
initLodop
();
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
list
=
res
.
body
.
goodsInfo
.
qrCodeList
;
LODOP
.
PRINT_INIT
(
"打印货品"
);
LODOP
.
SET_PRINT_PAGESIZE
(
1
,
400
,
600
,
0
)
createAllPage
(
list
);
LODOP
.
PREVIEW
();
jp
.
close
();
})
}
catch
(
e
){
jp
.
get
(
"${ctx}/warehouse/goods/goods/printQr?goodsInfoId="
+
id
,
function
(
res
)
{
var
list
=
res
.
body
.
goodsInfo
.
qrCodeList
;
jp
.
close
();
})
}
}
function
createAllPage
(
list
){
...
...
src/main/webapp/webpage/modules/warehouse/ledger/ledgerDetail.jsp
0 → 100644
View file @
7515a7b8
<%--
Created by IntelliJ IDEA.
User: yangzi
Date: 2023/2/21
Time: 10:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<table id="detail_table"></table>
<script>
var selector = "#detail_table";
function initTable(){
var data = ${fns:toJson(ledger.ledgerInfoList)};
$(selector).bootstrapTable({
data: data,
columns:[{checkbox: true},
{
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
})
}
},
{
field: 'type.name',
title: '类型',
formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'model',
title: '型号',
formatter: function (value,row,index){
return Mustache.render($("#modelTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'batchNum',
title: '批次号',
formatter: function (value,row,index){
return Mustache.render($("#batchNumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'shelves.name',
title: '货架',
formatter: function (value,row,index){
return Mustache.render($("#shelvesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'code',
title: '物资编码',
formatter: function (value,row,index){
return Mustache.render($("#codeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
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('');
}
}
]
});
}
function getSelections(){
return $(selector).bootstrapTable('getSelections');
}
function removeRow(index, rowId, rowDelFlag){
if(rowId){
var delFlag = rowDelFlag === 1 ? 0 : 1
updateRow(index, {
delFlag: delFlag
})
}else{
$(selector).bootstrapTable("remove", {
field: '$index',
values: [index]
})
}
}
function updateRow(index, row){
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
function onInputChange(rowIndex, elem , field){
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function (){
updateRow(rowIndex, obj)
}, 0)
}
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
var obj = {
type: {
id: node.id,
name: node.text
}
};
updateRow(rowIndex, obj)
}
}
/**
* 获取所有明细数据
* @returns {*|jQuery}
*/
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="codeTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_code" name="ledgerInfoList[{{idx}}].code" type="text" value="{{row.code}}" readonly class="form-control" />
</script>
src/main/webapp/webpage/modules/warehouse/ledger/ledgerForm.jsp
View file @
7515a7b8
This diff is collapsed.
Click to expand it.
src/main/webapp/webpage/modules/warehouse/ledger/ledgerList.js
View file @
7515a7b8
...
...
@@ -249,21 +249,21 @@ $(document).ready(function() {
$
(
'#ledgerTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
go
(
"${ctx}/warehouse/ledger/ledger/form/add"
);
jp
.
openSaveDialog
(
"新增台账"
,
"${ctx}/warehouse/ledger/ledger/form/add"
,
'1200'
,
'800'
);
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
go
(
"${ctx}/warehouse/ledger/ledger/form/edit?id="
+
id
);
jp
.
openSaveDialog
(
"编辑台账"
,
"${ctx}/warehouse/ledger/ledger/form/edit?id="
+
id
,
'1200'
,
'800'
);
}
function
view
(
id
){
//没有权限时,不显示确定按钮
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
go
(
"${ctx}/warehouse/ledger/ledger/form/view?id="
+
id
);
jp
.
openViewDialog
(
"查看台账"
,
"${ctx}/warehouse/ledger/ledger/form/view?id="
+
id
,
'1200'
,
'800'
);
}
...
...
@@ -311,12 +311,8 @@ $(document).ready(function() {
<
th
>
类型
<
/th
>
<
th
>
型号
<
/th
>
<
th
>
批次号
<
/th
>
<
th
>
主表外键
<
/th
>
<
th
>
货品明细
id
<
/th
>
<
th
>
二维码
id
<
/th
>
<
th
>
货架
id
<
/th
>
<
th
>
货架
<
/th
>
<
th
>
物资编码
<
/th
>
<
th
>
备注信息
<
/th
>
<
/tr
>
<
/thead
>
<
tbody
id
=
"ledgerChild-{{idx}}-1-List"
>
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageList.js
View file @
7515a7b8
...
...
@@ -318,6 +318,7 @@ $(document).ready(function() {
$
(
"#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
+
"' />"
);
...
...
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