diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java index e913a20c..999113ad 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java @@ -308,6 +308,11 @@ public class ErpMaterialController extends BaseController return prefix + "/select"; } + @GetMapping("/editTechnologyTeam") + public String editTechnologyTeam() + { + return prefix + "/editTechnologyTeam"; + } //配置技术团队 @PostMapping("/addErpMaterialProduct") @ResponseBody diff --git a/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml b/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml index 7753afbf..bf0f0716 100644 --- a/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml @@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and erp.supplier_id = #{supplierId} and erp.business_members = #{businessMembers} - order by erp.update_time desc + order by erp.create_time desc +
- +
- +
- +
- @@ -62,9 +62,9 @@
- +
-
@@ -84,9 +84,9 @@
- +
- +
@@ -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 @@
- +
- +
@@ -24,9 +24,6 @@
- + -
- +
-
- +
@@ -178,6 +171,27 @@ //获取工程员 $(function(){ $("#businessMembers_add").val(userName); + supplierName(); + engineer(); + $("#add-weiwai").hide(); + }) + //获取供应商 + function supplierName(){ + $.ajax({ + url: ctx + 'system/supplier/getSupplier', + type: 'post', + success: function (res) { + if (res.rows.length > 0) { + var usertData = res.rows; + for (let i in usertData) { + $("#form-material-add select[name='supplierName']").append( + ""); + } + } + } + }) + } + function engineer(){ $.ajax({ url: ctx + 'erp/material/getEngineerList', type: 'get', @@ -193,8 +207,7 @@ } } }); - }) - + } $("#form-material-add").validate({ onkeyup: false, rules:{ @@ -254,9 +267,21 @@ } } function insertRowWai() { - var html = '删除'; + var html = '' + + '' + + '删除' + + ''; $(".bootstrap-table-sub-2").append(html); } + $("select[name='processMethod']").on("select2:select", function (e) { + data = e.params.data; + if (data.dictLabel == '委外加工') { + $("#add-weiwai").show(); + } else { + $("#add-weiwai").hide(); + } + + }); \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/detail.html b/ruoyi-admin/src/main/resources/templates/erp/material/detail.html index 8d9d9cde..cd4b21b0 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/detail.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/detail.html @@ -72,9 +72,9 @@
- +
-
@@ -128,6 +128,8 @@ + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/material.html b/ruoyi-admin/src/main/resources/templates/erp/material/material.html index a23b3a85..b3ebddb7 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/material.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/material.html @@ -70,29 +70,6 @@ - - -
  •  搜索  重置 @@ -106,7 +83,7 @@ 添加 - + 技术团队配置 @@ -143,21 +120,7 @@ var productItems = []; var prefix = ctx + "erp/material"; $(function() { - $.ajax({ - url: prefix + '/getEngineerList', - type: 'get', - success: function (res) { - if (res.rows.length > 0) { - var usertData = res.rows; - for (let i in usertData) { - $("select[name='businessMembers']").append( - ""); - } - } else { - $.modal.msgError(res.msg); - } - } - }); + engineer(); var options = { url: prefix + "/list", createUrl: prefix + "/add", @@ -212,6 +175,7 @@ }, {title: '品牌',field: 'brand',}, {title: '描述',field: 'describe',}, + {title: '利润率',field: '',visible: false,}, {title: '是否有技术团队',field: 'havaProductTem',visible: false, formatter:function (value, row, index){return $.table.selectDictLabel(haveProductTem,value);} }, @@ -268,8 +232,38 @@ $.table.init(options); }); - - + function technologyTeam(){ + const rows = $("#bootstrap-table").bootstrapTable('getSelections'); + if(rows.length!==1){ + $.modal.msgError("一次只能选择一个物料数据"); + return; + } + // var materialNoArr = []; + // selectedRows.forEach(function(row) { + // var value = row[materialNo]; + // materialNoArr.push(value); + // }); + // materialNo = materialNoArr.join(","); + var materialNo = rows[0].materialNo; + $.modal.open("编辑物料技术团队配置", prefix + "/editTechnologyTeam"); + } + function engineer(){ + $.ajax({ + url: prefix + '/getEngineerList', + type: 'get', + success: function (res) { + if (res.rows.length > 0) { + var usertData = res.rows; + for (let i in usertData) { + $("select[name='businessMembers']").append( + ""); + } + } else { + $.modal.msgError(res.msg); + } + } + }); + } //导出数据 function exportSelect() { diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/taskGcjlVerify.html b/ruoyi-admin/src/main/resources/templates/erp/material/taskGcjlVerify.html index f6836703..aa105af5 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/taskGcjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/taskGcjlVerify.html @@ -42,41 +42,15 @@
  • - +
    - +
    -
    - +
    - @@ -97,17 +71,17 @@
    - +
    -
    - +
    - +
    @@ -117,15 +91,15 @@
    - +
    -
    - +
    @@ -176,6 +150,7 @@