增加盘点模式
This commit is contained in:
329
货架标准上位机/ViewModels/InOutRecordViewModel.cs
Normal file
329
货架标准上位机/ViewModels/InOutRecordViewModel.cs
Normal file
@ -0,0 +1,329 @@
|
||||
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 System.Windows.Media;
|
||||
using SqlSugar;
|
||||
using HandyControl.Data;
|
||||
using System.Windows;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using 货架标准上位机.Views.Controls;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using 货架标准上位机.Api;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel;
|
||||
using System.Windows.Controls;
|
||||
using WCS.Model.ApiModel.InterfaceRecord;
|
||||
using HandyControl.Collections;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using HandyControl.Tools.Extension;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.ApiModel.InOutRecord;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class InOutRecordViewModel : BindableBase
|
||||
{
|
||||
public InOutRecordViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void InitMatCode()
|
||||
{
|
||||
//调用接口更新!
|
||||
Task.Run(() =>
|
||||
{
|
||||
var body = new GetMatCodeListRequest()
|
||||
{
|
||||
IsFromBaseData = false,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<string>>>(LocalFile.Config.ApiIpHost + "matBaseInfo/getMatCodeList", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Count() > 0)
|
||||
{
|
||||
matCodes = Result.Data.Select(t => new DataModel()
|
||||
{
|
||||
MatCode = t
|
||||
}).ToList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#region Property
|
||||
private List<InOutRecordModel> dataGridItemSource;
|
||||
public List<InOutRecordModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
{
|
||||
get { return matCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode, value);
|
||||
FilterItems(value);
|
||||
}
|
||||
}
|
||||
public ManualObservableCollection<DataModel> Items { get; set; } = new();
|
||||
private List<DataModel> matCodes = new List<DataModel>();
|
||||
private void FilterItems(string key)
|
||||
{
|
||||
//至少输入三个字符 避免删除或输入时界面变卡
|
||||
if (string.IsNullOrEmpty(key) || key.Length < 3)
|
||||
{
|
||||
Items.Clear();
|
||||
return;
|
||||
}
|
||||
key = key.ToUpper();
|
||||
Items.CanNotify = false;
|
||||
Items.Clear();
|
||||
foreach (var matCode in matCodes)
|
||||
{
|
||||
if (matCode.MatCode.ToUpper().Contains(key))
|
||||
{
|
||||
Items.Add(matCode);
|
||||
}
|
||||
}
|
||||
Items.CanNotify = true;
|
||||
}
|
||||
public class DataModel()
|
||||
{
|
||||
public string MatCode { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
private string matName;
|
||||
public string MatName
|
||||
{
|
||||
get { return matName; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matName, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料批次
|
||||
/// </summary>
|
||||
private string matBatch;
|
||||
public string MatBatch
|
||||
{
|
||||
get { return matBatch; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matBatch, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 库位
|
||||
/// </summary>
|
||||
private string storeCode;
|
||||
public string StoreCode
|
||||
{
|
||||
get { return storeCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref storeCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料条码 物料SN
|
||||
/// </summary>
|
||||
private string matSN;
|
||||
public string MatSN
|
||||
{
|
||||
get { return matSN; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matSN, value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
MatCode = string.Empty;
|
||||
MatName = string.Empty;
|
||||
MatSN = string.Empty;
|
||||
StoreCode = 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 GetInOutRecordRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
MatSN = MatSN,
|
||||
MatBatch = MatBatch,
|
||||
MatCode = MatCode,
|
||||
StoreCode = StoreCode,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<InOutRecordModel>>(LocalFile.Config.ApiIpHost + "inOutRecord/getInOutRecord", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
DataGridItemSource = Result.Data.Lists;
|
||||
MaxPage = Result.Data.MaxPage;
|
||||
TotalCount = Result.Data.TotalCount;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
dia.Close();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public ICommand BtnExportCommand { get => new DelegateCommand(BtnExport); }
|
||||
public async void BtnExport()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region 选择文件保存路径
|
||||
Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog();
|
||||
sfd.Filter = ".xlsx文件(*.xlsx)|*.xlsx";
|
||||
sfd.FileName = "出入库记录" + DateTime.Now.ToString("yyyyMMddhhmmss");
|
||||
sfd.OverwritePrompt = true;
|
||||
if (sfd.ShowDialog() != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string path = sfd.FileName;
|
||||
#endregion
|
||||
|
||||
#region 调用接口导出数据
|
||||
var body = new GetInOutRecordRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
MatSN = MatSN,
|
||||
MatBatch = MatBatch,
|
||||
MatCode = MatCode,
|
||||
StoreCode = StoreCode,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
};
|
||||
await ApiHelp.PostDownloadFileAsync(path, System.Net.Http.HttpMethod.Post, LocalFile.Config.ApiIpHost + "inOutRecord/exportInOutRecord", body);
|
||||
Growl.Success("导出成功!");
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("导出失败:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
#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); }
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
@ -106,43 +106,43 @@ namespace 货架标准上位机.ViewModels
|
||||
// SelectedItemSource = itemSource;
|
||||
// return;
|
||||
//}
|
||||
#region 调用接口生成出库单据
|
||||
try
|
||||
{
|
||||
var body = new SysOutOrderByMatCodeRequest()
|
||||
{
|
||||
OrderType = "出库",
|
||||
OrderSource = "WCS前端",
|
||||
ItemList = DataGridItemSource.Select(t => new MatCodeItemList()
|
||||
{
|
||||
MatCode = t.MatCode,
|
||||
MatName = t.MatName,
|
||||
MatBatch = t.MatBatch,
|
||||
ReqQty = t.NeedQty,
|
||||
}).ToList(),
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatCode", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success(Result.Message);
|
||||
OnRequestClose();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#region 调用接口生成出库单据
|
||||
try
|
||||
{
|
||||
var body = new SysOutOrderByMatCodeRequest()
|
||||
{
|
||||
OrderType = "出库",
|
||||
OrderSource = "WCS前端",
|
||||
ItemList = DataGridItemSource.Select(t => new MatCodeItemList()
|
||||
{
|
||||
MatCode = t.MatCode,
|
||||
MatName = t.MatName,
|
||||
MatBatch = t.MatBatch,
|
||||
ReqQty = t.NeedQty,
|
||||
}).ToList(),
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatCode", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success(Result.Message);
|
||||
OnRequestClose();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -142,6 +142,7 @@ namespace 货架标准上位机.ViewModels
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
@ -150,6 +151,7 @@ namespace 货架标准上位机.ViewModels
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口获取数据
|
||||
@ -205,6 +207,7 @@ namespace 货架标准上位机.ViewModels
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
@ -213,6 +216,7 @@ namespace 货架标准上位机.ViewModels
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
@ -282,6 +286,7 @@ namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
IsStart = true,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
@ -317,7 +322,56 @@ namespace 货架标准上位机.ViewModels
|
||||
public ICommand BtnPauseCommand { get => new DelegateCommand(BtnPause); }
|
||||
public void BtnPause()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
//判断是否勾选数据
|
||||
var selectedOutOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口结束出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
IsPause = true,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goOutOutstore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
//刷新出库单列表
|
||||
OutVentoryView.viewModel.RefreshOutOrderList(selectedOutOrder.OrderNumber);
|
||||
Growl.Success("已暂停出库!");
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
OutVentoryView.viewModel.RefreshOutOrderList(OutVentoryView.viewModel.SelectedOutOrder?.OrderNumber);
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -144,6 +144,7 @@ namespace 货架标准上位机.ViewModel
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口开始出库
|
||||
@ -157,7 +158,8 @@ namespace 货架标准上位机.ViewModel
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goInOutstore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功开始入库!");
|
||||
Growl.Warning("已成功开始出库!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
@ -187,8 +189,8 @@ namespace 货架标准上位机.ViewModel
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口结束出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
@ -200,7 +202,8 @@ namespace 货架标准上位机.ViewModel
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goOutOutstore", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功结束入库!");
|
||||
Growl.Warning("已成功结束出库!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
|
@ -129,11 +129,7 @@ namespace 货架标准上位机.ViewModels
|
||||
OrderSource = string.Empty;
|
||||
}
|
||||
|
||||
//public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
//public void BtnDelete()
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
public ICommand BtnOrderDetailCommand { get => new DelegateCommand(BtnOrderDetail); }
|
||||
public void BtnOrderDetail()
|
||||
@ -143,39 +139,41 @@ namespace 货架标准上位机.ViewModels
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
var selectedOutOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
var selectetOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectedOutOrder == null)
|
||||
if (selectetOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口获取数据
|
||||
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.StocktakingOrderNumber,
|
||||
StockTakingOrderId = selectetOrder.Id,
|
||||
StockTakingOrderNumber = selectetOrder.StocktakingOrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<OutOrderDetailModel>>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderDetail", body, "POST");
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<StockTakingOrderMatDetailModel>>>(LocalFile.Config.ApiIpHost + "stockTaking/getStockTakingOrderMatDetail", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
//打开窗体
|
||||
var window = new OutInventoryDocumentDetailView(Result.Data);
|
||||
var window = new StocktakingDocumentDetailView(Result.Data);
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("该单据没有单据明细!");
|
||||
Growl.Warning("该盘点单据不存在单据明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
@ -206,6 +204,7 @@ namespace 货架标准上位机.ViewModels
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
//判断是否勾选数据
|
||||
@ -214,6 +213,7 @@ namespace 货架标准上位机.ViewModels
|
||||
if (selectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取数据
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
@ -262,61 +262,107 @@ namespace 货架标准上位机.ViewModels
|
||||
public ICommand BtnStartCommand { get => new DelegateCommand(BtnStart); }
|
||||
public void BtnStart()
|
||||
{
|
||||
WarningManager.AddWarning(new WCS.Model.WebSocketModel.WebSocketMessageModel());
|
||||
//try
|
||||
//{
|
||||
// if (DataGridItemSource == null)
|
||||
// {
|
||||
// Growl.Warning("未勾选数据!");
|
||||
// return;
|
||||
// }
|
||||
// //判断是否勾选数据
|
||||
// var selectedOutOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
// .FirstOrDefault();
|
||||
// if (selectedOutOrder == null)
|
||||
// {
|
||||
// Growl.Warning("未勾选数据!");
|
||||
// return;
|
||||
// }
|
||||
try
|
||||
{
|
||||
//是否已搜索
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
//判断是否已勾选数据
|
||||
var selectetOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectetOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
// #region 调用接口开始盘点
|
||||
// var body = new GetOutOrderDetailRequest()
|
||||
// {
|
||||
// OrderId = selectedOutOrder.Id,
|
||||
// OrderNumber = selectedOutOrder.StocktakingOrderNumber,
|
||||
// UserName = LocalStatic.CurrentUser,
|
||||
// DeviceType = LocalFile.Config.DeviceType,
|
||||
// };
|
||||
// var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outStore/goInOutstore", body, "POST");
|
||||
// if (Result != null && Result.Code == 200)
|
||||
// {
|
||||
// //成功后直接跳转
|
||||
// MainWindow1.viewModel.GoToOutVentoryView = true;
|
||||
// Growl.Success("已跳转到物料出库页面!");
|
||||
// }
|
||||
// else if (Result != null)
|
||||
// {
|
||||
// Growl.Warning(Result.Message);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Growl.Warning("调用接口失败!");
|
||||
// }
|
||||
// #endregion
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// Growl.Error("出现异常:" + ex.Message);
|
||||
//}
|
||||
//finally
|
||||
//{
|
||||
//}
|
||||
#region 调用接口开始盘点
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
StockTakingOrderId = selectetOrder.Id,
|
||||
StockTakingOrderNumber = selectetOrder.StocktakingOrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/startStockTakingOrder", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
//成功后直接跳转
|
||||
MainWindow1.viewModel.GoToStockTakingView = true;
|
||||
Growl.Success("已跳转到物料盘点页面!");
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnPauseCommand { get => new DelegateCommand(BtnPause); }
|
||||
public void BtnPause()
|
||||
{
|
||||
WarningManager.RemoveWarning(Guid.NewGuid());
|
||||
try
|
||||
{
|
||||
//是否已搜索
|
||||
if (DataGridItemSource == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
//判断是否已勾选数据
|
||||
var selectetOrder = DataGridItemSource.Where(t => t.IsSelected)
|
||||
.FirstOrDefault();
|
||||
if (selectetOrder == null)
|
||||
{
|
||||
Growl.Warning("未勾选数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口结束盘点
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
StockTakingOrderId = selectetOrder.Id,
|
||||
StockTakingOrderNumber = selectetOrder.StocktakingOrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/endStockTakingOrder", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Success("暂停盘点成功!");
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("暂停失败:调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
296
货架标准上位机/ViewModels/StocktakingViewModel.cs
Normal file
296
货架标准上位机/ViewModels/StocktakingViewModel.cs
Normal file
@ -0,0 +1,296 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using MiniExcelLibs;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using TouchSocket.Core;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using 货架标准上位机.Api;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class StocktakingViewModel : BindableBase
|
||||
{
|
||||
public StocktakingViewModel()
|
||||
{
|
||||
RefreshStockTakingOrderList();
|
||||
}
|
||||
|
||||
#region Property
|
||||
private StockTakingOrderModel selectedOutOrder;
|
||||
public StockTakingOrderModel SelectedOutOrder
|
||||
{
|
||||
get { return selectedOutOrder; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedOutOrder, value);
|
||||
if (selectedOutOrder != null)
|
||||
{
|
||||
SelectedOutOrderNumber = selectedOutOrder.StocktakingOrderNumber;
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string selectedOutOrderNumber;
|
||||
public string SelectedOutOrderNumber
|
||||
{
|
||||
get => selectedOutOrderNumber;
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedOutOrderNumber, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ObservableCollection<StockTakingOrderModel> outOrderList;
|
||||
public ObservableCollection<StockTakingOrderModel> OutOrderList
|
||||
{
|
||||
get => outOrderList;
|
||||
set
|
||||
{
|
||||
SetProperty(ref outOrderList, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<StockTakingOrderMatDetailModel> dataGridItemSource;
|
||||
public ObservableCollection<StockTakingOrderMatDetailModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
RefreshCount();
|
||||
}
|
||||
}
|
||||
|
||||
//单据总盘数
|
||||
private int totalPan;
|
||||
public int TotalPan
|
||||
{
|
||||
get => totalPan; set
|
||||
{
|
||||
SetProperty(ref totalPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int sendedPan;
|
||||
public int SendedPan
|
||||
{
|
||||
get => sendedPan; set
|
||||
{
|
||||
SetProperty(ref sendedPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string orderStatus;
|
||||
public string OrderStatus
|
||||
{
|
||||
get { return orderStatus; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshCount()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
SendedPan = dataGridItemSource.Where(t => t.IsStocktaking).Count();
|
||||
TotalPan = dataGridItemSource.Count();
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ICommand BtnStartCommand { get => new DelegateCommand(BtnStart); }
|
||||
public void BtnStart()
|
||||
{
|
||||
try
|
||||
{
|
||||
//判断是否选择单据
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
|
||||
#region 调用接口开始盘点
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
StockTakingOrderId = selectedOutOrder.Id,
|
||||
StockTakingOrderNumber = selectedOutOrder.StocktakingOrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/startStockTakingOrder", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功开始盘点!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnPauseCommand { get => new DelegateCommand(BtnPause); }
|
||||
public void BtnPause()
|
||||
{
|
||||
try
|
||||
{
|
||||
//判断是否选择单据
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
return;
|
||||
}
|
||||
#region 调用接口结束盘点
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
StockTakingOrderId = selectedOutOrder.Id,
|
||||
StockTakingOrderNumber = selectedOutOrder.StocktakingOrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/endStockTakingOrder", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
Growl.Warning("已成功结束盘点!");
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshStockTakingOrderList(string OrderNumber = "")
|
||||
{
|
||||
#region 调用接口获取发料单
|
||||
try
|
||||
{
|
||||
var body = new GetStockTakingOrdersRequest()
|
||||
{
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<StockTakingOrderModel>>(LocalFile.Config.ApiIpHost + "stockTaking/getStockTakingOrdersByStatus", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
OutOrderList = new ObservableCollection<StockTakingOrderModel>(Result.Data.Lists);
|
||||
if (!string.IsNullOrEmpty(OrderNumber))
|
||||
{
|
||||
SelectedOutOrder = OutOrderList.Where(t => t.StocktakingOrderNumber == OrderNumber).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Warning(ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public void RefreshDataGridItemSource()
|
||||
{
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
//选择的单据为空无法进行查询
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取盘点单物料明细
|
||||
Task.Run(() =>
|
||||
{
|
||||
var body = new GetStockTakingOrderMatDetailRequest()
|
||||
{
|
||||
StockTakingOrderId = selectedOutOrder.Id,
|
||||
StockTakingOrderNumber = selectedOutOrder.StocktakingOrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<StockTakingOrderMatDetailModel>>>(LocalFile.Config.ApiIpHost + "stockTaking/getStockTakingOrderMatDetail", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<StockTakingOrderMatDetailModel>(Result.Data);
|
||||
}
|
||||
else
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
});
|
||||
|
||||
Growl.Warning("该单据未查询到盘点明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
196
货架标准上位机/Views/InOutRecordView.xaml
Normal file
196
货架标准上位机/Views/InOutRecordView.xaml
Normal file
@ -0,0 +1,196 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="货架标准上位机.InOutRecordView"
|
||||
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="2*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Margin="3" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="货架类型:" FontSize="18" ></TextBlock>
|
||||
<ComboBox Grid.Row="0" Grid.Column="1"
|
||||
DisplayMemberPath="ShelfTypeName"
|
||||
ItemsSource="{Binding ShelfTypeItems}"
|
||||
SelectedItem="{Binding SelectedShelfTypeItem}"
|
||||
FontSize="18"
|
||||
Height="20"
|
||||
IsEditable="True"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料编码:" FontSize="18" ></TextBlock>
|
||||
<hc:AutoCompleteTextBox Grid.Row="1" Grid.Column="1" MinWidth="120" FontSize="18" IsEditable="True"
|
||||
Height="20"
|
||||
IsTextSearchEnabled="True"
|
||||
Name="cbxMatCode" Margin="1"
|
||||
ItemsSource="{Binding Items}"
|
||||
Text="{Binding MatCode}"
|
||||
DisplayMemberPath="MatCode"/>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="2" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料名称:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding MatName}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="4" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料批次:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="1" Grid.Column="5" Text="{Binding MatBatch}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="2" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text="物料条码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="2" Grid.Column="3" Text="{Binding MatSN}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="120" ></TextBox>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Margin="5"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Right"
|
||||
Text=" 库 位 :" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding StoreCode}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontSize="18" MinWidth="160" ></TextBox>
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}"
|
||||
Margin="2"
|
||||
Command="{Binding BtnSearchCommand}"
|
||||
hc:BorderElement.CornerRadius="8"
|
||||
Grid.Column="6" MinHeight="35" FontSize="18" Content=" 搜索" FontFamily="{StaticResource IconFont}" >
|
||||
</Button>
|
||||
|
||||
<Button Style="{StaticResource ButtonWarning}"
|
||||
Margin="2"
|
||||
Command="{Binding BtnResetCommand}"
|
||||
hc:BorderElement.CornerRadius="8"
|
||||
Grid.Column="7" MinHeight="35" FontSize="18" Content=" 重置" FontFamily="{StaticResource IconFont}" >
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="3" Background="AliceBlue" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="8*"></RowDefinition>
|
||||
<RowDefinition Height="0.7*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnExportCommand}"
|
||||
Content=" 导 出" FontFamily="{StaticResource IconFont}"
|
||||
Style="{StaticResource ButtonWarning}" Background="DarkOrange">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="150" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="150" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="150" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn MaxWidth="100" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已锁定" Binding="{Binding IsLockedStr}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="入库时间" Binding="{Binding InstoreTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="物料SN" Binding="{Binding MatSN}"></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" 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>
|
||||
|
||||
<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>
|
39
货架标准上位机/Views/InOutRecordView.xaml.cs
Normal file
39
货架标准上位机/Views/InOutRecordView.xaml.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using Ping9719.WpfEx;
|
||||
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.Shapes;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class InOutRecordView : UserControlBase
|
||||
{
|
||||
public InOutRecordViewModel viewModel { get; set; } = new InOutRecordViewModel();
|
||||
public InOutRecordView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
{
|
||||
viewModel.InitMatCode();
|
||||
viewModel.BtnReset();
|
||||
}
|
||||
}
|
||||
}
|
@ -22,26 +22,6 @@
|
||||
<TextBlock Text="" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<!--<MenuItem Height="29" Width="35" Header="">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock Text="" FontSize="15" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
</MenuItem.Icon>
|
||||
<MenuItem Width="120" Header="蓝色">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock Text="" Foreground="Blue" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Width="120" Header="紫色">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock Text="" Foreground="Purple" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Width="120" Header="黑夜">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock Text="" Foreground="Black" FontSize="16" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>-->
|
||||
<MenuItem Height="29" Width="35" Header="">
|
||||
<MenuItem.Icon>
|
||||
<TextBlock Text="" FontSize="15" FontFamily="{StaticResource IconFont}"></TextBlock>
|
||||
|
@ -110,6 +110,7 @@
|
||||
<View:OutInventoryDocumentView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
<TabItem IsSelected="{Binding GoToOutVentoryView}" Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@ -142,11 +143,10 @@
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:MatBaseInfoView/>
|
||||
<View:StockTakingView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
|
||||
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
||||
<TabItem.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@ -166,6 +166,9 @@
|
||||
<TextBlock Margin="10,0,0,0" FontSize="16">出入记录</TextBlock>
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:InOutRecordView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Padding="10,10,40,10" Visibility="{Binding Auth,Source={x:Static local:UserInfoView.viewModel},ConverterParameter={x:Static local:AuthEnum.查询},Converter={StaticResource AuthVisConverter}}">
|
||||
@ -283,12 +286,14 @@
|
||||
<View:SetView />
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
</TabControl>
|
||||
<!--状态栏-->
|
||||
<Border Margin="5,3" Grid.Row="2" Grid.ColumnSpan="2" Background="AliceBlue" CornerRadius="3">
|
||||
<Grid>
|
||||
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<pi:IotState Content="状态内容待定" IsOk="False" Height="auto" Width="auto" InteriorHeight="13" Foreground="Gray" Background="{x:Null}"></pi:IotState>
|
||||
<pi:IotState Content="WebSocket连接" IsOk="False" Height="auto" Width="auto" InteriorHeight="13" Foreground="Gray" Background="{x:Null}"></pi:IotState>
|
||||
<Button Content="手动重连" ></Button>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<TextBlock Margin="0,0" Text="{Binding Time,StringFormat=yyyy-MM-dd HH:mm:ss,FallbackValue=2000-01-01 00:00:00}" Foreground="#FF3A90C1" VerticalAlignment="Center"></TextBlock>
|
||||
|
@ -115,6 +115,7 @@
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据来源" Binding="{Binding OrderSource}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据类型" Binding="{Binding OrderType}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据状态" Binding="{Binding OrderStatus}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据执行状态" Binding="{Binding OutOrderExeStatus}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="单据同步类型" Binding="{Binding SyncType}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="创建时间" Binding="{Binding CreateTime}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="创建人" Binding="{Binding CreateUser}"></DataGridTextColumn>
|
||||
|
@ -162,10 +162,10 @@
|
||||
<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>-->
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2">
|
||||
<TextBlock Text="总盘数:" VerticalAlignment="Bottom" FontSize="22">
|
||||
|
177
货架标准上位机/Views/StockTakingView.xaml
Normal file
177
货架标准上位机/Views/StockTakingView.xaml
Normal file
@ -0,0 +1,177 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="货架标准上位机.StockTakingView"
|
||||
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"
|
||||
xmlns:货架标准上位机="clr-namespace:货架标准上位机"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="737" d:DesignWidth="1192">
|
||||
<Border Margin="0" Background="LightGray" CornerRadius="3" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.9*"></RowDefinition>
|
||||
<!--<RowDefinition Height="0.9*"></RowDefinition>-->
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Margin="0" Background="AliceBlue" Padding="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="3" MinHeight="45" FontSize="28" Content="开始盘点" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnStartCommand}"
|
||||
>
|
||||
</Button>
|
||||
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="4" MinHeight="45" FontSize="28" Content="暂停盘点" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnPauseCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="0" Background="LightGray" Padding="0">
|
||||
<Border Margin="1" CornerRadius="3" Background="AliceBlue" Padding="0">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="6*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--</TabItem>-->
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Margin="0" Background="AliceBlue" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="11*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="6*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="盘点单列表" MouseDown="TextBlock_MouseDown" FontWeight="DemiBold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"></TextBlock>
|
||||
<Border CornerRadius="3" Margin="3 3 0 3" Grid.Row="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
||||
<ListView FontSize="18" ItemsSource="{Binding OutOrderList}" SelectedItem="{Binding SelectedOutOrder,Mode=TwoWay}" PreviewMouseWheel="ListView_PreviewMouseWheel">
|
||||
<ListView.View>
|
||||
<GridView AllowsColumnReorder="False">
|
||||
<GridView.ColumnHeaderContainerStyle>
|
||||
<Style TargetType="{x:Type GridViewColumnHeader}">
|
||||
<Setter Property="Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</GridView.ColumnHeaderContainerStyle>
|
||||
<GridViewColumn DisplayMemberBinding="{Binding StocktakingOrderNumber}"/>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Border CornerRadius="3" Margin="3" Grid.Row="0" Grid.Column="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"></RowDefinition>
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<TextBlock FontSize="26" Text="当前盘点单号:">
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="26" Text="{Binding SelectedOutOrderNumber}">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="40"
|
||||
AutoGenerateColumns="False" FontSize="15">
|
||||
<DataGrid.Resources>
|
||||
<货架标准上位机:WorkItemBackgroundConverter x:Key="converter"/>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="{Binding Path=IsStocktaking, Converter={StaticResource converter}}"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已取料" Binding="{Binding IsStocktakingStr}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="False" Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<Border CornerRadius="3" Background="Transparent" VerticalAlignment="Center" >
|
||||
<Grid HorizontalAlignment="Stretch" Margin="5 0 1 0" VerticalAlignment="Top" Width="Auto" Height="40">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="5*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
|
||||
<!--<TextBlock Text="当前状态:" 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">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="22">
|
||||
</TextBlock>
|
||||
<TextBlock Text=" 盘点进度:" VerticalAlignment="Bottom" FontSize="22">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding SendedPan}" VerticalAlignment="Bottom" FontSize="22">
|
||||
</TextBlock>
|
||||
<TextBlock Text="/" VerticalAlignment="Bottom" FontSize="22">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding TotalPan}" VerticalAlignment="Bottom" FontSize="22">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</pi:UserControlBase>
|
69
货架标准上位机/Views/StockTakingView.xaml.cs
Normal file
69
货架标准上位机/Views/StockTakingView.xaml.cs
Normal file
@ -0,0 +1,69 @@
|
||||
using Ping9719.WpfEx;
|
||||
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.Shapes;
|
||||
using System.Text.RegularExpressions;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class StockTakingView : UserControlBase
|
||||
{
|
||||
public static StocktakingViewModel viewModel = new StocktakingViewModel();
|
||||
public StockTakingView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var viewModel = this.DataContext as InInventoryViewModel;
|
||||
DataGrid datagrid = sender as DataGrid;
|
||||
var index = datagrid.SelectedIndex;
|
||||
if (index >= 0)
|
||||
{
|
||||
|
||||
}
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void ListView_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if (!e.Handled)
|
||||
{
|
||||
// ListView拦截鼠标滚轮事件
|
||||
e.Handled = true;
|
||||
|
||||
// 激发一个鼠标滚轮事件,冒泡给外层ListView接收到
|
||||
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
|
||||
eventArg.RoutedEvent = UIElement.MouseWheelEvent;
|
||||
eventArg.Source = sender;
|
||||
var parent = ((Control)sender).Parent as UIElement;
|
||||
parent.RaiseEvent(eventArg);
|
||||
}
|
||||
}
|
||||
|
||||
private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
viewModel.RefreshStockTakingOrderList(viewModel.SelectedOutOrderNumber);
|
||||
}
|
||||
}
|
||||
}
|
52
货架标准上位机/Views/StocktakingDocumentDetailView.xaml
Normal file
52
货架标准上位机/Views/StocktakingDocumentDetailView.xaml
Normal file
@ -0,0 +1,52 @@
|
||||
<hc:Window x:Class="货架标准上位机.StocktakingDocumentDetailView"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Height="500" Width="800" WindowStyle="None" BorderThickness="0" Background="{x:Null}" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
|
||||
<hc:Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
|
||||
<Setter Property="Padding" Value="25,0"></Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</hc:Window.Resources>
|
||||
<Border BorderBrush="Gray" Background="WhiteSmoke" CornerRadius="5" BorderThickness="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock FontSize="24" Name="Title" Text="盘点单据明细" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>
|
||||
|
||||
<Grid Margin="5,0" Grid.Row="1" >
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="39"
|
||||
AutoGenerateColumns="False" Name="dg1" FontSize="13">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="盘点单据编码" Binding="{Binding StocktakingOrderNumber}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="是否盘点" Binding="{Binding IsStocktaking}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="盘点数量" Binding="{Binding StocktakingQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Margin="5" x:Name="spacingPanel" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button Margin="5" Content="确认" FontSize="18" Click="closeClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</hc:Window>
|
47
货架标准上位机/Views/StocktakingDocumentDetailView.xaml.cs
Normal file
47
货架标准上位机/Views/StocktakingDocumentDetailView.xaml.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Runtime.CompilerServices;
|
||||
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.Shapes;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class StocktakingDocumentDetailView : HandyControl.Controls.Window
|
||||
{
|
||||
public StocktakingDocumentDetailView(List<StockTakingOrderMatDetailModel> details = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (details != null)
|
||||
{
|
||||
dg1.ItemsSource = details;
|
||||
}
|
||||
}
|
||||
|
||||
private void closeClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
DataGrid datagrid = sender as DataGrid;
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="7*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Margin="5 5 5 0" 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>
|
||||
@ -73,7 +73,7 @@
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Margin="5" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Border Grid.Row="1" Margin="2" Background="AliceBlue" CornerRadius="5" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
|
@ -79,6 +79,10 @@ namespace 货架标准上位机
|
||||
OutVentoryView.viewModel.RefreshDataGridItemSource();
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.通知刷新盘点:
|
||||
StockTakingView.viewModel.RefreshDataGridItemSource();
|
||||
client.Send(e.DataFrame.ToText());
|
||||
break;
|
||||
case WarningTypeEnum.恢复正常:
|
||||
var SolvedGuids = warning.SolvedGuids;
|
||||
SolvedGuids.ForEach(guid =>
|
||||
|
Reference in New Issue
Block a user