Browse Source

[feat] 工程管理

新增 开发修改单采购物料子表列表数据
修改 查找采购物料信息列表后端接口的方法
物料实体类新增 bomId字段
物料新增 查询所有物料信息列表和bom的id后端接口
采购物料选择页面新增 bomId主键字段
dev
liuxiaoxu 7 months ago
parent
commit
99fa06b787
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java
  2. 13
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java
  3. 8
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java
  4. 7
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  5. 15
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  6. 12
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  7. 129
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html
  8. 5
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/purchaseOrderMaterialSelect.html

2
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java

@ -162,7 +162,7 @@ public class ErpDevelopModifyorderController extends BaseController
public TableDataInfo getPurchaseMaterialList() public TableDataInfo getPurchaseMaterialList()
{ {
startPage(); startPage();
List<ErpMaterialVo> erpMaterialVos = erpMaterialService.selectAllErpMaterialList(); List<ErpMaterialVo> erpMaterialVos = erpMaterialService.selectAllErpMaterialListWithBom();
return getDataTable(erpMaterialVos); return getDataTable(erpMaterialVos);
} }

13
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java

@ -120,6 +120,9 @@ public class ErpMaterial extends BaseEntity
private String[] cateParentId; private String[] cateParentId;
/*bom的id*/
private Long bomId;
public List<SysTechnicalTeam> getTechnicalTeams() { public List<SysTechnicalTeam> getTechnicalTeams() {
return technicalTeams; return technicalTeams;
} }
@ -424,6 +427,15 @@ public class ErpMaterial extends BaseEntity
this.supplierName = supplierName; this.supplierName = supplierName;
} }
public Long getBomId() {
return bomId;
}
public void setBomId(Long bomId) {
this.bomId = bomId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this) return new ToStringBuilder(this)
@ -461,6 +473,7 @@ public class ErpMaterial extends BaseEntity
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("bomId", getBomId())
.toString(); .toString();
} }
} }

8
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java

@ -104,6 +104,14 @@ public interface ErpMaterialMapper
* @return 物料信息集合 * @return 物料信息集合
*/ */
List<ErpMaterialVo> selectAllErpMaterialList(); List<ErpMaterialVo> selectAllErpMaterialList();
/**
* 查询所有物料信息列表和bom的id
*
* @return 物料信息集合
*/
List<ErpMaterialVo> selectAllErpMaterialListWithBom();
//查询所有通过审核的半成品和成品物料的信息 //查询所有通过审核的半成品和成品物料的信息
List<ErpMaterialVo> selectCateErpMaterialList(); List<ErpMaterialVo> selectCateErpMaterialList();
} }

