From 1c60718e8c8f0af6ad18bb822c1e2e8430a7fbf3 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Tue, 20 Jun 2023 16:44:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REV=20=E5=8D=95=E5=B7=A5NDC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auto/run/NDCSocketConnectionAutoRun.java | 10 ++-- .../run/OneNDCSocketConnectionAutoRun.java | 11 ++--- .../HailiangAutoCacheLineDeviceDriver.java | 1 - .../StandardOrdinarySiteDeviceDriver.java | 49 ++++++------------- .../service/InstructionService.java | 1 + 5 files changed, 25 insertions(+), 47 deletions(-) diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java index 8e594e87..92d6a46a 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/NDCSocketConnectionAutoRun.java @@ -148,17 +148,17 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { } } } - } else if (phase == 0x1A) { - instructionService.finishByLinkNum(String.valueOf(ikey)); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } else if (phase == 0x30) { + }else if (phase == 0x30) { //请求删除任务 data = ndcAgvService.sendAgvTwoModeInst(143, index, 0); } else if (phase == 0xFF) { //任务删除确认 instructionService.forceCancelByLinkNum(String.valueOf(ikey)); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } else { + } else if (phase == 0x1A) { + instructionService.finishByLinkNum(String.valueOf(ikey)); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + } else { if (phase == 0x67) { //agv上报异常 device = deviceAppService.findDeviceByCode(Integer.toString(arr[27])); diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java index 85f50117..53d8bfb6 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java @@ -115,16 +115,13 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { } data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); } - } else if (phase == 0x0A) { - - instructionService.finishByLinkNum(String.valueOf(ikey)); - data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); - } else if (phase == 0x30) { data = ndcAgvService.sendAgvOneModeInst(143, index, 0); - } else if (phase == 0xFF) { - instructionService.cancelByLinkNum(String.valueOf(ikey)); + instructionService.forceCancelByLinkNum(String.valueOf(ikey)); + data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); + } else if (phase == 0x0A) { + instructionService.finishByLinkNum(String.valueOf(ikey)); data = ndcAgvService.sendAgvOneModeInst(phase, index, 0); } else if (phase == 0x50) { //离开区域 diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java index 95c1dd7d..9619de75 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/hailiang_one/hailiang_auto_cache_line/HailiangAutoCacheLineDeviceDriver.java @@ -163,7 +163,6 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i this.index = index; this.inst = inst; logServer.deviceExecuteLog(device_code, "", "", "设置phase值--->" + agvphase + ",index值--->" + index + ",指令信息关联编号--->" + (inst == null ? "" : inst.getLink_num())); - } @Override diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index 2b57252c..c91dc494 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -6,8 +6,10 @@ import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.acs.acsEnum.InstActionEnum; import org.nl.acs.agv.server.AgvService; import org.nl.acs.agv.server.NDCAgvService; +import org.nl.acs.auto.run.OneNDCSocketConnectionAutoRun; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver; @@ -122,6 +124,7 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple this.agvphase = agvphase; this.index = index; this.inst = inst; + logServer.deviceExecuteLog(device_code, "", "", "设置phase值--->" + agvphase + ",index值--->" + index + ",指令信息关联编号--->" + (inst == null ? "" : inst.getLink_num())); } int mode = 2; @@ -136,63 +139,41 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple if (agvphase == 0x03) { if (ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("1"); + inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET.getCode()); instructionService.update(inst); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); - + OneNDCSocketConnectionAutoRun.write(data); + this.set(0, 0, null); } } if (agvphase == 0x05) { if (ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("2"); + inst.setExecute_status(InstActionEnum.EXECUTE_GET_FINISH.getCode()); instructionService.update(inst); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); -// OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); - + OneNDCSocketConnectionAutoRun.write(data); + this.set(0, 0, null); } } if (agvphase == 0x07) { if (ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("5"); + inst.setExecute_status(InstActionEnum.EXECUTE_TO_PUT_FALL_SEND_FULL.getCode()); instructionService.update(inst); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); -// OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); + OneNDCSocketConnectionAutoRun.write(data); + this.set(0, 0, null); } } if (agvphase == 0x09) { if (ObjectUtil.isNotEmpty(inst)) { - inst.setExecute_status("6"); + inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode()); instructionService.update(inst); byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0); -// OneNDCSocketConnectionAutoRun.write(data); - agvphase = 0; - index = 0; - inst = null; - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "反馈成功"); - } else { - logServer.deviceExecuteLog(this.device_code, "", "", "agvphase:" + agvphase + "等待反馈"); - + OneNDCSocketConnectionAutoRun.write(data); + this.set(0, 0, null); } } diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java index b0622e69..b976164b 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -199,6 +199,7 @@ public interface InstructionService { */ void cancelByLinkNum(String linkNum) throws Exception; + /** * 根据指令Id强制取消指令 * From f02f3e063edb7507602ac0e0f753df6b363a65d8 Mon Sep 17 00:00:00 2001 From: liuxy Date: Tue, 20 Jun 2023 17:31:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix=EF=BC=9A=E6=88=90=E5=93=81=E5=87=BA?= =?UTF-8?q?=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/mapper/xml/MpsSaleOrderMapper.xml | 6 +- .../org/nl/wms/storage_manage/IOSEnum.java | 4 +- .../impl/StIvtIostorinvCpOutServiceImpl.java | 20 +++ .../impl/StIvtIostorinvCpServiceImpl.java | 14 ++ .../impl/StIvtIostorinvdtlCpServiceImpl.java | 25 ++++ .../moreOrLess/dao/StIfDeliveryorderCp.java | 2 + mes/qd/src/components/Crud/crud.js | 4 +- .../product/productIn/AddDialog.vue | 48 ++++--- .../product/productIn/AddDtl.vue | 34 ++++- .../product/productIn/index.vue | 7 +- .../product/productOut/AddDialog.vue | 136 ++++++++++-------- .../product/productOut/AddDtl.vue | 24 +++- .../product/productOut/AddIvt.vue | 23 ++- 13 files changed, 251 insertions(+), 96 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/ordermanage/service/saleOrder/dao/mapper/xml/MpsSaleOrderMapper.xml b/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/ordermanage/service/saleOrder/dao/mapper/xml/MpsSaleOrderMapper.xml index abcdf4bd..2d2e221c 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/ordermanage/service/saleOrder/dao/mapper/xml/MpsSaleOrderMapper.xml +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/mps_manage/ordermanage/service/saleOrder/dao/mapper/xml/MpsSaleOrderMapper.xml @@ -20,13 +20,13 @@ and der.sale_code = #{query.sale_code} - and der.status >= #{query.status} + and der.status = #{query.status} - and der.sale_type >= #{query.sale_type} + and der.sale_type = #{query.sale_type} - and der.cust_code >= #{query.cust_code} + and der.cust_code = #{query.cust_code} diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/IOSEnum.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/IOSEnum.java index 022ba03b..5c7b0ba5 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/IOSEnum.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/IOSEnum.java @@ -26,8 +26,10 @@ public enum IOSEnum { , "领料出库", "21", "销售出库", "22", "手工出库", "23")), //单据状态 BILL_STATUS(MapOf.of("生成", "10", "分配中", "20", "分配完", "30", "完成", "99")), - //单据状态 + //分配单据状态 WORK_STATUS(MapOf.of("未生成", "00", "生成", "10", "执行中", "20", "完成", "99")), + //订单/发货单 状态 + ORDER_STATUS(MapOf.of("生成", "10", "提交", "20", "发货中", "30", "确认", "99")), //锁定类型 LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","其他锁","99")), ; diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java index a40bda7a..eadbfacb 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java @@ -49,6 +49,8 @@ import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostor import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery; +import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIfDeliveryorderCpService; +import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIfDeliveryorderCp; import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService; import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp; import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil; @@ -113,6 +115,9 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl list = iostorinvdtlCpService.list( + new QueryWrapper().lambda() + .eq(StIvtIostorinvdtlCp::getIostorinv_id, id) + ); + + list.forEach(item -> { + iStIfDeliveryorderCpService.update( + new UpdateWrapper().lambda() + .set(StIfDeliveryorderCp::getStatus, IOSEnum.ORDER_STATUS.code("生成")) + .eq(StIfDeliveryorderCp::getDeliver_id, item.getSource_billdtl_id()) + ); + }); + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java index 9f5b8e98..08f4d6cf 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java @@ -366,6 +366,20 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl list = iostorinvdtlCpService.list( + new QueryWrapper().lambda() + .eq(StIvtIostorinvdtlCp::getIostorinv_id, id) + ); + + list.forEach(item -> { + iMpsSaleOrderService.update( + new UpdateWrapper().lambda() + .set(MpsSaleOrder::getStatus, IOSEnum.ORDER_STATUS.code("生成")) + .eq(MpsSaleOrder::getSale_id, item.getBase_billdtl_id()) + ); + }); } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvdtlCpServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvdtlCpServiceImpl.java index 5d7a7d9b..be88c7c0 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvdtlCpServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvdtlCpServiceImpl.java @@ -16,11 +16,15 @@ import org.nl.wms.mps_manage.ordermanage.service.saleOrder.IMpsSaleOrderService; import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.MpsSaleOrder; import org.nl.wms.storage_manage.IOSEnum; import org.nl.wms.storage_manage.IVTEnum; +import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService; import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdtlCpService; +import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisCp; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp; import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvdtlCpMapper; +import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIfDeliveryorderCpService; +import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIfDeliveryorderCp; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -57,6 +61,11 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl list) { @@ -69,6 +78,8 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl0 && StringUtils.isNotEmpty(iostorinvCp_id)){ // 先删除在插入 this.remove(new QueryWrapper().eq("iostorinv_id", iostorinvCp_id)); @@ -94,6 +105,20 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl().lambda() + .set(StIfDeliveryorderCp::getStatus, IOSEnum.ORDER_STATUS.code("提交")) + .eq(StIfDeliveryorderCp::getDeliver_id,row.getSource_billdtl_id()) + ); + } + } row.setIostorinv_id(iostorinvCp_id); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/moreOrLess/dao/StIfDeliveryorderCp.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/moreOrLess/dao/StIfDeliveryorderCp.java index 14f1ffa8..18aadf74 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/moreOrLess/dao/StIfDeliveryorderCp.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/moreOrLess/dao/StIfDeliveryorderCp.java @@ -1,5 +1,6 @@ package org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -26,6 +27,7 @@ public class StIfDeliveryorderCp implements Serializable { /** * 发货单标识 */ + @TableId private String deliver_id; /** diff --git a/mes/qd/src/components/Crud/crud.js b/mes/qd/src/components/Crud/crud.js index afb52210..4ae96be9 100644 --- a/mes/qd/src/components/Crud/crud.js +++ b/mes/qd/src/components/Crud/crud.js @@ -56,7 +56,7 @@ function CRUD(options) { reset: true }, // 自定义一些扩展属性 - props: {}, + props: { size: 10 }, // 在主页准备 queryOnPresenterCreated: true, // 调试开关 @@ -97,7 +97,7 @@ function CRUD(options) { // 页码 page: 0, // 每页数据条数 - size: 10, + size: options.props.size, // 总数据条数 total: 0 }, diff --git a/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue b/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue index 2e1b4018..20970af2 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue @@ -219,6 +219,7 @@ @@ -368,30 +369,33 @@ export default { this.nowrow.qty_unit_name = row.unit_name this.nowrow.qty_unit_id = row.base_unit_id }, - tableChanged2(row) { - let same_mater = true - this.form.tableData.forEach((item) => { - if (item.base_bill_code === row.sale_code && item.base_bill_table === row.seq_no) { - same_mater = false + tableChanged2(rows) { + rows.forEach((row) => { + debugger + let same_mater = true + this.form.tableData.forEach((item) => { + if (item.base_bill_code === row.sale_code && item.base_bill_table === row.seq_no) { + same_mater = false + } + }) + if (same_mater) { + const data = {} + data.material_id = row.material_id + data.material_code = row.material_code + data.material_name = row.material_name + data.material_spec = row.material_spec + data.plan_qty = row.sale_qty + data.qty_unit_name = row.qty_unit_name + data.qty_unit_id = row.qty_unit_id + data.base_billdtl_id = row.sale_id + data.base_bill_type = row.sale_type + data.base_bill_code = row.sale_code + data.base_bill_table = row.seq_no + data.edit = true + this.form.tableData.splice(-1, 0, data) + this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty) } }) - if (same_mater) { - const data = {} - data.material_id = row.material_id - data.material_code = row.material_code - data.material_name = row.material_name - data.material_spec = row.material_spec - data.plan_qty = row.sale_qty - data.qty_unit_name = row.qty_unit_name - data.qty_unit_id = row.qty_unit_id - data.base_billdtl_id = row.sale_id - data.base_bill_type = row.sale_type - data.base_bill_code = row.sale_code - data.base_bill_table = row.seq_no - data.edit = true - this.form.tableData.splice(-1, 0, data) - this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty) - } }, insertEvent(row) { this.dtlShow = true diff --git a/mes/qd/src/views/wms/storage_manage/product/productIn/AddDtl.vue b/mes/qd/src/views/wms/storage_manage/product/productIn/AddDtl.vue index 18fd6447..b8905c7f 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productIn/AddDtl.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productIn/AddDtl.vue @@ -61,10 +61,12 @@ v-loading="crud.loading" :data="crud.data" style="width: 100%;" + @select="handleSelectionChange" @selection-change="crud.selectionChangeHandler" @current-change="clickChange" > - + + @@ -127,6 +129,10 @@ export default { }, opendtlParam: { type: Object + }, + isSingle: { + type: Boolean, + default: true } }, data() { @@ -150,6 +156,7 @@ export default { return true }, open() { + this.query.status = '10' this.crud.toQuery() }, close() { @@ -158,10 +165,31 @@ export default { clickChange(item) { this.tableRadio = item }, + handleSelectionChange(val, row) { + if (this.isSingle) { + if (val.length > 1) { + this.$refs.table.clearSelection() + this.$refs.table.toggleRowSelection(val.pop()) + } else { + this.checkrow = row + } + } + }, submit() { - this.$emit('update:dialogShow', false) + // 处理单选 + if (this.isSingle && this.tableRadio) { + this.$emit('update:dialogShow', false) + this.$emit('tableChanged', this.tableRadio) + return + } this.rows = this.$refs.multipleTable.selection - this.$emit('tableChanged', this.tableRadio) + if (this.rows.length <= 0) { + this.$message('请先勾选物料') + return + } + this.crud.resetQuery(false) + this.$emit('update:dialogShow', false) + this.$emit('tableChanged', this.rows) }, formterType(row) { return this.dict.label.PCS_SAL_TYPE[row.sale_type] diff --git a/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue b/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue index 02a26a8c..6e2ac429 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue @@ -188,7 +188,7 @@ - + @@ -249,7 +249,10 @@ export default { optShow: { add: true, reset: true }, idField: 'iostorinv_id', url: '/api/productIn', - crudMethod: { ...productIn } + crudMethod: { ...productIn }, + props: { + size: 10 + } }) }, mixins: [presenter(), header(), crud()], diff --git a/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue b/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue index 6e17b508..65349fe3 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue @@ -194,11 +194,13 @@ @@ -319,16 +321,32 @@ export default { } }, deleteRow(index, rows) { - const material_code = rows[index].material_code - let len = rows.length - while (len--) { - const obj = rows[len] - if (material_code === obj.material_code) { - const index = rows.indexOf(obj) - if (index > -1) { // 移除找到的指定元素 - this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) - rows.splice(index, 1) - this.form.detail_count = this.form.tableData.length + const source_bill_code = rows[index].source_bill_code + const base_billdtl_id = rows[index].base_billdtl_id + if (source_bill_code === undefined) { + let len = rows.length + while (len--) { + const obj = rows[len] + if (base_billdtl_id === obj.base_billdtl_id) { + const index = rows.indexOf(obj) + if (index > -1) { // 移除找到的指定元素 + this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) + rows.splice(index, 1) + this.form.detail_count = this.form.tableData.length + } + } + } + } else { + let len = rows.length + while (len--) { + const obj = rows[len] + if (source_bill_code === obj.source_bill_code) { + const index = rows.indexOf(obj) + if (index > -1) { // 移除找到的指定元素 + this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty) + rows.splice(index, 1) + this.form.detail_count = this.form.tableData.length + } } } } @@ -341,58 +359,62 @@ export default { this.nowrow.qty_unit_name = row.unit_name this.nowrow.qty_unit_id = row.base_unit_id }, - tableChanged2(row) { - let same_mater = true - this.form.tableData.forEach((item) => { - if (item.source_bill_code === row.sale_code) { - same_mater = false + tableChanged2(rows) { + rows.forEach((row) => { + let same_mater = true + this.form.tableData.forEach((item) => { + if (item.source_bill_code === row.deliver_code) { + same_mater = false + } + }) + if (same_mater) { + const data = {} + data.material_id = row.material_id + data.material_code = row.material_code + data.material_name = row.material_name + data.material_spec = row.material_spec + data.plan_qty = row.delivery_qty + data.qty_unit_name = row.qty_unit_name + data.qty_unit_id = row.qty_unit_id + data.source_billdtl_id = row.deliver_id + data.source_bill_type = row.deliver_type + data.source_bill_code = row.deliver_code + data.base_billdtl_id = row.sale_id + data.base_bill_code = row.sale_code + data.base_bill_table = row.sale_seq_no + data.edit = true + this.form.tableData.splice(-1, 0, data) + this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty) + this.form.detail_count = this.form.tableData.length } }) - if (same_mater) { - const data = {} - data.material_id = row.material_id - data.material_code = row.material_code - data.material_name = row.material_name - data.material_spec = row.material_spec - data.plan_qty = row.delivery_qty - data.qty_unit_name = row.qty_unit_name - data.qty_unit_id = row.qty_unit_id - data.source_billdtl_id = row.deliver_id - data.source_bill_type = row.deliver_type - data.source_bill_code = row.deliver_code - data.base_billdtl_id = row.sale_id - data.base_bill_code = row.sale_code - data.base_bill_table = row.sale_seq_no - data.edit = true - this.form.tableData.splice(-1, 0, data) - this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty) - this.form.detail_count = this.form.tableData.length - } }, - tableChanged3(row) { - let same_mater = true - this.form.tableData.forEach((item) => { - if (item.sale_id === row.sale_id) { - same_mater = false + tableChanged3(rows) { + rows.forEach((row) => { + let same_mater = true + this.form.tableData.forEach((item) => { + if (item.base_billdtl_id === row.sale_id) { + same_mater = false + } + }) + if (same_mater) { + const data = {} + data.material_id = row.material_id + data.material_code = row.material_code + data.material_name = row.material_name + data.material_spec = row.material_spec + data.plan_qty = row.canuse_qty + data.qty_unit_name = row.unit_name + data.qty_unit_id = row.measure_unit_id + data.base_billdtl_id = row.sale_id + data.base_bill_code = row.sale_code + data.base_bill_table = row.seq_no + data.edit = true + this.form.tableData.splice(-1, 0, data) + this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty) + this.form.detail_count = this.form.tableData.length } }) - if (same_mater) { - const data = {} - data.material_id = row.material_id - data.material_code = row.material_code - data.material_name = row.material_name - data.material_spec = row.material_spec - data.plan_qty = row.canuse_qty - data.qty_unit_name = row.unit_name - data.qty_unit_id = row.measure_unit_id - data.base_billdtl_id = row.sale_id - data.base_bill_code = row.sale_code - data.base_bill_table = row.seq_no - data.edit = true - this.form.tableData.splice(-1, 0, data) - this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty) - this.form.detail_count = this.form.tableData.length - } }, insertEvent(row) { this.dtlShow = true diff --git a/mes/qd/src/views/wms/storage_manage/product/productOut/AddDtl.vue b/mes/qd/src/views/wms/storage_manage/product/productOut/AddDtl.vue index 5bdc47a1..8c6b0f6e 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productOut/AddDtl.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productOut/AddDtl.vue @@ -72,7 +72,8 @@ :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @current-change="clickChange" > - + + @@ -137,6 +138,10 @@ export default { }, storId: { type: String + }, + isSingle: { + type: Boolean, + default: true } }, data() { @@ -172,14 +177,27 @@ export default { }, open() { this.crud.query.mater_type = this.opendtlParam + this.query.status = '10' + this.crud.toQuery() }, clickChange(item) { this.tableRadio = item }, submit() { - this.$emit('update:dialogShow', false) + // 处理单选 + if (this.isSingle && this.tableRadio) { + this.$emit('update:dialogShow', false) + this.$emit('tableChanged', this.tableRadio) + return + } this.rows = this.$refs.multipleTable.selection - this.$emit('tableChanged', this.tableRadio) + if (this.rows.length <= 0) { + this.$message('请先勾选物料') + return + } + this.crud.resetQuery(false) + this.$emit('update:dialogShow', false) + this.$emit('tableChanged', this.rows) }, formatStatus(row, column) { return this.dict.label.PCS_DELI_STATUS[row.status] diff --git a/mes/qd/src/views/wms/storage_manage/product/productOut/AddIvt.vue b/mes/qd/src/views/wms/storage_manage/product/productOut/AddIvt.vue index 91a3f174..38d3c27e 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productOut/AddIvt.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productOut/AddIvt.vue @@ -81,7 +81,8 @@ :header-cell-style="{background:'#f5f7fa',color:'#606266'}" @current-change="clickChange" > - + + @@ -148,6 +149,10 @@ export default { }, storId: { type: String + }, + isSingle: { + type: Boolean, + default: true } }, data() { @@ -183,14 +188,26 @@ export default { }, open() { this.crud.query.lock_type = '0' + this.crud.toQuery() }, clickChange(item) { this.tableRadio = item }, submit() { - this.$emit('update:dialogShow', false) + // 处理单选 + if (this.isSingle && this.tableRadio) { + this.$emit('update:dialogShow', false) + this.$emit('tableChanged', this.tableRadio) + return + } this.rows = this.$refs.multipleTable.selection - this.$emit('tableChanged', this.tableRadio) + if (this.rows.length <= 0) { + this.$message('请先勾选物料') + return + } + this.crud.resetQuery(false) + this.$emit('update:dialogShow', false) + this.$emit('tableChanged', this.rows) } } } From e582ed1c2bb768729dd6d6a0a7d43468761f3225 Mon Sep 17 00:00:00 2001 From: liuxy Date: Tue, 20 Jun 2023 20:41:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?rev=EF=BC=9A=E7=95=8C=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java | 5 ++++- .../iostorInv/impl/StIvtIostorinvCpServiceImpl.java | 5 ++++- .../wms/storage_manage/product/productIn/AddDialog.vue | 4 ++-- .../wms/storage_manage/product/productIn/TaskDialog.vue | 6 +++--- .../wms/storage_manage/product/productIn/ViewDialog.vue | 8 ++++---- .../views/wms/storage_manage/product/productIn/index.vue | 2 +- .../wms/storage_manage/product/productOut/AddDialog.vue | 4 ++-- .../wms/storage_manage/product/productOut/DivDialog.vue | 9 +++++---- .../wms/storage_manage/product/productOut/StructIvt.vue | 4 ++-- .../wms/storage_manage/product/productOut/TaskDialog.vue | 6 +++--- .../wms/storage_manage/product/productOut/ViewDialog.vue | 8 ++++---- .../wms/storage_manage/product/productOut/index.vue | 2 +- 12 files changed, 35 insertions(+), 28 deletions(-) diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java index eadbfacb..ee4bba7d 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpOutServiceImpl.java @@ -450,7 +450,10 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成"))); + .allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) + || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成")) + || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配中")) + ); if (!is_dis) throw new BadRequestException("请先分配单据!"); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java index 08f4d6cf..265429fb 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/storage_manage/productmanage/service/iostorInv/impl/StIvtIostorinvCpServiceImpl.java @@ -695,7 +695,10 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成"))); + .allMatch(row -> row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配完")) + || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("完成")) + || row.getBill_status().equals(IOSEnum.BILL_STATUS.code("分配中")) + ); if (!is_dis) throw new BadRequestException("请先分配单据!"); diff --git a/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue b/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue index 20970af2..d5a099ed 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productIn/AddDialog.vue @@ -83,8 +83,8 @@ - - + + - + - + @@ -111,7 +111,7 @@ - + diff --git a/mes/qd/src/views/wms/storage_manage/product/productIn/ViewDialog.vue b/mes/qd/src/views/wms/storage_manage/product/productIn/ViewDialog.vue index f0021b52..a747989f 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productIn/ViewDialog.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productIn/ViewDialog.vue @@ -72,8 +72,8 @@ - - + + - + @@ -142,7 +142,7 @@ - + diff --git a/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue b/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue index 6e2ac429..18c01571 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productIn/index.vue @@ -323,7 +323,7 @@ export default { } else { this.dis_flag = true } - if (currentRow.bill_status === '30') { + if (currentRow.bill_status === '30' || currentRow.bill_status === '20') { this.confirm_flag = false } else { this.confirm_flag = true diff --git a/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue b/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue index 65349fe3..1e9c9b07 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productOut/AddDialog.vue @@ -83,8 +83,8 @@ - - + + - - - + + + @@ -204,7 +204,7 @@ - + @@ -453,6 +453,7 @@ export default { this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.SUCCESS) this.queryTableDtl() this.tabledis = [] + this.form2.point_code = '' }).finally(() => { this.loadingSetAllPoint = false }) diff --git a/mes/qd/src/views/wms/storage_manage/product/productOut/StructIvt.vue b/mes/qd/src/views/wms/storage_manage/product/productOut/StructIvt.vue index 2717ab56..bb0a4d8e 100644 --- a/mes/qd/src/views/wms/storage_manage/product/productOut/StructIvt.vue +++ b/mes/qd/src/views/wms/storage_manage/product/productOut/StructIvt.vue @@ -82,8 +82,8 @@ - - + +