|
|
@ -271,12 +271,6 @@ |
|
|
|
onExpandRow : function(index, row, $detail) { |
|
|
|
initChildTable(index, row, $detail); |
|
|
|
}, |
|
|
|
/*onCollapseRow: function(index, row){ |
|
|
|
var childTableFormId = 'child_table_form_'+index; |
|
|
|
var formData = $('#'+childTableFormId).serialize(); |
|
|
|
var formObj = $.common.formDataToObj(formData); |
|
|
|
subTableFormArray.push(formObj); |
|
|
|
},*/ |
|
|
|
columns: [ |
|
|
|
{ |
|
|
|
field: 'id', |
|
|
@ -291,7 +285,6 @@ |
|
|
|
{ |
|
|
|
field: 'bomId', |
|
|
|
title: 'bom主键Id', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'materialNo', |
|
|
@ -350,22 +343,20 @@ |
|
|
|
initChildTable = function(index, row, $detail) { |
|
|
|
var parentRow = row; |
|
|
|
var parentRowIndex = index; |
|
|
|
var childTableId = 'child_table_'+index; |
|
|
|
var childFormTableId = 'child_form_table_'+index; |
|
|
|
var childTableFormId = 'child_table_form_'+index; |
|
|
|
var childTableId = 'child_table_' + index; |
|
|
|
var childFormTableId = 'child_form_table_' + index; |
|
|
|
var childTableFormId = 'child_table_form_' + index; |
|
|
|
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>'); |
|
|
|
$detail.html('<table id="'+childTableId+'"></table>'); |
|
|
|
$detail.html('<table id="' + childTableId + '"></table><table id="' + childFormTableId + '"></table>'); |
|
|
|
// BOM展示 |
|
|
|
$('#'+childTableId).bootstrapTable({ |
|
|
|
// url: ctx + "system/makeorderbom/list", |
|
|
|
$('#' + childTableId).bootstrapTable({ |
|
|
|
url: ctx + "erp/bom/allLevelList", |
|
|
|
method: 'post', |
|
|
|
sidePagination: "server", |
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
// queryParams : { |
|
|
|
// makeNo: $("#makeNo").val(), |
|
|
|
// salesOrderCode: $("#saleNo").val(), |
|
|
|
// salesOrderMaterialNo: parentRow.materialCode |
|
|
|
// }, |
|
|
|
queryParams: { |
|
|
|
parentId: parentRow.bomId |
|
|
|
}, |
|
|
|
columns: [{ |
|
|
|
field: 'id', |
|
|
|
title: '主键id', |
|
|
@ -374,17 +365,17 @@ |
|
|
|
{ |
|
|
|
field: 'level', |
|
|
|
title: '阶层', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.selectDictLabel(levelDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'bomNo', |
|
|
|
title: 'BOM号', |
|
|
|
formatter:function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return value |
|
|
|
} |
|
|
|
} |
|
|
@ -392,25 +383,28 @@ |
|
|
|
{ |
|
|
|
field: 'materialNo', |
|
|
|
title: '料号', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
var curIndex = row.sortNo-1; |
|
|
|
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="pickDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">'; |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return '/'; |
|
|
|
} else { |
|
|
|
return value |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'photoUrl', |
|
|
|
title: '图片', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.imageView(value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'materialName', |
|
|
|
title: '物料名称', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return value |
|
|
|
} |
|
|
|
} |
|
|
@ -418,17 +412,17 @@ |
|
|
|
{ |
|
|
|
field: 'materialType', |
|
|
|
title: '物料类型', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'describe', |
|
|
|
title: '描述', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return value |
|
|
|
} |
|
|
|
} |
|
|
@ -436,10 +430,10 @@ |
|
|
|
{ |
|
|
|
field: 'brand', |
|
|
|
title: '品牌', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return value |
|
|
|
} |
|
|
|
} |
|
|
@ -447,10 +441,10 @@ |
|
|
|
{ |
|
|
|
field: 'unit', |
|
|
|
title: '单位', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return value |
|
|
|
} |
|
|
|
} |
|
|
@ -459,17 +453,25 @@ |
|
|
|
{ |
|
|
|
field: 'processMethod', |
|
|
|
title: '半成品类型', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.selectDictLabel(processMethodDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'warehouseDept', |
|
|
|
align: 'center', |
|
|
|
title: '入库部门', visible: false, |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return $.table.selectDictLabel(warehouseDates, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'useNum', |
|
|
|
title: '用量', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return value |
|
|
|
} |
|
|
|
} |
|
|
@ -477,39 +479,24 @@ |
|
|
|
{ |
|
|
|
field: 'lossRate', |
|
|
|
title: '损耗率', |
|
|
|
// formatter: function (value,row,index){ |
|
|
|
// if (value == null || value == ''){ |
|
|
|
// return '/'; |
|
|
|
// }else{ |
|
|
|
// return value + "%"; |
|
|
|
// } |
|
|
|
// } |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'materialNum', |
|
|
|
title: '订单用量', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return parentRow.materialNum * row.useNum; |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'hasPickNum', |
|
|
|
title: '已领料数量', |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'pickNum', |
|
|
|
title: '本次领料数量', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
var curIndex = row.sortNo-1; |
|
|
|
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">'; |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'makeNo', |
|
|
|
title: '生产订单号', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'salesOrderCode', |
|
|
|
title: '销售订单号', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'salesOrderMaterialNo', |
|
|
|
title: '销售订单料号', |
|
|
|
field: 'parentId', |
|
|
|
title: '父级id', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
@ -518,12 +505,11 @@ |
|
|
|
visible: false |
|
|
|
}], |
|
|
|
// 当所有数据被加载时触发 |
|
|
|
onLoadSuccess: function(data) { |
|
|
|
onLoadSuccess: function (data) { |
|
|
|
|
|
|
|
}, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
function purchaseDoSubmit(index, layero,uniqueId){ |
|
|
|
console.log(uniqueId); |
|
|
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|
|
@ -548,6 +534,7 @@ |
|
|
|
$("#bootstrap-table-purchase").bootstrapTable('insertRow', { |
|
|
|
index:1, |
|
|
|
row: { |
|
|
|
bomId:rowData.bomId, |
|
|
|
materialNo:rowData.materialNo, |
|
|
|
materialPhotourl:rowData.materialPhotourl, |
|
|
|
materialName: rowData.materialName, |
|
|
|