From c875a4b0fffa1da360159c110f6ad8305682ba3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=B8=85?= Date: Thu, 4 Sep 2025 16:13:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=89=A9=E6=96=99=E6=96=B0=E5=A2=9E=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E5=8E=82=E5=AE=B6=202.=E5=87=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E3=80=81=E5=8D=95=E4=BB=B7=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=BE=93=E4=B8=A4=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintain/business/domain/ErpMaterial.java | 4 + .../business/domain/bo/ErpMaterialBo.java | 4 + .../business/domain/vo/ErpMaterialVo.java | 5 + .../listener/ErpMaterialImportListener.java | 108 +++++++++--------- ...ErpMaterialInventoryRecordServiceImpl.java | 2 +- .../src/views/business/material/index.vue | 40 ++++--- .../views/business/materialPicking/add.vue | 11 +- .../views/business/materialPicking/index.vue | 8 +- .../business/materialPickingInfo/index.vue | 2 +- .../views/business/materialPutaway/index.vue | 19 ++- .../views/business/materialReturns/index.vue | 8 +- 11 files changed, 123 insertions(+), 88 deletions(-) diff --git a/maintain-business/src/main/java/com/maintain/business/domain/ErpMaterial.java b/maintain-business/src/main/java/com/maintain/business/domain/ErpMaterial.java index 2208558..e687e00 100644 --- a/maintain-business/src/main/java/com/maintain/business/domain/ErpMaterial.java +++ b/maintain-business/src/main/java/com/maintain/business/domain/ErpMaterial.java @@ -92,6 +92,10 @@ public class ErpMaterial extends BaseEntity { * 物资品牌 */ private String materialBrand; + /** + * 生产厂家 + */ + private String manufacturer; /** * 采购标的 */ diff --git a/maintain-business/src/main/java/com/maintain/business/domain/bo/ErpMaterialBo.java b/maintain-business/src/main/java/com/maintain/business/domain/bo/ErpMaterialBo.java index 82f203f..8212e05 100644 --- a/maintain-business/src/main/java/com/maintain/business/domain/bo/ErpMaterialBo.java +++ b/maintain-business/src/main/java/com/maintain/business/domain/bo/ErpMaterialBo.java @@ -114,6 +114,10 @@ public class ErpMaterialBo extends BaseEntity { * 物资品牌 */ private String materialBrand; + /** + * 生产厂家 + */ + private String manufacturer; /** * 采购标的 */ diff --git a/maintain-business/src/main/java/com/maintain/business/domain/vo/ErpMaterialVo.java b/maintain-business/src/main/java/com/maintain/business/domain/vo/ErpMaterialVo.java index f968693..227965e 100644 --- a/maintain-business/src/main/java/com/maintain/business/domain/vo/ErpMaterialVo.java +++ b/maintain-business/src/main/java/com/maintain/business/domain/vo/ErpMaterialVo.java @@ -122,6 +122,11 @@ public class ErpMaterialVo implements Serializable { */ @ExcelProperty(value = "物资品牌") private String materialBrand; + /** + * 生产厂家 + */ + @ExcelProperty(value = "生产厂家") + private String manufacturer; /** * 采购标的 */ diff --git a/maintain-business/src/main/java/com/maintain/business/listener/ErpMaterialImportListener.java b/maintain-business/src/main/java/com/maintain/business/listener/ErpMaterialImportListener.java index 8c88c6a..710f617 100644 --- a/maintain-business/src/main/java/com/maintain/business/listener/ErpMaterialImportListener.java +++ b/maintain-business/src/main/java/com/maintain/business/listener/ErpMaterialImportListener.java @@ -84,21 +84,21 @@ public class ErpMaterialImportListener extends AnalysisEventListener materialTypes = materialTypeMapper.selectList(new LambdaQueryWrapper().eq(ErpMaterialType::getTypeName, material.getMaterialTypeName())); - if (materialTypes.isEmpty()) { - ErpMaterialType materialType = new ErpMaterialType(); - materialType.setTypeName(material.getMaterialTypeName()); - materialType.setParentId(1L); - materialType.setAncestors("0,1"); - materialTypeMapper.insert(materialType); - material.setMaterialTypeId(materialType.getTypeId()); - }else { - material.setMaterialTypeId(materialTypes.get(0).getTypeId()); - } - } +// if (StringUtils.isNotEmpty(material.getMaterialTypeName())) { +// List materialTypes = materialTypeMapper.selectList(new LambdaQueryWrapper().eq(ErpMaterialType::getTypeName, material.getMaterialTypeName())); +// if (materialTypes.isEmpty()) { +// ErpMaterialType materialType = new ErpMaterialType(); +// materialType.setTypeName(material.getMaterialTypeName()); +// materialType.setParentId(1L); +// materialType.setAncestors("0,1"); +// materialTypeMapper.insert(materialType); +// material.setMaterialTypeId(materialType.getTypeId()); +// }else { +// material.setMaterialTypeId(materialTypes.get(0).getTypeId()); +// } +// } /** * 供应商 */ @@ -114,22 +114,22 @@ public class ErpMaterialImportListener extends AnalysisEventListener().eq(ErpWarehouseLocation::getLocationType, material.getWarehouseLocationType())); - if (ObjectUtil.isNull(warehouseLocation)) { - ErpWarehouseLocation location = new ErpWarehouseLocation(); - location.setLocationCode(material.getWarehouseLocationType()); - location.setLocationType(material.getWarehouseLocationType()); - warehouseLocationMapper.insert(location); - material.setWarehouseLocationCode(location.getLocationCode()); - material.setWarehouseLocationId(location.getId()); - } else { - material.setWarehouseLocationCode(warehouseLocation.getLocationCode()); - material.setWarehouseLocationId(warehouseLocation.getId()); - } - } +// if (StringUtils.isNotEmpty(material.getWarehouseLocationType())) { +// ErpWarehouseLocation warehouseLocation = warehouseLocationMapper.selectOne(new LambdaQueryWrapper().eq(ErpWarehouseLocation::getLocationType, material.getWarehouseLocationType())); +// if (ObjectUtil.isNull(warehouseLocation)) { +// ErpWarehouseLocation location = new ErpWarehouseLocation(); +// location.setLocationCode(material.getWarehouseLocationType()); +// location.setLocationType(material.getWarehouseLocationType()); +// warehouseLocationMapper.insert(location); +// material.setWarehouseLocationCode(location.getLocationCode()); +// material.setWarehouseLocationId(location.getId()); +// } else { +// material.setWarehouseLocationCode(warehouseLocation.getLocationCode()); +// material.setWarehouseLocationId(warehouseLocation.getId()); +// } +// } materialMapper.insert(material); successNum++; successMsg.append("
").append(successNum).append("、物料 【").append(material.getMaterialName()).append("】 导入成功"); @@ -141,19 +141,19 @@ public class ErpMaterialImportListener extends AnalysisEventListener materialTypes = materialTypeMapper.selectList(new LambdaQueryWrapper().eq(ErpMaterialType::getTypeName, material.getMaterialTypeName())); - if (materialTypes.isEmpty()) { - ErpMaterialType materialType = new ErpMaterialType(); - materialType.setTypeName(material.getMaterialTypeName()); - materialType.setParentId(1L); - materialType.setAncestors("0,1"); - materialTypeMapper.insert(materialType); - material.setMaterialTypeId(materialType.getTypeId()); - }else { - material.setMaterialTypeId(materialTypes.get(0).getTypeId()); - } - } +// if (StringUtils.isNotEmpty(material.getMaterialTypeName())) { +// List materialTypes = materialTypeMapper.selectList(new LambdaQueryWrapper().eq(ErpMaterialType::getTypeName, material.getMaterialTypeName())); +// if (materialTypes.isEmpty()) { +// ErpMaterialType materialType = new ErpMaterialType(); +// materialType.setTypeName(material.getMaterialTypeName()); +// materialType.setParentId(1L); +// materialType.setAncestors("0,1"); +// materialTypeMapper.insert(materialType); +// material.setMaterialTypeId(materialType.getTypeId()); +// }else { +// material.setMaterialTypeId(materialTypes.get(0).getTypeId()); +// } +// } /** * 物资仓库 */ @@ -186,18 +186,18 @@ public class ErpMaterialImportListener extends AnalysisEventListener().eq(ErpWarehouseLocation::getLocationType, material.getWarehouseLocationType())); - if (ObjectUtil.isNull(warehouseLocation)) { - ErpWarehouseLocation location = new ErpWarehouseLocation(); - location.setLocationCode(material.getWarehouseLocationType()); - location.setLocationType(material.getWarehouseLocationType()); - warehouseLocationMapper.insert(location); - material.setWarehouseLocationId(location.getId()); - } else { - material.setWarehouseLocationId(warehouseLocation.getId()); - } - } +// if (StringUtils.isNotEmpty(material.getWarehouseLocationType())) { +// ErpWarehouseLocation warehouseLocation = warehouseLocationMapper.selectOne(new LambdaQueryWrapper().eq(ErpWarehouseLocation::getLocationType, material.getWarehouseLocationType())); +// if (ObjectUtil.isNull(warehouseLocation)) { +// ErpWarehouseLocation location = new ErpWarehouseLocation(); +// location.setLocationCode(material.getWarehouseLocationType()); +// location.setLocationType(material.getWarehouseLocationType()); +// warehouseLocationMapper.insert(location); +// material.setWarehouseLocationId(location.getId()); +// } else { +// material.setWarehouseLocationId(warehouseLocation.getId()); +// } +// } materialMapper.updateById(material); successNum++; successMsg.append("
").append(successNum).append("、物料 ").append(material.getMaterialName()).append(" 更新成功"); diff --git a/maintain-business/src/main/java/com/maintain/business/service/impl/ErpMaterialInventoryRecordServiceImpl.java b/maintain-business/src/main/java/com/maintain/business/service/impl/ErpMaterialInventoryRecordServiceImpl.java index 173aee3..7794f8a 100644 --- a/maintain-business/src/main/java/com/maintain/business/service/impl/ErpMaterialInventoryRecordServiceImpl.java +++ b/maintain-business/src/main/java/com/maintain/business/service/impl/ErpMaterialInventoryRecordServiceImpl.java @@ -89,7 +89,7 @@ public class ErpMaterialInventoryRecordServiceImpl implements IErpMaterialInvent .like(StringUtils.isNotBlank(bo.getMaterialCode()),"t.material_code", bo.getMaterialCode()) .like(null != bo.getVendorId(),"t.vendor_id", bo.getVendorId()) .like(null != bo.getWarehouseId(), "t.warehouse_id", bo.getWarehouseId()) - .in(!bo.getWarehouseIdList().isEmpty(), "t.warehouse_id", bo.getWarehouseIdList()) + .in(null != bo.getWarehouseIdList(), "t.warehouse_id", bo.getWarehouseIdList()) .ge(null != bo.getInventory(), "t.inventory", bo.getInventory()) .orderByDesc("t.create_time"); Page queryPageList = baseMapper.customQueryPageInventoryList(pageQuery.build(), query); diff --git a/maintain-ui/src/views/business/material/index.vue b/maintain-ui/src/views/business/material/index.vue index 8bbd9e6..b4a62ac 100644 --- a/maintain-ui/src/views/business/material/index.vue +++ b/maintain-ui/src/views/business/material/index.vue @@ -138,27 +138,28 @@ + - + + + - - - - - + + + - + @@ -168,7 +169,7 @@ - + @@ -202,7 +203,7 @@ /> - + @@ -236,14 +237,14 @@ - + - + @@ -281,10 +282,8 @@ - - - - + + @@ -304,6 +303,13 @@ + + + + + + + @@ -414,8 +420,7 @@ export default { materialSpecifications: undefined, materialUnit: undefined, materialWarrantyPeriod: undefined, - referencePrice: undefined, - sellingPrice: undefined, + manufacturer: undefined, inventory: undefined, isEnable: undefined, isUniversal: undefined, @@ -545,6 +550,7 @@ export default { materialSpecifications: undefined, materialUnit: undefined, materialBrand: undefined, + manufacturer: undefined, procurementSubject: undefined, compatibleWith: undefined, materialUrl: undefined, diff --git a/maintain-ui/src/views/business/materialPicking/add.vue b/maintain-ui/src/views/business/materialPicking/add.vue index e344afe..558935f 100644 --- a/maintain-ui/src/views/business/materialPicking/add.vue +++ b/maintain-ui/src/views/business/materialPicking/add.vue @@ -86,7 +86,7 @@ @@ -96,7 +96,7 @@ @@ -260,7 +260,7 @@ export default { }; }, created() { - this.form = {...this.$route.query} + this.form = {...this.$route.query, outMoney: undefined} this.getWarehouseList(this.form.repairerDeptId) this.getVendorList() }, @@ -289,7 +289,9 @@ export default { }, /** 供应商改变 */ vendorIdChange(vendorId) { - this.queryMaterialParams.vendorId = vendorId; + if (vendorId) { + this.queryMaterialParams.vendorId = vendorId; + } this.form.pickingInfoList = [] }, /** 打开物料列表 */ @@ -348,6 +350,7 @@ export default { item.money = item.collectNumber * item.sellingPrice return sum + (item.collectNumber * item.sellingPrice); }, 0) + console.log('outMoney', this.form.outMoney) }, // 多选框选中数据 handleMaterialSelectionChange(selection) { diff --git a/maintain-ui/src/views/business/materialPicking/index.vue b/maintain-ui/src/views/business/materialPicking/index.vue index ce86aba..58201bf 100644 --- a/maintain-ui/src/views/business/materialPicking/index.vue +++ b/maintain-ui/src/views/business/materialPicking/index.vue @@ -274,7 +274,7 @@ @@ -284,7 +284,7 @@ @@ -612,8 +612,8 @@ export default { // 入库数量变动 collectNumberChange() { this.form.outMoney = this.form.pickingInfoList.reduce((sum, item) => { - item.money = item.collectNumber * item.price - return sum + (item.collectNumber * item.price); + item.money = item.collectNumber * item.sellingPrice + return sum + (item.collectNumber * item.sellingPrice); }, 0) }, // 多选框选中数据 diff --git a/maintain-ui/src/views/business/materialPickingInfo/index.vue b/maintain-ui/src/views/business/materialPickingInfo/index.vue index 67bab58..9a37cbb 100644 --- a/maintain-ui/src/views/business/materialPickingInfo/index.vue +++ b/maintain-ui/src/views/business/materialPickingInfo/index.vue @@ -119,7 +119,7 @@ - + diff --git a/maintain-ui/src/views/business/materialPutaway/index.vue b/maintain-ui/src/views/business/materialPutaway/index.vue index 2a2b157..47a31bd 100644 --- a/maintain-ui/src/views/business/materialPutaway/index.vue +++ b/maintain-ui/src/views/business/materialPutaway/index.vue @@ -266,17 +266,17 @@ @@ -712,6 +712,19 @@ export default { this.buttonLoading = false; return } + + let vendorIsNull = false + this.form.putawayInfoList.forEach(item =>{ + if (!item.vendorId) { + vendorIsNull = true + } + }) + if (vendorIsNull) { + this.$modal.msgError('入库明细列表物料供应商不能为空') + this.buttonLoading = false; + return + } + this.form.putawayInfoList.forEach(item =>{ item.materialId = item.materialId || item.id }) diff --git a/maintain-ui/src/views/business/materialReturns/index.vue b/maintain-ui/src/views/business/materialReturns/index.vue index 3054c08..349f8f9 100644 --- a/maintain-ui/src/views/business/materialReturns/index.vue +++ b/maintain-ui/src/views/business/materialReturns/index.vue @@ -242,7 +242,7 @@ @@ -400,15 +400,15 @@ export default { // 退货数量更改 returnsNumberChange() { this.form.returnsMoney = this.materialList.reduce((sum, item) => { - item.returnsMoney = item.returnsNumber * item.returnsPrice - return sum + (item.returnsNumber * item.returnsPrice); + item.returnsMoney = parseFloat(item.returnsNumber) * parseFloat(item.returnsPrice) + return sum + (parseFloat(item.returnsNumber) * parseFloat(item.returnsPrice)); }, 0) }, // 入库明细删除 handleRowDelete(row) { this.materialList = this.materialList.filter(item => item.id !== row.id); this.form.returnsMoney = this.materialList.reduce((sum, item) => { - return sum + (item.returnsNumber * item.returnsPrice); + return sum + (parseFloat(item.returnsNumber) * parseFloat(item.returnsPrice)); }, 0) }, // 取消按钮 -- 2.22.0