|
|
@ -124,7 +124,7 @@ |
|
|
|
|
|
|
|
//添加物料信息 |
|
|
|
function insertRow() { |
|
|
|
var url = ctx + 'warehouse/inventoryCheck/materialSelect'; |
|
|
|
var url = ctx + "erp/material/select"; |
|
|
|
var options = { |
|
|
|
title: '选择物料', |
|
|
|
url: url, |
|
|
@ -168,27 +168,41 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
function doSubmit(index, layero,uniqueId){ |
|
|
|
console.log(uniqueId); |
|
|
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|
|
|
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0]; |
|
|
|
console.log("rowData: "+rowData); |
|
|
|
$("#bootstrap-table").bootstrapTable('insertRow', { |
|
|
|
index:1, |
|
|
|
row: { |
|
|
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); |
|
|
|
//判断是否重复 |
|
|
|
var data = $("#bootstrap-table").bootstrapTable('getData'); |
|
|
|
var rows = data.length; |
|
|
|
if(rows > 0){ |
|
|
|
for(var i=0;i<rows;i++){ |
|
|
|
for(var j=0;j<rowData.length;j++){ |
|
|
|
if(data[i].materialNo===rowData[j].materialNo){ |
|
|
|
$.modal.alertError("不能选择已添加过的相同物料"); |
|
|
|
rowData.split(j,1); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
for(i=0;i<rowData.length;i++){ |
|
|
|
insertTable(rowData[i]); |
|
|
|
} |
|
|
|
layer.close(index); |
|
|
|
} |
|
|
|
function insertTable(rowData){ |
|
|
|
var newRow = { |
|
|
|
materialNo:rowData.materialNo, |
|
|
|
materialName: rowData.materialName, |
|
|
|
materialDescribe: rowData.materialDescribe, |
|
|
|
materialUnit: rowData.materialUnit, |
|
|
|
materialDescribe: rowData.describe, |
|
|
|
materialUnit: rowData.unit, |
|
|
|
inventoryCheckNum : "", |
|
|
|
inventoryAccountNum : "", |
|
|
|
warehouseStoreAddress : "", |
|
|
|
batchNumber : "", |
|
|
|
remark : "" |
|
|
|
} |
|
|
|
}) |
|
|
|
layer.close(index); |
|
|
|
$("#bootstrap-table").bootstrapTable('append',newRow); |
|
|
|
} |
|
|
|
|
|
|
|
// 逻辑删除前端的一行数据 |
|
|
|
function removeRow(materialNo){ |
|
|
|
$("#bootstrap-table").bootstrapTable('remove', {field: 'materialNo', values: materialNo}) |
|
|
|