@ -55,7 +55,7 @@
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var subTableFormArray = [];
// var subTableFormArray = [];
$(function(){
var options = {
@ -73,12 +73,12 @@
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
onCollapseRow: function(index, row){
/* 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',
@ -160,7 +160,8 @@
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
$detail.html('< h1 > 123< / h1 > < div > < form id = "'+childTableFormId+'" > < table id = "'+childTableId+'" > < / table > < table id = "'+childFormTableId+'" > < / table > < / form > < / div > ');
// $detail.html('< form id = "'+childTableFormId+'" > < table id = "'+childTableId+'" > < / table > < table id = "'+childFormTableId+'" > < / table > < / form > ');
$detail.html('< table id = "'+childTableId+'" > < / table > < table id = "'+childFormTableId+'" > < / table > ');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
@ -327,21 +328,33 @@
columns: [
{
field : 'id',
title : '生产订单部门ID'
title : '生产订单部门ID',
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
return '< input readonly class = "form-control" data-id = "id_'+curIndex+'" name = "orderDepts['+curIndex+'].id" value = "'+value+'" > < / input > ';
}
},
{
field : 'makeNo',
title : '生产订单号',
visible: false
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
return '< input class = "form-control" data-id = "id_'+curIndex+'" name = "orderDepts['+curIndex+'].makeNo" value = "'+value+'" > ';
}
},
{
field : 'materialNo',
title : '料号',
visible: false
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
return '< input class = "form-control" data-id = "id_'+curIndex+'" name = "orderDepts['+curIndex+'].materialNo" value = "'+value+'" > ';
}
},
{
field : 'deptNumber',
title : '部门编号',
field : 'deptName ',
title : '部门名称 ',
visible: false
},
{
@ -360,29 +373,31 @@
visible: false
},
{
field : 'deptName ',
field : 'deptNumber ',
title : '部门',
formatter: function (value, row, index) {
if(subTableFormArray[parentRowIndex]){
/* if(subTableFormArray[parentRowIndex]){
value = subTableFormArray[parentRowIndex].deptName?subTableFormArray[parentRowIndex].deptName:value;
}
return '< input readonly class = "form-control" data-id = "deptName_'+parentRowIndex+'" name = "orderDepts['+parentRowIndex+'].deptName" value = "'+value+'" > < / input > ';
}*/
var curIndex = parentRowIndex*5+index;
return '< input readonly class = "form-control" data-id = "deptNumber_'+curIndex+'" name = "orderDepts['+curIndex+'].deptNumber" value = "'+value+'" > ';
}
},
{
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var startDateName = 'planFinishStartDate_'+index;
var endDateName = 'planFinishEndDate_'+index;
var curIndex = parentRowIndex*5+index;
var endDateName = 'planFinishEndDate_'+parentRowIndex;
var startDateName = 'planFinishStartDate_'+parentRowIndex;
var html;
// 业务部门
if(row.deptNumber=='GMD'){
html = '< div class = "input-daterange input-group" > < input type = "text" class = "form-control" data-id = "'+startDateName+'" name = "orderDepts['+parentRow Index+'].planFinishStartDate" placeholder = "开始时间" / > \n' +
html = '< div class = "input-daterange input-group" > < input type = "text" class = "form-control" data-id = "'+startDateName+'" name = "orderDepts['+cur Index+'].planFinishStartDate" placeholder = "开始时间" value = "'+row.planFinishStartDate+' " / > \n' +
'< span class = "input-group-addon" > -< / span > \n' +
'< input type = "text" class = "form-control" data-id = "'+endDateName+'" name = "orderDepts['+parentRow Index+'].planFinishEndDate" placeholder = "结束时间" / > < / div > '
'< input type = "text" class = "form-control" data-id = "'+endDateName+'" name = "orderDepts['+cur Index+'].planFinishEndDate" placeholder = "结束时间" value = "'+row.planFinishEndDate+' " / > < / div > '
}else{
html = '< input class = "form-control" data-id = "planFinishDays_'+parentRow Index+'" name = "orderDepts['+parentRow Index+'].planFinishDays" value = "'+row.planFinishDays+'" > < / input > ';
html = '< input class = "form-control" data-id = "planFinishDays_'+cur Index+'" name = "orderDepts['+cur Index+'].planFinishDays" value = "'+row.planFinishDays+'" > ';
}
return html;
}
@ -419,6 +434,7 @@
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
for (let i = 0; i < data.rows.length ; i + + ) {
var curIndex = parentRowIndex*5+i;
var startDateIndex = 'planFinishStartDate_'+i;
var endDateIndex = 'planFinishEndDate_'+i;
@ -472,8 +488,9 @@
function submitHandler() {
debugger
var data = $("#form-makeorder-edit").serializeArray();
alert(JSON.stringify(data))
$.operate.saveModal(prefix + "/deptReview", data);
alert(JSON.stringify(data));
// saveModal 保存不关闭
$.operate.save(prefix + "/deptReview", data);
// var data = $('#bootstrap-sub-table-1').bootstrapTable('getData');
// var count = data.length;
// var allFormData;