1
huangxiaoqiang
2025-12-29 3159971af301f5bb8871e1c695fa4463c270db0f
1
已修改7个文件
111 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/config/buttons.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.js 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/config/buttons.js
@@ -291,6 +291,22 @@
    type: 'warning',
    onClick: function () {
    }
},{
    name: "冻结",
    icon: '',
    class: '',
    value: 'Lock',
    type: 'warning',
    onClick: function () {
    }
},{
    name: "解锁",
    icon: '',
    class: '',
    value: 'Unlock',
    type: 'warning',
    onClick: function () {
    }
},
]
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/stock/stockInfoDetail.js
@@ -16,7 +16,62 @@
    buttons: { view: [], box: [], detail: [] }, //扩展的按钮
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {
      onInit() {
        var LockBtn = this.buttons.find(x => x.value == "Lock");
        if (LockBtn != null) {
          LockBtn.onClick = () => {
            var rows = this.$refs.table.getSelected();
            if (!rows || rows.length === 0) {
              return this.$Message.error("请先选择需要处理的单据");
            }
            var keys = rows.map(x => {return x.id;})
            var param = {
              DelKeys: keys,
              Extra: true
          }
            this.http.post(`api/StockInfoDetail/LockOrUpLockStockDetail`,param,"数据处理中...")
              .then((x) => {
                if (x.status) {
                  this.$Message.success(x.message);
                  this.refresh();
                } else {
                  return this.$Message.error(x.message);
                }
              })
              .catch((error) => {
                this.$Message.error('请求失败:' + (error.message || '未知错误'));
              });
            }
        }
        var UnlockBtn = this.buttons.find(x => x.value == "Unlock");
        if (UnlockBtn != null) {
          UnlockBtn.onClick = () => {
            var rows = this.$refs.table.getSelected();
            if (!rows || rows.length === 0) {
              return this.$Message.error("请先选择需要处理的单据");
            }
            var keys = rows.map(x => {return x.id;})
            var param = {
              DelKeys: keys,
              Extra: false
          }
            this.http.post(`api/StockInfoDetail/LockOrUpLockStockDetail`,param,"数据处理中...")
              .then((x) => {
                if (x.status) {
                  this.$Message.success(x.message);
                  this.refresh();
                } else {
                  return this.$Message.error(x.message);
                }
              })
              .catch((error) => {
                this.$Message.error('请求失败:' + (error.message || '未知错误'));
              });
            }
        }
      },
      onInited() {
        //框架初始化配置后
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
@@ -67,7 +67,14 @@
        { title: "物料编号", field: "materielCode", type: 'like' },
        { title: "物料名称", field: "materielName", type: 'like' },
        { title: "单据编号", field: "orderNo", type: 'like' },
      ], [
        { title: "托盘号", field: "palletCode", type: 'like' },
        { title: "批次", field: "batchNo", type: 'like' },
        { title: "条码", field: "barcode", type: 'like' },
      ],
      [
        { title: "库存状态", field: "status", type: 'select', dataKey: "stockStatusEmun", data: [] },
      ],
    ]);
    const columns = ref([
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs
@@ -107,6 +107,9 @@
        [Description("已清理")]
        å·²æ¸…理 = 33,
        [Description("手动冻结")]
        æ‰‹åŠ¨å†»ç»“ = 55,
        [Description("手动解锁")]
        æ‰‹åŠ¨è§£é” = 66,
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IStockService/IStockInfoDetailService.cs
@@ -15,5 +15,7 @@
        PageGridData<StockInfoDetailWithPalletDto> GetPageData2(PageDataOptions options);
        Task<WebResponseContent> LockOrUpLockStockDetail(SaveModel saveModel);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs
@@ -128,6 +128,27 @@
        }
        public async Task<WebResponseContent> LockOrUpLockStockDetail(SaveModel saveModel)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                var details = await BaseDal.QueryDataAsync(x => saveModel.DelKeys.Contains(x.Id));
                bool flag = Convert.ToBoolean(saveModel.Extra);
                details.ForEach(x => x.Status = flag ? StockStatusEmun.手动冻结.ObjToInt(): StockStatusEmun.手动解锁.ObjToInt());
                await BaseDal.UpdateDataAsync(details);
                return content.OK(flag ? "冻结成功!" : "解锁成功!");
            }
            catch (Exception ex)
            {
                return content.Error(ex.Message);
            }
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoDetailController.cs
@@ -31,5 +31,10 @@
            return Json(result);
        }
        [HttpPost, Route("LockOrUpLockStockDetail")]
        public Task<WebResponseContent> LockOrUpLockStockDetail([FromBody]SaveModel saveModel)
        {
            return Service.LockOrUpLockStockDetail(saveModel);
        }
    }
}