货架管理

This commit is contained in:
hehaibing-1996
2025-01-11 18:37:33 +08:00
parent ff7339e37d
commit 94aa92f536
28 changed files with 697 additions and 637 deletions

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WCS.BLL.DbModels.STZL
{
/// <summary>
/// 启用禁用状态
/// </summary>
public enum EnableStatusEnum
{
= 1,
= 0
}
}

View File

@ -18,16 +18,22 @@ namespace WCS.DAL.DbModels
public int Id { get; set; }
/// <summary>
/// 货架编码 对应二维码
/// </summary>
[SugarColumn(ColumnName = "shelf_code", Length = 64, IsNullable = false, ColumnDescription = "货架编码")]
public string ShelfCode { get; set; }
/// 货架类型Id
/// </summary>
[SugarColumn(ColumnName = "shelf_type_id", IsNullable = true, ColumnDescription = "货架类型Id")]
public int ShelfTypeId { get; set; }
/// <summary>
/// 货架类型
/// </summary>
[SugarColumn(ColumnName = "shelf_type", Length = 64, IsNullable = true, ColumnDescription = "货架类型")]
public string ShelfType { get; set; }
public string ShelfTypeName { get; set; }
/// <summary>
/// 货架编码 对应二维码
/// </summary>
[SugarColumn(ColumnName = "shelf_code", Length = 64, IsNullable = false, ColumnDescription = "货架编码")]
public string ShelfCode { get; set; }
/// <summary>
/// 货架状态 货架当前的状态空货架/非空货架

View File

@ -0,0 +1,22 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WCS.BLL.DbModels
{
/// <summary>
/// 货架类型
/// </summary>
[SugarTable("wcs_shelf_type")]
public class ShelfTypeInfo
{
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)]
public int Id { get; set; }
[SugarColumn(ColumnName = "shelf_type_name", Length = 64, IsNullable = true, ColumnDescription = "货架类型名称")]
public string ShelfTypeName { get; set; }
}
}

View File

