From 08220d98b61cc18bd5ec5bf0a5ae8a0cce92a061 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 30 三月 2026 14:37:49 +0800
Subject: [PATCH] fix: 添加 Warehouse.GetAll 接口并修复前端数据解析
---
Code/WMS/WIDESEA_WMSClient/src/views/stock/stockChat.vue | 15 +++++----------
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/WarehouseController.cs | 10 ++++++++++
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/Code/WMS/WIDESEA_WMSClient/src/views/stock/stockChat.vue b/Code/WMS/WIDESEA_WMSClient/src/views/stock/stockChat.vue
index 9cc6436..2f210cb 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/views/stock/stockChat.vue
+++ b/Code/WMS/WIDESEA_WMSClient/src/views/stock/stockChat.vue
@@ -185,16 +185,11 @@
try {
const res = await proxy.http.get(`/api/StockInfo/Get3DLayout?warehouseId=${warehouseId}`)
if (res.Status && res.Data) {
- locationData = res.Data
- // 鎻愬彇鐗╂枡缂栧彿鍜屾壒娆″垪琛�
- const codes = new Set()
- const batches = new Set()
- res.Data.forEach(loc => {
- if (loc.materielCode) codes.add(loc.materielCode)
- if (loc.batchNo) batches.add(loc.batchNo)
- })
- materielCodeList.value = Array.from(codes)
- batchNoList.value = Array.from(batches)
+ const data = res.Data
+ locationData = data.Locations || []
+ // 浣跨敤鍚庣杩斿洖鐨勭瓫閫夊垪琛�
+ materielCodeList.value = data.MaterielCodeList || []
+ batchNoList.value = data.BatchNoList || []
// 娓叉煋璐т綅
renderLocations()
}
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/WarehouseController.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/WarehouseController.cs
index 9a40dd7..1ff2f9f 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/WarehouseController.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/WarehouseController.cs
@@ -18,5 +18,15 @@
{
}
+ /// <summary>
+ /// 鑾峰彇鎵�鏈変粨搴�
+ /// </summary>
+ /// <returns>浠撳簱鍒楄〃</returns>
+ [HttpGet("GetAll")]
+ public async Task<WebResponseContent> GetAll()
+ {
+ var result = await Service.Repository.QueryDataAsync(x => x.WarehouseStatus == 1);
+ return WebResponseContent.Instance.OK(data: result);
+ }
}
}
--
Gitblit v1.9.3