|
|
@ -160,8 +160,31 @@ |
|
|
|
}, |
|
|
|
{title: '最新报价',field: 'materialSole',align: 'center',}, |
|
|
|
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, |
|
|
|
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true}, |
|
|
|
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true}, |
|
|
|
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center', |
|
|
|
editable:{ |
|
|
|
type: 'text', |
|
|
|
validate: function(v) { |
|
|
|
if (!v) return '输入不能为空'; |
|
|
|
if (isNaN(v)) return '输入错误'; |
|
|
|
if (v < 0) return '单价可以为0'; |
|
|
|
//正则金额保留两位小数 |
|
|
|
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center', |
|
|
|
editable:{ |
|
|
|
type: 'text', |
|
|
|
validate: function(v) { |
|
|
|
if (!v) return '输入不能为空'; |
|
|
|
if (isNaN(v)) return '输入错误'; |
|
|
|
if (v < 0) return '单价可以为0'; |
|
|
|
//正则金额保留两位小数 |
|
|
|
if (!/^\d+(\.\d{1,2})?$/.test(v)) return '金额保留两位小数'; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '录入人',field: 'createBy',align: 'center',visible: false}, |
|
|
|
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, |
|
|
|
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, |
|
|
@ -213,29 +236,34 @@ |
|
|
|
}); |
|
|
|
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-1").bootstrapTable('getData').length; |
|
|
|
for(var i=0;i<rows;i++){ |
|
|
|
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData')[i]; |
|
|
|
if(data.materialNo==rowData.materialNo){ |
|
|
|
$.modal.alertError("不能选择已添加过的相同料号"); |
|
|
|
for(var j=0;i<rows;j++){ |
|
|
|
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData'); |
|
|
|
for (var i = 0;i<data.length;i++){ |
|
|
|
if(data[i].materialNo==rowData[j].materialNo){ |
|
|
|
//如果是物料料号的相同,则从rowData清除相同的料号物料 |
|
|
|
rowData.splice(j,1); |
|
|
|
$.modal.alertError("不能选择已添加过的相同料号" + rowData[j].materialNo); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log("rowData: "+rowData); |
|
|
|
for(var i=0;i<rowData.length;i++){ |
|
|
|
$("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('insertRow', { |
|
|
|
index:1, |
|
|
|
index: i, |
|
|
|
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, |
|
|
|
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, |
|
|
|
materialSole: '', |
|
|
|
photoUrl: rowData.photoUrl, |
|
|
|
photoUrl: rowData[i].photoUrl, |
|
|
|
materialNum: 1, |
|
|
|
materialRmb: "", |
|
|
|
materialNoRmb: "", |
|
|
@ -244,6 +272,7 @@ |
|
|
|
remark: "" |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
layer.close(index); |
|
|
|
} |
|
|
|
function insertRow() { |
|
|
@ -344,7 +373,7 @@ |
|
|
|
}); |
|
|
|
/* 删除指定表格行 */ |
|
|
|
function removeRow(materialCode){ |
|
|
|
$("#bootstrap-sub-table-requisitionChild").bootstrapTable('remove', { |
|
|
|
$("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('remove', { |
|
|
|
field: 'materialCode', |
|
|
|
values: materialCode |
|
|
|
}) |
|
|
|