|
|
@ -688,39 +688,44 @@ |
|
|
|
|
|
|
|
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 totalNum = $("#bootstrap-select-table").bootstrapTable('getData').length; |
|
|
|
var rmb1 = $("#taxRate_edit").val(); |
|
|
|
if (rmb1== null){ |
|
|
|
rmb1 = 0; |
|
|
|
} |
|
|
|
var rows = $("#bootstrap-table-editOrder").bootstrapTable('getData').length; |
|
|
|
for(var i=0;i<rows;i++){ |
|
|
|
var data = $("#bootstrap-table-editOrder").bootstrapTable('getData')[i]; |
|
|
|
if(data.materialCode==rowData.materialNo){ |
|
|
|
$.modal.alertError("不能选择已添加过的相同料号"); |
|
|
|
for(var j=0;i<rows;j++){ |
|
|
|
var data = $("#bootstrap-table-editOrder").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; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
var rmb = parseFloat(rmb1).toFixed(2) / 100; |
|
|
|
var usd = $("#usdTax_edit").val()!=null?Number(usd).toFixed(2):0; |
|
|
|
for(var i=0;i<rowData.length;i++) { |
|
|
|
$("#bootstrap-table-editOrder").bootstrapTable('insertRow', { |
|
|
|
index: totalNum, |
|
|
|
row: { |
|
|
|
id:'', |
|
|
|
materialId:rowData.id, |
|
|
|
materialCode: rowData.materialNo, |
|
|
|
materialName: rowData.materialName, |
|
|
|
materialType: rowData.materialType, |
|
|
|
describe: rowData.describe, |
|
|
|
brand: rowData.brand, |
|
|
|
photoUrl: rowData.photoUrl, |
|
|
|
warehouseDept:rowData.warehouseDept, |
|
|
|
unit: rowData.unit, |
|
|
|
processMethod: rowData.processMethod, |
|
|
|
materialId:rowData[i].id, |
|
|
|
materialCode: rowData[i].materialNo, |
|
|
|
materialName: rowData[i].materialName, |
|
|
|
materialType: rowData[i].materialType, |
|
|
|
describe: rowData[i].describe, |
|
|
|
brand: rowData[i].brand, |
|
|
|
photoUrl: rowData[i].photoUrl, |
|
|
|
warehouseDept:rowData[i].warehouseDept, |
|
|
|
unit: rowData[i].unit, |
|
|
|
processMethod: rowData[i].processMethod, |
|
|
|
countTax:rmb , |
|
|
|
usdTax: usd, |
|
|
|
materialSole: rowData.materialSole, |
|
|
|
materialSole: rowData[i].materialSole, |
|
|
|
materialNum: 0.00, |
|
|
|
materialNoRmb: 0.00, |
|
|
|
materialNoUsd: 0.00, |
|
|
@ -733,6 +738,7 @@ |
|
|
|
remark: "", |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
layer.close(index); |
|
|
|
} |
|
|
|
function insertRow() { |
|
|
|