From 99fa06b78797ce33f7e5f4b299d839e2122dbe3d Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 24 Jul 2024 19:08:33 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=20=E5=BC=80=E5=8F=91=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8D=95=E9=87=87=E8=B4=AD=E7=89=A9=E6=96=99=E5=AD=90=E8=A1=A8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=20=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E9=87=87=E8=B4=AD=E7=89=A9=E6=96=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=97=E8=A1=A8=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95=20=E7=89=A9=E6=96=99=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E7=B1=BB=E6=96=B0=E5=A2=9E=20bomId=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=E7=89=A9=E6=96=99=E6=96=B0=E5=A2=9E=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=92=8Cbom=E7=9A=84id=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E9=87=87=E8=B4=AD=E7=89=A9=E6=96=99=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E=20bomId=E4=B8=BB?= =?UTF-8?q?=E9=94=AE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ErpDevelopModifyorderController.java | 2 +- .../com/ruoyi/erp/domain/ErpMaterial.java | 13 ++ .../ruoyi/erp/mapper/ErpMaterialMapper.java | 8 ++ .../erp/service/IErpMaterialService.java | 7 + .../service/impl/ErpMaterialServiceImpl.java | 15 ++ .../mapper/erp/ErpMaterialMapper.xml | 12 ++ .../templates/erp/developModifyOrder/add.html | 129 ++++++++---------- .../purchaseOrderMaterialSelect.html | 5 + 8 files changed, 119 insertions(+), 72 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java index 366b1d66..5ce2d0b5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java +++ b/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 erpMaterialVos = erpMaterialService.selectAllErpMaterialList(); + List erpMaterialVos = erpMaterialService.selectAllErpMaterialListWithBom(); return getDataTable(erpMaterialVos); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java index 481afe4d..d549db64 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpMaterial.java +++ b/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 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(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java index 28905108..360f0b87 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java @@ -104,6 +104,14 @@ public interface ErpMaterialMapper * @return 物料信息集合 */ List selectAllErpMaterialList(); + + /** + * 查询所有物料信息列表和bom的id + * + * @return 物料信息集合 + */ + List selectAllErpMaterialListWithBom(); + //查询所有通过审核的半成品和成品物料的信息 List selectCateErpMaterialList(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java index c849aa3e..ce303c4b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java @@ -40,6 +40,13 @@ public interface IErpMaterialService public List selectAllErpMaterialList(); + /** + * 查询所有物料信息列表和bom的id + * + * @return 物料信息集合 + */ + public List selectAllErpMaterialListWithBom(); + /** * 新增物料信息 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java index a29f9c3e..36f4d0ef 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java +++ b/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 selectAllErpMaterialListWithBom() { + + List erpMaterialVos = erpMaterialMapper.selectAllErpMaterialListWithBom(); + return erpMaterialVos; + } + + + /** * 新增物料信息 * diff --git a/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml b/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml index 59e16ad6..00c3ba09 100644 --- a/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml @@ -40,6 +40,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -154,6 +156,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + '; + 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 ''; - } - }, - { - 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, diff --git a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/purchaseOrderMaterialSelect.html b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/purchaseOrderMaterialSelect.html index 89ecd1b4..ef05ac12 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/purchaseOrderMaterialSelect.html +++ b/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',