Commit 00e888b5 by yyq1988

调整入库表单

parent 581f74ce
...@@ -273,15 +273,13 @@ function delRow(obj, prefix){ ...@@ -273,15 +273,13 @@ function delRow(obj, prefix){
content: ctx+"/warehouse/shelves/shelves/shelvesSelect", content: ctx+"/warehouse/shelves/shelves/shelvesSelect",
btn: ['确定', '关闭'], btn: ['确定', '关闭'],
yes: function(index, layero){ yes: function(index, layero){
var ids = layero.find("iframe")[0].contentWindow.getIdSelections(); var items = layero.find("iframe")[0].contentWindow.getSelections();
var names = layero.find("iframe")[0].contentWindow.getNameSelections(); if(Array.isArray(items)&&items.length ==0){
if(ids.length ==0){
jp.warning("请选择至少一个货架!"); jp.warning("请选择至少一个货架!");
return; return;
} }
// 执行保存 // 执行保存
yesFuc(ids.join(","), names.join(",")); yesFuc(items);
top.layer.close(index); top.layer.close(index);
}, },
cancel: function(index){ cancel: function(index){
......
...@@ -159,9 +159,7 @@ ...@@ -159,9 +159,7 @@
}); });
} }
function getSelections() { function getSelections() {
return $.map($("#table").bootstrapTable('getSelections'), function (row) { return $("#table").bootstrapTable('getSelections')
return row
});
} }
</script> </script>
......
...@@ -301,8 +301,6 @@ $(document).ready(function() { ...@@ -301,8 +301,6 @@ $(document).ready(function() {
var list = res.body.goodsInfo.qrCodeList; var list = res.body.goodsInfo.qrCodeList;
LODOP.PRINT_INIT("打印货品"); LODOP.PRINT_INIT("打印货品");
LODOP.SET_PRINT_PAGESIZE(1,400,600,0) LODOP.SET_PRINT_PAGESIZE(1,400,600,0)
LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW",true);
LODOP.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW",true);
createAllPage(list); createAllPage(list);
LODOP.PREVIEW(); LODOP.PREVIEW();
jp.close(); jp.close();
...@@ -317,7 +315,7 @@ $(document).ready(function() { ...@@ -317,7 +315,7 @@ $(document).ready(function() {
list.forEach(function(item){ list.forEach(function(item){
LODOP.NewPage(); LODOP.NewPage();
var imgUrl = "${ctxPath}/" + item.url; var imgUrl = "${ctxPath}/" + item.url;
LODOP.ADD_PRINT_IMAGE('0%',"0%","100%","100%","<img border='0' src='"+imgUrl+"' />"); LODOP.ADD_PRINT_IMAGE('0%',"0%","100%","100%","<img width='150' border='0' src='"+imgUrl+"' />");
}) })
} }
......
...@@ -126,7 +126,6 @@ ...@@ -126,7 +126,6 @@
...item ...item
} }
}) })
debugger
$(selector).bootstrapTable('append', data) $(selector).bootstrapTable('append', data)
} }
}) })
...@@ -175,21 +174,37 @@ ...@@ -175,21 +174,37 @@
} }
} }
function addShelve(){ /**
jp.openShelvesSelectDialog(function (id,name){ * 获取所有明细数据
* @returns {*|jQuery}
*/
function getTableData(){
return $(selector).bootstrapTable('getData');
}
getSelections().forEach(function (item,index){ function addShelve(){
jp.openShelvesSelectDialog(function (items){
var Shelve = items[0];
// TODO: 获取选中的明细下标
getSelections().forEach(function (item){
var index = getTableData().findIndex(function (current){
return current.qrCode.id === item.qrCode.id;
})
updateRow(index,{ updateRow(index,{
shelves: { shelves: {
id: id, id: Shelve.id,
name: name name: Shelve.name
} },
warehouse: Shelve.warehouse
}) })
}) })
}) })
} }
/**
* 点击扫码显示扫码窗口
*/
function addScan(){ function addScan(){
layer.open({ layer.open({
type: 1, type: 1,
...@@ -217,6 +232,21 @@ ...@@ -217,6 +232,21 @@
var json = JSON.parse($(elem).val()); var json = JSON.parse($(elem).val());
var qrCodeId = json.code; var qrCodeId = json.code;
var goodsInfoId = json.infoId; 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',[
{
qrCode: qrCode,
goodsInfo: qrCode.goodsInfo,
...qrCode.goodsInfo,
id: '',
delFlag: 0,
remarks: ''
}
]);
$(elem).val('').focus();
})
}catch (e){ }catch (e){
console.log(e); console.log(e);
} }
...@@ -230,6 +260,7 @@ ...@@ -230,6 +260,7 @@
<input id="storageInfoList{{idx}}_goodsInfoName" name="storageInfoList[{{idx}}].goodsInfo.name" type="hidden" value="{{row.goodsInfo.name}}"/> <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}}_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}}_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}}_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 id="storageInfoList{{idx}}_qrCodeId" name="storageInfoList[{{idx}}].qrCode.id" type="hidden" value="{{row.qrCode.id}}" readonly class="form-control" />
......
...@@ -255,7 +255,7 @@ $(document).ready(function() { ...@@ -255,7 +255,7 @@ $(document).ready(function() {
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/storage/storage/form/edit?id=" + id); jp.openSaveDialog("编辑入库单","${ctx}/warehouse/storage/storage/form/edit?id=" + id, '1200', '800');
} }
function view(id){//没有权限时,不显示确定按钮 function view(id){//没有权限时,不显示确定按钮
...@@ -274,9 +274,9 @@ $(document).ready(function() { ...@@ -274,9 +274,9 @@ $(document).ready(function() {
var html = Mustache.render(htmltpl, { var html = Mustache.render(htmltpl, {
idx:row.id idx:row.id
}); });
$.get("${ctx}/warehouse/storage/storage/detail?id="+row.id, function(storage){ $.get("${ctx}/warehouse/storage/storage/countStorage?id="+row.id, function(storage){
var storageChild1RowIdx = 0, storageChild1Tpl = $("#storageChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var storageChild1RowIdx = 0, storageChild1Tpl = $("#storageChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
var data1 = storage.storageInfoList; var data1 = storage.countStorageInfoList;
for (var i=0; i<data1.length; i++){ for (var i=0; i<data1.length; i++){
data1[i].dict = {}; data1[i].dict = {};
addRow('#storageChild-'+row.id+'-1-List', storageChild1RowIdx, storageChild1Tpl, data1[i]); addRow('#storageChild-'+row.id+'-1-List', storageChild1RowIdx, storageChild1Tpl, data1[i]);
...@@ -309,7 +309,10 @@ $(document).ready(function() { ...@@ -309,7 +309,10 @@ $(document).ready(function() {
<th>名称</th> <th>名称</th>
<th>类型</th> <th>类型</th>
<th>型号</th> <th>型号</th>
<th>仓库</th>
<th>货架</th> <th>货架</th>
<th>总价</th>
<th>数量</th>
<th>备注信息</th> <th>备注信息</th>
</tr> </tr>
</thead> </thead>
...@@ -331,7 +334,16 @@ $(document).ready(function() { ...@@ -331,7 +334,16 @@ $(document).ready(function() {
{{row.model}} {{row.model}}
</td> </td>
<td> <td>
{{row.shelves.name}} {{row.warehouseNames}}
</td>
<td>
{{row.shelvesNames}}
</td>
<td>
{{row.sum}}
</td>
<td>
{{row.num}}
</td> </td>
<td> <td>
{{row.remarks}} {{row.remarks}}
......
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