diff --git a/maintain-business/src/main/java/com/maintain/business/service/impl/ErpRepairFormServiceImpl.java b/maintain-business/src/main/java/com/maintain/business/service/impl/ErpRepairFormServiceImpl.java index 442d23206cbb7cf78e4ee3eb08a140390213a673..2ce6187f974731164561369f56bd7ce6d0724869 100644 --- a/maintain-business/src/main/java/com/maintain/business/service/impl/ErpRepairFormServiceImpl.java +++ b/maintain-business/src/main/java/com/maintain/business/service/impl/ErpRepairFormServiceImpl.java @@ -311,9 +311,11 @@ public class ErpRepairFormServiceImpl implements IErpRepairFormService { .eq(ErpMaterialPickingInfo::getRepairFormId, repairForm.getId()) ); // 删除库存记录表数据 - LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.lambdaUpdate(); - lambdaUpdateWrapper.in(ErpMaterialInventoryRecord::getInfoId, pickingInfoIds); - materialInventoryRecordMapper.delete(lambdaUpdateWrapper); + if (!pickingInfoIds.isEmpty()) { + LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.lambdaUpdate(); + lambdaUpdateWrapper.in(ErpMaterialInventoryRecord::getInfoId, pickingInfoIds); + materialInventoryRecordMapper.delete(lambdaUpdateWrapper); + } } return flag; } diff --git a/maintain-business/src/main/resources/mapper/ErpRepairFormMapper.xml b/maintain-business/src/main/resources/mapper/ErpRepairFormMapper.xml index 574f83278e9d5dec8ecd8428c381b3e6ac91ebd5..5ae045b7344c26615e7522b0665e2450def282d6 100644 --- a/maintain-business/src/main/resources/mapper/ErpRepairFormMapper.xml +++ b/maintain-business/src/main/resources/mapper/ErpRepairFormMapper.xml @@ -172,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ( SELECT repair_form_id, SUM(money) AS totalMaterialMoney FROM erp_material_picking_info + WHERE state != 3 GROUP BY repair_form_id ) empi ON erf.id = empi.repair_form_id diff --git a/maintain-ui/src/views/business/materialPicking/add.vue b/maintain-ui/src/views/business/materialPicking/add.vue index 4268661356a2e905850c45e1408667a682cb6f82..395b9a7052875beb689f56d4a4aede9f10c0c5b7 100644 --- a/maintain-ui/src/views/business/materialPicking/add.vue +++ b/maintain-ui/src/views/business/materialPicking/add.vue @@ -86,7 +86,7 @@ @@ -380,16 +380,26 @@ export default { this.$modal.msgError('出库明细列表不能为空') return } - let isTrue = false + let isUndefined = false this.form.pickingInfoList.forEach(item =>{ - if (!item.collectNumber) { - isTrue = true + if (item.collectNumber === undefined) { + isUndefined = true } }) - if (isTrue) { + if (isUndefined) { this.$modal.msgError('领料数量不能为空') return } + let isValidNumber = false + this.form.pickingInfoList.forEach(item => { + if (item.collectNumber < 0.01) { + isValidNumber = true + } + }) + if (isValidNumber) { + this.$modal.msgError('出库物料数量不能为[0.00]') + return + } this.form.materialList = this.form.pickingInfoList.map(item =>{ return { recordId: item.recordId, diff --git a/maintain-ui/src/views/business/materialPicking/index.vue b/maintain-ui/src/views/business/materialPicking/index.vue index 34df710196fcbc86e59ef2fd627ab559ada6d5b0..72713d498b99ba675c20095abf2b9d5825aa103b 100644 --- a/maintain-ui/src/views/business/materialPicking/index.vue +++ b/maintain-ui/src/views/business/materialPicking/index.vue @@ -274,7 +274,7 @@ @@ -759,6 +759,26 @@ export default { this.$modal.msgError('出库物料列表不能为空') return } + let isUndefined = false + this.form.pickingInfoList.forEach(item =>{ + if (item.collectNumber === undefined) { + isUndefined = true + } + }) + if (isUndefined) { + this.$modal.msgError('领料数量不能为空') + return + } + let isValidNumber = false + this.form.pickingInfoList.forEach(item => { + if (item.collectNumber < 0.01) { + isValidNumber = true + } + }) + if (isValidNumber) { + this.$modal.msgError('出库物料数量不能为[0.00]') + return + } this.form.materialList = this.form.pickingInfoList.map(item =>{ return { recordId: item.recordId,