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.setUnit(erpMaterialVo.getUnit());
fatherBom.setBrand(erpMaterialVo.getBrand()); fatherBom.setBrand(erpMaterialVo.getBrand());
fatherBom.setDescribe(erpMaterialVo.getDescribe()); fatherBom.setDescribe(erpMaterialVo.getDescribe());
fatherBom.setWarehouseDept(erpMaterialVo.getWarehouseDept());
fatherBom.setParentId(0L); fatherBom.setParentId(0L);
fatherBom.setLevel(0L); fatherBom.setLevel(0L);
erpBomMapper.insertErpBom(fatherBom); erpBomMapper.insertErpBom(fatherBom);
@ -565,6 +566,7 @@ private ISysAttachService attachService;
subBom.setUnit(erpMaterialVo.getUnit()); subBom.setUnit(erpMaterialVo.getUnit());
subBom.setBrand(erpMaterialVo.getBrand()); subBom.setBrand(erpMaterialVo.getBrand());
subBom.setDescribe(erpMaterialVo.getDescribe()); subBom.setDescribe(erpMaterialVo.getDescribe());
subBom.setWarehouseDept(erpMaterialVo.getWarehouseDept());
subBom.setUseNum(useNum); subBom.setUseNum(useNum);
subBom.setLossRate(String.valueOf(lossRate)); subBom.setLossRate(String.valueOf(lossRate));
subBom.setParentId(parentId); subBom.setParentId(parentId);
@ -628,8 +630,8 @@ private ISysAttachService attachService;
* @param erpBom * @param erpBom
* @return * @return
*/ */
@Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override
public ProcessInstance submitApply(ErpBom erpBom) { public ProcessInstance submitApply(ErpBom erpBom) {
SysUser user = ShiroUtils.getSysUser(); SysUser user = ShiroUtils.getSysUser();
erpBom.setApplyUser(user.getLoginName()); 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="materialName" column="sub_material_name" />
<result property="materialType" column="sub_material_type" /> <result property="materialType" column="sub_material_type" />
<result property="processMethod" column="sub_process_method" /> <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="unit" column="sub_unit" />
<result property="brand" column="sub_brand" /> <result property="brand" column="sub_brand" />
<result property="describe" column="sub_describe" /> <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="useNum" column="sub_use_num" />
<result property="lossRate" column="sub_loss_rate" /> <result property="lossRate" column="sub_loss_rate" />
<result property="parentId" column="sub_parent_id" /> <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 processMethodDatas = [[${@dict.getType('processMethod')}]];
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-bom-add").validate({ $("#form-bom-add").validate({
onkeyup: false, onkeyup: false,
rules:{ rules:{
@ -166,7 +165,7 @@
var usertData = res.rows; var usertData = res.rows;
for (let i in usertData) { for (let i in usertData) {
$("#selectEngineer").append( $("#selectEngineer").append(
"<option value='" + usertData[i].loginName + "'>" + usertData[i].userName + "</option>"); "<option value='" + usertData[i].loginName + "'>" + usertData[i].loginName + "</option>");
} }
$("#selectEngineer").val(loginName); $("#selectEngineer").val(loginName);
} else { } else {
@ -355,8 +354,8 @@
} }
}, },
formatter: function (value,row,index){ formatter: function (value,row,index){
if(value == null){ if(value == null || value == ""){
return "%"; return "0%";
} }
return value + "%"; 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: 'cancelInstanceId',visible: false},
{ title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false}, { title: '流程恢复实例ID',field: 'restoreInstanceId',visible: false},
{ title: '流程实例类型',field: 'instanceTypeName', visible: false}, { title: '流程实例类型',field: 'instanceTypeName', visible: false},
{ { title: '申请人ID',field: 'applyUser',visible: false},
field: 'applyUser', { title: '<span style="color: red;">申请人</span>',field: 'applyUserName',
title: '申请人ID', formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';}
visible: false
}, },
{ { title: '申请时间',field: 'applyTime',sortable: true,},
field: 'applyUserName', { title: '当前任务ID',field: 'taskId',visible: false,},
title: '<span style="color: red;">申请人</span>', { title: '待办用户ID',field: 'todoUserId',visible: false,},
formatter: function(value, row, index) { { title: '当前任务名称',field: 'taskName',align: 'center',
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',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>'; return '<span class="badge badge-primary">' + value + '</span>';
} }
}, },
{ { title: '审核状态',field: 'auditStatus',sortable: true,
field: 'auditStatus',
title: '审核状态',
sortable: true,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value); return $.table.selectDictLabel(auditStatusDatas, value);
} }
}, },
{ { title: '使用状态',field: 'useStatus',sortable: true,
field: 'useStatus',
title: '使用状态',
sortable: true,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value); return $.table.selectDictLabel(useStatusDatas, value);
} }
@ -205,46 +175,18 @@
{ title: '工程员',field: 'engineer', sortable: true,}, { title: '工程员',field: 'engineer', sortable: true,},
{ title: 'bom号',field: 'bomNo', sortable: true,}, { title: 'bom号',field: 'bomNo', sortable: true,},
{ title: '关联料号',field: 'materialNo', sortable: true,}, { title: '关联料号',field: 'materialNo', sortable: true,},
{ { title: '图片',field: 'photoUrl',formatter: function(value, row, index) {return $.table.imageView(value);}},
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{ title: '物料名称',field: 'materialName', sortable: true,}, { title: '物料名称',field: 'materialName', sortable: true,},
{ { title: '物料类型',field: 'materialType',sortable: true,
field: 'materialType', formatter: function(value, row, index) {return $.table.selectCategoryLabel(materialTypeDatas, value);}},
title: '物料类型', { title: '加工方式',field: 'processMethod',sortable: true,
sortable: true, formatter: function(value, row, index) {return $.table.selectDictLabel(processMethodDatas, value);}
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: 'unit', sortable: true,},
{ title: '品牌',field: 'brand', sortable: true,}, { title: '品牌',field: 'brand', sortable: true,},
{title: '描述',field: 'describe', sortable: true,}, {title: '描述',field: 'describe', sortable: true,},
{ { title: '父级id',field: 'parentId',visible:false },
field: 'parentId', {title: '层级',field: 'level', visible:false,
title: '父级id',
visible:false
},
{
field: 'level',
title: '层级',
visible:false,
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value); return $.table.selectDictLabel(levelDatas, value);
} }
@ -561,10 +503,16 @@
title: '损耗率', title: '损耗率',
formatter: function (value,row,index){ formatter: function (value,row,index){
if (value == null || value == ''){ 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 + "%"; return value + "%";
} }
}
}, },
{ {
field: 'processMethod', field: 'processMethod',
@ -714,9 +662,18 @@
}, },
{ {
field: 'lossRate', field: 'lossRate',
title: '损耗率(%)', title: '损耗率',
formatter: function (value,row,index){ 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