Commit 709df285 by yyq1988

调整入库表单

parent 5cb4c35f
...@@ -78,6 +78,16 @@ ...@@ -78,6 +78,16 @@
} }
}, },
{ {
field: 'warehouse.name',
title: '仓库',
formatter: function (value,row,index){
return Mustache.render($("#warehouseTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'remarks', field: 'remarks',
title: '备注', title: '备注',
formatter: function (value,row,index){ formatter: function (value,row,index){
...@@ -120,7 +130,19 @@ ...@@ -120,7 +130,19 @@
} }
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 newItems = [];
items.forEach(function(item){
var fined = getTableData().find(function(v){
return v.qrCode.id !== item.qrCode.id
})
if(!fined){
newItems.push(item)
}
})
var data = newItems.map(function (item){
item[0] = false; item[0] = false;
if(item.goodsInfo && !item.goodsInfo.amount){ if(item.goodsInfo && !item.goodsInfo.amount){
item.goodsInfo.amount = 0; item.goodsInfo.amount = 0;
...@@ -131,7 +153,7 @@ ...@@ -131,7 +153,7 @@
remarks: '', remarks: '',
...item ...item
} }
}) });
$(selector).bootstrapTable('append', data) $(selector).bootstrapTable('append', data)
} }
}) })
...@@ -329,7 +351,9 @@ ...@@ -329,7 +351,9 @@
<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>
</script> </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 "/>
</script>
<script id="scanResultTpl" type="text/html"> <script id="scanResultTpl" type="text/html">
<br> <br>
<div class="container-fluid"> <div class="container-fluid">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment