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 @@