dengjunjie
2025-01-10 7cc4be28036bef1aa1f2fbc0f0e6aea6fc5a77c0
优化库存视图前端,优化获取旧WMS辅料库存
已修改10个文件
114 ■■■■ 文件已修改
代码管理/WMS/WIDESEA_WMSClient/public/webconfig.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockViewService.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/淮安PDA/pages/stash/OutEmpty.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/public/webconfig.js
@@ -1,3 +1,3 @@
window.webConfig = {
    "webApiBaseUrl": "http://127.0.0.1:9293/"
    "webApiBaseUrl": "http://10.30.4.92:9283/"
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js
@@ -1,6 +1,8 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import { el } from "element-plus/es/locales.mjs";
let extension = {
    components: {
      //查询界面扩展组件
@@ -41,7 +43,7 @@
              for (let index = 0; index < list.length; index++) {
                str+=list[index]+'<br>';
              }
              return str;
            return str = list[0] == "" ? "空箱" : str;
            }
          }
          if (column.field == 'batchNo') {
@@ -51,12 +53,13 @@
              for (let index = 0; index < list.length; index++) {
                str+=list[index]+'<br>';
              }
              return str;
            return str = list[0] == "" ? "无" : str;
            }
          }
          if (column.field == 'materielInfo') {
            const today = new Date()
            column.formatter = (row) => {
            if (row.details.length > 0) {
              const today = new Date();
              const closestDate = row.details
              .map(x => {
@@ -69,16 +72,25 @@
              const daysSinceClosest = Math.ceil(Math.abs((today - closestDate) / (1000 * 60 * 60 * 24)));
              return '<span style="color: #F56C6C">'+ daysSinceClosest+"天"+'</span>';
            } else {
              return '<span style="color: #F56C6C">' + "无保质期" + '</span>';
            }
            }
          }
          if (column.field == 'sumStock') {
            column.formatter = (row) => {
            if (row.details.length > 0) {
              var sum=0;
              const closestDate = row.details
              .map(x => {
                sum+=(x.stockQuantity)
              })
              return '<span style="color: #F56C6C">'+ sum+row.details[0].unit+'</span>';
            } else {
              return '<span style="color: #F56C6C">' + "1个" + '</span>';
            }
            }
          }
        })
@@ -120,4 +132,3 @@
    }
  };
  export default extension;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue
@@ -49,7 +49,8 @@
      ],
      [
        { title: "物料编号", field: "materielCode",type: "like"},
        { title: "批次号", field: "batchNo",type: "like"}
        { title: "批次号", field: "batchNo",type: "like"},
        { title: "所属仓库", field: "warehouseId",type: "selectList",dataKey: "warehouse",data: [],},
      ],
    ]);
    const columns = ref([
@@ -86,6 +87,14 @@
        align: "left",
      },
      {
        field: "warehouseId",
        title: "所属仓库",
        type: "string",
        width: 80,
        align: "left",
        bind: { key: "warehouse", data: [] },
      },
      {
        field: "roadwayNo",
        title: "巷道编号",
        type: "decimal",
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs
@@ -131,6 +131,7 @@
                            Details = new List<Dt_StockInfoDetail>()
                        };
                        var ContainerDetailsInfos = TesugarClient.Queryable("ContainerDetailsInfo", "x").Where("CId", "=", id).ToList();
                        if (ContainerDetailsInfos.Count < 1) stockInfo.PalletType = PalletTypeEnum.Empty.ObjToInt();
                        foreach (var ContainerDetailsInfo in ContainerDetailsInfos)
                        {
                            dynamic ruleConfig1 = ContainerDetailsInfo;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs
@@ -16,62 +16,67 @@
    public class StockViewDTO
    {
        /// <summary>
        ///
        /// è´§ä½ç¼–号
        /// </summary>
        public string LocationCode { get; set; }
        /// <summary>
        ///
        /// è´§ä½åç§°
        /// </summary>
        public string LocationName { get; set; }
        /// <summary>
        ///
        /// è´§ä½åˆ—
        /// </summary>
        public int Column { get; set; }
        /// <summary>
        ///
        /// è´§ä½è¡Œ
        /// </summary>
        public int Row { get; set; }
        /// <summary>
        ///
        /// è´§ä½å±‚
        /// </summary>
        public int Layer { get; set; }
        /// <summary>
        ///
        /// åº“区主键
        /// </summary>
        public int WarehouseId {  get; set; }
        /// <summary>
        /// è´§ä½æ·±åº¦
        /// </summary>
        public int Depth { get; set; }
        /// <summary>
        ///
        /// è´§ä½çŠ¶æ€
        /// </summary>
        public int LocationStatus { get; set; }
        /// <summary>
        ///
        /// è´§ä½ç±»åž‹
        /// </summary>
        public int LocationType { get; set; }
        /// <summary>
        ///
        /// å··é“编号
        /// </summary>
        public string RoadwayNo { get; set; }
        /// <summary>
        ///
        /// ç¦ç”¨çŠ¶æ€
        /// </summary>
        public int EnalbeStatus { get; set; }
        /// <summary>
        ///
        /// åº“存主键
        /// </summary>
        public int StockId { get; set; }
        /// <summary>
        ///
        /// æ‰˜ç›˜å·
        /// </summary>
        public string PalletCode { get; set; }
@@ -81,47 +86,47 @@
        public bool IsFull { get; set; }
        /// <summary>
        ///
        /// ç‰©æ–™ç¼–码
        /// </summary>
        public string MaterielCode { get; set; }
        /// <summary>
        ///
        /// ç‰©æ–™æ‰¹å·
        /// </summary>
        public string BatchNo { get; set; }
        /// <summary>
        ///
        /// åº“存状态
        /// </summary>
        public int StockStatus { get; set; }
        /// <summary>
        ///
        /// åº“存备注
        /// </summary>
        public string StockRemark { get; set; }
        /// <summary>
        ///
        /// åˆ›å»ºäºº
        /// </summary>
        public string Creater { get; set; }
        /// <summary>
        ///
        /// åˆ›å»ºæ—¶é—´
        /// </summary>
        public DateTime CreateDate { get; set; }
        /// <summary>
        ///
        /// ä¿®æ”¹äºº
        /// </summary>
        public string Modifier { get; set; }
        /// <summary>
        ///
        /// ä¿®æ”¹æ—¶é—´
        /// </summary>
        public DateTime? ModifyDate { get; set; }
        /// <summary>
        ///
        /// åº“存详情
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(StockId))]
        public List<Dt_StockInfoDetail> Details { get; set; }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -76,7 +76,7 @@
        /// <param name="qty">数量</param>
        /// <param name="address">地址</param>
        /// <returns></returns>
        WebResponseContent OutEmpty(int qty, string address, int WarehouseId);
        WebResponseContent OutEmpty(int qty, string address, int WarehouseId, string barcode);
        /// <summary>
        /// WCS申请入库
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockViewService.cs
@@ -88,6 +88,7 @@
                    Depth = a.Depth,
                    EnalbeStatus = a.EnableStatus,
                    Layer = a.Layer,
                    WarehouseId = b.WarehouseId,
                    LocationName = a.LocationName,
                    LocationStatus = a.LocationStatus,
                    LocationType = a.LocationType,
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -173,7 +173,7 @@
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public WebResponseContent OutEmpty(int qty, string address, int WarehouseId)
        public WebResponseContent OutEmpty(int qty, string address, int WarehouseId, string barcode)
        {
            try
            {
@@ -182,8 +182,17 @@
                {
                    return WebResponseContent.Instance.Error($"未找到库区");
                }
                var stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt(), qty, nameof(Dt_StockInfo.CreateDate));
                if (stockInfos == null) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}未找到空箱库存");
                List<Dt_StockInfo> stockInfos = null;
                if (string.IsNullOrEmpty(barcode))
                {
                    stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt(), qty, nameof(Dt_StockInfo.CreateDate));
                }
                else
                {
                    stockInfos = _stockRepository.StockInfoRepository.QueryData(x => x.WarehouseId == WarehouseId && x.PalletType == PalletTypeEnum.Empty.ObjToInt() && x.StockStatus == StockStatusEmun.入库完成.ObjToInt() && x.PalletCode == barcode);
                    if (stockInfos.Count == 0) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}未找到空箱【{barcode}】");
                }
                if (stockInfos.Count < qty) return WebResponseContent.Instance.Error($"{warehouse.WarehouseName}空箱库存不足,库存数【{stockInfos.Count}】");
                List<Dt_Task> tasks = GetTasks(stockInfos, TaskTypeEnum.OutEmpty);
                stockInfos.ForEach(x =>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -61,9 +61,9 @@
        /// <param name="address">地址</param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("OutEmpty"), AllowAnonymous]
        public WebResponseContent OutEmpty(int qty, string address, int WarehouseId)
        public WebResponseContent OutEmpty(int qty, string address, int WarehouseId, string barcode)
        {
            return Service.OutEmpty(qty, address, WarehouseId);
            return Service.OutEmpty(qty, address, WarehouseId,barcode);
        }
        [HttpPost, HttpGet, Route("DeviceRequestInboundTask"), AllowAnonymous]
´úÂë¹ÜÀí/»´°²PDA/pages/stash/OutEmpty.vue
@@ -6,6 +6,9 @@
                    <uni-easyinput type="text" placeholder="请输入数量" ref='midInput' :focus="!focus" v-model="qty"
                        @input="barcodeInput" />
                </uni-forms-item>
                <uni-forms-item label="托盘条码:">
                    <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="focus" v-model="barcode" />
                </uni-forms-item>
                <uni-forms-item>
                    <button @click="OutEmpty" type="primary" size="default" style="margin-top: 2%;">空箱出库</button>
                </uni-forms-item>
@@ -23,12 +26,14 @@
                focus: false,
                qty: "",
                address: "",
                barcode: "",
            }
        },
        onShow() {},
        onLoad(res) {
            this.WarehouseId = res.warehouseId;
            this.focus = false;
            this.qty = 1;
            if (res.warehouseId == 5) {
                this.address = "8001";
            }
@@ -53,8 +58,15 @@
                    })
                    return;
                }
                if (this.qty < 1) {
                    this.$refs.uToast.show({
                        title: "数量不能小于1",
                        type: 'error'
                    })
                    return;
                }
                this.$u.post('/api/Task/OutEmpty?qty=' + this.qty + '&address=' + this.address + '&WarehouseId=' +
                    this.WarehouseId).then(
                    this.WarehouseId + '&barcode=' + this.barcode).then(
                    res => {
                        if (res.status) {
                            this.$refs.uToast.show({