@ -70,11 +70,11 @@ namespace WCS.BLL.Manager
DbHelp.dbLog.DbMaintenance.CreateDatabase();
Logs.Write("【初始化数据库】创建数据库", LogsType.StartBoot);
DbHelp.db.CodeFirst.InitTables( typeof(ShelfInfo), typeof(StoreInfo)
DbHelp.db.CodeFirst.InitTables(typeof(ShelfInfo), typeof(StoreInfo), typeof(ShelfTypeInfo)
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
, typeof(MatBaseInfo), typeof(MatInfo)
, typeof(StockTakingOrder), typeof(StockTakingOrderMatDetail), typeof(InOutRecord)
, typeof(DocumentSerialNumber), typeof(MatInfoLog)
, typeof(DocumentSerialNumber), typeof(MatInfoLog)
, typeof(AppVersion)
);

View File

@ -18,7 +18,7 @@ namespace WCS.BLL.Services.IService
public Task<ResponseCommon<object>> addOrUpdateMatBaseInfo(AddMatBaseInfoRequest<MatBaseInfo> request);
public Task<ResponseCommon<object>> deleteMatBaseInfo(DeleteMatBaseInfosRequest request);
public Task<ResponseCommon<object>> deleteMatBaseInfo(DeleteInfosRequest request);
public Task<ResponseCommon<List<string>>> getMatCodeList(GetMatCodeListRequest request);

View File

@ -26,7 +26,10 @@ namespace WCS.BLL.Services.IService
/// <param name="request"></param>
/// <returns></returns>
public Task<ResponseCommon<object>> addOrUpdateShelfInfo(AddShelfInfoRequest<ShelfInfo> request);
public Task<ResponseCommon<object>> deleteShelfInfo(DeleteInfosRequest request);
/// <summary>
/// 查询库位列表
/// </summary>

View File

@ -349,7 +349,7 @@ namespace WCS.BLL.Services.Service
}
}
public async Task<ResponseCommon<object>> deleteMatBaseInfo(DeleteMatBaseInfosRequest request)
public async Task<ResponseCommon<object>> deleteMatBaseInfo(DeleteInfosRequest request)
{
//先查询出具体的Id
var matBaseInfos = await DbHelp.db.Queryable<MatBaseInfo>()

View File

@ -17,6 +17,7 @@ using WCS.DAL.DbModels;
using WCS.Model;
using WCS.Model.ApiModel;
using WCS.Model.ApiModel.InOutRecord;
using WCS.Model.ApiModel.MatBaseInfo;
using WCS.Model.ApiModel.StoreInfo;
using WCS.Model.ApiModel.User;
@ -30,7 +31,9 @@ namespace WCS.BLL.Services.Service
try
{
var recordsQueryable = DbHelp.db.Queryable<ShelfInfo>()
;
.WhereIF(request.ShelfTypeId != null, t => t.ShelfTypeId == request.ShelfTypeId)
.WhereIF(request.IsEnable != null, t => t.IsEnable == request.IsEnable)
.WhereIF(!string.IsNullOrEmpty(request.ShelfCode), t => t.ShelfCode.Contains(request.ShelfCode));
var totalCount = await recordsQueryable.CountAsync();
var records = await recordsQueryable
@ -69,6 +72,7 @@ namespace WCS.BLL.Services.Service
try
{
var shelfnfo = await DbHelp.db.Queryable<ShelfInfo>()
.Where(t => t.ShelfCode == request.ShelfInfo.ShelfCode)
.FirstAsync();
//修改货架信息
if (request.AddOrUpdate == AddOrUpdate.Update)
@ -83,7 +87,7 @@ namespace WCS.BLL.Services.Service
return new ResponseCommon<Object>
{
Code = 201,
Message = $"更新货架信息失败:货架不存在!",
Message = $"更新货架信息失败:货架不存在!",
Data = null
};
}
@ -92,14 +96,14 @@ namespace WCS.BLL.Services.Service
return new ResponseCommon<Object>
{
Code = 201,
Message = $"更新货架信息失败:已存在货架编码",
Message = $"更新货架信息失败:货架[{shelfnfo.ShelfCode}]已存在!",
Data = null
};
}
else
{
var rowNum = await DbHelp.db.Updateable(shelfnfo).ExecuteCommandAsync();
request.ShelfInfo.ModifyUser = request.UserName;
var rowNum = await DbHelp.db.Updateable(request.ShelfInfo).ExecuteCommandAsync();
if (rowNum == 0)
{
return new ResponseCommon<Object>
@ -127,17 +131,14 @@ namespace WCS.BLL.Services.Service
return new ResponseCommon<Object>
{
Code = 201,
Message = $"货架信息失败:货架已存在!",
Message = $"货架信息失败:货架[{shelfnfo.ShelfCode}]已存在!",
Data = null
};
}
else
{
var newShelfInfo = new ShelfInfo()
{
};
var rowNum = await DbHelp.db.Insertable(newShelfInfo).ExecuteCommandAsync();
request.ShelfInfo.ModifyUser = request.UserName;
var rowNum = await DbHelp.db.Insertable(request.ShelfInfo).ExecuteCommandAsync();
if (rowNum == 0)
{
return new ResponseCommon<Object>
@ -218,6 +219,35 @@ namespace WCS.BLL.Services.Service
}
}
public async Task<ResponseCommon<object>> deleteShelfInfo(DeleteInfosRequest request)
{
//先查询出具体的Id
var shelfInfos = await DbHelp.db.Queryable<ShelfInfo>()
.Where(t => request.MatBaseInfoIds.Contains(t.Id))
.ToListAsync();
//执行删除
try
{
var deleteRows = await DbHelp.db.Deleteable(shelfInfos).ExecuteCommandAsync();
return new ResponseCommon<Object>
{
Code = 200,
Message = $"已删除{deleteRows}条数据!",
Data = null
};
}
catch (Exception ex)
{
var response = new ResponseCommon<Object>
{
Code = 300,
Message = $"操作失败:{ex.Message}",
Data = null
};
return response;
}
}
#region
/// <summary>
/// 发送指令获取模组的电压值

View File

@ -6,7 +6,7 @@ namespace WCS.Model.ApiModel.Home
{
public class ShelfTypeModel
{
public int Id { get; set; }
public int? Id { get; set; }
public string ShelfTypeName { get; set; }
}

View File

@ -5,7 +5,7 @@ using WCS.Model.ApiModel.User;
namespace WCS.Model.ApiModel.MatBaseInfo
{
public class DeleteMatBaseInfosRequest : RequestBase
public class DeleteInfosRequest : RequestBase
{
public List<int> MatBaseInfoIds { get; set; }
}

View File

@ -6,7 +6,8 @@ namespace WCS.Model.ApiModel.StoreInfo
{
public class GetShelvesRequest : PageQueryRequestBase
{
public int ShelfTypeId { get; set; }
public int? ShelfTypeId { get; set; }
public string ShelfCode { get; set; }
public bool? IsEnable { get; set; }
}
}

View File

@ -9,50 +9,85 @@ namespace WCS.Model.ApiModel.StoreInfo
{
public int Id { get; set; }
public string ShelfCode { get; set; }
public int ShelfTypeId { get; set; }
/// <summary>
/// 货架类型ID
/// </summary>
public int? ShelfTypeId { get; set; } = 0;
/// <summary>
/// 货架类型名称
/// </summary>
public string ShelfTypeName { get; set; }
public string ShelfTypeName { get; set; } = string.Empty;
/// <summary>
/// 货架当前状态
/// </summary>
public int CurrentMode { get; set; }
/// <summary>
/// 货架行数
/// </summary>
public int Rowcounts { get; set; }
/// 货架编码 对应二维码
/// </summary>
public string ShelfCode { get; set; } = string.Empty;
/// <summary>
/// 货架列数
/// 货架状态 货架当前的状态空货架/非空货架
/// </summary>
public int Columncounts { get; set; }
public ShelfStatusEnum ShelfStatus { get; set; } = ShelfStatusEnum.;
/// <summary>
/// 货架对应警示灯的Id
/// 货架区域
/// </summary>
public int LightId { get; set; }
public string ShelfArea { get; set; } = string.Empty;
/// <summary>
/// 货架对应Can模块的Ip
/// 货架尺寸
/// </summary>
public string ClientIp { get; set; }
public string ShelfSize { get; set; } = string.Empty;
/// <summary>
/// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架)
/// 备注
/// </summary>
public string GroupName { get; set; }
public string Remark { get; set; } = string.Empty;
public bool IsBind { get; set; }
#region
/// <summary>
/// 当前位置ID
/// </summary>
public int CurrentLocationId { get; set; } = 0;
public string BigShelfCode { get; set; }
/// <summary>
/// 当前位置编码
/// </summary>
public string CurrentLocaiotnCode { get; set; } = string.Empty;
#endregion
/// <summary>
/// 更新人
/// </summary>
public string ModifyUser { get; set; } = string.Empty;
/// <summary>
/// 更新时间
/// </summary>
public DateTime ModifyTime { get; set; } = DateTime.Now;
/// <summary>
/// 是否启用
/// </summary>
public bool IsEnable { get; set; } = true;
public string IsEnableStr
{
get
{
if (IsEnable)
return "启用";
else
return "禁用";
}
}
/// <summary>
/// 序号
/// </summary>
public int RowNumber { get; set; }
public bool IsSelected
{
get { return isSelected; }
@ -70,4 +105,10 @@ namespace WCS.Model.ApiModel.StoreInfo
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
public enum ShelfStatusEnum
{
= 0,
= 1,
}
}

View File

@ -126,25 +126,6 @@ namespace WCS.WebApi.Controllers
}
}
[Route("shelfCheckAll")]
[HttpPost(Name = "shelfCheckAll")]
public async Task<ResponseBase> shelfCheckAll(GetShelfStatusRequest request)
{
try
{
return await _selfCheckService.StartSelfCheckByGroupName(request.GroupNames);
}
catch (Exception ex)
{
return new ResponseBase()
{
Code = 300,
Message = "操作失败:" + ex.Message,
};
}
}
/// <summary>
/// 重置货架的状态 使其回到待机模式
/// </summary>
@ -204,8 +185,6 @@ namespace WCS.WebApi.Controllers
}
}
/// <summary>
/// 获取货架对应的服务端的Ip和端口号
/// </summary>
@ -230,7 +209,6 @@ namespace WCS.WebApi.Controllers
}
}
[Route("getWebSocketWarnings")]
[HttpPost(Name = "getWebSocketWarnings")]
public async Task<ResponseBase> getWebSocketWarnings(RequestBase request)
@ -254,5 +232,46 @@ namespace WCS.WebApi.Controllers
};
}
}
[Route("getShelfTypes")]
[HttpPost(Name = "getShelfTypes")]
public async Task<ResponseBase> getShelfTypes(RequestBase request)
{
try
{
//直接获取当前所有货架类型并返回
var shelfTypes = DbHelp.db.Queryable<ShelfTypeInfo>()
.Select(t => new ShelfTypeModel()
{
Id = t.Id,
ShelfTypeName = t.ShelfTypeName
})
.ToList();
return new PageQueryResponse<ShelfTypeModel>()
{
Code = 200,
Message = "success",
Data = new PageQueryResponseData<ShelfTypeModel>
{
Lists = shelfTypes,
Count = shelfTypes.Count
}
};
}
catch (Exception ex)
{
return new PageQueryResponse<ShelfTypeModel>()
{
Code = 300,
Message = $"查询失败:{ex.Message}",
};
}
}
}
}

