From 218173fcd46883aab427b2e8f0b507ad874093e1 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 24 十二月 2025 10:26:00 +0800
Subject: [PATCH] 1

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs |    9 +++-
 项目代码/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue                                        |    6 +-
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs   |    8 +++-
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs                        |   17 +++++++-
 项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue                                       |   15 ++++---
 项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue                          |   19 +++++----
 项目代码/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue                                |   41 +++++++-------------
 7 files changed, 63 insertions(+), 52 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue"
index 7015bbe..79d4523 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/allocateinboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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. 缁勭洏寮圭獥锛氱‘淇漰rops鍜屼簨浠剁粦瀹氭纭� -->
-    <PalletDialog
-      v-model:visible="palletVisible"  
-      :docNo="currentPalletDocNo"     
-      @back-success="handlePalletBackSuccess"  
-    ></PalletDialog>
-
+  <!-- 2. 缁勭洏寮圭獥锛氱‘淇漰rops鍜屼簨浠剁粦瀹氭纭� -->
+  <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锛氱粍浠舵敞鍐屽悕涓庢ā鏉挎爣绛惧悕閫傞厤锛坘ebab-case瀵瑰簲view-grid锛�
     viewGrid: ViewGrid,  // 娉ㄥ唽涓簁ebab-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,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue"
index 9108816..27b4795 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue"
index 88df97e..48529e7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue"
index 8db255e..9106f80 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/stock/stockInfoDetailByMaterielSum.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/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: "搴撳瓨鏁伴噺",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
index 240fb3f..4ef506d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/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,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs"
index 0920a53..81a2421 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Allocate/AllocateOrderController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/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);
                 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
index c522cb8..67a1cdf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/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);
                     }

--
Gitblit v1.9.3