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