1
huangxiaoqiang
2025-12-24 218173fcd46883aab427b2e8f0b507ad874093e1
1
已修改7个文件
115 ■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue
@@ -1,37 +1,24 @@
<template>
  <view-grid
    ref="grid"
    @openPalletDialog="handleOpenPalletDialog"
    :columns="columns"
    :detail="detail"
    :editFormFields="editFormFields"
    :editFormOptions="editFormOptions"
    :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions"
    :table="table"
    :extend="extend"
  >
  <view-grid ref="grid" @openPalletDialog="handleOpenPalletDialog" :columns="columns" :detail="detail"
    :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields"
    :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
  </view-grid>
      <!-- 2. ç»„盘弹窗:确保props和事件绑定正确 -->
    <PalletDialog
      v-model:visible="palletVisible"
      :docNo="currentPalletDocNo"
      @back-success="handlePalletBackSuccess"
    ></PalletDialog>
  <!-- 2. ç»„盘弹窗:确保props和事件绑定正确 -->
  <PalletDialog v-model:visible="palletVisible" :docNo="currentPalletDocNo" @back-success="handlePalletBackSuccess">
  </PalletDialog>
</template>
    <script>
<script>
import extend from "@/extension/inbound/allocateinboundOrder.js";
import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue';
import { ref, defineComponent } from "vue";
import PalletDialog from "@/extension/inbound/extend/Pallet.vue";
export default defineComponent({
   components: {
  components: {
    // å…³é”®ä¿®å¤2:组件注册名与模板标签名适配(kebab-case对应view-grid)
    viewGrid: ViewGrid,  // æ³¨å†Œä¸ºkebab-case,模板用<view-grid>
    PalletDialog      // æ³¨å†Œç»„盘弹窗
  },
  setup() {
    const table = ref({
@@ -262,12 +249,12 @@
          required: true,
        },
        {
          field: "materielCode",
          field: "materielName",
          title: "物料名称",
          type: "string",
          width: 100,
          align: "left",
          bind: { key: "MaterielNames", data: [] },
          bind: { key: "materielInfo", data: [] },
        },
        {
          field: "batchNo",
@@ -374,7 +361,7 @@
      sortName: "id",
      key: "id",
    });
     // 6. ç»„盘弹窗联动(所有变量必须返回)
    // 6. ç»„盘弹窗联动(所有变量必须返回)
    const palletVisible = ref(false);
    const currentPalletDocNo = ref("");
@@ -398,7 +385,7 @@
      searchFormOptions,
      columns,
      detail,
       // ç»„盘弹窗相关
      // ç»„盘弹窗相关
      PalletDialog,    // å¼¹çª—组件(无需返回,注册即可,但变量需返回)
      palletVisible,
      currentPalletDocNo,
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -239,12 +239,12 @@
          required: true,
        },
        {
          field: "materielCode",
          field: "materielName",
          title: "物料名称",
          type: "string",
          width: 120,
          width: 150,
          align: "left",
          bind: { key: "MaterielNames", data: [] },
          bind: { key: "materielInfo", data: [] },
        },
        {
          field: "batchNo",
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
@@ -54,20 +54,20 @@
          type: "string",
        },
      ],
    ]);
    const searchFormFields = ref({
      materielCode: "",
      materielName: "",
      orderNo: "",
      palletCode:""
      palletCode: ""
    });
    const searchFormOptions = ref([
      [
        { title: "物料编号", field: "materielCode" ,type:'like'},
        { title: "物料名称", field: "materielName" ,type:'like'},
        { title: "单据编号", field: "orderNo" ,type:'like'},
        { title: "托盘号", field: "palletCode" ,type:'like'},
        { title: "物料编号", field: "materielCode", type: 'like' },
        { title: "物料名称", field: "materielName", type: 'like' },
        { title: "单据编号", field: "orderNo", type: 'like' },
        { title: "托盘号", field: "palletCode", type: 'like' },
      ],
    ]);
    const columns = ref([
@@ -90,7 +90,7 @@
      },
      {
        field: "palletCode",
        title: "托盘编号",
        title: "托盘编号",
        type: "string",
        width: 150,
        align: "left",
@@ -108,6 +108,7 @@
        type: "string",
        width: 150,
        align: "left",
        bind: { key: "materielInfo", data: [] },
      },
      {
        field: "orderNo",
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue
@@ -54,22 +54,22 @@
          type: "string",
        },
      ],
    ]);
    const searchFormFields = ref({
      materielCode: "",
      materielName: "",
      batchNo: "",
      supplyCode:"",
      warehouseCode:""
      supplyCode: "",
      warehouseCode: ""
    });
    const searchFormOptions = ref([
      [
        { title: "物料编号", field: "materielCode" ,type:'like'},
        { title: "物料名称", field: "materielName" ,type:'like'},
        { title: "批次号", field: "batchNo" ,type:'like'},
        { title: "供应商编号", field: "supplyCode" ,type:'like'},
        { title: "仓库号", field: "warehouseCode" ,type:'like'},
        { title: "物料编号", field: "materielCode", type: 'like' },
        { title: "物料名称", field: "materielName", type: 'like' },
        { title: "批次号", field: "batchNo", type: 'like' },
        { title: "供应商编号", field: "supplyCode", type: 'like' },
        { title: "仓库号", field: "warehouseCode", type: 'like' },
      ],
    ]);
    const columns = ref([
@@ -96,6 +96,7 @@
        type: "string",
        width: 150,
        align: "left",
        bind: { key: "materielInfo", data: [] },
      },
      {
        field: "batchNo",
@@ -117,7 +118,7 @@
        type: "string",
        width: 120,
        align: "left",
      },
      },
      {
        field: "stockQuantity",
        title: "库存数量",
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs
@@ -27,6 +27,7 @@
        public readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository;
        public readonly IRepository<Dt_AllocateOrderDetail> _allocateOrderDetailRepository;
        private readonly IMaterielInfoService _materielInfoService;
        private readonly IRepository<Dt_MaterielInfo> _materielInforepository;
        public readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository;
        private readonly ILogger<AllocateService> _logger;
@@ -38,7 +39,8 @@
            IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository,
            IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository,
            ILogger<AllocateService> logger,
            IMaterielInfoService materielInfoService) : base(BaseDal)
            IMaterielInfoService materielInfoService,
            IRepository<Dt_MaterielInfo> materielInforepository) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _inboundService = inboundService;
