Tiandele
2026-03-20 9ad0f71549e3fbaea1acad38a216fd2c3a658149
新增库存锁定、库存解锁
已修改5个文件
181 ■■■■ 文件已修改
项目代码/WMS/WMSClient/src/api/buttons.js 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSClient/src/extension/widesea_wms/stock/VV_StockInfo.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_IStorageBasicService/Stock/IVV_StockInfoService.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_StockInfoService.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_WMSServer/Controllers/Stock/VV_StockInfoController.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WMS/WMSClient/src/api/buttons.js
@@ -103,7 +103,7 @@
    onClick: function () {
      this.printClick()
    }
  },{
  }, {
    name: '任务完成',
    // icon: 'el-icon-printer',
    type: 'primary',
@@ -111,9 +111,9 @@
    // color: '#529b2e',
    value: 'TaskHandComplete',
    onClick: function () {
    }
  },{
  }, {
    name: '直接出库',
    // icon: 'el-icon-printer',
    type: 'primary',
@@ -121,26 +121,26 @@
    // color: '#529b2e',
    value: 'OutBound',
    onClick: function () {
    }
  },{
  }, {
    name: '初始化库位',
    type: 'primary',
    // color: '#529b2e',
    value: 'initializeLocation',
    onClick: function () {
    }
  },{
  }, {
    name: '补录数据',
    type: 'primary',
    // color: '#529b2e',
    value: 'SupplementationData',
    onClick: function () {
    }
  },{
  }, {
    name: '指定出库',
    // icon: 'el-icon-printer',
    type: 'primary',
@@ -148,10 +148,10 @@
    // color: '#529b2e',
    value: 'ManualOutBound',
    onClick: function () {
    }
  }
  ,{
  , {
    name: '启用',
    // icon: 'el-icon-printer',
    type: 'primary',
@@ -159,9 +159,9 @@
    // color: '#529b2e',
    value: 'EnableLocation',
    onClick: function () {
    }
  },{
  }, {
    name: '禁用',
    // icon: 'el-icon-printer',
    type: 'primary',
@@ -169,7 +169,7 @@
    // color: '#529b2e',
    value: 'DisableLocation',
    onClick: function () {
    }
  },
  {
@@ -180,7 +180,7 @@
    // color: '#529b2e',
    value: 'Boxing',
    onClick: function () {
    }
  }
  ,
@@ -192,9 +192,9 @@
    // color: '#529b2e',
    value: 'RequestIn',
    onClick: function () {
    }
  },{
  }, {
    name: '确认任务',
    // icon: 'el-icon-printer',
    type: 'primary',
@@ -202,7 +202,29 @@
    // color: '#529b2e',
    value: 'confirmTask',
    onClick: function () {
    }
  }
  , {
    name: '库存锁定',
    // icon: 'el-icon-printer',
    type: 'primary',
    // plain: true,
    // color: '#529b2e',
    value: 'stockLock',
    onClick: function () {
    }
  }
  , {
    name: '库存解锁',
    // icon: 'el-icon-printer',
    type: 'primary',
    // plain: true,
    // color: '#529b2e',
    value: 'stockUnLock',
    onClick: function () {
    }
  }
]
ÏîÄ¿´úÂë/WMS/WMSClient/src/extension/widesea_wms/stock/VV_StockInfo.js
@@ -91,6 +91,58 @@
        }
      };
      // åº“存锁定
      var stockLock = this.buttons.find(x => x.value == "stockLock");
      if (stockLock != null) {
        stockLock.onClick = () => {
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) {
            return this.$error("请选择数据!");
          }
          let ids = rows.map(x => {
            return x.id;
          })
          this.http.post(`/api/VV_StockInfo/stockLock`, ids, "库存锁定中...").then((result) => {
            if (result.status) {
              this.$Message.success(result.message);
              this.refresh();
            } else {
              this.$Message.error(result.message);
              this.refresh();
            }
          })
        }
      };
      // åº“存解锁
      var stockUnLock = this.buttons.find(x => x.value == "stockUnLock");
      if (stockUnLock != null) {
        stockUnLock.onClick = () => {
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) {
            return this.$error("请选择数据!");
          }
          let ids = rows.map(x => {
            return x.id;
          })
          this.http.post(`/api/VV_StockInfo/stockUnLock`, ids, "库存解锁中...").then((result) => {
            if (result.status) {
              this.$Message.success(result.message);
              this.refresh();
            } else {
              this.$Message.error(result.message);
              this.refresh();
            }
          })
        }
      };
      // this.columns.forEach((column) => {
      //   if (column.field == 'materielName') {
      //     column.formatter = (row) => {
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_IStorageBasicService/Stock/IVV_StockInfoService.cs
@@ -2,4 +2,7 @@
public interface IVV_StockInfoService : IService<VV_StockInfo>
{
    WebResponseContent stockLock(object[] keys);
    WebResponseContent stockUnLock(object[] keys);
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_StockInfoService.cs
@@ -11,8 +11,51 @@
public class VV_StockInfoService : ServiceBase<VV_StockInfo, IVV_StockInfoRepository>, IVV_StockInfoService
{
    public VV_StockInfoService(IVV_StockInfoRepository BaseDal) : base(BaseDal)
    private readonly IDt_PalletStockInfoRepository _repository;
    public VV_StockInfoService(IVV_StockInfoRepository BaseDal, IDt_PalletStockInfoRepository repository) : base(BaseDal)
    {
        _repository = repository;
    }
    public WebResponseContent stockLock(object[] keys)
    {
        WebResponseContent content = new WebResponseContent();
        try
        {
            foreach (var item in keys)
            {
                var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item));
                stock.StockStatus= 1;
                _repository.UpdateData(stock);
            }
            return content.OK("锁定成功!");
        }
        catch (Exception e)
        {
            return content.Error(e.Message);
        }
    }
    public WebResponseContent stockUnLock(object[] keys)
    {
        WebResponseContent content = new WebResponseContent();
        try
        {
            foreach (var item in keys)
            {
                var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item));
                stock.StockStatus = 0;
                _repository.UpdateData(stock);
            }
            return content.OK("解锁成功!");
        }
        catch (Exception e)
        {
            return content.Error(e.Message);
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_WMSServer/Controllers/Stock/VV_StockInfoController.cs
@@ -11,4 +11,25 @@
    {
    }
    /// <summary>
    /// åº“存锁定
    /// </summary>
    /// <param name="keys"></param>
    /// <returns></returns>
    [HttpPost,HttpGet,Route("stockLock"),AllowAnonymous]
    public WebResponseContent stockLock([FromBody]object[] keys)
    {
        return Service.stockLock(keys);
    }
    /// <summary>
    /// åº“存解锁
    /// </summary>
    /// <param name="keys"></param>
    /// <returns></returns>
    [HttpPost, HttpGet, Route("stockUnLock"), AllowAnonymous]
    public WebResponseContent stockUnLock([FromBody] object[] keys)
    {
        return Service.stockUnLock(keys);
    }
}