fature
This commit is contained in:
@ -270,7 +270,15 @@ namespace 货架标准上位机.Api
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 调用接口超时时间10s
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="dataObj"></param>
|
||||
/// <param name="httpMethod"></param>
|
||||
/// <param name="isSaveLog"></param>
|
||||
/// <returns></returns>
|
||||
public static T GetDataFromHttp<T>(string url, object dataObj, string httpMethod, bool isSaveLog = false)
|
||||
{
|
||||
Guid guid = Guid.NewGuid();
|
||||
|
@ -17,6 +17,7 @@ namespace 货架标准上位机
|
||||
权限 = 2000,
|
||||
设置 = 3000,
|
||||
调试 = 4000,
|
||||
主页 = 5000,
|
||||
}
|
||||
|
||||
public class EnumTreeAttribute : Attribute
|
||||
|
BIN
货架标准上位机/Resources/扫码枪结束入库二维码.png
Normal file
BIN
货架标准上位机/Resources/扫码枪结束入库二维码.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
@ -51,7 +51,7 @@ namespace 货架标准上位机.ViewModel
|
||||
if (newBytes > 0)
|
||||
{
|
||||
var currentScanedCode = Encoding.UTF8.GetString(e.ByteBlock, 0, e.ByteBlock.Len);
|
||||
Logs.Write($"接收到扫码枪扫码数据{currentScanedCode}");
|
||||
Logs.Write($"接收到扫码枪[{scanner.COM}]扫码数据{currentScanedCode}", LogsType.Scanner);
|
||||
scanner.TempCode += currentScanedCode;
|
||||
//校验末尾码
|
||||
CheckDataCompleteness(scanner);
|
||||
@ -88,11 +88,18 @@ namespace 货架标准上位机.ViewModel
|
||||
var isModuleCode = Regex.IsMatch(scanner.TempCode, ModuleCodePattern);
|
||||
if (isModuleCode)
|
||||
{
|
||||
Logs.Write($"[{scanner.COM}]校验到扫码数据为货架码【{scanner.TempCode}】", LogsType.Scanner);
|
||||
ModuleCodeProcess(scanner);
|
||||
}
|
||||
else if (scanner.TempCode == "shelfGoOutInStore")
|
||||
{
|
||||
Logs.Write($"[{scanner.COM}]校验到扫码数据为结束入库码【{scanner.TempCode}】", LogsType.Scanner);
|
||||
ShelfGoOutInstoreProcess(scanner);
|
||||
}
|
||||
//TODO 增加正则表达式进行判断是否扫到的是物料码
|
||||
else
|
||||
{
|
||||
Logs.Write($"[{scanner.COM}]校验到扫码数据为物料码【{scanner.TempCode}】", LogsType.Scanner);
|
||||
MatSnProcess(scanner);
|
||||
}
|
||||
}
|
||||
@ -118,13 +125,15 @@ namespace 货架标准上位机.ViewModel
|
||||
//如果扫码枪前一个货架未退出入库
|
||||
if (scanner.IsInstoreMode)
|
||||
{
|
||||
//判断当前入库货架是否包含本次扫码的模组
|
||||
//判断当前入库货架是否包含本次扫码的模组 表示用户重复对货架码进行扫码 不能让其多次进入入库
|
||||
if (scanner.ModulesStr.Contains(scanner.TempCode))
|
||||
{
|
||||
Logs.Write($"当前扫码模组{scanner.TempCode},是当前入库货架{scanner.ShelfCode}的模组,不进行操作!", LogsType.Scanner);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Logs.Write($"当前扫码模组{scanner.TempCode},不是当前入库货架{scanner.ShelfCode}的模组,先进行当前入库货架的退出入库操作!", LogsType.Scanner);
|
||||
#region 调用接口结束扫码枪占用入库的货架
|
||||
try
|
||||
{
|
||||
@ -135,26 +144,32 @@ namespace 货架标准上位机.ViewModel
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase>(LocalFile.Config.ApiIpHost + "instore/shelfGoOutInStore", body, "POST");
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase>(LocalFile.Config.ApiIpHost + "instore/shelfGoOutInStore", body, "POST", true);
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Logs.Write($"货架{scanner.ShelfCode}已成功退出入库!", LogsType.Scanner);
|
||||
scanner.ShelfCode = string.Empty;
|
||||
scanner.ModulesStr = string.Empty;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Logs.Write($"货架{scanner.ShelfCode}退出入库失败!", LogsType.Scanner);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Logs.Write($"货架{scanner.ShelfCode}退出入库失败!发生异常:{ex.Message}", LogsType.Scanner);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
//调用接口 请求进入入库模式
|
||||
//调用接口 本次扫码的货架进入入库模式
|
||||
#region 调用接口进入入库模式
|
||||
try
|
||||
{
|
||||
Logs.Write($"扫码模组{scanner.TempCode},请求进入入库!", LogsType.Scanner);
|
||||
var body = new ShelfGoInInstoreRequest()
|
||||
{
|
||||
ModuleCode = scanner.TempCode,
|
||||
@ -165,20 +180,25 @@ namespace 货架标准上位机.ViewModel
|
||||
var Result = ApiHelp.GetDataFromHttp<ShelfGoInInstoreResponse>(LocalFile.Config.ApiIpHost + "instore/shelfGoInInStore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Logs.Write($"扫码模组{scanner.TempCode},进入入库模式成功!", LogsType.Scanner);
|
||||
scanner.IsInstoreMode = true;
|
||||
scanner.ShelfCode = Result.Data.ShelfCode;
|
||||
scanner.ModulesStr = Result.Data.ModulesStr;
|
||||
//TODO 清除其他扫码枪的占用
|
||||
|
||||
//清除其他扫码枪的占用
|
||||
var sacnners = ScannerManager.Scanners
|
||||
.Where(t => ShelfCode == Result.Data.ShelfCode)
|
||||
.Where(t => t.COM != scanner.COM)
|
||||
.ToList();
|
||||
foreach (var item in sacnners)
|
||||
foreach (var scanner1 in sacnners)
|
||||
{
|
||||
item.ShelfCode = string.Empty;
|
||||
scanner1.ShelfCode = string.Empty;
|
||||
scanner1.ModulesStr = string.Empty;
|
||||
}
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
Logs.Write($"扫码模组{scanner.TempCode},进入入库模式失败!{Result.Message}", LogsType.Scanner);
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
@ -189,6 +209,36 @@ namespace 货架标准上位机.ViewModel
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫码枪扫到结束码
|
||||
/// </summary>
|
||||
/// <param name="scanner"></param>
|
||||
public void ShelfGoOutInstoreProcess(Scanner scanner)
|
||||
{
|
||||
#region 调用接口结束扫码枪占用入库的货架
|
||||
try
|
||||
{
|
||||
var body = new ShelfGoOutInStoreRequest()
|
||||
{
|
||||
ShelfCode = scanner.ShelfCode,
|
||||
IPAdress = scanner.COM,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase>(LocalFile.Config.ApiIpHost + "instore/shelfGoOutInStore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
scanner.ShelfCode = string.Empty;
|
||||
scanner.ModulesStr = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
/// <summary>
|
||||
/// 扫到物料码的数据处理
|
||||
/// </summary>
|
||||
|
@ -243,7 +243,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
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)
|
||||
@ -293,7 +293,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = 65535,
|
||||
};
|
||||
await ApiHelp.PostDownloadFileAsync(path, System.Net.Http.HttpMethod.Post, LocalFile.Config.ApiIpHost + "inOutRecord/exportInOutRecord", body);
|
||||
Growl.Success("导出成功!");
|
||||
@ -334,6 +334,14 @@ namespace 货架标准上位机.ViewModel
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = PageSize,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<SystemApiLogModel>>(LocalFile.Config.ApiIpHost + "interfaceRecord/getInterfaceRecord", body, "POST");
|
||||
@ -211,7 +211,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = 65535,
|
||||
|
||||
};
|
||||
await ApiHelp.PostDownloadFileAsync(path, System.Net.Http.HttpMethod.Post, LocalFile.Config.ApiIpHost + "interfaceRecord/exportInterfaceRecord", body);
|
||||
@ -251,6 +251,14 @@ namespace 货架标准上位机.ViewModel
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
|
@ -142,7 +142,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = PageSize,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatBaseInfoModel>>(LocalFile.Config.ApiIpHost + "matBaseInfo/getMatBaseInfo", body, "POST");
|
||||
@ -163,8 +163,6 @@ namespace 货架标准上位机.ViewModel
|
||||
dia.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -173,7 +171,6 @@ namespace 货架标准上位机.ViewModel
|
||||
public ICommand BtnExportCommand { get => new DelegateCommand(BtnExport); }
|
||||
public async void BtnExport()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
#region 选择文件保存路径
|
||||
@ -199,7 +196,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = 65535,
|
||||
};
|
||||
await ApiHelp.PostDownloadFileAsync(path, System.Net.Http.HttpMethod.Post, LocalFile.Config.ApiIpHost + "matBaseInfo/exportMatBaseInfo", body);
|
||||
Growl.Success("导出成功!");
|
||||
@ -240,7 +237,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = 65535,
|
||||
};
|
||||
var result = await ApiHelp.PostImportFileAsync<ResponseCommon<List<string>>>(path, System.Net.Http.HttpMethod.Post,
|
||||
LocalFile.Config.ApiIpHost + "matBaseInfo/importMatBaseInfo", LocalStatic.CurrentUser, LocalFile.Config.DeviceType);
|
||||
@ -256,7 +253,6 @@ namespace 货架标准上位机.ViewModel
|
||||
else
|
||||
HandyControl.Controls.MessageBox.Show(result.Message);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -295,7 +291,6 @@ namespace 货架标准上位机.ViewModel
|
||||
else
|
||||
{
|
||||
Growl.Error($"{Result?.Message?.ToString()}");
|
||||
//BtnAdd();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -430,6 +425,14 @@ namespace 货架标准上位机.ViewModel
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
|
@ -26,11 +26,22 @@ using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using System.Collections.ObjectModel;
|
||||
using HandyControl.Tools.Extension;
|
||||
using 货架标准上位机.Tool;
|
||||
using System.Printing;
|
||||
using System.Printing.IndexedProperties;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class MatInfoViewModel : BindableBase
|
||||
{
|
||||
public MatInfoViewModel()
|
||||
{
|
||||
IsPrintedItemSource = new List<ComboBoxItem>()
|
||||
{
|
||||
new ComboBoxItem(){Text = "全部",Value = null},
|
||||
new ComboBoxItem(){Text = "否",Value = false },
|
||||
new ComboBoxItem(){Text = "是",Value = true},
|
||||
};
|
||||
}
|
||||
#region Property
|
||||
private ObservableCollection<MatInfoModel> dataGridItemSource;
|
||||
public ObservableCollection<MatInfoModel> DataGridItemSource
|
||||
@ -52,6 +63,35 @@ namespace 货架标准上位机.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private List<ComboBoxItem> isPrintedItemSource;
|
||||
public List<ComboBoxItem> IsPrintedItemSource
|
||||
{
|
||||
get => isPrintedItemSource;
|
||||
set { SetProperty(ref isPrintedItemSource, value); }
|
||||
}
|
||||
|
||||
public class ComboBoxItem
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public bool? Value { get; set; }
|
||||
}
|
||||
|
||||
private bool? isPrinted;
|
||||
public bool? IsPrinted
|
||||
{
|
||||
get => isPrinted;
|
||||
set { SetProperty(ref isPrinted, value); }
|
||||
}
|
||||
|
||||
private string matBatch;
|
||||
public string MatBatch
|
||||
{
|
||||
get => matBatch;
|
||||
set { SetProperty(ref matBatch, value); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
@ -125,7 +165,6 @@ namespace 货架标准上位机.ViewModel
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
//var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetMatInfoRequest()
|
||||
@ -134,11 +173,13 @@ namespace 货架标准上位机.ViewModel
|
||||
MatName = MatName,
|
||||
MatSpec = MatSpec,
|
||||
MatSN = MatSN,
|
||||
MatBatch = MatBatch,
|
||||
IsPrinted = IsPrinted,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = PageSize,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInfoModel>>(LocalFile.Config.ApiIpHost + "matBaseInfo/getMatInfo", body, "POST");
|
||||
@ -166,7 +207,7 @@ namespace 货架标准上位机.ViewModel
|
||||
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
public async void BtnDelete()
|
||||
{
|
||||
Growl.Ask($"是否删除所有勾选得数据]!", isConfirmed =>
|
||||
Growl.Ask($"是否删除所有勾选的数据]!", isConfirmed =>
|
||||
{
|
||||
if (isConfirmed)
|
||||
{
|
||||
@ -187,7 +228,7 @@ namespace 货架标准上位机.ViewModel
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
MatBaseInfoIds = matBaseInfoIds,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "matBaseInfo/deleteMatBaseInfo", body, "POST");
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "matBaseInfos/deleteMatBaseInfo", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
@ -204,10 +245,99 @@ namespace 货架标准上位机.ViewModel
|
||||
}
|
||||
|
||||
public ICommand BtnPrintCommand { get => new DelegateCommand(BtnPrint); }
|
||||
public async void BtnPrint()
|
||||
public void BtnPrint()
|
||||
{
|
||||
var matBaseInfo = DataGridItemSource?.Where(t => t.IsSelected == true).ToList();
|
||||
//TO DO后台批量打印
|
||||
var matBaseInfos = DataGridItemSource?.Where(t => t.IsSelected == true).ToList();
|
||||
|
||||
if (matBaseInfos == null || matBaseInfos.Count == 0)
|
||||
{
|
||||
Growl.Warning("请选择需要打印的物料!");
|
||||
return;
|
||||
}
|
||||
|
||||
//重复打印提示
|
||||
#region
|
||||
var printedMatBaseInfo = matBaseInfos.Where(t => t.IsPrinted).ToList();
|
||||
if (printedMatBaseInfo != null && printedMatBaseInfo.Count > 0)
|
||||
{
|
||||
//拼接提示字符串
|
||||
var messageStr = "以下条码已打印:\r\n" +
|
||||
string.Join("\r\n", printedMatBaseInfo.Select(t => $"[{t.MatSN}]已打印{t.PrintedTimes}次!").ToList())
|
||||
+ "\r\n\r\n是否继续打印?(重复打印可能造成条码重复)";
|
||||
var result = HandyControl.Controls.MessageBox.Show(messageStr, "重复打印提示", MessageBoxButton.OKCancel);
|
||||
if (result == MessageBoxResult.Cancel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
//批量打印
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessDialog process = null;
|
||||
Dialog dia = null;
|
||||
var totalCount = matBaseInfos.Count();
|
||||
int currentCount = 0;
|
||||
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
process = new ProcessDialog();
|
||||
dia = Dialog.Show(process);
|
||||
});
|
||||
matBaseInfos.ForEach(t =>
|
||||
{
|
||||
PrintTender.PrintTag(new PrintClass()
|
||||
{
|
||||
MatSn = t.MatSN,
|
||||
MatName = t.MatName,
|
||||
MatCode = t.MatCode,
|
||||
MatBatch = t.MatBatch,
|
||||
MatQty = t.MatQty.ToString(),
|
||||
MatSpec = t.MatSpec,
|
||||
});
|
||||
currentCount++;
|
||||
if (process != null)
|
||||
process.viewModel.ProcessValue = Convert.ToInt32(((decimal)currentCount / totalCount) * 100);
|
||||
});
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
dia.Close();
|
||||
dia.Collapse();
|
||||
});
|
||||
|
||||
#region 回传后端打印成功
|
||||
try
|
||||
{
|
||||
var body = new PrintedMatInfoRequest()
|
||||
{
|
||||
PrintedMatInfoIds = matBaseInfos.Select(t => t.Id).ToList(),
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "matBaseInfo/printedMatInfo", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
//回传成功
|
||||
}
|
||||
else
|
||||
{
|
||||
//回传失败
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logs.Write("回传“打印成功”失败:" + ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logs.Write("打印条码失败:" + ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -238,6 +368,14 @@ namespace 货架标准上位机.ViewModel
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
|
@ -220,7 +220,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
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)
|
||||
@ -270,7 +270,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = 65535,
|
||||
};
|
||||
await ApiHelp.PostDownloadFileAsync(path, System.Net.Http.HttpMethod.Post, LocalFile.Config.ApiIpHost + "matInventoryDetail/exportMatInventoryDetail", body);
|
||||
Growl.Success("导出成功!");
|
||||
@ -301,7 +301,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = 1,
|
||||
PageSize = 10000,
|
||||
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)
|
||||
@ -399,7 +399,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10000,
|
||||
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)
|
||||
@ -506,6 +506,14 @@ namespace 货架标准上位机.ViewModel
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
|
228
货架标准上位机/ViewModels/ModuleInfoViewModel.cs
Normal file
228
货架标准上位机/ViewModels/ModuleInfoViewModel.cs
Normal file
@ -0,0 +1,228 @@
|
||||
using HandyControl.Controls;
|
||||
using MiniExcelLibs;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using 货架标准上位机.Views.Controls;
|
||||
using 货架标准上位机.Api;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using WCS.Model.ApiModel;
|
||||
using Newtonsoft.Json.Bson;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class ModuleInfoViewModel : BindableBase
|
||||
{
|
||||
public ModuleInfoViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region Property
|
||||
private List<ModuleInfoModel> dataGridItemSource;
|
||||
public List<ModuleInfoModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ModuleInfoModel selectedataGridItem;
|
||||
public ModuleInfoModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string shelfCode;
|
||||
public string ShelfCode
|
||||
{
|
||||
get { return shelfCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string moduleCode;
|
||||
|
||||
public string ModuleCode
|
||||
{
|
||||
get => moduleCode;
|
||||
set { SetProperty(ref moduleCode, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
ModuleCode = string.Empty;
|
||||
ShelfCode = string.Empty;
|
||||
}
|
||||
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
|
||||
public void BtnSearchReset()
|
||||
{
|
||||
BtnSearch(true);
|
||||
}
|
||||
|
||||
public void BtnSearch(bool IsPageReset = true)
|
||||
{
|
||||
if (CurrentPage == 0 || IsPageReset)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetShelvesRequest()
|
||||
{
|
||||
ShelfCode = ShelfCode,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = PageSize,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ModuleInfoModel>>(LocalFile.Config.ApiIpHost + "storeInfo/getModules", 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 BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
public void BtnDelete()
|
||||
{
|
||||
//查询勾选的第一个数据
|
||||
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
|
||||
|
||||
#region PageOperation 分页操作
|
||||
private int currentPage;
|
||||
public int CurrentPage
|
||||
{
|
||||
get { return currentPage; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref currentPage, value);
|
||||
BtnSearch(false);
|
||||
}
|
||||
}
|
||||
|
||||
private int maxPage;
|
||||
public int MaxPage
|
||||
{
|
||||
get { return maxPage; }
|
||||
set { SetProperty(ref maxPage, value); }
|
||||
}
|
||||
|
||||
//总数量
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get { return totalCount; }
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
CurrentPage = 1;
|
||||
}
|
||||
|
||||
public ICommand BtnPrePageCommand { get => new DelegateCommand(BtnPrePage); }
|
||||
public void BtnPrePage()
|
||||
{
|
||||
if (CurrentPage > 1)
|
||||
{
|
||||
CurrentPage--;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnNextPageCommand { get => new DelegateCommand(BtnNextPage); }
|
||||
public void BtnNextPage()
|
||||
{
|
||||
if (CurrentPage < MaxPage)
|
||||
{
|
||||
CurrentPage++;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnLastPageCommand { get => new DelegateCommand(BtnLastPage); }
|
||||
public void BtnLastPage()
|
||||
{
|
||||
if (CurrentPage != MaxPage)
|
||||
{
|
||||
CurrentPage = MaxPage;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -100,7 +100,7 @@ namespace 货架标准上位机.ViewModels
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = PageSize,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outStore/GetOutOrderList", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
@ -412,6 +412,14 @@ namespace 货架标准上位机.ViewModels
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
@ -445,5 +453,6 @@ namespace 货架标准上位机.ViewModels
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -278,6 +278,7 @@ namespace 货架标准上位机.ViewModel
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(Result.Data);
|
||||
OrderStatus = Result.Message;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -285,7 +286,6 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
});
|
||||
|
||||
Growl.Warning("该单据未查询到发料明细!");
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ namespace 货架标准上位机.ViewModel
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = PageSize,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ShelfInfoModel>>(LocalFile.Config.ApiIpHost + "storeInfo/getShelves", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
@ -250,6 +250,14 @@ namespace 货架标准上位机.ViewModel
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ namespace 货架标准上位机.ViewModels
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
PageSize = PageSize,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<StockTakingOrderModel>>(LocalFile.Config.ApiIpHost + "stockTaking/getStockTakingOrders", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
@ -398,6 +398,7 @@ namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
Growl.Warning("单据已提交,库存数据已修改!");
|
||||
BtnSearch();
|
||||
StockTakingView.viewModel.RefreshStockTakingOrderList(StockTakingView.viewModel.SelectedOutOrderNumber);
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
@ -419,6 +420,7 @@ namespace 货架标准上位机.ViewModels
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region PageOperation 分页操作
|
||||
private int currentPage;
|
||||
public int CurrentPage
|
||||
@ -446,6 +448,14 @@ namespace 货架标准上位机.ViewModels
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
|
@ -232,6 +232,10 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
SelectedOutOrder = OutOrderList.Where(t => t.StocktakingOrderNumber == OrderNumber).FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedOutOrder = OutOrderList.FirstOrDefault(); ;
|
||||
}
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
|
214
货架标准上位机/ViewModels/StoreInfoViewModel.cs
Normal file
214
货架标准上位机/ViewModels/StoreInfoViewModel.cs
Normal file
@ -0,0 +1,214 @@
|
||||
using HandyControl.Controls;
|
||||
using MiniExcelLibs;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using 货架标准上位机.Views.Controls;
|
||||
using 货架标准上位机.Api;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using WCS.Model.ApiModel;
|
||||
using Newtonsoft.Json.Bson;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class StoreInfoViewModel : BindableBase
|
||||
{
|
||||
public StoreInfoViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#region Property
|
||||
private List<StoreInfoModel> dataGridItemSource;
|
||||
public List<StoreInfoModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
private StoreInfoModel selectedataGridItem;
|
||||
public StoreInfoModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string shelfCode;
|
||||
public string ShelfCode
|
||||
{
|
||||
get { return shelfCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string moduleCode;
|
||||
public string ModuleCode
|
||||
{
|
||||
get => moduleCode;
|
||||
set { SetProperty(ref moduleCode, value); }
|
||||
}
|
||||
|
||||
private string storeCode;
|
||||
public string StoreCode
|
||||
{
|
||||
get => storeCode;
|
||||
set { SetProperty(ref storeCode, value); }
|
||||
}
|
||||
|
||||
private string currentMatSN;
|
||||
public string CurrentMatSN
|
||||
{
|
||||
get => currentMatSN;
|
||||
set { SetProperty(ref currentMatSN, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
ShelfCode = string.Empty;
|
||||
ModuleCode = string.Empty;
|
||||
StoreCode = string.Empty;
|
||||
CurrentMatSN = string.Empty;
|
||||
}
|
||||
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearchReset); }
|
||||
public void BtnSearchReset()
|
||||
{
|
||||
BtnSearch(true);
|
||||
}
|
||||
|
||||
public void BtnSearch(bool IsPageReset = true)
|
||||
{
|
||||
if (CurrentPage == 0 || IsPageReset)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetStoresRequest()
|
||||
{
|
||||
ShelfCode = ShelfCode,
|
||||
ModuleCode = ModuleCode,
|
||||
StoreCode = StoreCode,
|
||||
CurrentMatSN = CurrentMatSN,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = PageSize,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<StoreInfoModel>>(LocalFile.Config.ApiIpHost + "storeInfo/getStores", 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
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PageOperation 分页操作
|
||||
private int currentPage;
|
||||
public int CurrentPage
|
||||
{
|
||||
get { return currentPage; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref currentPage, value);
|
||||
BtnSearch(false);
|
||||
}
|
||||
}
|
||||
|
||||
private int maxPage;
|
||||
public int MaxPage
|
||||
{
|
||||
get { return maxPage; }
|
||||
set { SetProperty(ref maxPage, value); }
|
||||
}
|
||||
|
||||
//总数量
|
||||
private int totalCount;
|
||||
public int TotalCount
|
||||
{
|
||||
get { return totalCount; }
|
||||
set { SetProperty(ref totalCount, value); }
|
||||
}
|
||||
|
||||
private int pageSize = 10;
|
||||
public int PageSize
|
||||
{
|
||||
get => pageSize;
|
||||
set { SetProperty(ref pageSize, value); }
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnFirstPageCommand { get => new DelegateCommand(BtnFirstPage); }
|
||||
public void BtnFirstPage()
|
||||
{
|
||||
CurrentPage = 1;
|
||||
}
|
||||
|
||||
public ICommand BtnPrePageCommand { get => new DelegateCommand(BtnPrePage); }
|
||||
public void BtnPrePage()
|
||||
{
|
||||
if (CurrentPage > 1)
|
||||
{
|
||||
CurrentPage--;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnNextPageCommand { get => new DelegateCommand(BtnNextPage); }
|
||||
public void BtnNextPage()
|
||||
{
|
||||
if (CurrentPage < MaxPage)
|
||||
{
|
||||
CurrentPage++;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnLastPageCommand { get => new DelegateCommand(BtnLastPage); }
|
||||
public void BtnLastPage()
|
||||
{
|
||||
if (CurrentPage != MaxPage)
|
||||
{
|
||||
CurrentPage = MaxPage;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
16
货架标准上位机/Views/Controls/ProcessDialog.xaml
Normal file
16
货架标准上位机/Views/Controls/ProcessDialog.xaml
Normal file
@ -0,0 +1,16 @@
|
||||
<Border x:Class="货架标准上位机.Views.Controls.ProcessDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
CornerRadius="10"
|
||||
Width="300"
|
||||
Height="186"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:SimplePanel>
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<ProgressBar Style="{StaticResource ProgressBarSuccess}" Value="{Binding ProcessValue}" Width="200"/>
|
||||
<TextBlock Text="正在打印,请稍候..." FontSize="20" TextAlignment="Center"></TextBlock>
|
||||
</StackPanel>
|
||||
<Button Width="22" Height="22" Command="hc:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
||||
</hc:SimplePanel>
|
||||
</Border>
|
31
货架标准上位机/Views/Controls/ProcessDialog.xaml.cs
Normal file
31
货架标准上位机/Views/Controls/ProcessDialog.xaml.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace 货架标准上位机.Views.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// TextDialog.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ProcessDialog
|
||||
{
|
||||
public ProcessDialogViewModel viewModel = new ProcessDialogViewModel();
|
||||
public ProcessDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
20
货架标准上位机/Views/Controls/ProcessDialogViewModel.cs
Normal file
20
货架标准上位机/Views/Controls/ProcessDialogViewModel.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace 货架标准上位机.Views.Controls
|
||||
{
|
||||
public class ProcessDialogViewModel : BindableBase
|
||||
{
|
||||
private int processValue;
|
||||
public int ProcessValue
|
||||
{
|
||||
get => processValue;
|
||||
set { SetProperty(ref processValue, value); }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -34,7 +34,7 @@
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
MinHeight="40"
|
||||
FontSize="20"
|
||||
Content="结束入库"
|
||||
Content="结束入库"
|
||||
FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnEndCommand}">
|
||||
</Button>
|
||||
@ -50,19 +50,10 @@
|
||||
<Border Grid.Row="2" Margin="5,5,5,5" BorderThickness="1" Background="White" BorderBrush="DodgerBlue" CornerRadius="3">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<!--<ColumnDefinition Width="2*"></ColumnDefinition>-->
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--<GroupBox Grid.Column="0" Background="White" Padding="0" Style="{StaticResource GroupBoxTab}" Margin="0,5,5,5" >
|
||||
<GroupBox.Header>
|
||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">入库报警信息</TextBlock>
|
||||
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextInfoCommand}"> 清空</Button>
|
||||
</Grid>
|
||||
</GroupBox.Header>
|
||||
<pi:TextBoxLog Token="InstoreWarning" Style="{StaticResource TextBoxExtend.Multi}" Margin="-1" hc:InfoElement.Placeholder="没有日志信息" Foreground="CornflowerBlue"></pi:TextBoxLog>
|
||||
</GroupBox>-->
|
||||
<GroupBox Grid.Column="1" Background="White" Padding="0" Style="{StaticResource GroupBoxTab}" Margin="0,5,5,5" >
|
||||
|
||||
<GroupBox Grid.Column="1" Background="White" Padding="0" Style="{StaticResource GroupBoxTab}">
|
||||
<GroupBox.Header>
|
||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">入库日志信息</TextBlock>
|
||||
|
@ -161,15 +161,26 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
|
@ -34,6 +34,7 @@ namespace 货架标准上位机
|
||||
{
|
||||
viewModel.InitMatCode();
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,15 +135,26 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
@ -173,7 +184,6 @@
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
@ -41,6 +41,7 @@ namespace 货架标准上位机
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,12 +186,12 @@
|
||||
</TabItem>
|
||||
<TabItem Header="模组管理">
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:RoleView />
|
||||
<View:ModuleInfoView />
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
<TabItem Header="库位管理">
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:RoleView />
|
||||
<View:StoreInfoView />
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
@ -184,15 +184,26 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
|
@ -28,6 +28,7 @@ namespace 货架标准上位机
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
|
@ -1,15 +1,21 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Tools.Extension;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using 货架标准上位机.Api;
|
||||
using 货架标准上位机.Tool;
|
||||
using 货架标准上位机.ViewModel;
|
||||
using 货架标准上位机.Views.Controls;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
@ -36,6 +42,7 @@ namespace 货架标准上位机
|
||||
|
||||
private void btnOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
#region 数据校验
|
||||
if (string.IsNullOrEmpty(txtMatBatch.Text.Trim()))
|
||||
{
|
||||
@ -88,6 +95,69 @@ namespace 货架标准上位机
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<MatInfoModel>>>(LocalFile.Config.ApiIpHost + "matBaseInfo/generateMatInfo", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Count > 0)
|
||||
{
|
||||
if (button != null && button.Content.ToString().Contains("打印"))
|
||||
//批量打印
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
ProcessDialog process = null;
|
||||
Dialog dia = null;
|
||||
var totalCount = Result.Data.Count;
|
||||
int currentCount = 0;
|
||||
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
process = new ProcessDialog();
|
||||
dia = Dialog.Show(process);
|
||||
});
|
||||
Result.Data.ForEach(t =>
|
||||
{
|
||||
PrintTender.PrintTag(new PrintClass()
|
||||
{
|
||||
MatSn = t.MatSN,
|
||||
MatName = t.MatName,
|
||||
MatCode = t.MatCode,
|
||||
MatBatch = t.MatBatch,
|
||||
MatQty = t.MatQty.ToString(),
|
||||
MatSpec = t.MatSpec,
|
||||
});
|
||||
currentCount++;
|
||||
if (process != null)
|
||||
process.viewModel.ProcessValue = Convert.ToInt32(((decimal)currentCount / totalCount) * 100);
|
||||
});
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
dia.Close();
|
||||
dia.Collapse();
|
||||
});
|
||||
|
||||
#region 回传后端打印成功
|
||||
try
|
||||
{
|
||||
var body = new PrintedMatInfoRequest()
|
||||
{
|
||||
PrintedMatInfoIds = Result.Data.Select(t => t.Id).ToList(),
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result11 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "matBaseInfo/printedMatInfo", body, "POST");
|
||||
if (Result11 != null && Result11.Code == 200)
|
||||
{
|
||||
//回传成功
|
||||
}
|
||||
else
|
||||
{
|
||||
//回传失败
|
||||
Logs.Write("回传“打印成功”失败");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logs.Write("回传“打印成功”失败:" + ex.Message);
|
||||
}
|
||||
#endregion
|
||||
});
|
||||
}
|
||||
Growl.Success("生成成功!");
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,8 @@
|
||||
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="5 5 5 0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
@ -58,7 +59,6 @@
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding MatSN}"></TextBox>
|
||||
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="9" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnSearchCommand}">
|
||||
@ -69,8 +69,44 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="1" Margin="5 5 5 0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
|
||||
<Border Grid.Row="1" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料批次:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding MatBatch}"></TextBox>
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="已 打 印:" FontSize="18" ></TextBlock>
|
||||
<ComboBox Grid.Column="3"
|
||||
DisplayMemberPath="Text"
|
||||
SelectedValuePath="Value"
|
||||
ItemsSource="{Binding IsPrintedItemSource}"
|
||||
SelectedValue="{Binding IsPrinted}"
|
||||
Height="35" FontSize="18">
|
||||
</ComboBox>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
@ -79,26 +115,12 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
|
||||
|
||||
|
||||
<!--<Button MinHeight="40" FontSize="18" Margin="5"
|
||||
Content="删 除" FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Command="{Binding BtnDeleteCommand}"
|
||||
Style="{StaticResource ButtonDanger}"
|
||||
>
|
||||
</Button>-->
|
||||
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5"
|
||||
<Button MinHeight="40" FontSize="18" Margin="4" hc:BorderElement.CornerRadius="6"
|
||||
Content="打印/补打" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnPrintCommand}"
|
||||
Foreground="WhiteSmoke"
|
||||
Background="DarkOrange"
|
||||
>
|
||||
Foreground="WhiteSmoke"
|
||||
Background="DarkOrange">
|
||||
</Button>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid
|
||||
@ -133,7 +155,8 @@
|
||||
<DataGridTextColumn Header="供应商" MaxWidth="150" Binding="{Binding MatSupplier}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="客户" MaxWidth="150" Binding="{Binding MatCustomer}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="打印次数" Binding="{Binding PrintTimes}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已打印" Binding="{Binding IsPrinted,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="打印次数" Binding="{Binding PrintedTimes}"></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>
|
||||
@ -151,15 +174,26 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
|
@ -29,6 +29,7 @@ namespace 货架标准上位机
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
|
@ -161,15 +161,26 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
|
@ -34,6 +34,7 @@ namespace 货架标准上位机
|
||||
{
|
||||
viewModel.InitMatCode();
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
164
货架标准上位机/Views/ModuleInfoView.xaml
Normal file
164
货架标准上位机/Views/ModuleInfoView.xaml
Normal file
@ -0,0 +1,164 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="货架标准上位机.ModuleInfoView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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">
|
||||
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1.9*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="货架编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ShelfCode}"></TextBox>
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="模组编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="3"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ModuleCode}"></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="9" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnSearchCommand}">
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="10" MinHeight="40" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnResetCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
Name="dataGrid"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
SelectionChanged="dataGrid_SelectionChanged"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTemplateColumn CanUserResize="False">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Width="30" Height="30" IsHitTestVisible="False" IsChecked="{Binding IsSelected}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Width="30" Height="30" Unchecked="allChecked_Unchecked" Checked="allChecked_Checked" Name="allChecked"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.HeaderTemplate>
|
||||
</DataGridTemplateColumn>-->
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="货架编码" Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="模组编码" Binding="{Binding ModuleCode}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="PCB板ID" Binding="{Binding BoardId}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单板灯数量" Binding="{Binding LightCount}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="TCP连接信息" Binding="{Binding CleintIp}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="R" Binding="{Binding R}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="C" Binding="{Binding C}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="是否启用" Binding="{Binding IsEnable,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BindShelfCode}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Width="Auto" MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="0" Name="btnFirst" Content="首页" Foreground="Black" FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="1" Name="btnPrev" Content="上一页" FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}"/>
|
||||
<TextBox BorderBrush="Transparent" Grid.Column="2" FontSize="14" MinWidth="50" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="IBeam" IsEnabled="False"
|
||||
Text ="{Binding CurrentPage}" TextAlignment="Center"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Name="btnNext" Content="下一页" FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="4" Name="btnLast" Content="末页" FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
90
货架标准上位机/Views/ModuleInfoView.xaml.cs
Normal file
90
货架标准上位机/Views/ModuleInfoView.xaml.cs
Normal file
@ -0,0 +1,90 @@
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class ModuleInfoView : UserControlBase
|
||||
{
|
||||
public ModuleInfoViewModel viewModel { get; set; } = new ModuleInfoViewModel();
|
||||
public ModuleInfoView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||
{
|
||||
foreach (var item in viewModel.DataGridItemSource)
|
||||
{
|
||||
item.IsSelected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void allChecked_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||
{
|
||||
foreach (var item in viewModel.DataGridItemSource)
|
||||
{
|
||||
item.IsSelected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 更新选中项的状态
|
||||
if (dataGrid.SelectedCells.Count > 0 && viewModel.SelectedataGridItem != null)
|
||||
{
|
||||
viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||
//dataGrid.UnselectAllCells(); // 取消选中所有单元格
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Debug.WriteLine("SelectionChanged event handler failed: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="7*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="2" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Border Grid.Row="0" Margin="2 2 2 0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
@ -51,15 +51,7 @@
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding OrderSource}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
|
||||
<!--<TextBlock Grid.Row="2" Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="单据状态:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding OrderNumber}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>-->
|
||||
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}"
|
||||
Command="{Binding BtnSearchCommand}"
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
@ -141,17 +133,29 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
|
@ -43,7 +43,7 @@
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="0" Background="LightGray" Padding="0">
|
||||
<Border Margin="1" CornerRadius="3" Background="AliceBlue" Padding="0">
|
||||
<Border Margin="0" CornerRadius="3" Background="AliceBlue" Padding="0">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"></ColumnDefinition>
|
||||
@ -172,10 +172,9 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
|
||||
<!--<TextBlock Text="当前状态:" FontSize="22">
|
||||
<TextBlock Text="当前状态:" FontSize="22">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding OrderStatus,FallbackValue=未发料或未发完}" Foreground="red" FontSize="22">
|
||||
</TextBlock>-->
|
||||
<TextBlock Text="{Binding OrderStatus,FallbackValue=未知}" Foreground="Red" FontSize="22"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
|
||||
<TextBlock Text="总盘数:" VerticalAlignment="Bottom" FontSize="22">
|
||||
|
@ -83,12 +83,12 @@
|
||||
Command="{Binding BtnDeleteCommand}"
|
||||
Style="{StaticResource ButtonDanger}">
|
||||
</Button>
|
||||
<Button MinHeight="40" FontSize="18" Margin="5"
|
||||
<!--<Button MinHeight="40" FontSize="18" Margin="5"
|
||||
Content="生成模组" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnImportCommand}"
|
||||
Foreground="WhiteSmoke"
|
||||
Background="Green">
|
||||
</Button>
|
||||
</Button>-->
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
@ -119,7 +119,7 @@
|
||||
<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}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="是否绑定" Binding="{Binding IsBind,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="绑定后货架编码" Binding="{Binding BindShelfCode}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
@ -136,15 +136,26 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
|
@ -31,6 +31,7 @@ namespace 货架标准上位机
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.InitShelfTypeItems();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||
@ -66,7 +67,7 @@ namespace 货架标准上位机
|
||||
dataGrid.UnselectAllCells(); // 取消选中所有单元格
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("SelectionChanged event handler failed: " + ex.Message);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:货架标准上位机="clr-namespace:货架标准上位机"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737" d:DesignWidth="1192">
|
||||
d:DesignHeight="737" d:DesignWidth="1192" LoadedVisible="UserControlBase_LoadedVisible" >
|
||||
<Border Margin="0" Background="LightGray" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
@ -65,5 +65,10 @@ namespace 货架标准上位机
|
||||
{
|
||||
viewModel.RefreshStockTakingOrderList(viewModel.SelectedOutOrderNumber);
|
||||
}
|
||||
|
||||
private void UserControlBase_LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.RefreshStockTakingOrderList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@
|
||||
</Button>
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnCommitCommand}"
|
||||
Content="提交盘点" FontFamily="{StaticResource IconFont}" Background="SaddleBrown" Foreground="White">
|
||||
Content="提交盘点" FontFamily="{StaticResource IconFont}" Background="SaddleBrown" Foreground="White">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
@ -131,17 +131,29 @@
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="5">
|
||||
<TextBlock FontSize="14" Text="共"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="条记录 "></TextBlock>
|
||||
<TextBlock FontSize="14" Text="第"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="/"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" Text="页"></TextBlock>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
|
178
货架标准上位机/Views/StoreInfoView.xaml
Normal file
178
货架标准上位机/Views/StoreInfoView.xaml
Normal file
@ -0,0 +1,178 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="货架标准上位机.StoreInfoView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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">
|
||||
<Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.3*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2.5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="货架编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ShelfCode}"></TextBox>
|
||||
<TextBlock Grid.Column="2"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="模组编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="3"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding ModuleCode}"></TextBox>
|
||||
<TextBlock Grid.Column="4"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="库位编码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding StoreCode}"></TextBox>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="当前物料:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="1" Grid.Row="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding CurrentMatSN}"></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="8" MinHeight="40" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnSearchCommand}">
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="9" MinHeight="40" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnResetCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
Name="dataGrid"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
SelectionChanged="dataGrid_SelectionChanged"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="货架编码" Binding="{Binding ShelfCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="模组编码" Binding="{Binding ModuleCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库位编码" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="PCB板ID" Binding="{Binding BoardId}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="储位号" Binding="{Binding LightNumber}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="电压标准值" Binding="{Binding StandardVoltage}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="电压偏移值" Binding="{Binding OffsetVoltage}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="当前电压" Binding="{Binding CurrentVoltage}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="当前物料" Binding="{Binding CurrentMatSn}"></DataGridTextColumn>
|
||||
<DataGridTemplateColumn CanUserResize="False" Width="auto">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding IsAdmin,Converter={StaticResource Boolean2BooleanReConverter}}">
|
||||
<Button Style="{StaticResource ButtonWarning}" Margin="0,0,5,0" IsEnabled="True" Content="禁用" Width="60" Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }" />
|
||||
<Button Style="{StaticResource ButtonDanger}" Margin="0,0,0,0" IsEnabled="True" Content="启用" Width="60" Command="{Binding DataContext.DelCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" CommandParameter="{Binding }"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Width="Auto" MinHeight="26">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5">
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="共"></TextBlock>
|
||||
<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>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
|
||||
<TextBlock FontSize="14" VerticalAlignment="Center" Text="页 "></TextBlock>
|
||||
|
||||
<ComboBox FontSize="14" VerticalAlignment="Center" SelectedValue="{Binding PageSize}" SelectedValuePath="Tag">
|
||||
<ComboBoxItem Tag="10" IsSelected="True">10条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="20">20条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="50">50条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="100">100条/页</ComboBoxItem>
|
||||
<ComboBoxItem Tag="500">500条/页</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions >
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="0" Name="btnFirst" Content="首页" Foreground="Black" FontSize="14"
|
||||
Command="{Binding BtnFirstPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="1" Name="btnPrev" Content="上一页" FontSize="14"
|
||||
Command="{Binding BtnPrePageCommand}"/>
|
||||
<TextBox BorderBrush="Transparent" Grid.Column="2" FontSize="14" MinWidth="50" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="IBeam" IsEnabled="False"
|
||||
Text ="{Binding CurrentPage}" TextAlignment="Center"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Name="btnNext" Content="下一页" FontSize="14"
|
||||
Command="{Binding BtnNextPageCommand}"/>
|
||||
<Button BorderBrush="Transparent" Background="Transparent" Grid.Column="4" Name="btnLast" Content="末页" FontSize="14"
|
||||
Command="{Binding BtnLastPageCommand}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
90
货架标准上位机/Views/StoreInfoView.xaml.cs
Normal file
90
货架标准上位机/Views/StoreInfoView.xaml.cs
Normal file
@ -0,0 +1,90 @@
|
||||
using Ping9719.WpfEx;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class StoreInfoView : UserControlBase
|
||||
{
|
||||
public StoreInfoViewModel viewModel { get; set; } = new StoreInfoViewModel();
|
||||
public StoreInfoView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.BtnReset();
|
||||
viewModel.BtnSearchReset();
|
||||
}
|
||||
|
||||
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||
{
|
||||
foreach (var item in viewModel.DataGridItemSource)
|
||||
{
|
||||
item.IsSelected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void allChecked_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (viewModel != null && viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > 0)
|
||||
{
|
||||
foreach (var item in viewModel.DataGridItemSource)
|
||||
{
|
||||
item.IsSelected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 更新选中项的状态
|
||||
if (dataGrid.SelectedCells.Count > 0 && viewModel.SelectedataGridItem != null)
|
||||
{
|
||||
viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||
//dataGrid.UnselectAllCells(); // 取消选中所有单元格
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Debug.WriteLine("SelectionChanged event handler failed: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
@ -16,9 +16,10 @@ namespace 货架标准上位机
|
||||
{
|
||||
public static class WebSocket
|
||||
{
|
||||
public static WebSocketClient client = null;
|
||||
public static void InitWebSocket()
|
||||
{
|
||||
var client = new WebSocketClient();
|
||||
client = new WebSocketClient();
|
||||
client.Setup(new TouchSocketConfig()
|
||||
.SetRemoteIPHost("ws://127.0.0.1:7789/ws")
|
||||
.ConfigureContainer(a =>
|
||||
@ -34,10 +35,8 @@ namespace 货架标准上位机
|
||||
//配置断线重连
|
||||
a.UseReconnection(-1, true, 1000);//-1表示一直重连
|
||||
}));
|
||||
|
||||
client.Connect();
|
||||
}
|
||||
|
||||
}
|
||||
public class WebSocketClientPlugin : PluginBase, IWebSocketReceivedPlugin
|
||||
{
|
||||
|
@ -64,6 +64,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Printing" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -104,6 +105,9 @@
|
||||
<Compile Update="Views\Controls\ScannerDisplayControl.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Controls\ProcessDialog.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user