提交代码
This commit is contained in:
31
货架标准上位机/Converters/WorkItemBackgroundConverter.cs
Normal file
31
货架标准上位机/Converters/WorkItemBackgroundConverter.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
class WorkItemBackgroundConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value.ToString() == "True")
|
||||
{
|
||||
return Brushes.ForestGreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Brushes.White;
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -48,7 +48,7 @@ namespace 货架标准上位机.ViewModel
|
||||
public WrapPanel wrapPanel;
|
||||
public async void AddUserControl()
|
||||
{
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
//var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
var body = new GetShelfStatusRequest()
|
||||
@ -75,9 +75,9 @@ namespace 货架标准上位机.ViewModel
|
||||
}
|
||||
finally
|
||||
{
|
||||
dia.Close();
|
||||
//dia.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 页面加载时任务
|
||||
|
@ -185,15 +185,16 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
var body = new QueryByMatSnRequest()
|
||||
{
|
||||
MatSn = scanner.TempCode,
|
||||
ShelfCode = scanner.ShelfCode,
|
||||
IpAddress = scanner.COM,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<QueryByMatSnResponse>(LocalFile.Config.ApiIpHost + "instore/queryByMatSn", body, "POST");
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<MatInfoModel>>(LocalFile.Config.ApiIpHost + "instore/queryByMatSn", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
scanner.MatSn = Result.Data.materialBar;
|
||||
scanner.MatSn = Result.Data.MatSN;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
278
货架标准上位机/ViewModels/MatInfoViewModel.cs
Normal file
278
货架标准上位机/ViewModels/MatInfoViewModel.cs
Normal file
@ -0,0 +1,278 @@
|
||||
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 WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using System.Collections.ObjectModel;
|
||||
using HandyControl.Tools.Extension;
|
||||
using 货架标准上位机.Tool;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class MatInfoViewModel : BindableBase
|
||||
{
|
||||
#region Property
|
||||
private ObservableCollection<MatInfoModel> dataGridItemSource;
|
||||
public ObservableCollection<MatInfoModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
public MatInfoModel selectedataGridItem;
|
||||
public MatInfoModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
{
|
||||
get { return matCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
private string matName;
|
||||
public string MatName
|
||||
{
|
||||
get { return matName; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matName, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料规格
|
||||
/// </summary>
|
||||
private string matSpec;
|
||||
public string MatSpec
|
||||
{
|
||||
get { return matSpec; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matSpec, value);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
MatSpec = string.Empty;
|
||||
MatSN = 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 GetMatInfoRequest()
|
||||
{
|
||||
MatCode = MatCode,
|
||||
MatName = MatName,
|
||||
MatSpec = MatSpec,
|
||||
MatSN = MatSN,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10,
|
||||
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInfoModel>>(LocalFile.Config.ApiIpHost + "matBaseInfo/getMatInfo", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<MatInfoModel>(Result.Data.Lists);
|
||||
MaxPage = Result.Data.MaxPage;
|
||||
TotalCount = Result.Data.TotalCount;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
//dia.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 物料删除操作
|
||||
/// </summary>
|
||||
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
public async void BtnDelete()
|
||||
{
|
||||
Growl.Ask($"是否删除所有勾选得数据]!", isConfirmed =>
|
||||
{
|
||||
if (isConfirmed)
|
||||
{
|
||||
//查询勾选的第一个数据
|
||||
var matBaseInfoIds = DataGridItemSource?.Where(t => t.IsSelected == true)
|
||||
.Select(t => t.Id)
|
||||
.ToList();
|
||||
|
||||
if (matBaseInfoIds == null)
|
||||
{
|
||||
Growl.Warning("请选择需要修改的数据!");
|
||||
}
|
||||
else
|
||||
{
|
||||
var body = new DeleteMatBaseInfosRequest()
|
||||
{
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
MatBaseInfoIds = matBaseInfoIds,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "matBaseInfo/deleteMatBaseInfo", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
CurrentPage = 1;
|
||||
Growl.Success("删除成功!" + Result?.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Error($"{Result?.Message?.ToString()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
public ICommand BtnPrintCommand { get => new DelegateCommand(BtnPrint); }
|
||||
public async void BtnPrint()
|
||||
{
|
||||
var matBaseInfo = DataGridItemSource?.Where(t => t.IsSelected == true).ToList();
|
||||
//TO DO后台批量打印
|
||||
}
|
||||
#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
|
||||
}
|
||||
}
|
66
货架标准上位机/ViewModels/OutInventoryAddDucumentViewModel.cs
Normal file
66
货架标准上位机/ViewModels/OutInventoryAddDucumentViewModel.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
|
||||
namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
public class OutInventoryAddDucumentViewModel : BindableBase
|
||||
{
|
||||
#region Property
|
||||
private ObservableCollection<MatInventorySummaryModel> dataGridItemSource;
|
||||
public ObservableCollection<MatInventorySummaryModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
/// <summary>
|
||||
/// 新增物料
|
||||
/// </summary>
|
||||
public ICommand BtnAddCommand { get => new DelegateCommand(BtnAdd); }
|
||||
public void BtnAdd()
|
||||
{
|
||||
var window = new OutInventoryAddMatView();
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
var result = window.ShowDialog();
|
||||
if (result == true)
|
||||
{
|
||||
if (DataGridItemSource == null)
|
||||
DataGridItemSource = new ObservableCollection<MatInventorySummaryModel>();
|
||||
DataGridItemSource.Add(window.inventorySummary);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand DelCommand { get => new DelegateCommand<MatInventorySummaryModel>(Del); }
|
||||
public void Del(MatInventorySummaryModel obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
DataGridItemSource.Remove(obj);
|
||||
;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
95
货架标准上位机/ViewModels/OutInventoryAddMatViewModel.cs
Normal file
95
货架标准上位机/ViewModels/OutInventoryAddMatViewModel.cs
Normal file
@ -0,0 +1,95 @@
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using 货架标准上位机.Api;
|
||||
|
||||
namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
public class OutInventoryAddMatViewModel : BindableBase
|
||||
{
|
||||
#region Property
|
||||
private ObservableCollection<MatInventorySummaryModel> dataGridItemSource;
|
||||
public ObservableCollection<MatInventorySummaryModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
private MatInventorySummaryModel selectedataGridItem;
|
||||
public MatInventorySummaryModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
{
|
||||
get { return matCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matName;
|
||||
public string MatName
|
||||
{
|
||||
get { return matName; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matName, value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearch); }
|
||||
public void BtnSearch()
|
||||
{
|
||||
#region 调用接口获取数据
|
||||
try
|
||||
{
|
||||
var body = new GetMatInventorySummaryRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
MatCode = MatCode,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<MatInventorySummaryModel>>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventorySummary", body, "POST");
|
||||
if (Result != null && Result.Data != null)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<MatInventorySummaryModel>(Result.Data);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
379
货架标准上位机/ViewModels/OutInventoryViewModel.cs
Normal file
379
货架标准上位机/ViewModels/OutInventoryViewModel.cs
Normal file
@ -0,0 +1,379 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using MiniExcelLibs;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using TouchSocket.Core;
|
||||
using 货架标准上位机.ViewModel;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class OutInventoryViewModel : BindableBase
|
||||
{
|
||||
public OutInventoryViewModel()
|
||||
{
|
||||
//线程 更新当前选择的订单的状态
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// while (true)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// Thread.Sleep(1000);
|
||||
// //if (LocalStatic.IsRefreshOrderDetail)
|
||||
// //{
|
||||
// // LocalStatic.IsRefreshOrderDetail = false;
|
||||
// // SelectedPickBillNumberChanged();
|
||||
// //}
|
||||
// }
|
||||
// catch
|
||||
// {
|
||||
// //Logs.Write("更新订单状态异常!!");
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
}
|
||||
|
||||
public System.Windows.Controls.TextBox textBox { get; set; }
|
||||
|
||||
#region Property
|
||||
private string number;
|
||||
public string Number
|
||||
{
|
||||
get { return number; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref number, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool isOrderOut;
|
||||
public bool IsOrderOut
|
||||
{
|
||||
get { return isOrderOut; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref isOrderOut, value);
|
||||
//LocalStatic.IsOrderOut = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string matCode1;
|
||||
public string MatCode1
|
||||
{
|
||||
get { return matCode1; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode1, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int matQty1;
|
||||
public int MatQty1
|
||||
{
|
||||
get { return matQty1; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matQty1, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string order_prod_number;
|
||||
public string Order_prod_number
|
||||
{
|
||||
get { return order_prod_number; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref order_prod_number, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string material_code;
|
||||
public string Material_code
|
||||
{
|
||||
get { return material_code; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref material_code, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string material_name;
|
||||
public string Material_name
|
||||
{
|
||||
get { return material_name; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref material_name, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string material_spec;
|
||||
public string Material_spec
|
||||
{
|
||||
get { return material_spec; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref material_spec, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matCode;
|
||||
public string MatCode
|
||||
{
|
||||
get { return matCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matName;
|
||||
public string MatName
|
||||
{
|
||||
get { return matName; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matName, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matCode3;
|
||||
public string MatCode3
|
||||
{
|
||||
get { return matCode3; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode3, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matName3;
|
||||
public string MatName3
|
||||
{
|
||||
get { return matName3; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matName3, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matSpec3;
|
||||
public string MatSpec3
|
||||
{
|
||||
get { return matSpec3; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matSpec3, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matBatch3;
|
||||
public string MatBatch3
|
||||
{
|
||||
get { return matBatch3; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matBatch3, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string selectedPickBillNumber;
|
||||
public string SelectedPickBillNumber
|
||||
{
|
||||
get { return selectedPickBillNumber; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedPickBillNumber, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string orderProdNumber;
|
||||
public string OrderProdNumber
|
||||
{
|
||||
get { return orderProdNumber; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderProdNumber, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string orderStatus;
|
||||
public string OrderStatus
|
||||
{
|
||||
get { return orderStatus; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref orderStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
private List<object> dataGridItemSource;
|
||||
public List<object> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
RefreshCount();
|
||||
}
|
||||
}
|
||||
|
||||
//领料单号列表
|
||||
private List<string> pickBillNumberList;
|
||||
public List<string> PickBillNumberList
|
||||
{
|
||||
get { return pickBillNumberList; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref pickBillNumberList, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void RefreshCount()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
TotalPan = dataGridItemSource.Count();
|
||||
//SendedPan = dataGridItemSource.Where(t => t.IsSend == true).Count();
|
||||
//UnSendedPan = dataGridItemSource.Where(t => t.IsSend == false).Count();
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
//public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearch); }
|
||||
//public void BtnSearch()
|
||||
//{
|
||||
// if (string.IsNullOrEmpty(MatCode1))
|
||||
// {
|
||||
// Growl.Warning("请输入料号进行筛选!");
|
||||
// return;
|
||||
// }
|
||||
// else if (MatQty1 == 0)
|
||||
// {
|
||||
// Growl.Warning("请输入需要的数量!");
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
// var inventoryDetails = DbHelp.db.Queryable<InventoryDetail>();
|
||||
// if (!string.IsNullOrEmpty(MatCode1))
|
||||
// {
|
||||
// inventoryDetails = inventoryDetails
|
||||
// .Where(t => t.MatCode.Contains(MatCode1))
|
||||
// .Includes(t => t.StoreInfo)
|
||||
// .OrderBy(t => t.MatQty);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
// var inventorys = inventoryDetails.ToList();
|
||||
// int totalMatQty = 0;
|
||||
// //List<InventoryDetail> dataSourceTemp = new List<InventoryDetail>();
|
||||
// foreach (var item in inventorys)
|
||||
// {
|
||||
// if (totalMatQty < MatQty1)
|
||||
// {
|
||||
// totalMatQty += item.MatQty;
|
||||
// item.IsSelected = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// DataGridItemSource = inventorys;
|
||||
//}
|
||||
|
||||
public ICommand BtnOutOrderCommand { get => new DelegateCommand(BtnOutOrder); }
|
||||
public void BtnOutOrder()
|
||||
{
|
||||
var window = new OutInventoryAddDucumentView();
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
//public ICommand BtnTempOutCommand { get => new DelegateCommand(BtnTempOut); }
|
||||
//public void BtnTempOut()
|
||||
//{
|
||||
// var window = new OutInventoryDocumentDetailView();
|
||||
// window.ShowDialog();
|
||||
// if (window.DialogResult == true)
|
||||
// {
|
||||
// DataGridItemSource = window.DataGridItemSource;
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
public ICommand BtnReset3Command { get => new DelegateCommand(BtnReset3); }
|
||||
public void BtnReset3()
|
||||
{
|
||||
MatCode3 = string.Empty;
|
||||
MatName3 = string.Empty;
|
||||
MatSpec3 = string.Empty;
|
||||
MatBatch3 = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
public ICommand BtnStartCommand { get => new DelegateCommand(BtnStart); }
|
||||
public void BtnStart()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public ICommand BtnPauseCommand { get => new DelegateCommand(BtnPause); }
|
||||
public void BtnPause()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region PageOperation
|
||||
private int totalPan;
|
||||
public int TotalPan
|
||||
{
|
||||
get { return totalPan; }
|
||||
set { SetProperty(ref totalPan, value); }
|
||||
}
|
||||
|
||||
private int sendedPan;
|
||||
public int SendedPan
|
||||
{
|
||||
get { return sendedPan; }
|
||||
set { SetProperty(ref sendedPan, value); }
|
||||
}
|
||||
|
||||
private int unSendedPan;
|
||||
public int UnSendedPan
|
||||
{
|
||||
get { return unSendedPan; }
|
||||
set { SetProperty(ref unSendedPan, value); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region private method
|
||||
public bool GrowlCallBack(bool aaa)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -110,7 +110,7 @@
|
||||
</StackPanel>
|
||||
</TabItem.Header>
|
||||
<hc:TransitioningContentControl TransitionMode="Fade">
|
||||
<View:MatBaseInfoView/>
|
||||
<View:OutVentoryView/>
|
||||
</hc:TransitioningContentControl>
|
||||
</TabItem>
|
||||
|
||||
|
@ -42,6 +42,8 @@ namespace 货架标准上位机
|
||||
MatBaseInfo = matBaseInfo,
|
||||
TotalCount = Convert.ToInt32(txtTotalCount.Text),
|
||||
MatQty = Convert.ToInt32(txtMatQty.Text),
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<MatInfoModel>>>(LocalFile.Config.ApiIpHost + "matBaseInfo/generateMatInfo", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Count > 0)
|
||||
|
@ -56,7 +56,7 @@
|
||||
Text="物料条码:" FontSize="18" ></TextBlock>
|
||||
<TextBox Grid.Column="7"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Stretch"
|
||||
FontSize="18" MinWidth="90" Text="{Binding MatSn}"></TextBox>
|
||||
FontSize="18" MinWidth="90" Text="{Binding MatSN}"></TextBox>
|
||||
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
@ -82,13 +82,13 @@
|
||||
|
||||
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5"
|
||||
<!--<Button MinHeight="40" FontSize="18" Margin="5"
|
||||
Content="删 除" FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Command="{Binding BtnDeleteCommand}"
|
||||
Style="{StaticResource ButtonDanger}"
|
||||
>
|
||||
</Button>
|
||||
</Button>-->
|
||||
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5"
|
||||
@ -124,12 +124,13 @@
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="序号" Binding="{Binding RowNumber}"></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 MatUnit}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="客户" Binding="{Binding MatCustomer}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="状态" Binding="{Binding IsEnableStr}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="供应商" Binding="{Binding MatSupplier}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料条码" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="打印次数" Binding="{Binding PrintTimes}"></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>
|
||||
|
@ -18,7 +18,7 @@ namespace 货架标准上位机
|
||||
{
|
||||
public partial class MatInfoView : UserControlBase
|
||||
{
|
||||
public MatBaseInfoViewModel viewModel { get; set; } = new MatBaseInfoViewModel();
|
||||
public MatInfoViewModel viewModel { get; set; } = new MatInfoViewModel();
|
||||
public MatInfoView()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -49,18 +49,7 @@ namespace 货架标准上位机
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// if (viewModel.SelectedataGridItem != null)
|
||||
// {
|
||||
// viewModel.SelectedataGridItem.IsSelected = !viewModel.SelectedataGridItem.IsSelected;
|
||||
// }
|
||||
|
||||
//}
|
||||
//catch
|
||||
//{
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||
|
@ -27,15 +27,7 @@ namespace 货架标准上位机
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// DataGrid datagrid = sender as DataGrid;
|
||||
// datagrid.UnselectAllCells();
|
||||
//}
|
||||
//catch
|
||||
//{
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
private void LoadedVisible(object sender, EventArgs e)
|
||||
|
90
货架标准上位机/Views/OutInventoryAddDucumentView.xaml
Normal file
90
货架标准上位机/Views/OutInventoryAddDucumentView.xaml
Normal file
@ -0,0 +1,90 @@
|
||||
<hc:Window x:Class="货架标准上位机.OutInventoryAddDucumentView"
|
||||
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="850" WindowStyle="None" Background="{x:Null}" BorderThickness="0" 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 Background="AliceBlue" CornerRadius="10" BorderThickness="1.5" BorderBrush="Black" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="1.5*"></RowDefinition>
|
||||
<RowDefinition Height="10*"></RowDefinition>
|
||||
<RowDefinition Height="0.8*"></RowDefinition>
|
||||
<RowDefinition Height="1.5*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock FontSize="25" Name="Title" Text="新增出库单据" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Center"/>
|
||||
<hc:Divider Margin="0"></hc:Divider>
|
||||
</StackPanel>
|
||||
|
||||
<Border Grid.Row="1" Margin="2 2 2 0" Background="AliceBlue" Padding="0">
|
||||
<Border Background="AliceBlue" Padding="0">
|
||||
<Grid >
|
||||
<StackPanel Margin="3" Orientation="Horizontal">
|
||||
<Button MinHeight="40" FontSize="18"
|
||||
Content="增加物料" FontFamily="{StaticResource IconFont}"
|
||||
Foreground="WhiteSmoke"
|
||||
Background="HotPink"
|
||||
Command="{Binding BtnAddCommand}">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
|
||||
<Grid Margin="5,0" Grid.Row="2" >
|
||||
<DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
RowHeight="39" ItemsSource="{Binding DataGridItemSource}"
|
||||
AutoGenerateColumns="False" Name="dg1" FontSize="15">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" MaxWidth="150" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料规格" MaxWidth="150" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库存数量" Binding="{Binding TotalQty}"></DataGridTextColumn>
|
||||
<DataGridTemplateColumn CanUserResize="False" Header="需求数量">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Width="80" Height="25" Text="{Binding NeedQty}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn CanUserResize="False" Header="">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<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 }"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="3" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<TextBlock FontSize="20" Text="已选物料:"></TextBlock>
|
||||
<TextBlock FontSize="20" Text="{Binding SelectedTypeCount}"></TextBlock>
|
||||
<TextBlock FontSize="20" Text="种"></TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="3" x:Name="spacingPanel" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button Margin="0" Content="生成出库单" Background="ForestGreen" Foreground="White" MinHeight="40" FontSize="20" Click="comfirmClick"/>
|
||||
<TextBlock Margin="20" Text=""></TextBlock>
|
||||
<Button Margin="0" Content="取消" Background="IndianRed" Foreground="White" MinHeight="40" FontSize="20" Click="closeClick"/>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</hc:Window>
|
97
货架标准上位机/Views/OutInventoryAddDucumentView.xaml.cs
Normal file
97
货架标准上位机/Views/OutInventoryAddDucumentView.xaml.cs
Normal file
@ -0,0 +1,97 @@
|
||||
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using 货架标准上位机.ViewModels;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class OutInventoryAddDucumentView : HandyControl.Controls.Window
|
||||
{
|
||||
public OutInventoryAddDucumentViewModel viewModel = new OutInventoryAddDucumentViewModel();
|
||||
public OutInventoryAddDucumentView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
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;
|
||||
var index = datagrid.SelectedIndex;
|
||||
if (index >= 0)
|
||||
{
|
||||
//if (viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > index)
|
||||
//{
|
||||
// var data = viewModel.DataGridItemSource.ElementAt(index);
|
||||
// data.IsSelected = !data.IsSelected;
|
||||
// viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||
//}
|
||||
}
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
|
||||
private void txtMatQty1_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
if (!Regex.IsMatch(e.Text, "^[0-9]"))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
//public List<InventoryDetail> DataGridItemSource = new List<InventoryDetail>();
|
||||
|
||||
private void comfirmClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = true;
|
||||
//if (viewModel.DataGridItemSource != null)
|
||||
// DataGridItemSource = viewModel.DataGridItemSource.Where(t => t.IsSelected).ToList();
|
||||
this.Close();
|
||||
}
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//viewModel.RefreshCount();
|
||||
}
|
||||
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;
|
||||
// }
|
||||
// viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||
//}
|
||||
}
|
||||
|
||||
private void allChecked_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//var viewMode = this.DataContext as OutInventoryDocumentDetailViewModel;
|
||||
//if (viewMode != null && viewMode.DataGridItemSource != null && viewMode.DataGridItemSource.Count() > 0)
|
||||
//{
|
||||
// foreach (var item in viewMode.DataGridItemSource)
|
||||
// {
|
||||
// item.IsSelected = false;
|
||||
// }
|
||||
// viewMode.DataGridItemSource = viewMode.DataGridItemSource.ToList();
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
102
货架标准上位机/Views/OutInventoryAddMatView.xaml
Normal file
102
货架标准上位机/Views/OutInventoryAddMatView.xaml
Normal file
@ -0,0 +1,102 @@
|
||||
<hc:Window x:Class="货架标准上位机.OutInventoryAddMatView"
|
||||
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:local="clr-namespace:货架标准上位机"
|
||||
mc:Ignorable="d"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Height="500" Width="900" 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 BorderThickness="1.5" BorderBrush="Black" Background="AliceBlue" CornerRadius="10" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.2*"></RowDefinition>
|
||||
<RowDefinition Height="1.5*"></RowDefinition>
|
||||
<RowDefinition Height="9*"></RowDefinition>
|
||||
<RowDefinition Height="1.5*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Margin="2" FontSize="25" Name="Title" Text="选择物料(双击选中)" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<hc:Divider Margin="0"/>
|
||||
</StackPanel>
|
||||
<Border Grid.Row="1" Margin="2 2 2 0" Background="LightGray" Padding="0">
|
||||
<Border Background="AliceBlue" 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>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Margin="2" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Text="物料编码:">
|
||||
</TextBlock>
|
||||
<TextBox MinWidth="120" Grid.Column="1" MaxWidth="120" Text="{Binding MatCode}" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black" ></TextBox>
|
||||
<TextBlock Grid.Column="2" Margin="10 2 2 2" FontSize="20" HorizontalAlignment="Right" VerticalAlignment="Center" Text="物料名称:">
|
||||
</TextBlock>
|
||||
<TextBox Grid.Column="3" MinWidth="120" MaxWidth="120" Text="{Binding MatName}" Name="txtMatQty1" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black" >
|
||||
</TextBox>
|
||||
|
||||
<Button Grid.Column="4" Style="{StaticResource ButtonSuccess}"
|
||||
Command="{Binding BtnSearchCommand}"
|
||||
hc:BorderElement.CornerRadius="10"
|
||||
MinHeight="35" FontSize="20" Content=" 搜索" FontFamily="{StaticResource IconFont}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
|
||||
<Grid Margin="5,0" Grid.Row="2" >
|
||||
<DataGrid Grid.Row="1"
|
||||
Name="dataGrid"
|
||||
SelectionChanged="DataGrid_SelectionChanged"
|
||||
MouseDoubleClick="dataGrid_MouseDoubleClick"
|
||||
RowHeight="39"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
SelectedItem="{Binding SelectedataGridItem}"
|
||||
AutoGenerateColumns="False" FontSize="14">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn CanUserResize="False">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<RadioButton Width="30" Height="30"
|
||||
GroupName="111222333"
|
||||
IsChecked="{Binding IsSelected , UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料名称" MaxWidth="200" Binding="{Binding MatName}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="库存数量" Binding="{Binding TotalQty}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料规格" MaxWidth="200" Binding="{Binding MatSpec}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料客户" Binding="{Binding MatCustomer}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料供应商" Binding="{Binding MatSupplier}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Margin="3" x:Name="spacingPanel" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button Margin="0 0 10 0 " Content="选择" Background="ForestGreen" Foreground="White" MinHeight="40" FontSize="21" Click="comfirmClick">
|
||||
</Button>
|
||||
<Button Margin="10 0 0 0 " Content="取消" Background="IndianRed" Foreground="White" MinHeight="40" FontSize="21" Click="closeClick"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</hc:Window>
|
81
货架标准上位机/Views/OutInventoryAddMatView.xaml.cs
Normal file
81
货架标准上位机/Views/OutInventoryAddMatView.xaml.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using TouchSocket.Core;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using 货架标准上位机.ViewModels;
|
||||
|
||||
namespace 货架标准上位机
|
||||
{
|
||||
public partial class OutInventoryAddMatView : HandyControl.Controls.Window
|
||||
{
|
||||
public OutInventoryAddMatViewModel viewModel = new OutInventoryAddMatViewModel();
|
||||
|
||||
public MatInventorySummaryModel inventorySummary = null;
|
||||
|
||||
public OutInventoryAddMatView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void closeClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void comfirmClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//
|
||||
var item = viewModel.DataGridItemSource.Where(t => t.isSelected).FirstOrDefault();
|
||||
if (item == null)
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show("请选择物料!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//选中物料返回
|
||||
inventorySummary = item;
|
||||
this.DialogResult = true;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (viewModel.SelectedataGridItem != null)
|
||||
{
|
||||
viewModel.SelectedataGridItem.IsSelected = true;
|
||||
//dataGrid.UnselectAllCells();//取消选中 避免手动点击check选项时反选失败 和重新点击该项时反选失败
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
comfirmClick(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
200
货架标准上位机/Views/OutInventoryView.xaml
Normal file
200
货架标准上位机/Views/OutInventoryView.xaml
Normal file
@ -0,0 +1,200 @@
|
||||
<pi:UserControlBase
|
||||
xmlns:pi="https://github.com/ping9719/wpfex"
|
||||
x:Class="货架标准上位机.OutVentoryView"
|
||||
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="0.5*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button
|
||||
hc:BorderElement.CornerRadius="15"
|
||||
Background="Green" Foreground="White"
|
||||
Grid.Column="1" MinHeight="45" FontSize="28" Content=" 发 料 单" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnOutOrderCommand}">
|
||||
</Button>
|
||||
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<TextBlock FontSize="26" Text="发料单号:">
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="26" Text="{Binding SelectedPickBillNumber}">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<!--</TabItem>-->
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="2" Margin="0" Background="AliceBlue" Padding="0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="8*"></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>
|
||||
<!--<Border CornerRadius="3" Margin="1 1 1 0" Grid.Row="0" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">-->
|
||||
<TextBlock Text="发料单列表" FontWeight="DemiBold" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"></TextBlock>
|
||||
<!--</Border>-->
|
||||
<Border CornerRadius="3" Margin="1" Grid.Row="1" Background="AliceBlue" BorderBrush="CadetBlue" BorderThickness="1.5">
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
||||
<ListView FontSize="18" ItemsSource="{Binding PickBillNumberList}" SelectedItem="{Binding SelectedPickBillNumber}" PreviewMouseWheel="ListView_PreviewMouseWheel">
|
||||
</ListView>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Border CornerRadius="3" Margin="1" 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 VerticalAlignment="Center" Orientation="Horizontal" >
|
||||
<TextBlock Text="订单号:" FontSize="24">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding OrderProdNumber}" FontSize="24">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<DataGrid Grid.Row="2"
|
||||
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=IsSend, Converter={StaticResource converter}}"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTemplateColumn CanUserResize="False">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox Width="30" Height="30"
|
||||
Checked="CheckBox_Checked"
|
||||
Unchecked="CheckBox_Checked"
|
||||
IsChecked="{Binding IsSelected , UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</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 StoreCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></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 IsSendStr}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="False" Header="最小包装条码" 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>
|
108
货架标准上位机/Views/OutInventoryView.xaml.cs
Normal file
108
货架标准上位机/Views/OutInventoryView.xaml.cs
Normal file
@ -0,0 +1,108 @@
|
||||
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 OutVentoryView : UserControlBase
|
||||
{
|
||||
public OutVentoryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new OutInventoryViewModel();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
//if (viewModel.DataGridItemSource != null && viewModel.DataGridItemSource.Count() > index)
|
||||
//{
|
||||
// var data = viewModel.DataGridItemSource.ElementAt(index);
|
||||
// //data.IsSelected = !data.IsSelected;
|
||||
// viewModel.DataGridItemSource = viewModel.DataGridItemSource.ToList();
|
||||
//}
|
||||
}
|
||||
datagrid.UnselectAllCells();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void allChecked_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//var viewMode = this.DataContext as OutInventoryViewModel;
|
||||
//if (viewMode != null && viewMode.DataGridItemSource != null && viewMode.DataGridItemSource.Count() > 0)
|
||||
//{
|
||||
// foreach (var item in viewMode.DataGridItemSource)
|
||||
// {
|
||||
// //item.IsSelected = true;
|
||||
// }
|
||||
// viewMode.DataGridItemSource = viewMode.DataGridItemSource.ToList();
|
||||
//}
|
||||
}
|
||||
|
||||
private void allChecked_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//var viewMode = this.DataContext as OutInventoryViewModel;
|
||||
//if (viewMode != null && viewMode.DataGridItemSource != null && viewMode.DataGridItemSource.Count() > 0)
|
||||
//{
|
||||
// foreach (var item in viewMode.DataGridItemSource)
|
||||
// {
|
||||
// //item.IsSelected = false;
|
||||
// }
|
||||
// viewMode.DataGridItemSource = viewMode.DataGridItemSource.ToList();
|
||||
//}
|
||||
}
|
||||
|
||||
private void CheckBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//var viewMode = this.DataContext as OutInventoryViewModel;
|
||||
//viewMode.RefreshCount();
|
||||
}
|
||||
|
||||
private void txtMatQty1_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
if (!Regex.IsMatch(e.Text, "^[0-9]"))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user