View File

@ -96,7 +96,7 @@ namespace WCS.WebApi.Controllers
}
[HttpPost("deleteMatBaseInfo")]
public async Task<ResponseCommon<object>> deleteMatBaseInfo(DeleteMatBaseInfosRequest request)
public async Task<ResponseCommon<object>> deleteMatBaseInfo(DeleteInfosRequest request)
{
return await _matBaseInfoService.deleteMatBaseInfo(request);
}

View File

@ -36,6 +36,12 @@ namespace WCS.WebApi.Controllers
{
return await _storeInfoService.addOrUpdateShelfInfo(request);
}
[HttpPost("deleteShelfInfo")]
public async Task<ResponseCommon<object>> deleteShelfInfo(DeleteInfosRequest request)
{
return await _storeInfoService.deleteShelfInfo(request);
}
#endregion
#region

View File

@ -111,36 +111,7 @@ namespace 智慧物流软件系统.ViewModel
public void SelfCheck()
{
#region
lock (this)
{
try
{
var body = new GetShelfStatusRequest()
{
UserName = LocalStatic.CurrentUser,
DeviceType = "WCS前端",
GroupNames = LocalFile.Config.GroupName,
};
var Result = ApiHelp.GetDataFromHttp<ResponseBase>(LocalFile.Config.ApiIpHost + "home/shelfCheckAll", body, "POST",true);
if (Result != null && Result.Code == 200)
{
}
else
{
}
Thread.Sleep(20);
}
catch (Exception ex)
{
}
finally
{
}
}
#endregion
}
#endregion

View File

@ -267,44 +267,44 @@ namespace 智慧物流软件系统.ViewModel
CurrentPage = 1;
return;
}
#region
var dia = Dialog.Show(new TextDialog());
try
{
var body = new GetInOutRecordRequest()
{
//#region 调用接口获取数
//var dia = Dialog.Show(new TextDialog());
//try
//{
// var body = new GetInOutRecordRequest()
// {
MatSN = MatSN,
MatName = MatName,
MatBatch = MatBatch,
MatCode = MatCode,
StoreCode = StoreCode,
Direction = SelectedDirection,
// MatSN = MatSN,
// MatName = MatName,
// MatBatch = MatBatch,
// MatCode = MatCode,
// StoreCode = StoreCode,
// Direction = SelectedDirection,
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
// ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
PageNumber = CurrentPage,
PageSize = PageSize,
};
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<InOutRecordModel>>(LocalFile.Config.ApiIpHost + "inOutRecord/getInOutRecord", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists != null)
{
DataGridItemSource = Result.Data.Lists;
MaxPage = Result.Data.MaxPage;
TotalCount = Result.Data.TotalCount;
}
}
catch (Exception ex)
{
Growl.Error("加载数据失败:" + ex.Message);
}
finally
{
dia.Close();
}
#endregion
// UserName = LocalStatic.CurrentUser,
// DeviceType = LocalFile.Config.DeviceType,
// PageNumber = CurrentPage,
// PageSize = PageSize,
// };
// var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<InOutRecordModel>>(LocalFile.Config.ApiIpHost + "inOutRecord/getInOutRecord", body, "POST");
// if (Result != null && Result.Data != null && Result.Data.Lists != null)
// {
// DataGridItemSource = Result.Data.Lists;
// MaxPage = Result.Data.MaxPage;
// TotalCount = Result.Data.TotalCount;
// }
//}
//catch (Exception ex)
//{
// Growl.Error("加载数据失败:" + ex.Message);
//}
//finally
//{
// dia.Close();
//}
//#endregion
}
public ICommand BtnExportCommand { get => new DelegateCommand(BtnExport); }

View File

