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
53e40cb9
Commit
53e40cb9
authored
Jun 14, 2023
by
yyq1988
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化入库添加明细保存问题
parent
377576dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
43 deletions
+56
-43
storageDetail.jsp
...ebapp/webpage/modules/warehouse/storage/storageDetail.jsp
+49
-43
storageForm.jsp
.../webapp/webpage/modules/warehouse/storage/storageForm.jsp
+7
-0
No files found.
src/main/webapp/webpage/modules/warehouse/storage/storageDetail.jsp
View file @
53e40cb9
...
...
@@ -44,13 +44,7 @@
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>'
return '<span>'+(index+1)+'</span>'
}
},
{
...
...
@@ -273,8 +267,10 @@
* 获取所有明细数据
* @returns {*|jQuery}
*/
function getTableData(){
return $(selector).bootstrapTable('getData');
function getTableData(useCurrentPage){
return $(selector).bootstrapTable('getData',{
useCurrentPage: useCurrentPage
});
}
/**
...
...
@@ -284,28 +280,31 @@
jp.openShelvesSelectDialog(function (items){
setTimeout(function(){
var Shelve = items[0]; // 货架对象
updateTask(getSelections(), 10, function(index){
var realSelections = []; // 保存真实选中的数据
var allSelections = getSelections(); // 保存所有选中的数据(含分页)
var currentPageData = getTableData(true); // 保存当前分页数据
allSelections.forEach(function(item){
var finded = currentPageData.find(function(value){
return value.qrCode.id === item.qrCode.id
});
if(finded){
realSelections.push(item);
}
});
realSelections.forEach(function (item){
var index = getTableData().findIndex(function (current){
return current.qrCode.id === item.qrCode.id;
}); // 需更新的行的下标
updateRow(index,{
shelves: {
id: Shelve.id,
name: Shelve.name
},
warehouse: Shelve.warehouse
})
;
})
;
})
})
},200)
// getSelections().forEach(function (item){
// var index = getTableData().findIndex(function (current){
// return current.qrCode.id === item.qrCode.id;
// }); // 需更新的行的下标
// // updateRow(index,{
// // shelves: {
// // id: Shelve.id,
// // name: Shelve.name
// // },
// // warehouse: Shelve.warehouse
// // })
// })
})
}
...
...
@@ -384,49 +383,56 @@
</script>
<script id="hideTpl" type="text/html">
<input id="storageInfoList{{idx}}_id" name="storageInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input id="storageInfoList{{idx}}_delFlag" name="storageInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
<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}}_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" />
<input name="storageInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input name="storageInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
<input name="storageInfoList[{{idx}}].goodsInfo.id" type="hidden" value="{{row.goodsInfo.id}}"/>
<input name="storageInfoList[{{idx}}].goodsInfo.name" type="hidden" value="{{row.goodsInfo.name}}"/>
<input name="storageInfoList[{{idx}}].goodsInfo.amount" type="hidden" value="{{row.goodsInfo.amount}}"/>
<input name="storageInfoList[{{idx}}].warehouse.id" type="hidden" value="{{row.warehouse.id}}" readonly class="form-control" />
<input name="storageInfoList[{{idx}}].warehouse.name" type="hidden" value="{{row.warehouse.name}}" readonly class="form-control" />
<input name="storageInfoList[{{idx}}].amount" type="hidden" value="{{row.amount}}" readonly class="form-control" />
<input name="storageInfoList[{{idx}}].qrCode.id" type="hidden" value="{{row.qrCode.id}}" readonly class="form-control" />
<input name="storageInfoList[{{idx}}].name" type="hidden" readonly value="{{row.name}}" class="form-control "/>
<input name="storageInfoList[{{idx}}].type.id" type="hidden" readonly value="{{row.type.id}}" class="form-control "/>
<input name="storageInfoList[{{idx}}].type.name" type="hidden" readonly value="{{row.type.name}}" class="form-control "/>
<input name="storageInfoList[{{idx}}].model" type="hidden" readonly value="{{row.model}}" class="form-control "/>
<input name="storageInfoList[{{idx}}].shelves.id" type="hidden" readonly value="{{row.shelves.id}}" class="form-control "/>
<input name="storageInfoList[{{idx}}].shelves.name" type="hidden" readonly value="{{row.shelves.name}}" class="form-control "/>
<input name="storageInfoList[{{idx}}].remarks" type="hidden" readonly value="{{row.remarks}}" class="form-control "/>
</script>
<script id="nameTpl" type="text/html">
<input
id="storageInfoList{{idx}}_name" name="storageInfoList[{{idx}}].name" type="text" readonly value="{{row.name}}" onchange="onInputChange('{{idx}}', this, 'name')"
class="form-control "/>
<input
type="text" readonly value="{{row.name}}"
class="form-control "/>
</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}}"
<sys:treeselect
NotNameProperty
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>
<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" type="text" value="{{row.model}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="shelvesTpl" type="text/html">//<!--
{{#row.readonly}}
<sys:shelvesselect id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelves.id" value="{{row.shelves.id}}" labelName="storageInfoList[{{idx}}].shelves.name" labelValue="{{row.shelves.name}}"
cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" disabled="disabled"></sys:shelvesselect>
<sys:shelvesselect
NotName
id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelves.id" value="{{row.shelves.id}}" labelName="storageInfoList[{{idx}}].shelves.name" labelValue="{{row.shelves.name}}"
cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" disabled="disabled"></sys:shelvesselect
NotName
>
{{/row.readonly}}
{{^row.readonly}}
<sys:shelvesselect id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelves.id" value="{{row.shelves.id}}" labelName="storageInfoList[{{idx}}].shelves.name" labelValue="{{row.shelves.name}}"
cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" callback="onSelectShelves"></sys:shelvesselect>//-->
<sys:shelvesselect
NotName
id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelves.id" value="{{row.shelves.id}}" labelName="storageInfoList[{{idx}}].shelves.name" labelValue="{{row.shelves.name}}"
cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" callback="onSelectShelves"></sys:shelvesselect
NotName
>//-->
{{/row.readonly}}
</script>
<script id="remarksTpl" type="text/html">
{{#row.readonly}}
<textarea id="storageInfoList{{idx}}_remarks"
name="storageInfoList[{{idx}}].remarks"
rows="2" readonly class="form-control ">{{row.remarks}}</textarea>
<textarea id="storageInfoList{{idx}}_remarks" rows="2" readonly class="form-control ">{{row.remarks}}</textarea>
{{/row.readonly}}
{{^row.readonly}}
<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" rows="2" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
{{/row.readonly}}
</script>
<script id="warehouseTpl" type="text/html">
<input id="storageInfoList{{idx}}_warehouseName"
name="storageInfoList[{{idx}}].warehouse.name"
type="text" value="{{row.warehouse.name}}" readonly class="form-control "/>
<input id="storageInfoList{{idx}}_warehouseName" type="text" value="{{row.warehouse.name}}" readonly class="form-control "/>
</script>
<script id="scanResultTpl" type="text/html">
<br>
...
...
src/main/webapp/webpage/modules/warehouse/storage/storageForm.jsp
View file @
53e40cb9
...
...
@@ -138,7 +138,14 @@
jp
.
warning
(
'请填写明细!'
);
return
;
}
/**处理明细隐藏input元素*/
jp
.
loading
();
getTableData
().
forEach
(
function
(
item
,
index
){
$
(
"#inputForm"
).
append
(
Mustache
.
render
(
$
(
"#hideTpl"
).
html
(),{
row
:
item
,
idx
:
index
}))
})
jp
.
post
(
$
(
"#inputForm"
).
attr
(
'action'
),
$
(
'#inputForm'
).
serialize
(),
function
(
data
){
if
(
data
.
success
){
jp
.
getParent
().
refresh
();
...
...
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