Commit 709df285 by yyq1988

调整入库表单

parent 5cb4c35f
......@@ -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',
title: '备注',
formatter: function (value,row,index){
......@@ -120,7 +130,19 @@
}
jp.openStorageSelectDialog({batchNum:$("#batchNum").val(),state: 0, isMultiSelect: true },function (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;
if(item.goodsInfo && !item.goodsInfo.amount){
item.goodsInfo.amount = 0;
......@@ -131,7 +153,7 @@
remarks: '',
...item
}
})
});
$(selector).bootstrapTable('append', data)
}
})
......@@ -329,7 +351,9 @@
<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>
</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">
<br>
<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