@ -348,7 +348,7 @@ namespace 智慧物流软件系统.ViewModel
}
else
{
var body = new DeleteMatBaseInfosRequest()
var body = new DeleteInfosRequest()
{
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,

View File

@ -222,7 +222,7 @@ namespace 智慧物流软件系统.ViewModel
}
else
{
var body = new DeleteMatBaseInfosRequest()
var body = new DeleteInfosRequest()
{
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,

View File

@ -241,48 +241,48 @@ namespace 智慧物流软件系统.ViewModel
return;
}
#region
var dia = Dialog.Show(new TextDialog());
try
{
var body = new GetMatInventoryDetailRequest()
{
MatName = MatName,
MatSN = MatSN,
MatBatch = MatBatch,
MatCode = MatCode,
StoreCode = StoreCode,
//#region 调用接口获取数
//var dia = Dialog.Show(new TextDialog());
//try
//{
// var body = new GetMatInventoryDetailRequest()
// {
// MatName = MatName,
// MatSN = MatSN,
// MatBatch = MatBatch,
// MatCode = MatCode,
// StoreCode = StoreCode,
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
ShelfCode = ShelfCode,
// ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
// ShelfCode = ShelfCode,
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
PageNumber = CurrentPage,
PageSize = PageSize,
};
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists != null)
{
DataGridItemSource = Result.Data.Lists;
MaxPage = Result.Data.MaxPage;
TotalCount = Result.Data.TotalCount;
TotalQtyStr = "物料总数量" + Result.Message;
}
else
{
TotalQtyStr = string.Empty;
}
}
catch (Exception ex)
{
Growl.Error("加载数据失败:" + ex.Message);
}
finally
{
dia.Close();
}
#endregion
// UserName = LocalStatic.CurrentUser,
// DeviceType = LocalFile.Config.DeviceType,
// PageNumber = CurrentPage,
// PageSize = PageSize,
// };
// var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
// if (Result != null && Result.Data != null && Result.Data.Lists != null)
// {
// DataGridItemSource = Result.Data.Lists;
// MaxPage = Result.Data.MaxPage;
// TotalCount = Result.Data.TotalCount;
// TotalQtyStr = "物料总数量" + Result.Message;
// }
// else
// {
// TotalQtyStr = string.Empty;
// }
//}
//catch (Exception ex)
//{
// Growl.Error("加载数据失败:" + ex.Message);
//}
//finally
//{
// dia.Close();
//}
//#endregion
}
public ICommand BtnExportCommand { get => new DelegateCommand(BtnExport); }
@ -331,95 +331,95 @@ namespace 智慧物流软件系统.ViewModel
{
try
{
#region SN
try
{
var body = new GetMatInventoryDetailRequest()
{
MatName = MatName,
MatSN = MatSN,
MatBatch = MatBatch,
MatCode = MatCode,
StoreCode = StoreCode,
//#region 调用接口获取物料SN
//try
//{
// var body = new GetMatInventoryDetailRequest()
// {
// MatName = MatName,
// MatSN = MatSN,
// MatBatch = MatBatch,
// MatCode = MatCode,
// StoreCode = StoreCode,
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
ShelfCode = ShelfCode,
// ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
// ShelfCode = ShelfCode,
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
PageNumber = 1,
PageSize = 65535,
};
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists != null)
{
//获取搜索条件返回数据中未锁定的物料
var unLockedMatSns = Result.Data.Lists.Where(t => t.IsLocked == false)
.Select(t => t.MatSN)
.ToList();
// UserName = LocalStatic.CurrentUser,
// DeviceType = LocalFile.Config.DeviceType,
// PageNumber = 1,
// PageSize = 65535,
// };
// var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
// if (Result != null && Result.Data != null && Result.Data.Lists != null)
// {
// //获取搜索条件返回数据中未锁定的物料
// var unLockedMatSns = Result.Data.Lists.Where(t => t.IsLocked == false)
// .Select(t => t.MatSN)
// .ToList();
if (unLockedMatSns.Count == 0)
{
HandyControl.Controls.MessageBox.Show("根据您的搜索条件不存在可以出库的物料(或物料已全部被锁定)!");
return;
}
//提示 是否生成出库单
var result = HandyControl.Controls.MessageBox.Show($"根据您的搜索条件,共有{unLockedMatSns.Count}盘未锁定的物料,是否生成出库单并锁定物料?", "提示", MessageBoxButton.OKCancel);
// if (unLockedMatSns.Count == 0)
// {
// HandyControl.Controls.MessageBox.Show("根据您的搜索条件不存在可以出库的物料(或物料已全部被锁定)!");
// return;
// }
// //提示 是否生成出库单
// var result = HandyControl.Controls.MessageBox.Show($"根据您的搜索条件,共有{unLockedMatSns.Count}盘未锁定的物料,是否生成出库单并锁定物料?", "提示", MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
{
var dia = Dialog.Show(new TextDialog());
try
{
#region
var body1 = new SysOutOrderByMatSnRequest()
{
OrderType = "出库",
OrderSource = "WCS前端-库存数据出库",
SnList = unLockedMatSns,
DeviceType = LocalFile.Config.DeviceType,
UserName = LocalStatic.CurrentUser
};
var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatSn", body1, "POST");
if (Result1 != null && Result1.Code == 200)
{
App.Current.Dispatcher.Invoke(() =>
{
dia.Close();
dia.Collapse();
HandyControl.Controls.MessageBox.Show(Result1.Message);
});
}
else if (Result1 != null)
{
Growl.Warning(Result1.Message);
}
// if (result == MessageBoxResult.OK)
// {
// var dia = Dialog.Show(new TextDialog());
// try
// {
// #region 调用接口生成出库单
// var body1 = new SysOutOrderByMatSnRequest()
// {
// OrderType = "出库",
// OrderSource = "WCS前端-库存数据出库",
// SnList = unLockedMatSns,
// DeviceType = LocalFile.Config.DeviceType,
// UserName = LocalStatic.CurrentUser
// };
// var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatSn", body1, "POST");
// if (Result1 != null && Result1.Code == 200)
// {
// App.Current.Dispatcher.Invoke(() =>
// {
// dia.Close();
// dia.Collapse();
// HandyControl.Controls.MessageBox.Show(Result1.Message);
// });
// }
// else if (Result1 != null)
// {
// Growl.Warning(Result1.Message);
// }
#endregion
}
catch (Exception ex)
{
Growl.Error("生成出库单据失败:" + ex.Message);
}
finally
{
App.Current.Dispatcher.Invoke(() =>
{
dia.Close();
dia.Collapse();
});
}
}
}
}
catch (Exception ex)
{
Growl.Error("获取数据失败:" + ex.Message);
}
finally
{
}
#endregion
// #endregion
// }
// catch (Exception ex)
// {
// Growl.Error("生成出库单据失败:" + ex.Message);
// }
// finally
// {
// App.Current.Dispatcher.Invoke(() =>
// {
// dia.Close();
// dia.Collapse();
// });
// }
// }
// }
//}
//catch (Exception ex)
//{
// Growl.Error("获取数据失败:" + ex.Message);
//}
//finally
//{
//}
//#endregion
}
catch (Exception ex)
{
@ -430,102 +430,102 @@ namespace 智慧物流软件系统.ViewModel
public ICommand BtnGenerateStocktakingCommand { get => new DelegateCommand(BtnGenerateStocktaking); }
public void BtnGenerateStocktaking()
{
try
{
#region SN
try
{
var body = new GetMatInventoryDetailRequest()
{
MatName = MatName,
MatSN = MatSN,
MatBatch = MatBatch,
MatCode = MatCode,
StoreCode = StoreCode,
//try
//{
// #region 调用接口获取物料SN
// try
// {
// var body = new GetMatInventoryDetailRequest()
// {
// MatName = MatName,
// MatSN = MatSN,
// MatBatch = MatBatch,
// MatCode = MatCode,
// StoreCode = StoreCode,
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
ShelfCode = ShelfCode,
// ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
// ShelfCode = ShelfCode,
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
PageNumber = CurrentPage,
PageSize = 65535,
};
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists != null)
{
//获取搜索条件返回数据中未锁定的物料
var unLockedMatSns = Result.Data.Lists.Where(t => t.IsLocked == false)
.Select(t => t.MatSN)
.ToList();
// UserName = LocalStatic.CurrentUser,
// DeviceType = LocalFile.Config.DeviceType,
// PageNumber = CurrentPage,
// PageSize = 65535,
// };
// var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
// if (Result != null && Result.Data != null && Result.Data.Lists != null)
// {
// //获取搜索条件返回数据中未锁定的物料
// var unLockedMatSns = Result.Data.Lists.Where(t => t.IsLocked == false)
// .Select(t => t.MatSN)
// .ToList();
if (unLockedMatSns.Count == 0)
{
HandyControl.Controls.MessageBox.Show("根据您的搜索条件不存在可以盘点的物料!");
return;
}
//提示 是否生成出库单
var result = HandyControl.Controls.MessageBox.Show($"根据您的搜索条件,共有{unLockedMatSns.Count}盘未锁定的物料,是否生成盘点单?", "提示", MessageBoxButton.OKCancel);
// if (unLockedMatSns.Count == 0)
// {
// HandyControl.Controls.MessageBox.Show("根据您的搜索条件不存在可以盘点的物料!");
// return;
// }
// //提示 是否生成出库单
// var result = HandyControl.Controls.MessageBox.Show($"根据您的搜索条件,共有{unLockedMatSns.Count}盘未锁定的物料,是否生成盘点单?", "提示", MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
{
var dia = Dialog.Show(new TextDialog());
try
{
#region
var body1 = new SysStockTakingOrderRequest()
{
StocktakingOrderType = "snList",
StocktakingOrderSource = "WCS前端-库存数据",
List = unLockedMatSns,
DeviceType = LocalFile.Config.DeviceType,
UserName = LocalStatic.CurrentUser
};
var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/sysStockTakingOrder", body1, "POST");
if (Result1 != null && Result1.Code == 200)
{
App.Current.Dispatcher.Invoke(() =>
{
dia.Close();
dia.Collapse();
HandyControl.Controls.MessageBox.Show(Result1.Message);
});
}
else if (Result1 != null)
{
Growl.Warning(Result1.Message);
}
// if (result == MessageBoxResult.OK)
// {
// var dia = Dialog.Show(new TextDialog());
// try
// {
// #region 调用接口生成盘点单
// var body1 = new SysStockTakingOrderRequest()
// {
// StocktakingOrderType = "snList",
// StocktakingOrderSource = "WCS前端-库存数据",
// List = unLockedMatSns,
// DeviceType = LocalFile.Config.DeviceType,
// UserName = LocalStatic.CurrentUser
// };
// var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/sysStockTakingOrder", body1, "POST");
// if (Result1 != null && Result1.Code == 200)
// {
// App.Current.Dispatcher.Invoke(() =>
// {
// dia.Close();
// dia.Collapse();
// HandyControl.Controls.MessageBox.Show(Result1.Message);
// });
// }
// else if (Result1 != null)
// {
// Growl.Warning(Result1.Message);
// }
#endregion
}
catch (Exception ex)
{
Growl.Error("生成盘点单据失败:" + ex.Message);
}
finally
{
App.Current.Dispatcher.Invoke(() =>
{
dia.Close();
dia.Collapse();
});
}
}
}
}
catch (Exception ex)
{
Growl.Error("获取数据失败:" + ex.Message);
}
finally
{
}
#endregion
}
catch (Exception ex)
{
Growl.Error("导出失败:" + ex.Message);
}
// #endregion
// }
// catch (Exception ex)
// {
// Growl.Error("生成盘点单据失败:" + ex.Message);
// }
// finally
// {
// App.Current.Dispatcher.Invoke(() =>
// {
// dia.Close();
// dia.Collapse();
// });
// }
// }
// }
// }
// catch (Exception ex)
// {
// Growl.Error("获取数据失败:" + ex.Message);
// }
// finally
// {
// }
// #endregion
//}
//catch (Exception ex)
//{
// Growl.Error("导出失败:" + ex.Message);
//}
}
#endregion

