|
|
@ -79,7 +79,7 @@ |
|
|
|
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="erp:bom:export"> |
|
|
|
<i class="fa fa-download"></i> 导出 |
|
|
|
</a> |
|
|
|
<a class="btn btn-info" onclick="$.table.importExcel()"> |
|
|
|
<a class="btn btn-info" onclick="importExcel()"> |
|
|
|
<i class="fa fa-upload"></i> 导入 |
|
|
|
</a> |
|
|
|
<a class="btn btn-success" onclick="bomEqulas()" shiro:hasPermission="erp:bom:equals"> |
|
|
@ -92,7 +92,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<th:block th:include="include :: bootstrap-table-fixed-columns-js" /> |
|
|
|
<!-- <th:block th:include="include :: bootstrap-table-fixed-columns-js" />--> |
|
|
|
<script th:src="@{/js/activiti.js}"></script> |
|
|
|
<script th:inline="javascript"> |
|
|
|
var editFlag = [[${@permission.hasPermi('erp:bom:edit')}]]; |
|
|
@ -126,7 +126,7 @@ |
|
|
|
sortStable: true, // 设置为 true 将获得稳定的排序 |
|
|
|
modalName: "bom", |
|
|
|
detailView: true, |
|
|
|
adaptive: true, |
|
|
|
// adaptive: true, |
|
|
|
fixedColumns: true, // 启用冻结列 |
|
|
|
rightFixedColumns:1, |
|
|
|
fixedRightNumber: 1, // 冻结右列个数 |
|
|
@ -155,11 +155,6 @@ |
|
|
|
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);} |
|
|
|
}, |
|
|
|
{ title: '单位',field: 'unit'}, |
|
|
|
{ title: '流程实例ID',field: 'instanceId',visible: false}, |
|
|
|
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false}, |
|
|
|
{ title: '流程作废实例ID', field: 'cancelInstanceId',visible: false}, |
|
|
|
{ title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false}, |
|
|
|
{ title: '流程实例类型',field: 'instanceTypeName', visible: false}, |
|
|
|
{ title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);}}, |
|
|
|
{ title: '<span style="color: red;">申请人</span>',field: 'applyUserName', |
|
|
|
formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';} |
|
|
@ -171,24 +166,28 @@ |
|
|
|
return '<span class="badge badge-primary">' + value + '</span>'; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ title: '流程实例ID',field: 'instanceId',visible: false}, |
|
|
|
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false}, |
|
|
|
{ title: '流程作废实例ID', field: 'cancelInstanceId',visible: false}, |
|
|
|
{ title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false}, |
|
|
|
{ title: '流程实例类型',field: 'instanceTypeName', visible: false}, |
|
|
|
{ title: '申请人ID',field: 'applyUser',visible: false}, |
|
|
|
{ title: '当前任务ID',field: 'taskId',visible: false,}, |
|
|
|
{ title: '待办用户ID',field: 'todoUserId',visible: false,}, |
|
|
|
{ title: '审核状态',field: 'auditStatus',sortable: true,visible: false, |
|
|
|
{ title: '审核状态',field: 'auditStatus',visible: false, |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectDictLabel(auditStatusDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ title: '使用状态',field: 'useStatus',sortable: true,visible: false, |
|
|
|
{ title: '使用状态',field: 'useStatus',visible: false, |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectDictLabel(useStatusDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ title: '工程员',field: 'engineer', sortable: true,visible: false}, |
|
|
|
{ title: '物料类型',field: 'materialType',sortable: true,visible: false, |
|
|
|
{ title: '工程员',field: 'engineer', visible: false}, |
|
|
|
{ title: '物料类型',field: 'materialType',visible: false, |
|
|
|
formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}}, |
|
|
|
{ title: '加工方式',field: 'processMethod',sortable: true,visible: false, |
|
|
|
{ title: '加工方式',field: 'processMethod',visible: false, |
|
|
|
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);} |
|
|
|
}, |
|
|
|
{ title: '父级id',field: 'parentId',visible:false }, |
|
|
@ -746,6 +745,7 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
// 导出 |
|
|
|
function exportExcel(formId) { |
|
|
|
// $.table.set(); |
|
|
|
var bomNoData = []; |
|
|
@ -800,6 +800,62 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
// 导入 |
|
|
|
function importExcel(formId, width, height) { |
|
|
|
table.set(); |
|
|
|
var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId; |
|
|
|
var _width = $.common.isEmpty(width) ? "400" : width; |
|
|
|
var _height = $.common.isEmpty(height) ? "230" : height; |
|
|
|
layer.open({ |
|
|
|
type: 1, |
|
|
|
area: [_width + 'px', _height + 'px'], |
|
|
|
fix: false, |
|
|
|
// 不固定 |
|
|
|
maxmin: true, |
|
|
|
shade: 0.3, |
|
|
|
title: '导入' + table.options.modalName + '数据', |
|
|
|
content: $('#' + currentId).html(), |
|
|
|
btn: ['<i class="fa fa-check"></i> 导入', '<i class="fa fa-remove"></i> 取消'], |
|
|
|
// 弹层外区域关闭 |
|
|
|
shadeClose: true, |
|
|
|
btn1: function(index, layero){ |
|
|
|
var file = layero.find('#file').val(); |
|
|
|
if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) { |
|
|
|
$.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
var index = layer.load(2, {shade: false}); |
|
|
|
$.modal.disable(); |
|
|
|
|
|
|
|
// 获取CheckBox的状态 |
|
|
|
var updateSupport = layero.find('#updateSupport').is(':checked'); |
|
|
|
|
|
|
|
var formData = new FormData(layero.find('form')[0]); |
|
|
|
formData.append('updateSupport', updateSupport); // 添加CheckBox的状态到FormData |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
url: table.options.importUrl, |
|
|
|
data: formData, |
|
|
|
cache: false, |
|
|
|
contentType: false, |
|
|
|
processData: false, |
|
|
|
type: 'POST', |
|
|
|
success: function (result) { |
|
|
|
layer.close(index); |
|
|
|
$.modal.enable(); |
|
|
|
|
|
|
|
$.modal.closeAll(); |
|
|
|
$.modal.alertSuccess(result); |
|
|
|
$.table.refresh(); |
|
|
|
}, |
|
|
|
error: function (result){ |
|
|
|
layer.close(index); |
|
|
|
$.modal.alertError(result); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
<!-- 导入区域 --> |
|
|
|