|
@ -127,7 +127,13 @@ |
|
|
detailView: true, |
|
|
detailView: true, |
|
|
//指定父id列 |
|
|
//指定父id列 |
|
|
onExpandRow : function(index, row, $detail) { |
|
|
onExpandRow : function(index, row, $detail) { |
|
|
initChildTable(index, row, $detail); |
|
|
$detail.html('<h4>一阶</h4><table class="table-container" id="one_level_table_'+row.id+'"></table>' + |
|
|
|
|
|
'<h4>多阶</h4><table class="table-container" id="all_level_table_'+row.id+'"></table>' |
|
|
|
|
|
).find('table'); |
|
|
|
|
|
// 一阶 |
|
|
|
|
|
initOneLevelTable(index,row,$detail); |
|
|
|
|
|
// 多阶 |
|
|
|
|
|
initAllLevelTable(index,row,$detail); |
|
|
}, |
|
|
}, |
|
|
columns: [{ |
|
|
columns: [{ |
|
|
checkbox: true |
|
|
checkbox: true |
|
@ -296,18 +302,156 @@ |
|
|
$.table.init(options); |
|
|
$.table.init(options); |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
initChildTable = function(index, row, $detail) { |
|
|
initOneLevelTable = function(index, row, $detail) { |
|
|
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table'); |
|
|
$("#"+"one_level_table_"+row.id).bootstrapTable({ |
|
|
$(childTable).bootstrapTable({ |
|
|
url: prefix + "/oneLevelList", |
|
|
url: prefix + "/subList", |
|
|
|
|
|
method: 'post', |
|
|
method: 'post', |
|
|
sidePagination: "server", |
|
|
sidePagination: "server", |
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
queryParams : { |
|
|
queryParams : { |
|
|
parentId: row.id |
|
|
parentId: row.id |
|
|
}, |
|
|
}, |
|
|
onExpandRow : function(index, row, $detail) { |
|
|
columns: [{ |
|
|
initChildSonTable(index, row, $detail); |
|
|
field: 'id', |
|
|
|
|
|
title: '主键id' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'level', |
|
|
|
|
|
title: '层级', |
|
|
|
|
|
formatter: function(value, row, index) { |
|
|
|
|
|
return $.table.selectDictLabel(levelDatas, value); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'bomNo', |
|
|
|
|
|
title: 'bom号', |
|
|
|
|
|
formatter:function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'photoUrl', |
|
|
|
|
|
title: '图片', |
|
|
|
|
|
formatter: function(value, row, index) { |
|
|
|
|
|
return $.table.imageView(value); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'materialNo', |
|
|
|
|
|
title: '料号', |
|
|
|
|
|
formatter: function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'materialName', |
|
|
|
|
|
title: '物料名称', |
|
|
|
|
|
formatter: function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'materialType', |
|
|
|
|
|
title: '物料类型', |
|
|
|
|
|
formatter: function(value, row, index) { |
|
|
|
|
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'describe', |
|
|
|
|
|
title: '描述', |
|
|
|
|
|
formatter: function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
field: 'brand', |
|
|
|
|
|
title: '品牌', |
|
|
|
|
|
formatter: function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'unit', |
|
|
|
|
|
title: '单位', |
|
|
|
|
|
formatter: function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'useNum', |
|
|
|
|
|
title: '用量', |
|
|
|
|
|
formatter: function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'lossRate', |
|
|
|
|
|
title: '损耗率', |
|
|
|
|
|
formatter: function (value,row,index){ |
|
|
|
|
|
if (value == null || value == ''){ |
|
|
|
|
|
return '/'; |
|
|
|
|
|
}else{ |
|
|
|
|
|
return value |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'processMethod', |
|
|
|
|
|
title: '加工方式', |
|
|
|
|
|
formatter: function(value, row, index) { |
|
|
|
|
|
return $.table.selectDictLabel(processMethodDatas, value); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'parentId', |
|
|
|
|
|
title: '父级id', |
|
|
|
|
|
visible: false, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'sortNo', |
|
|
|
|
|
title: '排序', |
|
|
|
|
|
visible: false |
|
|
|
|
|
}] |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
initAllLevelTable = function(index, row, $detail) { |
|
|
|
|
|
$("#"+"all_level_table_"+row.id).bootstrapTable({ |
|
|
|
|
|
url: prefix + "/allLevelList", |
|
|
|
|
|
method: 'post', |
|
|
|
|
|
sidePagination: "server", |
|
|
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
|
|
queryParams : { |
|
|
|
|
|
parentId: row.id |
|
|
}, |
|
|
}, |
|
|
columns: [{ |
|
|
columns: [{ |
|
|
field: 'id', |
|
|
field: 'id', |
|
|