Browse Source

[feat] erpBom页面bom子数据修改入库部门修改

dev
zhangsiqi 4 months ago
parent
commit
607254d0f4
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  2. 4
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  3. 7
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html
  4. 113
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

4
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -543,6 +543,7 @@ private ISysAttachService attachService;
fatherBom.setUnit(erpMaterialVo.getUnit());
fatherBom.setBrand(erpMaterialVo.getBrand());
fatherBom.setDescribe(erpMaterialVo.getDescribe());
fatherBom.setWarehouseDept(erpMaterialVo.getWarehouseDept());
fatherBom.setParentId(0L);
fatherBom.setLevel(0L);
erpBomMapper.insertErpBom(fatherBom);
@ -565,6 +566,7 @@ private ISysAttachService attachService;
subBom.setUnit(erpMaterialVo.getUnit());
subBom.setBrand(erpMaterialVo.getBrand());
subBom.setDescribe(erpMaterialVo.getDescribe());
subBom.setWarehouseDept(erpMaterialVo.getWarehouseDept());
subBom.setUseNum(useNum);
subBom.setLossRate(String.valueOf(lossRate));
subBom.setParentId(parentId);
@ -628,8 +630,8 @@ private ISysAttachService attachService;
* @param erpBom
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Override
public ProcessInstance submitApply(ErpBom erpBom) {
SysUser user = ShiroUtils.getSysUser();
erpBom.setApplyUser(user.getLoginName());

4
ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml

@ -56,11 +56,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialName" column="sub_material_name" />
<result property="materialType" column="sub_material_type" />
<result property="processMethod" column="sub_process_method" />
<result property="engineer" column="engineer" />
<result property="engineer" column="sub_engineer" />
<result property="unit" column="sub_unit" />
<result property="brand" column="sub_brand" />
<result property="describe" column="sub_describe" />
<result property="warehouseDept" column="warehouseDept" />
<result property="warehouseDept" column="sub_warehouseDept" />
<result property="useNum" column="sub_use_num" />
<result property="lossRate" column="sub_loss_rate" />
<result property="parentId" column="sub_parent_id" />

7
ruoyi-admin/src/main/resources/templates/erp/bom/add.html

@ -115,7 +115,6 @@
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-bom-add").validate({
onkeyup: false,
rules:{
@ -166,7 +165,7 @@
var usertData = res.rows;
for (let i in usertData) {
$("#selectEngineer").append(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>");
"<option value='" + usertData[i].loginName + "'>" + usertData[i].loginName + "</option>");
}
$("#selectEngineer").val(loginName);
} else {
@ -355,8 +354,8 @@
}
},
formatter: function (value,row,index){
if(value == null){
return "%";
if(value == null || value == ""){
return "0%";
}
return value + "%";
},

113
ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

@ -150,54 +150,24 @@
{ title: '流程作废实例ID', field: 'cancelInstanceId',visible: false},
{ title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false},
{ title: '流程实例类型',field: 'instanceTypeName', visible: false},
{
field: 'applyUser',
title: '申请人ID',
visible: false
{ title: '申请人ID',field: 'applyUser',visible: false},
{ title: '<span style="color: red;">申请人</span>',field: 'applyUserName',
formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';}
},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{
field: 'applyTime',
title: '申请时间',
sortable: true,
},
{
field: 'taskId',
title: '当前任务ID',
visible: false,
},
{
field: 'todoUserId',
title: '待办用户ID',
visible: false,
},
{
field: 'taskName',
title: '当前任务名称',
align: 'center',
{ title: '申请时间',field: 'applyTime',sortable: true,},
{ title: '当前任务ID',field: 'taskId',visible: false,},
{ title: '待办用户ID',field: 'todoUserId',visible: false,},
{ title: '当前任务名称',field: 'taskName',align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{
field: 'auditStatus',
title: '审核状态',
sortable: true,
{ title: '审核状态',field: 'auditStatus',sortable: true,
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{
field: 'useStatus',
title: '使用状态',
sortable: true,
{ title: '使用状态',field: 'useStatus',sortable: true,
formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}
@ -205,46 +175,18 @@
{ title: '工程员',field: 'engineer', 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: 'photoUrl',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: 'materialType',sortable: true,
formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
{ title: '加工方式',field: 'processMethod',sortable: true,
formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}
},
{ title: '单位',field: 'unit', sortable: true,},
{ title: '品牌',field: 'brand', sortable: true,},
{title: '描述',field: 'describe', sortable: true,},
{
field: 'parentId',
title: '父级id',
visible:false
},
{
field: 'level',
title: '层级',
visible:false,
{ title: '父级id',field: 'parentId',visible:false },
{title: '层级',field: 'level', visible:false,
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
@ -561,10 +503,16 @@
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return "/";
return "0%";
}
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配
const match = value.match(regex); // 使用match方法查找所有匹配
if (match) {
return value;
}else{
return value + "%";
}
}
},
{
field: 'processMethod',
@ -714,9 +662,18 @@
},
{
field: 'lossRate',
title: '损耗率(%)',
title: '损耗率',
formatter: function (value,row,index){
return value + '%';
if (value == null || value == ''){
return "0%";
}
const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配
const match = value.match(regex); // 使用match方法查找所有匹配
if (match) {
return value;
}else{
return value + "%";
}
}
},
{

Loading…
Cancel
Save