|
@ -76,7 +76,7 @@ |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:bom:add"> |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:bom:add"> |
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
</a> |
|
|
</a> |
|
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:bom:export"> |
|
|
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="erp:bom:export"> |
|
|
<i class="fa fa-download"></i> 导出 |
|
|
<i class="fa fa-download"></i> 导出 |
|
|
</a> |
|
|
</a> |
|
|
<a class="btn btn-info" onclick="$.table.importExcel()"> |
|
|
<a class="btn btn-info" onclick="$.table.importExcel()"> |
|
@ -126,6 +126,7 @@ |
|
|
sortStable: true, // 设置为 true 将获得稳定的排序 |
|
|
sortStable: true, // 设置为 true 将获得稳定的排序 |
|
|
modalName: "bom", |
|
|
modalName: "bom", |
|
|
detailView: true, |
|
|
detailView: true, |
|
|
|
|
|
adaptive: true, |
|
|
fixedColumns: true, // 启用冻结列 |
|
|
fixedColumns: true, // 启用冻结列 |
|
|
rightFixedColumns:1, |
|
|
rightFixedColumns:1, |
|
|
fixedRightNumber: 1, // 冻结右列个数 |
|
|
fixedRightNumber: 1, // 冻结右列个数 |
|
@ -144,47 +145,52 @@ |
|
|
columns: [{ |
|
|
columns: [{ |
|
|
checkbox: true |
|
|
checkbox: true |
|
|
}, |
|
|
}, |
|
|
{ title: '主键ID',field: 'id'}, |
|
|
{ title: '主键ID',field: 'id',visible: false}, |
|
|
|
|
|
{ title: 'bom号',field: 'bomNo', sortable: true,}, |
|
|
|
|
|
{ title: '料号',field: 'materialNo', sortable: true,}, |
|
|
|
|
|
{ title: '物料名称',field: 'materialName', sortable: true,}, |
|
|
|
|
|
{title: '描述',field: 'describe'}, |
|
|
|
|
|
{ title: '品牌',field: 'brand', sortable: true,}, |
|
|
|
|
|
{title: '半成品类型',field: 'processMethod', |
|
|
|
|
|
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);} |
|
|
|
|
|
}, |
|
|
|
|
|
{ title: '单位',field: 'unit'}, |
|
|
{ title: '流程实例ID',field: 'instanceId',visible: false}, |
|
|
{ title: '流程实例ID',field: 'instanceId',visible: false}, |
|
|
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false}, |
|
|
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false}, |
|
|
{ title: '流程作废实例ID', field: 'cancelInstanceId',visible: false}, |
|
|
{ title: '流程作废实例ID', field: 'cancelInstanceId',visible: false}, |
|
|
{ title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false}, |
|
|
{ title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false}, |
|
|
{ title: '流程实例类型',field: 'instanceTypeName', visible: false}, |
|
|
{ title: '流程实例类型',field: 'instanceTypeName', visible: false}, |
|
|
{ title: '申请人ID',field: 'applyUser',visible: false}, |
|
|
{ title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);}}, |
|
|
{ title: '<span style="color: red;">申请人</span>',field: 'applyUserName', |
|
|
{ title: '<span style="color: red;">申请人</span>',field: 'applyUserName', |
|
|
formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';} |
|
|
formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';} |
|
|
}, |
|
|
}, |
|
|
{ title: '申请时间',field: 'applyTime',sortable: true,}, |
|
|
{ title: '申请时间',field: 'applyTime',sortable: true,}, |
|
|
{ title: '当前任务ID',field: 'taskId',visible: false,}, |
|
|
{title: '上次更新时间',field: 'updateTime',}, |
|
|
{ title: '待办用户ID',field: 'todoUserId',visible: false,}, |
|
|
{ title: '当前状态',field: 'taskName',align: 'center', |
|
|
{ title: '当前任务名称',field: 'taskName',align: 'center', |
|
|
|
|
|
formatter: function(value, row, index) { |
|
|
formatter: function(value, row, index) { |
|
|
return '<span class="badge badge-primary">' + value + '</span>'; |
|
|
return '<span class="badge badge-primary">' + value + '</span>'; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ title: '审核状态',field: 'auditStatus',sortable: true, |
|
|
|
|
|
|
|
|
{ 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, |
|
|
formatter: function(value, row, index) { |
|
|
formatter: function(value, row, index) { |
|
|
return $.table.selectDictLabel(auditStatusDatas, value); |
|
|
return $.table.selectDictLabel(auditStatusDatas, value); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ title: '使用状态',field: 'useStatus',sortable: true, |
|
|
{ title: '使用状态',field: 'useStatus',sortable: true,visible: false, |
|
|
formatter: function(value, row, index) { |
|
|
formatter: function(value, row, index) { |
|
|
return $.table.selectDictLabel(useStatusDatas, value); |
|
|
return $.table.selectDictLabel(useStatusDatas, value); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ title: '工程员',field: 'engineer', sortable: true,}, |
|
|
{ title: '工程员',field: 'engineer', sortable: true,visible: false}, |
|
|
{ title: 'bom号',field: 'bomNo', sortable: true,}, |
|
|
{ title: '物料类型',field: 'materialType',sortable: true,visible: false, |
|
|
{ title: '关联料号',field: 'materialNo', sortable: true,}, |
|
|
|
|
|
{ title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);}}, |
|
|
|
|
|
{ title: '物料名称',field: 'materialName', sortable: true,}, |
|
|
|
|
|
{ title: '物料类型',field: 'materialType',sortable: true, |
|
|
|
|
|
formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}}, |
|
|
formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}}, |
|
|
{ title: '加工方式',field: 'processMethod',sortable: true, |
|
|
{ title: '加工方式',field: 'processMethod',sortable: true,visible: false, |
|
|
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);} |
|
|
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);} |
|
|
}, |
|
|
}, |
|
|
{ title: '单位',field: 'unit', sortable: true,}, |
|
|
|
|
|
{ title: '品牌',field: 'brand', sortable: true,}, |
|
|
|
|
|
{title: '描述',field: 'describe', sortable: true,}, |
|
|
|
|
|
{ title: '父级id',field: 'parentId',visible:false }, |
|
|
{ title: '父级id',field: 'parentId',visible:false }, |
|
|
{title: '层级',field: 'level', visible:false, |
|
|
{title: '层级',field: 'level', visible:false, |
|
|
formatter: function(value, row, index) { |
|
|
formatter: function(value, row, index) { |
|
@ -740,6 +746,42 @@ |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
function exportExcel(formId) { |
|
|
|
|
|
// $.table.set(); |
|
|
|
|
|
var bomNoData = []; |
|
|
|
|
|
var selections = $("#bootstrap-table").bootstrapTable("getSelections"); |
|
|
|
|
|
if(selections.length === 0){ |
|
|
|
|
|
$.modal.alertWarning("请至少选择一条bom信息"); |
|
|
|
|
|
return; |
|
|
|
|
|
}else { |
|
|
|
|
|
$.modal.confirm("确定导出选中的所有" + table.options.modalName + "吗?", function () { |
|
|
|
|
|
//·拼接单号 |
|
|
|
|
|
for(let i=0;i<selections.length;i++){ |
|
|
|
|
|
bomNoData.push(selections[i].bomNo); |
|
|
|
|
|
} |
|
|
|
|
|
var bomNos = JSON.stringify(bomNoData); |
|
|
|
|
|
console.log(bomNos); |
|
|
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
|
|
var config = { |
|
|
|
|
|
url: prefix + '/export', |
|
|
|
|
|
type: "post", |
|
|
|
|
|
dataType: "json", |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: bomNos, |
|
|
|
|
|
success: function(result) { |
|
|
|
|
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; |
|
|
|
|
|
$.modal.alertSuccess("导出成功!") |
|
|
|
|
|
$.modal.closeLoading(); |
|
|
|
|
|
}, |
|
|
|
|
|
error: function (result){ |
|
|
|
|
|
$.modal.alertError(result.msg); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
$.ajax(config) |
|
|
|
|
|
// $.operate.saveJson(prefix + "/export", bomNos); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
<!-- 导入区域 --> |
|
|
<!-- 导入区域 --> |
|
|