View File

@ -115,22 +115,22 @@ namespace 智慧物流软件系统.ViewModels
{
HandyControl.Controls.MessageBox.Show("请选择货架类型!");
}
var window = new OutInventoryAddMatView(SelectedShelfTypeItem.Id);
window.Owner = Application.Current.MainWindow;
window.Topmost = true;
//var window = new OutInventoryAddMatView(SelectedShelfTypeItem.Id);
//window.Owner = Application.Current.MainWindow;
//window.Topmost = true;
var result = window.ShowDialog();
if (result == true)
{
if (DataGridItemSource == null)
DataGridItemSource = new ObservableCollection<MatInventorySummaryModel>();
DataGridItemSource.Add(window.inventorySummary);
SelectedTypeCount = DataGridItemSource.Count;
}
else
{
return;
}
//var result = window.ShowDialog();
//if (result == true)
//{
// if (DataGridItemSource == null)
// DataGridItemSource = new ObservableCollection<MatInventorySummaryModel>();
// DataGridItemSource.Add(window.inventorySummary);
// SelectedTypeCount = DataGridItemSource.Count;
//}
//else
//{
// return;
//}
}
public ICommand DelCommand { get => new DelegateCommand<MatInventorySummaryModel>(Del); }
@ -185,45 +185,45 @@ namespace 智慧物流软件系统.ViewModels
// return;
//}
}
#region
try
{
var body = new SysOutOrderByMatCodeRequest()
{
OrderType = "出库",
OrderSource = "WCS前端",
ShelfTypeId = SelectedShelfTypeItem.Id,
ShelfTypeName = SelectedShelfTypeItem.ShelfTypeName,
ItemList = DataGridItemSource.Select(t => new MatCodeItemList()
{
MatCode = t.MatCode,
MatName = t.MatName,
MatBatch = t.MatBatch,
ReqQty = t.NeedQty,
}).ToList(),
DeviceType = LocalFile.Config.DeviceType,
UserName = LocalStatic.CurrentUser
};
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatCode", body, "POST");
if (Result != null && Result.Code == 200)
{
Growl.Success(Result.Message);
OnRequestClose(true);
}
else if (Result != null)
{
Growl.Warning(Result.Message);
return;
}
}
catch (Exception ex)
{
Growl.Error("加载数据失败:" + ex.Message);
}
finally
{
}
#endregion
//#region 调用接口生成出库单
//try
//{
// var body = new SysOutOrderByMatCodeRequest()
// {
// OrderType = "出库",
// OrderSource = "WCS前端",
// ShelfTypeId = SelectedShelfTypeItem.Id,
// ShelfTypeName = SelectedShelfTypeItem.ShelfTypeName,
// ItemList = DataGridItemSource.Select(t => new MatCodeItemList()
// {
// MatCode = t.MatCode,
// MatName = t.MatName,
// MatBatch = t.MatBatch,
// ReqQty = t.NeedQty,
// }).ToList(),
// DeviceType = LocalFile.Config.DeviceType,
// UserName = LocalStatic.CurrentUser
// };
// var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatCode", body, "POST");
// if (Result != null && Result.Code == 200)
// {
// Growl.Success(Result.Message);
// OnRequestClose(true);
// }
// else if (Result != null)
// {
// Growl.Warning(Result.Message);
// return;
// }
//}
//catch (Exception ex)
//{
// Growl.Error("加载数据失败:" + ex.Message);
//}
//finally
//{
//}
//#endregion
}
#endregion
}