@@ -48,6 +50,7 @@
            _logger = logger;
            _inboundOrderDetailRepository = inboundOrderDetailRepository;
            _materielInfoService = materielInfoService;
            _materielInforepository = materielInforepository;
        }
        public IRepository<Dt_AllocateOrder> Repository => BaseDal;
@@ -299,6 +302,15 @@
                .Select(g => g.First())
                .ToList();
            // èŽ·å–æ‰€æœ‰ç‰©æ–™ä»£ç 
            var materielCodes = distinctDetails.Select(d => d.MaterielCode).Distinct().ToList();
            // ä»Žæ•°æ®åº“查询物料信息(假设使用 DbContext)
            var materielInfos = _materielInforepository.Db.Queryable<Dt_MaterielInfo>()
                .Where(m => materielCodes.Contains(m.MaterielCode))
                .Select(m => new { m.MaterielCode, m.MaterielName })
                .ToDictionary(m => m.MaterielCode, m => m.MaterielName);
            return new List<Dt_InboundOrder>()
            {
                new Dt_InboundOrder(){
@@ -315,9 +327,10 @@
                   Remark=allocateOrder.Remark,
                   Details=distinctDetails.Select(detail=>new Dt_InboundOrderDetail
                   {
                       OrderId= 0,
                       MaterielCode=detail.MaterielCode,
                       MaterielName="",
                       MaterielName=detail.MaterielName,
                       BatchNo=detail.BatchNo,
                       OrderQuantity=detail.OrderQuantity,
                       ReceiptQuantity=detail.ReceiptQuantity,
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs
@@ -8,6 +8,7 @@
using WIDESEA_Core;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.BaseController;
using WIDESEA_Core.BaseRepository;
using WIDESEA_DTO.Allocate;
using WIDESEA_IAllocateService;
using WIDESEA_IInboundService;
@@ -26,9 +27,11 @@
    public class AllocateOrderController : ApiBaseController<IAllocateService, Dt_AllocateOrder>
    {
        private readonly ILogger<AllocateOrderController> _logger;
        public AllocateOrderController(IAllocateService service, ILogger<AllocateOrderController> logger) : base(service)
        private readonly IRepository<Dt_MaterielInfo> _materialInfoRepository;
        public AllocateOrderController(IAllocateService service, ILogger<AllocateOrderController> logger,IRepository<Dt_MaterielInfo> materialInfoRepository) : base(service)
        {
            _logger = logger;
            _materialInfoRepository = materialInfoRepository;
        }
        [HttpPost, Route("ReceiveAllocateOrder"), MethodParamsValidate, AllowAnonymous]
@@ -68,6 +71,7 @@
                {
                    return WebResponseContent.Instance.Error($"条码不能为空");
                }
                var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailDto.materialCode).MaterielName;
                if (detailDto.Barcodes != null && detailDto.Barcodes.Any())
                {
                    foreach (var barcodeDto in detailDto.Barcodes)
@@ -76,6 +80,7 @@
                        {
                            WarehouseCode = detailDto.WarehouseCode,
                            MaterielCode = detailDto.MaterialCode,
                            MaterielName = materialName,
                            LineNo = detailDto.LineNo,
                            OrderQuantity = detailDto.Qty,
                            SupplyCode = barcodeDto.SupplyCode,
@@ -101,7 +106,7 @@
                        Unit = detailDto.Unit,
                        BarcodeUnit =detailDto.Unit,
                        BarcodeQty=detailDto.Qty,
                        MaterielName = materialName
                    };
                    allocateOrder.Details.Add(orderDetail);
                }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -43,12 +43,13 @@
        private readonly ILocationInfoService _locationInfoService;
        private readonly IDailySequenceService _dailySequenceService;
        private readonly IMaterialUnitService _materialUnitService;
        private readonly IRepository<Dt_MaterielInfo> _materialInfoRepository;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        private readonly IOutboundOrderDetailService _outboundOrderDetailService;
        private readonly IRepository<Dt_Task> _taskRepository;
        private readonly ITask_HtyService _task_HtyService;
        private readonly ILogger<InboundOrderController> _logger;
        public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService) : base(service)
        public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository, ITask_HtyService task_HtyService, IRepository<Dt_MaterielInfo> materialInfoRepository) : base(service)
        {
            this.erpApiService = erpApiService;
            _invokeMESService = invokeMESService;
@@ -62,6 +63,7 @@
            _outboundOrderDetailService = outboundOrderDetailService;
            _taskRepository = taskRepository;
            _task_HtyService = task_HtyService;
            _materialInfoRepository = materialInfoRepository;
        }
        [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
@@ -147,7 +149,7 @@
                Dt_InboundOrder dt_InboundOrder = new Dt_InboundOrder() { Details = new List<Dt_InboundOrderDetail>() };
                foreach (var detailitem in item.details)
                {
                    var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailitem.materialCode).MaterielName;
                    if (detailitem.barcodes != null && detailitem.barcodes.Any())
                    {
                        foreach (var barcode in detailitem.barcodes)
@@ -156,6 +158,7 @@
                            {
                                lineNo = detailitem.lineNo,
                                MaterielCode = detailitem.materialCode,
                                MaterielName = materialName,
                                SupplyCode = detailitem.supplyCode,
                                BatchNo = detailitem.batchNo,
                                Unit = detailitem.unit,
@@ -184,6 +187,7 @@
                            OrderQuantity = detailitem.qty,
                            BarcodeUnit = detailitem.unit,
                            BarcodeQty = detailitem.qty,
                            MaterielName = materialName
                        };
                        dt_InboundOrder.Details.Add(inboundOrderDetail);
                    }