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()
{
startPage();
List<ErpMaterialVo> erpMaterialVos = erpMaterialService.selectAllErpMaterialList();
List<ErpMaterialVo> erpMaterialVos = erpMaterialService.selectAllErpMaterialListWithBom();
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;
/*bom的id*/
private Long bomId;
public List<SysTechnicalTeam> getTechnicalTeams() {
return technicalTeams;
}
@ -424,6 +427,15 @@ public class ErpMaterial extends BaseEntity
this.supplierName = supplierName;
}
public Long getBomId() {
return bomId;
}
public void setBomId(Long bomId) {
this.bomId = bomId;
}
@Override
public String toString() {
return new ToStringBuilder(this)
@ -461,6 +473,7 @@ public class ErpMaterial extends BaseEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("bomId", getBomId())
.toString();
}
}

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

@ -104,6 +104,14 @@ public interface ErpMaterialMapper
* @return 物料信息集合
*/
List<ErpMaterialVo> selectAllErpMaterialList();
/**
* 查询所有物料信息列表和bom的id
*
* @return 物料信息集合
*/
List<ErpMaterialVo> selectAllErpMaterialListWithBom();
//查询所有通过审核的半成品和成品物料的信息
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();
/**
* 查询所有物料信息列表和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;
}
/**
* 查询所有物料信息列表和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="supplierId" column="supplier_id" />
<result property="supplierName" column="supplier_name" />
<result property="bomId" column="bom_id" />
</resultMap>
<sql id="selectErpMaterialVo">
@ -154,6 +156,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAllErpMaterialList" resultMap="ErpMaterialResult">
<include refid="selectErpMaterialVo"/>
</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 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,

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

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

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

@ -29,6 +29,11 @@
columns: [{
checkbox: true
},
{
field: 'bomId',
title: 'bom主键Id',
visible:false
},
{
title: '料号',
field: 'materialNo',

Loading…
Cancel
Save