From 4ffd242bc9edaf6e0145fa27ad29287b4874fd90 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Sat, 1 Jun 2024 17:41:21 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86:?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E7=89=A9=E6=96=99=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=92=E5=BA=8F=E6=9C=89=E5=85=88=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F=E3=80=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A5=E5=BA=93=EF=BC=8C=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=96=99=E5=8F=B7=EF=BC=8C=E7=89=A9=E6=96=99=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=EF=BC=8C=E7=89=A9=E6=96=99=E7=B1=BB=E5=9E=8B=EF=BC=8C=E5=8D=8A?= =?UTF-8?q?=E6=88=90=E5=93=81=E7=B1=BB=E5=9E=8B=EF=BC=8C=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=B8=BA=E5=BF=85=E5=A1=AB=E9=A1=B9=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=8A=80=E6=9C=AF=E5=9B=A2=E9=98=9F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/ErpMaterialController.java | 5 + .../mapper/erp/ErpMaterialMapper.xml | 2 +- .../templates/erp/bom/taskGcjlVerify.html | 236 +++++++++++++++++- .../resources/templates/erp/material/add.html | 71 ++++-- .../templates/erp/material/detail.html | 9 +- .../templates/erp/material/edit.html | 75 +++--- .../erp/material/editTechnologyTeam.html | 167 +++++++++++++ .../templates/erp/material/material.html | 76 +++--- .../erp/material/taskGcjlVerify.html | 49 +--- .../erp/material/taskGczgVerify.html | 40 +-- .../erp/material/taskModifyApply.html | 45 +--- .../erp/material/taskYfzjVerify.html | 45 +--- 12 files changed, 563 insertions(+), 257 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/erp/material/editTechnologyTeam.html 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 @@