7
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -40,6 +40,13 @@ public interface IErpMaterialService
public List<ErpMaterialVo> selectAllErpMaterialList(); public List<ErpMaterialVo> selectAllErpMaterialList();
/**
* 查询所有物料信息列表和bom的id
*
* @return 物料信息集合
*/
public List<ErpMaterialVo> selectAllErpMaterialListWithBom();
/** /**
* 新增物料信息 * 新增物料信息
* *

15
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -166,6 +166,21 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
return erpMaterialVos; return erpMaterialVos;
} }
/**
* 查询所有物料信息列表和bom的id
*
* @return 物料信息集合
*/
@Override
public List<ErpMaterialVo> selectAllErpMaterialListWithBom() {
List<ErpMaterialVo> erpMaterialVos = erpMaterialMapper.selectAllErpMaterialListWithBom();
return erpMaterialVos;
}
/** /**
* 新增物料信息 * 新增物料信息
* *

12
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -40,6 +40,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="applyTime" column="apply_time" /> <result property="applyTime" column="apply_time" />
<result property="supplierId" column="supplier_id" /> <result property="supplierId" column="supplier_id" />
<result property="supplierName" column="supplier_name" /> <result property="supplierName" column="supplier_name" />
<result property="bomId" column="bom_id" />
</resultMap> </resultMap>
<sql id="selectErpMaterialVo"> <sql id="selectErpMaterialVo">
@ -154,6 +156,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAllErpMaterialList" resultMap="ErpMaterialResult"> <select id="selectAllErpMaterialList" resultMap="ErpMaterialResult">
<include refid="selectErpMaterialVo"/> <include refid="selectErpMaterialVo"/>
</select> </select>
<select id="selectAllErpMaterialListWithBom" resultMap="ErpMaterialResult">
select em.id, em.del_flag, em.create_by, em.create_time, em.update_by, em.update_time, em.remark,
em.bomNo, em.material_no, em.material_name, em.audit_status,em.use_status,
em.hava_product_tem,em.product_item,em.itemName, em.material_type, em.process_method,
em.unit, em.brand, em.`describe`, em.warehouse_dept,em.business_members,
eb.id as bom_id from erp_material em
left join erp_bom eb on em.material_no = eb.material_no
</select>
<select id="selectCateErpMaterialList" resultMap="ErpMaterialResult"> <select id="selectCateErpMaterialList" resultMap="ErpMaterialResult">
select erp.id, erp.del_flag, erp.create_by, erp.remark,erp.bomNo, erp.material_no, select erp.id, erp.del_flag, erp.create_by, erp.remark,erp.bomNo, erp.material_no,
erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem, erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem,

129
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html

@ -271,12 +271,6 @@
onExpandRow : function(index, row, $detail) { onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail); initChildTable(index, row, $detail);
}, },
/*onCollapseRow: function(index, row){
var childTableFormId = 'child_table_form_'+index;
var formData = $('#'+childTableFormId).serialize();
var formObj = $.common.formDataToObj(formData);
subTableFormArray.push(formObj);
},*/
columns: [ columns: [
{ {
field: 'id', field: 'id',
@ -291,7 +285,6 @@
{ {
field: 'bomId', field: 'bomId',
title: 'bom主键Id', title: 'bom主键Id',
visible: false
}, },
{ {
field: 'materialNo', field: 'materialNo',
@ -350,22 +343,20 @@
initChildTable = function(index, row, $detail) { initChildTable = function(index, row, $detail) {
var parentRow = row; var parentRow = row;
var parentRowIndex = index; var parentRowIndex = index;
var childTableId = 'child_table_'+index; var childTableId = 'child_table_' + index;
var childFormTableId = 'child_form_table_'+index; var childFormTableId = 'child_form_table_' + index;
var childTableFormId = 'child_table_form_'+index; var childTableFormId = 'child_table_form_' + index;
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>'); // $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table>'); $detail.html('<table id="' + childTableId + '"></table><table id="' + childFormTableId + '"></table>');
// BOM展示 // BOM展示
$('#'+childTableId).bootstrapTable({ $('#' + childTableId).bootstrapTable({
// url: ctx + "system/makeorderbom/list", url: ctx + "erp/bom/allLevelList",
method: 'post', method: 'post',
sidePagination: "server", sidePagination: "server",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
// queryParams : { queryParams: {
// makeNo: $("#makeNo").val(), parentId: parentRow.bomId
// salesOrderCode: $("#saleNo").val(), },
// salesOrderMaterialNo: parentRow.materialCode
// },
columns: [{ columns: [{
field: 'id', field: 'id',
title: '主键id', title: '主键id',
@ -374,17 +365,17 @@
{ {
field: 'level', field: 'level',
title: '阶层', title: '阶层',
formatter: function(value, row, index) { formatter: function (value, row, index) {
return $.table.selectDictLabel(levelDatas, value); return $.table.selectDictLabel(levelDatas, value);
} }
}, },
{ {
field: 'bomNo', field: 'bomNo',
title: 'BOM号', title: 'BOM号',
formatter:function (value,row,index){ formatter: function (value, row, index) {
if (value == null || value == ''){ if (value == null || value == '') {
return '/'; return '/';
}else{ } else {
return value return value
} }
} }
@ -392,25 +383,28 @@
{ {
field: 'materialNo', field: 'materialNo',
title: '料号', title: '料号',
formatter: function (value,row,index){ formatter: function (value, row, index) {
var curIndex = row.sortNo-1; if (value == null || value == '') {
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="pickDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">'; return '/';
} else {
return value
}
} }
}, },
{ {
field: 'photoUrl', field: 'photoUrl',
title: '图片', title: '图片',
formatter: function(value, row, index) { formatter: function (value, row, index) {
return $.table.imageView(value); return $.table.imageView(value);
} }
}, },
{ {
field: 'materialName', field: 'materialName',
title: '物料名称', title: '物料名称',
formatter: function (value,row,index){ formatter: function (value, row, index) {
if (value == null || value == ''){ if (value == null || value == '') {
return '/'; return '/';
}else{ } else {
return value return value
} }
} }
@ -418,17 +412,17 @@
{ {
field: 'materialType', field: 'materialType',
title: '物料类型', title: '物料类型',
formatter: function(value, row, index) { formatter: function (value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value); return $.table.selectCategoryLabel(materialTypeDatas, value);
} }
}, },
{ {
field: 'describe', field: 'describe',
title: '描述', title: '描述',
formatter: function (value,row,index){ formatter: function (value, row, index) {
if (value == null || value == ''){ if (value == null || value == '') {
return '/'; return '/';
}else{ } else {
return value return value
} }
} }
@ -436,10 +430,10 @@
{ {
field: 'brand', field: 'brand',
title: '品牌', title: '品牌',
formatter: function (value,row,index){ formatter: function (value, row, index) {
if (value == null || value == ''){ if (value == null || value == '') {
return '/'; return '/';
}else{ } else {
return value return value
} }
} }
@ -447,10 +441,10 @@
{ {
field: 'unit', field: 'unit',
title: '单位', title: '单位',
formatter: function (value,row,index){ formatter: function (value, row, index) {
if (value == null || value == ''){ if (value == null || value == '') {
return '/'; return '/';
}else{ } else {
return value return value
} }
} }
@ -459,17 +453,25 @@
{ {
field: 'processMethod', field: 'processMethod',
title: '半成品类型', title: '半成品类型',
formatter: function(value, row, index) { formatter: function (value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value); return $.table.selectDictLabel(processMethodDatas, value);
} }
}, },
{
field: 'warehouseDept',
align: 'center',
title: '入库部门', visible: false,
formatter: function (value, row, index) {
return $.table.selectDictLabel(warehouseDates, value);
}
},
{ {
field: 'useNum', field: 'useNum',
title: '用量', title: '用量',
formatter: function (value,row,index){ formatter: function (value, row, index) {
if (value == null || value == ''){ if (value == null || value == '') {
return '/'; return '/';
}else{ } else {
return value return value
} }
} }
@ -477,39 +479,24 @@
{ {
field: 'lossRate', field: 'lossRate',
title: '损耗率', title: '损耗率',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value + "%";
// }
// }
}, },
{ {
field: 'materialNum', field: 'materialNum',
title: '订单用量', title: '订单用量',
formatter: function (value,row,index){ formatter: function (value, row, index) {
return parentRow.materialNum * row.useNum; return parentRow.materialNum * row.useNum;
} }
}, },
{ {
field: 'hasPickNum', field: 'parentId',
title: '已领料数量', title: '父级id',
},
{
field: 'pickNum',
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">';
}
},
{
field: 'makeNo',
title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
visible: false, visible: false,
}, },
{ {
@ -518,12 +505,11 @@
visible: false visible: false
}], }],
// 当所有数据被加载时触发 // 当所有数据被加载时触发
onLoadSuccess: function(data) { onLoadSuccess: function (data) {
}, },
}); });
}; }
function purchaseDoSubmit(index, layero,uniqueId){ function purchaseDoSubmit(index, layero,uniqueId){
console.log(uniqueId); console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']]; var iframeWin = window[layero.find('iframe')[0]['name']];
@ -548,6 +534,7 @@
$("#bootstrap-table-purchase").bootstrapTable('insertRow', { $("#bootstrap-table-purchase").bootstrapTable('insertRow', {
index:1, index:1,
row: { row: {
bomId:rowData.bomId,
materialNo:rowData.materialNo, materialNo:rowData.materialNo,
materialPhotourl:rowData.materialPhotourl, materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName, materialName: rowData.materialName,

5
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/purchaseOrderMaterialSelect.html

@ -28,6 +28,11 @@
modalName: "物料信息", modalName: "物料信息",
columns: [{ columns: [{
checkbox: true checkbox: true
},
{
field: 'bomId',
title: 'bom主键Id',
visible:false
}, },
{ {
title: '料号', title: '料号',

Loading…
Cancel
Save