|
|
@ -325,8 +325,8 @@ |
|
|
|
{checkbox: true}, |
|
|
|
{field: 'index',align: 'center', title: "序号", |
|
|
|
formatter: function (value, row, index,column) { |
|
|
|
return $.table.serialNumber(index) - 1; |
|
|
|
} |
|
|
|
return $.table.serialNumber(index) - 1; |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '物料索引id',field: 'materialId',align: 'center',visible: false}, |
|
|
|
{title: '料号',field: 'materialCode',align: 'center'}, |
|
|
@ -846,48 +846,54 @@ |
|
|
|
$("#form-salesOrder-add").validate({focusCleanup: true}); |
|
|
|
function doSubmit(index, layero,uniqueId){ |
|
|
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|
|
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
|
|
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); |
|
|
|
//判断是否重复 |
|
|
|
var rows = $("#bootstrap-sub-table-order").bootstrapTable('getData').length; |
|
|
|
for(var i=0;i<rows;i++){ |
|
|
|
var data = $("#bootstrap-sub-table-order").bootstrapTable('getData')[i]; |
|
|
|
if(data.materialCode==rowData.materialNo){ |
|
|
|
$.modal.alertError("不能选择已添加过的相同料号"); |
|
|
|
return; |
|
|
|
for(var j=0;i<rows;j++){ |
|
|
|
var data = $("#bootstrap-sub-table-order").bootstrapTable('getData'); |
|
|
|
for (var i = 0;i<data.length;j++){ |
|
|
|
if(data[j].materialNo==rowData[j].materialNo){ |
|
|
|
//如果是物料料号的相同,则从rowData清除相同的料号物料 |
|
|
|
rowData.splice(j,1); |
|
|
|
$.modal.alertError("不能选择已添加过的相同料号" + rowData[j].materialNo); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
$("#bootstrap-sub-table-order").bootstrapTable('insertRow', { |
|
|
|
index:1, |
|
|
|
row: { |
|
|
|
materialId:rowData.id, |
|
|
|
materialCode: rowData.materialNo, |
|
|
|
materialName: rowData.materialName, |
|
|
|
materialType: rowData.materialType, |
|
|
|
describe: rowData.describe, |
|
|
|
brand: rowData.brand, |
|
|
|
unit: rowData.unit, |
|
|
|
processMethod: rowData.processMethod, |
|
|
|
photoUrl: rowData.photoUrl, |
|
|
|
warehouseDept: rowData.warehouseDept, |
|
|
|
countTax: $("#taxRate_add").val(), |
|
|
|
usdTax: $("#usdTax_add").val(), |
|
|
|
materialSole: 0, |
|
|
|
materialNum: "", |
|
|
|
materialNoRmb: 0.00, |
|
|
|
materialNoUsd: 0.00, |
|
|
|
materialRmb: 0.00, |
|
|
|
materialNoRmbSum: 0.00, |
|
|
|
materialRmbSum: 0.00, |
|
|
|
materialUsd: 0.00, |
|
|
|
materialUsdSum: 0.00, |
|
|
|
materialNoUsdSum: 0.00, |
|
|
|
createBy: "", |
|
|
|
createTime: "", |
|
|
|
updateBy: "", |
|
|
|
updateTime: "", |
|
|
|
remark: "", |
|
|
|
} |
|
|
|
}) |
|
|
|
for(var i=0;i<rowData.length;i++) { |
|
|
|
$("#bootstrap-sub-table-order").bootstrapTable('insertRow', { |
|
|
|
index: 1, |
|
|
|
row: { |
|
|
|
materialId: rowData[i].id, |
|
|
|
materialCode: rowData[i].materialNo, |
|
|
|
materialName: rowData[i].materialName, |
|
|
|
materialType: rowData[i].materialType, |
|
|
|
describe: rowData[i].describe, |
|
|
|
brand: rowData[i].brand, |
|
|
|
unit: rowData[i].unit, |
|
|
|
processMethod: rowData[i].processMethod, |
|
|
|
photoUrl: rowData[i].photoUrl, |
|
|
|
warehouseDept: rowData[i].warehouseDept, |
|
|
|
countTax: $("#taxRate_add").val(), |
|
|
|
usdTax: $("#usdTax_add").val(), |
|
|
|
materialSole: 0, |
|
|
|
materialNum: "", |
|
|
|
materialNoRmb: 0.00, |
|
|
|
materialNoUsd: 0.00, |
|
|
|
materialRmb: 0.00, |
|
|
|
materialNoRmbSum: 0.00, |
|
|
|
materialRmbSum: 0.00, |
|
|
|
materialUsd: 0.00, |
|
|
|
materialUsdSum: 0.00, |
|
|
|
materialNoUsdSum: 0.00, |
|
|
|
createBy: "", |
|
|
|
createTime: "", |
|
|
|
updateBy: "", |
|
|
|
updateTime: "", |
|
|
|
remark: "", |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
layer.close(index); |
|
|
|
} |
|
|
|
function insertRow() { |
|
|
|