From f44def8f4e89ad7df293d2fc3862fc89eda329f1 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Mon, 3 Jun 2024 20:27:53 +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=B9bom=E4=BF=A1=E6=81=AF=E7=94=A8=E9=87=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E5=BF=85=E5=A1=AB=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E6=8D=9F=E8=80=97=E7=8E=87=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?%=EF=BC=8C=E6=B7=BB=E5=8A=A0BOM=E7=89=A9=E6=96=99=E6=98=AF?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E9=A1=B9=E4=B8=A2=E5=A4=B1=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E3=80=82=E5=B7=A5=E7=A8=8B=E5=91=98=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=E6=9C=AC=E4=BA=BA=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=98=BE=E7=A4=BA=E6=97=B6=E4=B8=A2=E5=A4=B1=E5=8D=8A?= =?UTF-8?q?=E6=88=90=E5=93=81=E7=B1=BB=E5=9E=8B=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/erp/domain/ErpBom.java | 4 + .../com/ruoyi/erp/domain/ErpMaterial.java | 11 + .../erp/service/impl/ErpBomServiceImpl.java | 3 +- ...FinancialCompantFixedAssetsController.java | 2 +- .../resources/mapper/erp/ErpBomMapper.xml | 11 +- .../mapper/erp/ErpMaterialMapper.xml | 4 +- .../main/resources/templates/erp/bom/add.html | 93 ++++--- .../main/resources/templates/erp/bom/bom.html | 18 +- .../resources/templates/erp/bom/detail.html | 43 +++- .../resources/templates/erp/bom/edit.html | 37 ++- .../templates/erp/bom/taskGcjlVerify.html | 31 ++- .../templates/erp/bom/taskGczgVerify.html | 34 +-- .../templates/erp/bom/taskModifyApply.html | 35 ++- .../templates/erp/bom/taskYfzjVerify.html | 33 +-- .../templates/erp/developModifyOrder/add.html | 231 +++++++++--------- .../purchasePlan/addPurchaseOrder.html | 55 +++-- .../templates/system/customerQuote/add.html | 89 ++++--- .../system/empRequisiteOrder/add.html | 43 +++- 18 files changed, 450 insertions(+), 327 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java index 320c4e05..add48fb6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpBom.java @@ -237,6 +237,10 @@ public class ErpBom extends BaseEntity } public void setLossRate(String lossRate) { + String[] lossRateArr = lossRate.split("\\%"); + if(lossRateArr.length>0){ + this.lossRate = lossRateArr[0]; + } this.lossRate = lossRate; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java index 316265d7..481afe4d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java @@ -117,6 +117,17 @@ public class ErpMaterial extends BaseEntity /** 供应商名称*/ private String supplierName; + private String[] cateParentId; + + + public List getTechnicalTeams() { + return technicalTeams; + } + + public void setTechnicalTeams(List technicalTeams) { + this.technicalTeams = technicalTeams; + } + private List technicalTeams; public void setId(Long id) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java index 0f8e807c..e00aa1d5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java @@ -217,6 +217,7 @@ private ISysAttachService attachService; String loginName = ShiroUtils.getLoginName(); //获取创建人 erpBom.setCreateBy(loginName); + erpBom.setEngineer(loginName); //创建时间 erpBom.setCreateTime(DateUtils.getNowDate()); //初始化BOM编号父类 @@ -230,7 +231,6 @@ private ISysAttachService attachService; //todo 使用useGeneratedKeys="true" keyProperty="id"关键子,插入后完成后需要获取新的id就需要重新getId() Long id = erpBom.getId(); insertErpBomSub(erpBom); - ErpMaterial erpMaterial = materialMapper.selectErpMaterialByMaterialNo(erpBom.getMaterialNo()); if (!Objects.isNull(erpMaterial)) { ErpMaterial erpMaterial1 = new ErpMaterial(); @@ -253,6 +253,7 @@ private ISysAttachService attachService; { String loginName = ShiroUtils.getLoginName(); erpBomVo.setUpdateBy(loginName); + erpBomVo.setEngineer(loginName); erpBomVo.setUpdateTime(DateUtils.getNowDate()); int editFlag = erpBomMapper.updateErpBom(erpBomVo); Long id = erpBomVo.getId(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java index e6f92800..c60570b2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialCompantFixedAssetsController.java @@ -38,7 +38,7 @@ public class FinancialCompantFixedAssetsController extends BaseController @GetMapping() public String CompantFixedAssets() { - return prefix + "/CompantFixedAssets"; + return prefix + "/compantFixedAssets"; } /** diff --git a/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml b/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml index cb98740d..af429518 100644 --- a/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml @@ -139,7 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and (erp.material_no like concat('%',#{keyword},'%') or erp.material_name like concat('%',#{keyword},'%')) and erp.bom_no != '' - order by erp.update_time desc + order by erp.create_time desc +
-
- +
-
+
- +
-
+
@@ -72,9 +78,12 @@
- +
+
+
@@ -101,6 +110,7 @@ var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; + var userName = [[${@permission.getPrincipalProperty('userName')}]]; $("#form-bom-add").validate({ onkeyup: false, rules:{ @@ -142,8 +152,24 @@ }, 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) { + $("#selectEngineer").append( + ""); + } + $("#selectEngineer").val(loginName); + } else { + $.modal.msgError(res.msg); + } + } + }); + $("#form-bom-add input[name='engineer']").val(loginName); //todo 物料编号下拉框 $("#materialNo").select2({ theme: "bootstrap", @@ -319,12 +345,14 @@ if (!value) { return '损耗率不能为空'; } - if (isNaN(value)) { - return '损耗率必须为数字'; - } else if (value > 100) { - return "输入数值不能大100" - } else if (value < 0) { - return "输入数值不能小于0"; + const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 + const match = value.match(regex); // 使用match方法查找所有匹配 + if (!match) { + return '损耗率必须以百分比结尾'; + } + var num = value.replace('%', ''); + if (num < 0 || num > 100) { + return '损耗率必须大于等于0小于等于100'; } } }, @@ -360,41 +388,38 @@ }] }; $.table.init(options); - // $.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) { - // $("#form-bom-add select[name='engineer']").append( - // ""); - // } - // } else { - // $.modal.msgError(res.msg); - // } - // } - // }); - $("form-bom-add input[name='engineer']").val(loginName); - $("form-bom-add input[name='engineer']").text(userName); + }); function materilalSelect(data) { var materialType1 = data.materialType.indexOf('yl'); var materialType2 = data.materialType.indexOf('fl'); - if(materialType1 != -1 && materialType2 != -1){ - $.modal.msgError("原料、辅料不能作为BOM主体"); + if(materialType1 !== -1 ){ + $.modal.msgError("原料不能作为BOM主体"); $("#materialNo").val(''); $("input[materialName]").val(''); return; - }; + } + console.log("materialType" + data.materialType); + if(materialType2 !== -1 ){ + $.modal.msgError("辅料不能作为BOM主体"); + $("#materialNo").val(''); + $("input[materialName]").val(''); + return; + } $("input[name='brand']").val(data.brand); $("textarea[name='describe']").val(data.describe); $("#selectMaterialType").val([data.materialType]).trigger("change"); + $("input[name='materialType']").val(data.materialType); $("#selectProcessMethod").val([data.processMethod]).trigger("change"); + $("input[name='processMethod']").val(data.processMethod); $("#selectUnit").val([data.unit]).trigger("change"); + $("input[name='unit']").val(data.unit); + } + function submitHandler() { if ($.validate.form()) { + $("#selectMaterialType").removeAttr("disabled"); $("#selectProcessMethod").removeAttr("disabled"); $("#selectUnit").removeAttr("disabled"); diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html index a94fe43e..aefb4b0b 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html @@ -251,16 +251,6 @@ }, { 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', @@ -440,7 +430,13 @@ if (value == null || value == ''){ return "%"; } - return value + "%"; + const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 + const match = value.match(regex); // 使用match方法查找所有匹配 + if (match) { + return value; + }else{ + return value + "%"; + } } }, { diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html b/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html index 8bad9831..abd9b705 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html @@ -13,13 +13,13 @@
- +
- +
@@ -55,13 +55,13 @@
- +
- +
@@ -90,13 +90,14 @@