Browse Source

[fix]

生产管理 生产订单
修改编辑生产bom页面物料表格损耗率编辑定义,修改验证方法及值初始化方法;
修改生产领料、入库、工程审核、生产订单详情页面损耗率字段显示效果;
修改生产bom实体类,损耗率类型改为Double;
dev
王晓迪 2 months ago
parent
commit
4259694263
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java
  2. 7
      ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html
  3. 7
      ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html
  4. 14
      ruoyi-admin/src/main/resources/templates/system/makeorder/detail.html
  5. 35
      ruoyi-admin/src/main/resources/templates/system/makeorder/editMakeOrderBom.html
  6. 14
      ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html

6
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java

@ -83,7 +83,7 @@ public class SysMakeorderBom extends BaseEntity
/** 损耗率 */ /** 损耗率 */
@Excel(name = "损耗率") @Excel(name = "损耗率")
private String lossRate; private Double lossRate;
/** 层级 */ /** 层级 */
@Excel(name = "层级") @Excel(name = "层级")
@ -250,11 +250,11 @@ public class SysMakeorderBom extends BaseEntity
this.useNum = useNum; this.useNum = useNum;
} }
public String getLossRate() { public Double getLossRate() {
return lossRate; return lossRate;
} }
public void setLossRate(String lossRate) { public void setLossRate(Double lossRate) {
this.lossRate = lossRate; this.lossRate = lossRate;
} }

7
ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html

@ -347,6 +347,13 @@
field: 'lossRate', field: 'lossRate',
align: 'center', align: 'center',
title: '损耗率', title: '损耗率',
formatter: function (value, row, index) {
if (value == null || value == ''){
return "0.00%";
}
value = parseFloat(value).toFixed(2);
return value + "%";
}
}, },
{ {
field: 'materialNum', field: 'materialNum',

7
ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html

@ -323,6 +323,13 @@
field: 'lossRate', field: 'lossRate',
title: '损耗率', title: '损耗率',
align: 'center', align: 'center',
formatter: function (value, row, index) {
if (value == null || value == ''){
return "0.00%";
}
value = parseFloat(value).toFixed(2);
return value + "%";
}
}, },
{ {
field: 'orderNum', field: 'orderNum',

14
ruoyi-admin/src/main/resources/templates/system/makeorder/detail.html

@ -307,13 +307,13 @@
field: 'lossRate', field: 'lossRate',
align: 'center', align: 'center',
title: '损耗率', title: '损耗率',
// formatter: function (value,row,index){ formatter: function (value, row, index) {
// if (value == null || value == ''){ if (value == null || value == ''){
// return '/'; return "0.00%";
// }else{ }
// return value + "%"; value = parseFloat(value).toFixed(2);
// } return value + "%";
// } }
}, },
{ {
field: 'materialNum', field: 'materialNum',

35
ruoyi-admin/src/main/resources/templates/system/makeorder/editMakeOrderBom.html

@ -209,7 +209,6 @@
editable : { editable : {
type : 'text', type : 'text',
title : '用量', title : '用量',
mode:'inline',
validate : function(value) { validate : function(value) {
if (!value) { if (!value) {
return '用量不能为空'; return '用量不能为空';
@ -230,43 +229,17 @@
editable : { editable : {
editor: { editor: {
defaultValue: '%', defaultValue: '%',
title : '损耗率(%)', title: '损耗率(%)',
mode:'inline',
type: 'text', type: 'text',
// 编辑时同样附带百分比符号
formatter: function(value) {
return value + '%';
},
// 编辑后去除百分比符号
custom_getter: function(value) {
return value.replace('%', '');
}
}, },
validate : function(value) { validate : function (value) {
if (!value) { if (!value) {
return '损耗率不能为空'; return '损耗率不能为空';
} }
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 if (isNaN(value)) return '损耗率必须是数字';
const match = value.match(regex); // 使用match方法查找所有匹配 if (value < 0 || value > 100) {
if (!match) {
return '损耗率必须以百分比结尾';
}
var num = value.replace('%', '');
if (num < 0 || num > 100) {
return '损耗率必须大于等于0小于等于100'; return '损耗率必须大于等于0小于等于100';
} }
},
},
formatter: function (value,row,index){
if (value == null || value == ''){
return "%";
}
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配
const match = value.match(regex); // 使用match方法查找所有匹配
if (match) {
return value;
}else{
return value + "%";
} }
}, },
}, },

14
ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html

@ -338,13 +338,13 @@
field: 'lossRate', field: 'lossRate',
align: 'center', align: 'center',
title: '损耗率', title: '损耗率',
// formatter: function (value,row,index){ formatter: function (value, row, index) {
// if (value == null || value == ''){ if (value == null || value == ''){
// return '/'; return "0.00%";
// }else{ }
// return value + "%"; value = parseFloat(value).toFixed(2);
// } return value + "%";
// } }
}, },
{ {
field: 'materialNum', field: 'materialNum',

Loading…
Cancel
Save