@@ -245,7 +245,8 @@
}
},
}
- })
+ });
+ var erpBom = [[${formData}]];
$(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
@@ -267,7 +268,220 @@
$("#form-edit").validate({
focusCleanup: true
});
+ $(function() {
+ $.ajax({
+ url: ctx + 'erp/material/getEngineerList',
+ type: 'get',
+ success: function (res) {
+ if (res.rows.length > 0) {
+ var usertData = res.rows;
+ for (let i in usertData) {
+ $("select[name='businessMembers']").append(
+ "
");
+ }
+ $("select[name='businessMembers']").val(erpBom.businessMembers);
+ } else {
+ $.modal.msgError(res.msg);
+ }
+ }
+ });
+ var options = {
+ url: prefix + "/list",
+ createUrl: prefix + "/add",
+ updateUrl: prefix + "/edit/{id}",
+ removeUrl: prefix + "/remove",
+ detailUrl: prefix + "/detail/{id}",
+ cancelUrl: prefix + "/cancel/{id}",
+ restoreUrl: prefix + "/restore/{id}",
+ exportUrl: prefix + "/export",
+ importUrl: prefix + "/importData",
+ importTemplateUrl: prefix + "/importTemplate",
+ pageList: [5, 10, 25, 50],
+ pageSize: 10,
+ sortable: true, // 是否启用排序
+ sortStable: true, // 设置为 true 将获得稳定的排序
+ modalName: "bom",
+ detailView: true,
+ fixedColumns: true, // 启用冻结列
+ rightFixedColumns:1,
+ fixedRightNumber: 1, // 冻结右列个数
+ height: $(window).height() - 100,
+ //指定父id列
+ onExpandRow : function(index, row, $detail) {
+ $detail.html('
一阶
' +
+ '
多阶
'
+ ).find('table');
+ // 一阶
+ initOneLevelTable(index,row,$detail);
+ // 多阶
+ initAllLevelTable(index,row,$detail);
+ $.table.bootstrapTable('resetView');
+ },
+ columns: [{
+ checkbox: true
+ },
+ {title: '主键ID',field: 'id'},
+ { 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},
+ {
+ field: 'applyUser',
+ title: '申请人ID',
+ visible: false
+ },
+ {
+ field: 'applyUserName',
+ title: '
申请人',
+ formatter: function(value, row, index) {
+ return '
' + (value ? value : "-") + '';
+ }
+ },
+ {
+ field: 'applyTime',
+ title: '申请时间',
+ sortable: true,
+ },
+ {
+ field: 'taskId',
+ title: '当前任务ID',
+ visible: false,
+ },
+ {
+ field: 'todoUserId',
+ title: '待办用户ID',
+ visible: false,
+ },
+ {
+ field: 'taskName',
+ title: '当前任务名称',
+ align: 'center',
+ formatter: function(value, row, index) {
+ return '
' + value + '';
+ }
+ },
+ {
+ field: 'auditStatus',
+ title: '审核状态',
+ sortable: true,
+ formatter: function(value, row, index) {
+ return $.table.selectDictLabel(auditStatusDatas, value);
+ }
+ },
+ {
+ field: 'useStatus',
+ title: '使用状态',
+ sortable: true,
+ formatter: function(value, row, index) {
+ return $.table.selectDictLabel(useStatusDatas, value);
+ }
+ },
+ {title: '工程员',field: 'businessMembers', sortable: true,},
+ {title: 'bom号',field: 'bomNo', sortable: true,},
+ {title: '关联料号',field: 'materialNo', sortable: true,},
+ {
+ field: 'photoUrl',
+ title: '图片',
+ formatter: function(value, row, index) {
+ return $.table.imageView(value);
+ }
+ },
+ { title: '物料名称',field: 'materialName', sortable: true,},
+ {
+ field: 'materialType',
+ title: '物料类型',
+ sortable: true,
+ formatter: function(value, row, index) {
+ return $.table.selectCategoryLabel(materialTypeDatas, value);
+ }
+ },
+ {
+ field: 'processMethod',
+ title: '半成品类型',
+ sortable: true,
+ formatter: function(value, row, index) {
+ return $.table.selectDictLabel(processMethodDatas, value);
+ }
+ },
+ {
+ field: 'unit',
+ title: '单位',
+ sortable: true,
+ },
+ { title: '品牌',field: 'brand', sortable: true,},
+ {title: '描述',field: 'describe', sortable: true,},
+ {title: '用量',field: 'useNum', sortable: true,},
+ {title: '损耗率',field: 'lossRate', sortable: true,
+ formatter:function (value,row,index){
+ if (value == null || value == ''){
+ return '/';
+ }else{
+ return value + "%";
+ }
+ }
+ },
+ {
+ field: 'parentId',
+ title: '父级id',
+ visible:false
+ },
+ {
+ field: 'level',
+ title: '层级',
+ visible:false,
+ formatter: function(value, row, index) {
+ return $.table.selectDictLabel(levelDatas, value);
+ }
+ },
+ {
+ field: 'sortNo',
+ title: '排序',
+ visible: false
+ },
+ {
+ title: '操作',
+ align: 'center',
+ formatter: function(value, row, index) {
+ var actions = [];
+ // 审核状态-审核通过 使用状态-是 未发起作废流程
+ if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){
+ // 作废
+ actions.push('
作废');
+ // 编辑
+ actions.push('
编辑 ');
+ }else{
+ actions.push('
编辑 ');
+ }
+ // 已作废
+ if(row.useStatus=="2" && !row.restoreInstanceId){
+ // 恢复
+ actions.push('
恢复 ');
+ }
+ // 有流程实例id
+ if (row.instanceId) {
+ // 有待办人展示审批按钮,
+ if (row.todoUserId) {
+ var todoUserIdList = row.todoUserId.split(",");
+ if(todoUserIdList.includes(loginName)){
+ var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
+ actions.push('
'+nodeName+' ');
+ }
+ }
+ // 审批历史
+ actions.push('
审批历史 ');
+ // 进度查看
+ actions.push('
进度查看 ');
+ }
+ // 详情
+ actions.push('
详情 ');
+ return actions.join('');
+ }
+ }]
+ };
+ $.table.init(options);
+ });
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');
diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/add.html b/ruoyi-admin/src/main/resources/templates/erp/material/add.html
index e0abb662..4f556b69 100644
--- a/ruoyi-admin/src/main/resources/templates/erp/material/add.html
+++ b/ruoyi-admin/src/main/resources/templates/erp/material/add.html
@@ -11,11 +11,11 @@