|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using Admin.Core.IService;
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using Admin.Core.Model.Model_New;
|
|
|
|
|
using Aucma.Core.ProductOffLine.Models;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
@ -15,35 +18,43 @@ namespace Aucma.Core.ProductOffLine.ViewModels
|
|
|
|
|
{
|
|
|
|
|
public partial class StatisticsPageViewModel : ObservableObject
|
|
|
|
|
{
|
|
|
|
|
public StatisticsPageViewModel() { LoadData(); }
|
|
|
|
|
// 成品下线操作mes数据
|
|
|
|
|
private readonly IOffLineInfoServices? _offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>();
|
|
|
|
|
|
|
|
|
|
public StatisticsPageViewModel() {
|
|
|
|
|
_offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>();
|
|
|
|
|
LoadData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MaterialComplateInfo> materialComplateInfos = new List<MaterialComplateInfo>();
|
|
|
|
|
|
|
|
|
|
#region 加载DataGrid数据
|
|
|
|
|
private void LoadData()
|
|
|
|
|
private async void LoadData()
|
|
|
|
|
{
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 2, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 60, CompleteAmount = 40 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 3, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 4, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 40, CompleteAmount = 10 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 5, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 30, CompleteAmount = 10 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 6, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 20 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 7, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 10, CompleteAmount = 10 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 8, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 9, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 80, CompleteAmount = 10 });
|
|
|
|
|
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 10, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉,SC", PlanAmount = 50, CompleteAmount = 10});
|
|
|
|
|
List<OffLineInfo> list = await _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= System.DateTime.Now.AddDays(-1), "PRODUCT_SCANTIME desc");
|
|
|
|
|
if (list != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (OffLineInfo record in list)
|
|
|
|
|
{
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
ListItems.Add(new TempInfo() { No = ListItems.Count + 1, ProductOrderNo = record.ProductOrderNo, ProductSNCode = record.ProductSNCode, ProductModel = record.ProductModel, ProductRemark = record.ProductRemark, ProductScanTime = record.ProductScanTime });
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 初始化datagrid
|
|
|
|
|
private ObservableCollection<MaterialComplateInfo> materialDataGrid = new ObservableCollection<MaterialComplateInfo>();
|
|
|
|
|
public ObservableCollection<MaterialComplateInfo> MaterialDataGrid
|
|
|
|
|
private ObservableCollection<TempInfo> listItems = new ObservableCollection<TempInfo>() { };
|
|
|
|
|
public ObservableCollection<TempInfo> ListItems
|
|
|
|
|
{
|
|
|
|
|
get { return materialDataGrid; }
|
|
|
|
|
get { return listItems; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
materialDataGrid = value;
|
|
|
|
|
listItems = value;
|
|
|
|
|
OnPropertyChanged();//属性通知
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|