|
|
@ -320,7 +320,8 @@ |
|
|
|
$.table.init(options); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 存储子表的状态 |
|
|
|
var childTableStates = {}; |
|
|
|
initChildTable = function(index, row, $detail) { |
|
|
|
var parentRow = row; |
|
|
|
var childTableId = 'child_table_'+index; |
|
|
@ -339,6 +340,11 @@ |
|
|
|
field: 'estimateDetailId', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '销售估价详情物料ID', |
|
|
|
field: 'estimateDetailMaterialId', |
|
|
|
visible: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '物料名称', |
|
|
|
field: 'materialName', |
|
|
@ -366,12 +372,13 @@ |
|
|
|
title: '操作', |
|
|
|
align: 'center', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="deleteRow(\'' + row.shippingDeviceId + '\')"><i class="fa fa-remove"></i>删除</a>'; |
|
|
|
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeDetailMaterialRow(\'' + row.estimateDetailMaterialId + '\')"><i class="fa fa-remove"></i>删除</a>'; |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
}); |
|
|
|
|
|
|
|
// 设置子表的初始状态为展开 |
|
|
|
childTableStates[index] = true; |
|
|
|
// 动态生成 form 表单 |
|
|
|
var formHtml = '<form class="form-inline" data-index="' + index + '">'; |
|
|
|
formHtml += '<h3>运输、服务、开发成本</h3>'; |
|
|
@ -421,6 +428,37 @@ function queryParams(params) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除子表物料的数据 |
|
|
|
function removeDetailMaterialRow(estimateDetailMaterialId) { |
|
|
|
$.modal.confirm("确定删除该条销售估价详情物料信息吗?", function() { |
|
|
|
var url = prefix + "/removeEstimateDetailMaterial"; |
|
|
|
var data = { "estimateDetailMaterialId": estimateDetailMaterialId }; |
|
|
|
|
|
|
|
$.operate.submit(url, "post", "json", data, function(result) { |
|
|
|
if (result.success) { |
|
|
|
$.modal.msgSuccess(result.msg); |
|
|
|
|
|
|
|
// 获取子表的实例 |
|
|
|
var childTableId = 'child_table_' + index; |
|
|
|
var $childTable = $('#' + childTableId); |
|
|
|
|
|
|
|
// 刷新子表 |
|
|
|
$childTable.bootstrapTable('refresh'); |
|
|
|
|
|
|
|
// 检查子表是否有数据 |
|
|
|
if ($childTable.bootstrapTable('getData').length === 0) { |
|
|
|
// 如果没有数据则收起子表 |
|
|
|
$childTable.closest('.detail-row').find('.detail-icon').click(); |
|
|
|
childTableStates[index] = false; // 更新子表状态 |
|
|
|
} |
|
|
|
} else { |
|
|
|
$.modal.msgError(result.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//form计算模块 |
|
|
|
function getTotalAmount(){ |
|
|
|
let getData = $('#bootstrap-table').bootstrapTable('getData'); |
|
|
|