View File

@ -22,19 +22,22 @@ namespace 智慧物流软件系统.ViewModel
public void SetValues(ShelfInfoModel shelfInfoModel)
{
if (shelfInfoModel != null)
if (shelfInfoModel == null)
{
ShelfId = shelfInfoModel.Id;
SelectedShelfTypeItem = shelfTypeItems.First(t => t.Id == shelfInfoModel.ShelfTypeId);
ShelfCode = shelfInfoModel.ShelfCode;
RowCounts = shelfInfoModel.Rowcounts;
ColumnCounts = shelfInfoModel.Columncounts;
LightId = shelfInfoModel.LightId;
ClientIp = shelfInfoModel.ClientIp;
GroupName = shelfInfoModel.GroupName;
IsBind = shelfInfoModel.IsBind;
BigShelfCode = shelfInfoModel.BigShelfCode;
shelfInfoModel = new ShelfInfoModel();
}
ShelfId = shelfInfoModel.Id;
var item = ShelfTypeItems.FirstOrDefault(t => t.Id == shelfInfoModel.ShelfTypeId);
if (item != null)
{
SelectedShelfTypeItem = item;
}
ShelfCode = shelfInfoModel.ShelfCode;
ShelfSize = shelfInfoModel.ShelfSize;
Remark = shelfInfoModel.Remark;
IsEnable = shelfInfoModel.IsEnable;
}
public ShelfInfoModel GetValues()
@ -45,27 +48,12 @@ namespace 智慧物流软件系统.ViewModel
ShelfTypeId = SelectedShelfTypeItem.Id,
ShelfTypeName = SelectedShelfTypeItem.ShelfTypeName,
ShelfCode = ShelfCode,
Rowcounts = RowCounts,
Columncounts = ColumnCounts,
LightId = LightId,
ClientIp = ClientIp,
GroupName = GroupName,
IsBind = IsBind,
BigShelfCode = BigShelfCode,
ShelfSize = ShelfSize,
Remark = Remark,
IsEnable = IsEnable,
};
}
private int shelfId;
public int ShelfId
{
get { return shelfId; }
set
{
SetProperty(ref shelfId, value);
}
}
private List<ShelfTypeModel> shelfTypeItems;
public List<ShelfTypeModel> ShelfTypeItems
{
@ -86,6 +74,16 @@ namespace 智慧物流软件系统.ViewModel
}
}
private int shelfId;
public int ShelfId
{
get { return shelfId; }
set
{
SetProperty(ref shelfId, value);
}
}
private string shelfCode;
public string ShelfCode
{
@ -96,73 +94,33 @@ namespace 智慧物流软件系统.ViewModel
}
}
private int rowCounts;
public int RowCounts
private string shelfSize;
public string ShelfSize
{
get { return rowCounts; }
get { return shelfSize; }
set
{
SetProperty(ref rowCounts, value);
SetProperty(ref shelfSize, value);
}
}
private int columnCounts;
public int ColumnCounts
private string remark;
public string Remark
{
get { return columnCounts; }
get { return remark; }
set
{
SetProperty(ref columnCounts, value);
SetProperty(ref remark, value);
}
}
private int lightId;
public int LightId
private bool isEnable;
public bool IsEnable
{
get { return lightId; }
get { return isEnable; }
set
{
SetProperty(ref lightId, value);
}
}
private string clientIp;
public string ClientIp
{
get { return clientIp; }
set
{
SetProperty(ref clientIp, value);
}
}
private string groupName;
public string GroupName
{
get { return groupName; }
set
{
SetProperty(ref groupName, value);
}
}
private bool isBind;
public bool IsBind
{
get { return isBind; }
set
{
SetProperty(ref isBind, value);
}
}
private string bigShelfCode;
public string BigShelfCode
{
get { return bigShelfCode; }
set
{
SetProperty(ref bigShelfCode, value);
SetProperty(ref isEnable, value);
}
}
#endregion

View File

