heshaofeng
2026-01-06 396187f90061319f013ad72bf04cb4804d1596cd
增加手动关闭功能
已修改7个文件
78 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/config/buttons.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/config/buttons.js
@@ -315,6 +315,14 @@
    type: 'warning',
    onClick: function () {
    }
},,{
    name: "关闭单据",
    icon: '',
    class: '',
    value: 'CloseOrder',
    type: 'warning',
    onClick: function () {
    }
},
]
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js
@@ -68,6 +68,35 @@
            });
        };
      }
      var CloseOrderBtn = this.buttons.find(
        (x) => x.value == "CloseOrder"
      );
      if (CloseOrderBtn != null) {
        CloseOrderBtn.onClick = () => {
          var rows = this.$refs.table.getSelected();
          // æ ¡éªŒæ˜¯å¦æœ‰é€‰ä¸­æ•°æ®
          if (!rows || rows.length === 0) {
            return this.$Message.error("请先选择需要关闭的单据");
          }
          if (rows.length > 1) {
            return this.$Message.error("请选择一条单据");
          }
          this.http.post(`api/InboundOrder/HandCloseOrder?orderIds=${rows[0].id}`, {}, "数据处理中...")
            .then((x) => {
              if (x.status) {
                this.$Message.success(x.message);
                this.refresh();
              } else {
                return this.$Message.error(x.message);
              }
            })
            .catch((error) => {
              // å¢žåŠ å¼‚å¸¸æ•èŽ·ï¼Œå¤„ç†ç½‘ç»œé”™è¯¯ç­‰æƒ…å†µ
              //_this.$Message.error('请求失败:' + (error.message || '未知错误'));
            });
        };
      }
      var GroupPalletBtn = this.buttons.find((x) => x.value == "GroupPallet");
      if (GroupPalletBtn != null) {
        GroupPalletBtn.onClick = () => {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/InboundOrderMenu.cs
@@ -31,10 +31,10 @@
        å…¥åº“完成 = 2,
        /// <summary>
        /// å…³é—­
        /// æ‰‹åЍ关闭
        /// </summary>
        [Description("关闭")]
        å…³é—­ = 99,
        [Description("手动关闭")]
        æ‰‹åЍ关闭 = 99,
        /// <summary>
        /// å–消
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
@@ -27,5 +27,7 @@
        WebResponseContent UndoPalletGroup(string code);
        WebResponseContent UnPalletGroupBarcode(string orderNo);
        WebResponseContent HandCloseOrder(List<int> orderIds);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -966,5 +966,27 @@
            return content.OK(data: details);
        }
        public WebResponseContent HandCloseOrder(List<int> orderIds)
        {
            try
            {
                foreach (int id in orderIds)
                {
                    var inbound = _inboundOrderRepository.QueryFirst(x => x.Id == id);
                    if(inbound.OrderStatus !=(int)InOrderStatusEnum.未开始 && inbound.OrderStatus != (int)InOrderStatusEnum.入库中)
                    {
                        return WebResponseContent.Instance.Error($"该单据状态不可以关闭");
                    }
                    inbound.OrderStatus = (int)InOrderStatusEnum.手动关闭;
                    _inboundOrderRepository.UpdateData(inbound);
                }
                return WebResponseContent.Instance.OK($"单据关闭成功");
            }
            catch (Exception e)
            {
                return WebResponseContent.Instance.Error(e.Message);
            }
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -83,6 +83,7 @@
                }
                Dt_InboundOrder inboundOrder = new Dt_InboundOrder();
                var details = _inboundOrderDetailRepository.QueryData(x => (x.OutBoxbarcodes == palletDto.Barcode|| x.Barcode == palletDto.Barcode) && x.OrderDetailStatus == (int)InOrderStatusEnum.未开始);
                if (details.Count() <= 0)
@@ -95,6 +96,10 @@
                {
                    return content.Error("未找到该条码主单信息");
                }
                if(inboundOrder.OrderStatus == (int)InOrderStatusEnum.手动关闭)
                {
                    return content.Error("该单据的状态不能组盘");
                }
                var warehouse =_warehouseAreaRepository.QueryFirst(x => x.Code == palletDto.WarehouseType);
                if(inboundOrder.BusinessType=="11" && inboundOrder.FactoryArea != warehouse.FactoryArea)
                {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -258,5 +258,11 @@
            return await _invokeMESService.BatchOrderFeedbackToMes(request.orderNos, request.inout);
        }
        [HttpPost, Route("HandCloseOrder"), AllowAnonymous, MethodParamsValidate]
        public WebResponseContent HandCloseOrder(List<int> orderIds)
        {
            return Service.HandCloseOrder(orderIds);
        }
    }
}