wanshenmean
2026-03-30 08220d98b61cc18bd5ec5bf0a5ae8a0cce92a061
fix: 添加 Warehouse.GetAll 接口并修复前端数据解析

- WarehouseController 添加 GetAll 接口获取仓库列表
- 修复 stockChat.vue 中 Get3DLayout 返回数据的解析
- 使用 res.Data.Locations 获取货位数组
- 使用后端返回的 MaterielCodeList 和 BatchNoList

Co-Authored-By: Claude <noreply@anthropic.com>
已修改2个文件
25 ■■■■■ 文件已修改
Code/WMS/WIDESEA_WMSClient/src/views/stock/stockChat.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/WarehouseController.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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()
    }
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);
        }
    }
}