@ -52,7 +52,7 @@ namespace 智慧物流软件系统.ViewModel
/// <summary>
/// 物料批次
/// 货架编号
/// </summary>
private string shelfCode;
public string ShelfCode
@ -73,11 +73,25 @@ namespace 智慧物流软件系统.ViewModel
SetProperty(ref shelfTypeItems, value);
}
}
private ShelfTypeModel? selectedShelfTypeItem;
public ShelfTypeModel? SelectedShelfTypeItem
{
get { return selectedShelfTypeItem; }
set
{
SetProperty(ref selectedShelfTypeItem, value);
}
}
public void InitShelfTypeItems()
{
//调用接口更新!
Task.Run(() =>
{
ShelfTypeItems = new List<ShelfTypeModel>();
ShelfTypeItems.Add(new ShelfTypeModel { Id = null, ShelfTypeName = "全部" });
var body = new RequestBase()
{
UserName = LocalStatic.CurrentUser,
@ -87,18 +101,23 @@ namespace 智慧物流软件系统.ViewModel
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ShelfTypeModel>>(LocalFile.Config.ApiIpHost + "home/getShelfTypes", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists.Count() > 0)
{
ShelfTypeItems = Result.Data.Lists;
ShelfTypeItems.AddRange(Result.Data.Lists);
}
SelectedShelfTypeItem = ShelfTypeItems.FirstOrDefault();
});
}
private ShelfTypeModel selectedShelfTypeItem;
public ShelfTypeModel SelectedShelfTypeItem
/// <summary>
/// 启用状态
/// </summary>
private bool? isEnable;
public bool? IsEnable
{
get { return selectedShelfTypeItem; }
get { return isEnable; }
set
{
SetProperty(ref selectedShelfTypeItem, value);
SetProperty(ref isEnable, value);
}
}
#endregion
@ -107,8 +126,12 @@ namespace 智慧物流软件系统.ViewModel
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
public void BtnReset()
{
SelectedShelfTypeItem = null;
if (ShelfTypeItems != null)
{
SelectedShelfTypeItem = ShelfTypeItems.FirstOrDefault();
}
ShelfCode = string.Empty;
IsEnable = null;
}
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
@ -130,8 +153,9 @@ namespace 智慧物流软件系统.ViewModel
{
var body = new GetShelvesRequest()
{
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
ShelfTypeId = SelectedShelfTypeItem == null ? null : SelectedShelfTypeItem.Id,
ShelfCode = ShelfCode,
IsEnable = IsEnable,
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
PageNumber = CurrentPage,
@ -194,32 +218,68 @@ namespace 智慧物流软件系统.ViewModel
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
public void BtnDelete()
{
//查询勾选的第一个数据
var shelfInfo = DataGridItemSource?.Where(t => t.IsSelected == true).FirstOrDefault();
if (shelfInfo == null)
Growl.Ask($"是否删除所有勾选的数据?", isConfirmed =>
{
Growl.Warning("请选择需要删除的数据!");
}
else
{
var body = new AddShelfInfoRequest<ShelfInfoModel>()
if (isConfirmed)
{
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
ShelfInfo = shelfInfo,
AddOrUpdate = AddOrUpdate.Delete
};
var Result = ApiHelp.GetDataFromHttp<ResponseBase<object>>(LocalFile.Config.ApiIpHost + "storeInfo/addOrUpdateShelfInfo", body, "POST");
if (Result != null && Result.Code == 200)
{
Growl.Success("删除成功!");
CurrentPage = 1;
//查询勾选的第一个数据
var matBaseInfoIds = DataGridItemSource?.Where(t => t.IsSelected == true)
.Select(t => t.Id)
.ToList();
if (matBaseInfoIds == null)
{
Growl.Warning("请选择需要修改的数据!");
}
else
{
var body = new DeleteInfosRequest()
{
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
MatBaseInfoIds = matBaseInfoIds,
};
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "storeInfo/deleteShelfInfo", body, "POST");
if (Result != null && Result.Code == 200)
{
BtnSearch();
Growl.Success("删除成功!" + Result?.Message);
}
else
{
Growl.Error($"{Result?.Message?.ToString()}");
}
}
}
else
{
Growl.Error($"{Result?.Message?.ToString()}");
}
}
return true;
});
////查询勾选的第一个数据
//var shelfInfo = DataGridItemSource?.Where(t => t.IsSelected == true).FirstOrDefault();
//if (shelfInfo == null)
//{
// Growl.Warning("请选择需要删除的数据!");
//}
//else
//{
// var body = new AddShelfInfoRequest<ShelfInfoModel>()
// {
// UserName = LocalStatic.CurrentUser,
// DeviceType = LocalFile.Config.DeviceType,
// ShelfInfo = shelfInfo,
// AddOrUpdate = AddOrUpdate.Delete
// };
// var Result = ApiHelp.GetDataFromHttp<ResponseBase<object>>(LocalFile.Config.ApiIpHost + "storeInfo/addOrUpdateShelfInfo", body, "POST");
// if (Result != null && Result.Code == 200)
// {
// Growl.Success("删除成功!");
// CurrentPage = 1;
// }
// else
// {
// Growl.Error($"{Result?.Message?.ToString()}");
// }
//}
}
#endregion

View File

@ -53,12 +53,11 @@
<TextBlock Grid.Column="6"
VerticalAlignment="Center" HorizontalAlignment="Right"
Text="物料状态:" FontSize="18" ></TextBlock>
Text="启用状态:" FontSize="18" ></TextBlock>
<ComboBox Grid.Column="7"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
FontSize="18" MinWidth="90"
SelectedValuePath="Tag" SelectedValue="{Binding IsEnable}"
>
SelectedValuePath="Tag" SelectedValue="{Binding IsEnable}">
<ComboBoxItem IsSelected="True" Tag="{x:Null}" >全部</ComboBoxItem>
<ComboBoxItem Tag="True">启用</ComboBoxItem>
<ComboBoxItem Tag="False">禁用</ComboBoxItem>

View File

@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Height="440" Width="320" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
Height="280" Width="320" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
<Border BorderBrush="Gray" Background="WhiteSmoke" CornerRadius="5" BorderThickness="1">
<Grid>
<Grid.RowDefinitions>
@ -24,7 +24,7 @@
<StackPanel Margin="5,0" Grid.Row="1" >
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="货架类型" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBlock Text="货架类型: " FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<ComboBox Grid.Row="0" Grid.Column="1"
DisplayMemberPath="ShelfTypeName"
ItemsSource="{Binding ShelfTypeItems}"
@ -37,7 +37,7 @@
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="货架编码:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBlock Text="货架编号: " FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Name="txtShelfCode" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Style="{StaticResource TextBoxExtend}"
@ -49,90 +49,40 @@
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="货架行数:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBlock Text="货架尺寸: " FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Name="txtRowCounts" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Style="{StaticResource TextBoxExtend}"
Text="{Binding RowCounts}"
hc:InfoElement.Placeholder="此项必填">
Text="{Binding ShelfSize}">
</TextBox>
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center">
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="货架列数:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBlock Text="备&#12288;&#12288;注: " FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Name="txtColumnCounts" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Style="{StaticResource TextBoxExtend}"
Text="{Binding ColumnCounts}"
hc:InfoElement.Placeholder="此项必填">
Text="{Binding Remark}">
</TextBox>
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center">
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="报警灯ID" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Name="txtLightId" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Style="{StaticResource TextBoxExtend}"
hc:InfoElement.Placeholder="此项必填"
Text="{Binding LightId}">
</TextBox>
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center">
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="TCP信息" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Name="txtClientIp" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Style="{StaticResource TextBoxExtend}"
hc:InfoElement.Placeholder="此项必填"
Text="{Binding ClientIp}">
</TextBox>
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center">
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="货架区域:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Name="txtGroupName" MinWidth="200" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Style="{StaticResource TextBoxExtend}"
hc:InfoElement.Placeholder="此项必填"
Text="{Binding GroupName}">
</TextBox>
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center">
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="是否绑定: " FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBlock Text="启用状态: " FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<ComboBox Name="IsBind" MinWidth="100" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
SelectedValuePath="Tag" SelectedValue="{Binding IsBind}">
<ComboBoxItem Tag="True">启用</ComboBoxItem>
<ComboBoxItem Tag="False" IsSelected="True">禁用</ComboBoxItem>
SelectedValuePath="Tag" SelectedValue="{Binding IsEnable}">
<ComboBoxItem Tag="True" IsSelected="True">启用</ComboBoxItem>
<ComboBoxItem Tag="False" >禁用</ComboBoxItem>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="绑定后货架编码:" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
<TextBox Name="txtBigShelfCode" MinWidth="150" MaxWidth="150" Grid.Row="0" Grid.Column="1" FontSize="15"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
Text="{Binding BigShelfCode}"
Style="{StaticResource TextBoxExtend}">
</TextBox>
</StackPanel>
</StackPanel>
<StackPanel Margin="5" x:Name="spacingPanel" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Margin="5" MinHeight="30" FontSize="15" Content="确认" Name="btnOk" Click="btnOk_Click"/>
<Button Margin="5" MinHeight="30" FontSize="15" Content="取消" Click="closeClick"/>
</StackPanel>
</Grid>
</Border>
</Window>

View File

@ -39,42 +39,6 @@ namespace 智慧物流软件系统
txtShelfCode.Focus();
return;
}
if (ViewModel.RowCounts == 0)
{
Growl.Warning("请输入货架行数!");
txtRowCounts.Focus();
return;
}
if (ViewModel.ColumnCounts == 0)
{
Growl.Warning("请输入货架列数!");
txtColumnCounts.Focus();
return;
}
if (ViewModel.LightId == 0)
{
Growl.Warning("请输入报警灯Id");
txtLightId.Focus();
return;
}
if (string.IsNullOrEmpty(ViewModel.ClientIp))
{
Growl.Warning("请输入TCP信息");
txtClientIp.Focus();
return;
}
if (string.IsNullOrEmpty(ViewModel.GroupName))
{
Growl.Warning("请输入货架区域!");
txtGroupName.Focus();
return;
}
if (ViewModel.IsBind && string.IsNullOrEmpty(ViewModel.BigShelfCode))
{
Growl.Warning("需要绑定的货架需要输入绑定后货架编码!");
txtBigShelfCode.Focus();
return;
}
#endregion
#region /

