diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java index 9cec974d..7e23b418 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java @@ -329,4 +329,8 @@ public class MesConstants { /**生产工单派工类型*/ public static final String MES_PRODUCT_ORDER_DISPATCH_TYPE_PRODUCE="1";//产线 public static final String MES_PRODUCT_ORDER_DISPATCH_TYPE_ROUTE="2";//工艺路线 + + /**MES删除标识(1否 0是)*/ + public static final String MES_IS_FLAG_YES="0"; + public static final String MES_IS_FLAG_NO="1"; } diff --git a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java index 7297383a..fe53f136 100644 --- a/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java +++ b/hw-modules/hw-jindie/src/main/java/com/hw/jindie/service/impl/KingdeeErpSyncServiceImpl.java @@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -1343,7 +1344,8 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { List toUpdatePurchaseReceiveBillList = new ArrayList<>(); List sysOperLogList = new ArrayList<>(); Date currentDate = new Date(); - StringBuilder notifyInfoBuilder = new StringBuilder("收料通知:"); + String lineSeparator = System.lineSeparator(); + StringBuilder notifyInfoBuilder = new StringBuilder("收料通知:").append(lineSeparator); Long projectErpId = null; String projectName = ""; try { @@ -1382,10 +1384,10 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { Long supplierId = resultObject.getLong("FSupplierId"); //交货数量 - BigDecimal actReceiveAmount = resultObject.getBigDecimal("FActReceiveQty"); + BigDecimal actReceiveAmount = resultObject.getBigDecimal("FActReceiveQty").setScale(2, RoundingMode.DOWN); //实到数量 - BigDecimal actlandAmount = resultObject.getBigDecimal("FActlandQty"); + BigDecimal actlandAmount = resultObject.getBigDecimal("FActlandQty").setScale(2, RoundingMode.DOWN);; //创建时间 @@ -1463,7 +1465,7 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService { notifyInfoBuilder.append("物料名称:").append(materialName).append("|物料规格:").append(materialSpec) .append("|实到数量:").append(actlandAmount).append("|预计到货日期:") .append(preDeliveryDate).append("|项目名称:").append(projectName) - .append(";"); + .append(";").append(lineSeparator); } // System.out.println("l:"+resultArray.get(i).toString().length()); diff --git a/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml b/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml index fcf063d3..54dec4ec 100644 --- a/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml +++ b/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesSaleOrderMapper.xml @@ -87,6 +87,7 @@ - SELECT max(erp_modify_date) FROM mes_sale_order order by erp_id,fentry_id + SELECT max(erp_modify_date) FROM mes_sale_order where is_flag = '1' order by erp_id,fentry_id - and supplier_code = #{supplierCode} + and supplier_code like concat('%', #{supplierCode}, '%') and supplier_name like concat('%', #{supplierName}, '%') and erp_id = #{erpId} and supplier_status = #{supplierStatus} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml index 83257050..89fb8437 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesOrderBindMapper.xml @@ -150,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_sale_order mso on mob.sale_order_id = mso.sale_order_id + mso.is_flag = '1' and mob.bind_amount=1 and mob.barcode_amount=0 and mso.order_amount=1 and mob.bind_amount > mob.barcode_amount and mob.safe_flag = #{safeFlag} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml index 8a4584b2..c9902466 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesPurchaseOrderMapper.xml @@ -416,7 +416,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mpo.order_amount, mpo.complete_amount, mpo.approve_date, mpo.erp_modify_date, mpo.plan_delivery_date, mpo.begin_date, mpo.end_date, mpo.order_status, mpo.complete_date, mpo.specification_parameter, mpo.src_bill_no, mpo.purchase_org_id, mpo.tond_base, - mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.always_flag,mpi.project_name + mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.always_flag,mpi.project_name, + IF((select count(*) from mes_order_bind mob where mob.purchase_order_id = mpo.purchase_order_id and mob.sale_order_id > 0) > 0, '1', '0') bindFlag from mes_purchase_order mpo left join mes_base_material_info mbmi on mpo.material_id =mbmi.erp_id left join mes_project_info mpi on mpo.tond_base=mpi.erp_id @@ -469,6 +470,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_sale_order mso on mob.sale_order_id = mso.sale_order_id + mso.is_flag = '1' and mob.bind_amount=1 and mob.barcode_amount=0 and mpo.order_amount=1 and mso.order_amount=1 and (mob.bind_amount > mob.barcode_amount or mbmi.always_flag='1') and mob.safe_flag = #{safeFlag} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml index 9140f171..e797844c 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderMapper.xml @@ -80,6 +80,7 @@ @@ -263,6 +263,7 @@ ((mso.material_id = mbmi.erp_id and (mso.sale_order_classfication='1' or mso.sale_order_classfication='3')) or (mso.material_id = mbmi.material_id and mso.sale_order_classfication='2')) left join mes_project_info mpi on mso.tond_base=mpi.erp_id + mso.is_flag = '1' and mso.saleorder_code like concat('%', #{saleorderCode}, '%') and mbmi.material_code like concat('%', #{materialCode}, @@ -279,7 +280,7 @@ and mso.sale_order_id = #{saleOrderId} and mso.sale_order_classfication = #{saleOrderClassfication} and exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id and msor.sale_order_id=#{virtualSaleOrderId}) - and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id) + and not exists (select 1 from mes_sale_order_relate msor where mso.sale_order_id = msor.relate_sale_order_id) and exists (select 1 from mes_material_bom mmb where mmb.erp_material_id=mso.material_id and mmb.material_bom_id in (${parentIds})) and mso.is_release in ('0','1','2') and mso.plan_delivery_date is not null and mso.plan_delivery_date < now() and mso.plan_delivery_date is not null and mso.plan_delivery_date >= now() diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml index e02f3854..08fffd4d 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductInstockMapper.xml @@ -255,7 +255,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_product_plan mpp on mpp.plan_code = wpi.plan_code left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id - where wpi.product_type = '3' + where mso.is_flag = '1' + and wpi.product_type = '3' and wpi.execute_status = '2' and (wpi.erp_status is null or wpi.erp_status != '1') and wpi.instock_amount > if(wpi.erp_amount is null, 0, wpi.erp_amount) diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml index f76094f7..124abe8c 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductOutstockMapper.xml @@ -332,7 +332,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_material_info mbmi on mbmi.material_id = wpo.product_id left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_sale_order mso on mso.sale_order_id = wpo.sale_order_id - where wpo.outstock_type = '1' + where mso.is_flag = '1' + and wpo.outstock_type = '1' and wpo.outstock_qty > 0 and wpo.apply_qty >= wpo.outstock_qty and wpo.outstock_qty > if(wpo.erp_amount is null, 0, wpo.erp_amount) diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml index 2b70aa70..011a601a 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockMapper.xml @@ -278,7 +278,7 @@ left join wms_base_warehouse wbw on wps.warehouse_id=wbw.warehouse_id left join mes_sale_order mso on wps.sale_order_id=mso.sale_order_id - wps.total_amount>0 and wps.stock_type='3' + mso.is_flag = '1' and wps.total_amount>0 and wps.stock_type='3' and mso.saleorder_code = #{saleorderCode} and wps.warehouse_id = #{warehouseId} and wps.product_id = #{productId} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml index 0da1236c..b484d0cf 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsProductStockSaleorderMapper.xml @@ -145,11 +145,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select wpss.product_stock_saleorder_id, wpss.warehouse_id, wpss.warehouse_floor, wpss.stock_type, wpss.product_id, wpss.saleorder_code, wpss.total_amount,wpss.apply_amount, wpss.occupy_amount,wpss.frozen_amount,wpss.outstock_amount, wpss.confirm_amount, mso.order_amount,wbw.warehouse_name,mbmi.material_code,mbmi.material_name - from wms_product_stock_saleorder wpss left join mes_sale_order mso on wpss.sale_order_id = mso.sale_order_id + from wms_product_stock_saleorder wpss + left join mes_sale_order mso on wpss.sale_order_id = mso.sale_order_id left join wms_base_warehouse wbw on wpss.warehouse_id=wbw.warehouse_id left join mes_base_material_info mbmi on mbmi.material_id=wpss.product_id - + mso.is_flag = '1' and wpss.saleorder_code = #{saleorderCode} and wpss.warehouse_id = #{warehouseId} and wpss.product_id = #{productId} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml index 8f9a68a0..231f8e95 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawInstockMapper.xml @@ -205,8 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and wri.apply_by like concat('%', #{applyBy}, '%') and mbmi.material_code like concat('%', #{materialCode}, '%') and mbmi.material_name like concat('%', #{materialName}, '%') - - + and wri.erp_status = #{erpStatus} order by wri.apply_date desc diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml index 304aec2d..71ccc0d2 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawOutstockMapper.xml @@ -265,10 +265,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select wro.raw_outstock_id, wro.task_code, wro.warehouse_id, wro.location_code, wro.order_id, wro.plan_code, wro.plan_detail_code, wro.station_id,wro.material_batch, wro.material_id, wro.operation_type, wro.task_type, wro.apply_reason, wro.audit_reason, wro.audit_status, wro.execute_status, wro.apply_by, wro.apply_date, wro.audit_by, wro.audit_date, wro.update_by, wro.update_date, wro.begin_time, wro.end_time,wro.outstock_amount,wro.real_outstock_amount,wbw.warehouse_name - ,mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbui.unit_name + ,mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbui.unit_name, wrod.erp_status, wrod.erp_amount from wms_raw_outstock wro left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id - left join mes_base_material_info mbmi on wro.material_id=mbmi.material_id + left join mes_base_material_info mbmi on wro.material_id=mbmi.material_id left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id + left join (select raw_outstock_id, max(erp_status) erp_status, max(erp_amount) erp_amount + from wms_raw_outstock_detail + group by raw_outstock_id) wrod on wro.raw_outstock_id = wrod.raw_outstock_id and wro.task_code like concat('%', #{taskCode}, '%') and wro.warehouse_id = #{warehouseId} @@ -282,6 +285,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mbmi.material_code like concat('%', #{materialCode}, '%') and mbmi.material_name like concat('%', #{materialName}, '%') and mbmi.material_spec like concat('%', #{materialSpec}, '%') + and wrod.erp_status = #{erpStatus} order by wro.apply_date desc @@ -387,9 +391,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id left join mes_product_plan mpp on mpp.plan_code = wro.plan_code left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id - - wro.real_outstock_amount > 0 + mso.is_flag = '1' + and wro.real_outstock_amount > 0 and wro.outstock_amount >= wro.real_outstock_amount and wro.real_outstock_amount > if(wro.erp_amount is null, 0, wro.erp_amount) and mbmi.material_classfication = '1' diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml index ee37c382..96f4a215 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsRawStockMapper.xml @@ -325,6 +325,7 @@ left join mes_sale_order mso on wrs.sale_order_id = mso.sale_order_id left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id + mso.is_flag = '1' and wrs.warehouse_id = #{warehouseId} and wrs.location_code = #{locationCode} and wrs.stock_type = #{stockType} diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml index c2a43812..df69fb1e 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml @@ -273,7 +273,7 @@ left join mes_sale_order mso on wst.sale_order_id = mso.sale_order_id left join mes_base_unit_info mbui on mbmi.material_unit_id = mbui.erp_id - wst.total_amount > 0 + mso.is_flag = '1' and wst.total_amount > 0 and wst.warehouse_id = #{warehouseId} and wst.warehouse_floor = #{warehouseFloor} and wst.stock_type = #{stockType} @@ -327,6 +327,7 @@ left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id left join mes_sale_order mso on wst.sale_order_id=mso.sale_order_id + mso.is_flag = '1' and wst.warehouse_id = #{warehouseId} and wst.warehouse_floor = #{warehouseFloor} and wbw.warehouse_type = #{warehouseType} diff --git a/hw-ui/src/api/mes/barcode.js b/hw-ui/src/api/mes/barcode.js index b46a4b49..6aa35302 100644 --- a/hw-ui/src/api/mes/barcode.js +++ b/hw-ui/src/api/mes/barcode.js @@ -197,3 +197,12 @@ export function listPrdBarcode(query) { params: query }) } + +// 批量新增条码信息 +export function batchAddBarcode(data) { + return request({ + url: '/mes/barcode/batchAdd', + method: 'post', + data: data + }) +} diff --git a/hw-ui/src/views/mes/barcode/index.vue b/hw-ui/src/views/mes/barcode/index.vue index 4ea41a6d..3b2f09d2 100644 --- a/hw-ui/src/views/mes/barcode/index.vue +++ b/hw-ui/src/views/mes/barcode/index.vue @@ -132,7 +132,17 @@ >固定条码新增 - + + 采购批量新增 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -720,7 +828,7 @@ import { listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode, reprintBarcodes, printBarcodes, getMaterialInfoByErpId, selectProductBarcodeInfoByBarcodeInfo, addInternalBarcode, regenerateBarcode, checkRawStock, addNoPurchaseBarcode, addRegularBarcode, - mergeAddBarcode, mergeUpdateBarcode + mergeAddBarcode, mergeUpdateBarcode, batchAddBarcode } from "@/api/mes/barcode"; import {checkWarehouseMaterials} from "@/api/wms/wmswarehouse"; @@ -728,6 +836,7 @@ import {checkWarehouseMaterials} from "@/api/wms/wmswarehouse"; import selectOrderBind from '@//views/mes/purchaseOrder/selectOrderBind.vue'; import selectMaterial from '@//views/mes/materialinfo/selectMaterial.vue'; import selectPurchaseOrder from '@//views/mes/purchaseOrder/addPurchaseOrder.vue'; +import addMultiplePurchaseOrder from '@//views/mes/purchaseOrder/addMultiplePurchaseOrder.vue'; export default { name: "Barcode", @@ -736,6 +845,7 @@ export default { 'select-orderBind': selectOrderBind, 'select-material': selectMaterial, 'select-purchaseOrder': selectPurchaseOrder, + 'add-multiple-purchaseOrder': addMultiplePurchaseOrder, }, data() { @@ -757,8 +867,8 @@ export default { barcodeList: [], // 是否显示采购订单弹出层 onlyPurchaseOrderOpen: false, - purchaseOrderOpen: false, + batchPurchaseOrderOpen: false, //是否显示选择物料弹出层 selectMaterialVisible: false, // 弹出层标题 @@ -971,6 +1081,19 @@ export default { REGULAR: "9" }, + batchOpen: false, + batchTitle: "采购批量新增", + batchForm: { + mesPurchaseOrderList: [], + poNo: undefined + }, + batchRules: { + poNo: [ + { required: true, message: "采购订单不能为空", trigger: "blur" } + ] + }, + // 选中的采购订单数据 + checkedPurchaseOrders: [], }; }, created() { @@ -1119,7 +1242,7 @@ export default { } let unavailableAmountResult = selectedRows.find(item => { - return parseInt(item.relateSaleOrderAmount) !== 1; + return item.relateSaleOrderAmount !== 1; }); if (unavailableAmountResult != null && unavailableAmountResult !== '') { @@ -1222,6 +1345,7 @@ export default { submitSingleSelectPurchaseOrder() { let selectedRow = this.$refs.purchaseOrderRef.selectedRow; + console.log("selectedRow",selectedRow) this.form.batchFlag = null; this.form.amount = null; this.form.receiveBillId = null; @@ -1262,7 +1386,7 @@ export default { } //本次可用条码数量 - this.form.availableBindAmount = parseInt(selectedRow.relateSaleOrderAmount); + this.form.availableBindAmount = Math.ceil(selectedRow.relateSaleOrderAmount); this.form.orderBindId = selectedRow.orderBindId; //本次生成条码总数量 this.form.barcodeAmount = null; @@ -1910,6 +2034,144 @@ export default { this.onlyPurchaseOrderOpen = false; }, + handleBatchAdd() { + this.resetBatch(); + this.batchOpen = true; + this.title = "采购批量新增"; + }, + + resetBatch() { + this.batchForm = { + mesPurchaseOrderList: [], + poNo: undefined + }; + this.resetForm("batchForm"); + }, + + /** 批量选择采购订单按钮操作 */ + handleBatchPurchaseOrderAdd() { + this.barcodeData = {mergeFlag: null}; + this.batchPurchaseOrderOpen = true; + }, + + /** 复选框选中数据 */ + handleMesPurchaseOrderSelectionChange(selection) { + this.checkedPurchaseOrders = selection; + }, + + rowMesPurchaseOrderIndex({row, rowIndex}) { + row.index = rowIndex + 1; + }, + + /** 提交按钮 */ + submitBatchForm() { + this.$refs["batchForm"].validate(valid => { + if (valid) { + // 验证必填项 + const invalidRow = this.batchForm.mesPurchaseOrderList.find(row => { + return !row.productionDate || !row.lastOutstockDate; + }); + + if (invalidRow) { + this.$modal.msgError("请填写所有行的生产日期和最晚出库日期"); + return; + } + + // 验证条码数量 + const invalidAmount = this.batchForm.mesPurchaseOrderList.find(row => { + return !row.barcodeAmount || row.barcodeAmount <= 0; + }); + + if (invalidAmount) { + this.$modal.msgError("请填写有效的条码数量"); + return; + } + + this.submitLoading = true; + + batchAddBarcode(this.batchForm.mesPurchaseOrderList).then(response => { + this.$modal.msgSuccess("新增成功"); + this.cancelBatch(); + this.getList(); + }).finally(e => { + this.submitLoading = false; + }); + + } + }); + }, + + cancelBatch() { + this.batchOpen = false; + this.resetBatchForm(); + }, + + /** 提交批量采购订单选择 */ + submitBatchPurchaseOrderForm() { + let selectedRows = this.$refs.purchaseOrderRef.selectedRows; + console.log("selectedRows",selectedRows) + + if (!selectedRows || selectedRows.length <= 0) { + this.$modal.msgWarning("请选择采购订单"); + return; + } + + let firstRow = selectedRows[0]; + let firstRowPoNo = firstRow.poNo; + + // 检查可用数量 + let unavailableAmountResult = selectedRows.find(item => { + return item.relateSaleOrderAmount <= 0; + }); + + if (unavailableAmountResult != null && unavailableAmountResult !== '') { + this.$modal.msgError("存在可用数量为0的数据"); + return; + } + + // 添加到表格数据 + selectedRows.forEach(selectedRow => { + let purchaseOrder = {} + purchaseOrder.poNo = selectedRow.poNo; + purchaseOrder.barcodeType = '1';//条码类型(1原材料,2半成品,3成品,4背板) + purchaseOrder.materialId = selectedRow.materialId;//物料信息表中物料ID主键 + purchaseOrder.materialCode = selectedRow.materialCode; + purchaseOrder.materialName = selectedRow.materialName; + purchaseOrder.materialSpec = selectedRow.materialSpec; + purchaseOrder.projectNo = selectedRow.projectNo; + purchaseOrder.receiveBillId = selectedRow.receiveBillId; + purchaseOrder.purchaseOrderId = selectedRow.purchaseOrderId; + purchaseOrder.currentSafeBindAmount = 0; + if (selectedRow.specificationParameter && selectedRow.specificationParameter !== '') { + purchaseOrder.barcodeSpec = selectedRow.specificationParameter; + } else { + purchaseOrder.barcodeSpec = selectedRow.materialSpec; + } + + //本次可用条码数量 + purchaseOrder.availableBindAmount = Math.ceil(selectedRow.relateSaleOrderAmount); + purchaseOrder.orderBindId = selectedRow.orderBindId; + //本次生成条码总数量 + purchaseOrder.barcodeAmount = null; + purchaseOrder.batchFlag = selectedRow.batchFlag; + purchaseOrder.amount = selectedRow.batchAmount; + purchaseOrder.saleBatchFlagDisable = !!purchaseOrder.batchFlag; + + this.batchForm.mesPurchaseOrderList.push(purchaseOrder); + }); + + this.batchForm.poNo = firstRowPoNo; + this.batchPurchaseOrderOpen = false; + }, + + resetBatchForm() { + this.batchForm = { + mesPurchaseOrderList: [], + poNo: undefined + }; + this.$refs["batchForm"].resetFields(); + }, + } }; diff --git a/hw-ui/src/views/mes/mesRaiseCapitalBom/index.vue b/hw-ui/src/views/mes/mesRaiseCapitalBom/index.vue index 807e629e..87ef6b92 100644 --- a/hw-ui/src/views/mes/mesRaiseCapitalBom/index.vue +++ b/hw-ui/src/views/mes/mesRaiseCapitalBom/index.vue @@ -482,9 +482,12 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { - if (!/^[0-9]\d*$/.test(this.form.productionTimeDays) - || !/^[0-9]\d*$/.test(this.form.productionTimeHours) - || !/^[0-9]\d*$/.test(this.form.productionTimeMinutes)) { + console.log(this.form) + if ( + (this.form.productionTimeDays !== undefined && !/^[0-9]\d*$/.test(this.form.productionTimeDays)) || + (this.form.productionTimeHours !== undefined && !/^[0-9]\d*$/.test(this.form.productionTimeHours)) || + (this.form.productionTimeMinutes !== undefined && !/^[0-9]\d*$/.test(this.form.productionTimeMinutes)) + ) { this.$modal.msgError("安装时长天、小时、分钟需为大于等于0的正整数!"); return; } diff --git a/hw-ui/src/views/mes/purchaseOrder/addMultiplePurchaseOrder.vue b/hw-ui/src/views/mes/purchaseOrder/addMultiplePurchaseOrder.vue new file mode 100644 index 00000000..c95b3d50 --- /dev/null +++ b/hw-ui/src/views/mes/purchaseOrder/addMultiplePurchaseOrder.vue @@ -0,0 +1,362 @@ + + + diff --git a/hw-ui/src/views/mes/purchaseOrder/bindOrder.vue b/hw-ui/src/views/mes/purchaseOrder/bindOrder.vue index 7050c68d..094a0852 100644 --- a/hw-ui/src/views/mes/purchaseOrder/bindOrder.vue +++ b/hw-ui/src/views/mes/purchaseOrder/bindOrder.vue @@ -289,7 +289,7 @@ export default { let totalBindAmount = 0; for (let i = 0; i < this.mesOrderBindList.length; i++) { let mob = this.mesOrderBindList[i]; - let bindAmount = mob.bindAmount ? parseInt(mob.bindAmount) : 0; + let bindAmount = mob.bindAmount ? mob.bindAmount : 0; let barcodeAmount = mob.barcodeAmount ? parseInt(mob.barcodeAmount) : 0; if (!mob.safeFlag) { diff --git a/hw-ui/src/views/mes/purchaseOrder/index.vue b/hw-ui/src/views/mes/purchaseOrder/index.vue index 5b67f47b..405afc0f 100644 --- a/hw-ui/src/views/mes/purchaseOrder/index.vue +++ b/hw-ui/src/views/mes/purchaseOrder/index.vue @@ -144,7 +144,7 @@ - + @@ -590,7 +590,20 @@ export default { }).then(() => { this.$modal.msgSuccess("执行成功"); }).catch(() => {}); - } + }, + + tableRowClassName({row}) { + //绿色背景采购订单绑定已销售订单 + if (row.bindFlag === '1') { + return 'success-row'; + } + return ''; + }, } }; + diff --git a/hw-ui/src/views/mes/purchaseOrder/selectOrderBind.vue b/hw-ui/src/views/mes/purchaseOrder/selectOrderBind.vue index 4766f1ee..2c079605 100644 --- a/hw-ui/src/views/mes/purchaseOrder/selectOrderBind.vue +++ b/hw-ui/src/views/mes/purchaseOrder/selectOrderBind.vue @@ -302,7 +302,7 @@ export default { getPurchaseOrdersWithBind(this.queryParams).then(response => { response.rows.forEach(e => { if(e.orderBindId){ - e.relateSaleOrderAmount = parseInt(e.bindAmount - e.barcodeAmount); + e.relateSaleOrderAmount = e.bindAmount - e.barcodeAmount; } }); diff --git a/hw-ui/src/views/mes/saleOrder/index.vue b/hw-ui/src/views/mes/saleOrder/index.vue index 3624996b..8bf52ed3 100644 --- a/hw-ui/src/views/mes/saleOrder/index.vue +++ b/hw-ui/src/views/mes/saleOrder/index.vue @@ -273,7 +273,14 @@ v-hasPermi="['mes:saleOrder:used']" v-if="scope.row.saleOrderClassfication==='1' || scope.row.saleOrderClassfication==='3'" >物料使用 - + 删除 @@ -458,7 +465,14 @@