View File

@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
d:DesignHeight="737" d:DesignWidth="1192" LoadedVisibleFirst="LoadedVisible">
d:DesignHeight="737" d:DesignWidth="1192" LoadedVisibleFirst="LoadedVisible" Loaded="UserControlBase_Loaded">
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
<Grid>
<Grid.RowDefinitions>
@ -21,8 +21,8 @@
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1.9*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1.9*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
@ -41,10 +41,25 @@
IsEditable="False"/>
<TextBlock Grid.Column="2"
VerticalAlignment="Center" HorizontalAlignment="Right"
Text="货架编" FontSize="18" ></TextBlock>
Text="货架编" FontSize="18">
</TextBlock>
<TextBox Grid.Column="3"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
FontSize="18" MinWidth="90" Text="{Binding ShelfCode}"></TextBox>
FontSize="18" MinWidth="90" Text="{Binding ShelfCode}">
</TextBox>
<TextBlock Grid.Column="4"
VerticalAlignment="Center" HorizontalAlignment="Right"
Text="启用状态:" FontSize="18" ></TextBlock>
<ComboBox Grid.Column="5"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
FontSize="18" MinWidth="90"
SelectedValuePath="Tag" SelectedValue="{Binding IsEnable}">
<ComboBoxItem IsSelected="True" Tag="{x:Null}" >全部</ComboBoxItem>
<ComboBoxItem Tag="True">启用</ComboBoxItem>
<ComboBoxItem Tag="False">禁用</ComboBoxItem>
</ComboBox>
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
Grid.Column="9" MinHeight="40" FontSize="18" Content="&#xe8b9; 搜索" FontFamily="{StaticResource IconFont}"
Command="{Binding BtnSearchCommand}">
@ -83,12 +98,6 @@
Command="{Binding BtnDeleteCommand}"
Style="{StaticResource ButtonDanger}">
</Button>
<!--<Button MinHeight="40" FontSize="18" Margin="5"
Content="&#xe866;生成模组" FontFamily="{StaticResource IconFont}"
Command="{Binding BtnImportCommand}"
Foreground="WhiteSmoke"
Background="Green">
</Button>-->
</StackPanel>
<DataGrid Grid.Row="1"
@ -113,14 +122,13 @@
</DataGridTemplateColumn>
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架类型" Binding="{Binding ShelfTypeName}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架编" Binding="{Binding ShelfCode}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架行数" Binding="{Binding Rowcounts}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架列数" Binding="{Binding Columncounts}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="报警灯ID" Binding="{Binding LightId}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="TCP连接信息" Binding="{Binding ClientIp}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架区域(组别)" Binding="{Binding GroupName}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="是否绑定" Binding="{Binding IsBind,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BigShelfCode}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架编" Binding="{Binding ShelfCode}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架尺寸" Binding="{Binding ShelfSize}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="备注" Binding="{Binding Remark}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="货架当前状态" Binding="{Binding ShelfStatus}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="启用状态" Binding="{Binding IsEnableStr}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="更新人" Binding="{Binding ModifyUser}"></DataGridTextColumn>
<DataGridTextColumn IsReadOnly="True" Header="更新时间" Binding="{Binding ModifyTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
@ -141,8 +149,6 @@
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
<TextBlock FontSize="14" VerticalAlignment="Center" Text="条记录 "></TextBlock>
<TextBlock FontSize="14" VerticalAlignment="Center" Text="第"></TextBlock>
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
<TextBlock FontSize="14" VerticalAlignment="Center" Text="/"></TextBlock>

View File

@ -29,8 +29,10 @@ namespace 智慧物流软件系统
private void LoadedVisible(object sender, EventArgs e)
{
viewModel.BtnReset();
//viewModel.BtnReset();
viewModel.InitShelfTypeItems();
viewModel.BtnSearchReset();
}
@ -87,5 +89,10 @@ namespace 智慧物流软件系统
{
;
}
private void UserControlBase_Loaded(object sender, RoutedEventArgs e)
{
//viewModel.BtnSearch();
}
}
}