提交代码
This commit is contained in:
@ -90,7 +90,7 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
ModuleCodeProcess(scanner);
|
||||
}
|
||||
//TO DO 增加正则表达式进行判断是否扫到的是物料码
|
||||
//TODO 增加正则表达式进行判断是否扫到的是物料码
|
||||
else
|
||||
{
|
||||
MatSnProcess(scanner);
|
||||
@ -168,6 +168,14 @@ namespace 货架标准上位机.ViewModel
|
||||
scanner.IsInstoreMode = true;
|
||||
scanner.ShelfCode = Result.Data.ShelfCode;
|
||||
scanner.ModulesStr = Result.Data.ModulesStr;
|
||||
//TODO 清除其他扫码枪的占用
|
||||
var sacnners = ScannerManager.Scanners
|
||||
.Where(t => ShelfCode == Result.Data.ShelfCode)
|
||||
.ToList();
|
||||
foreach (var item in sacnners)
|
||||
{
|
||||
item.ShelfCode = string.Empty;
|
||||
}
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
|
@ -24,6 +24,8 @@ 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;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
@ -39,7 +41,6 @@ namespace 货架标准上位机.ViewModel
|
||||
// })
|
||||
// .Distinct()
|
||||
// .ToList();
|
||||
|
||||
}
|
||||
|
||||
public void InitMatCode()
|
||||
@ -270,6 +271,192 @@ namespace 货架标准上位机.ViewModel
|
||||
Growl.Error("导出失败:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnGenerateOutstoreCommand { get => new DelegateCommand(BtnGenerateOutstore); }
|
||||
public async void BtnGenerateOutstore()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region 调用接口获取物料SN
|
||||
try
|
||||
{
|
||||
var body = new GetMatInventoryDetailRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
MatSN = MatSN,
|
||||
MatBatch = MatBatch,
|
||||
MatCode = MatCode,
|
||||
StoreCode = StoreCode,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10000,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
//获取搜索条件返回数据中未锁定的物料
|
||||
var unLockedMatSns = Result.Data.Lists.Where(t => t.IsLocked == false)
|
||||
.Select(t => t.MatSN)
|
||||
.ToList();
|
||||
|
||||
if (unLockedMatSns.Count == 0)
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show("根据您的搜索条件不存在可以出库的物料(或物料已全部被锁定)!");
|
||||
return;
|
||||
}
|
||||
//提示 是否生成出库单
|
||||
var result = HandyControl.Controls.MessageBox.Show($"根据您的搜索条件,共有{unLockedMatSns.Count}盘未锁定的物料,是否生成出库单并锁定物料?", "提示", MessageBoxButton.OKCancel);
|
||||
|
||||
if (result == MessageBoxResult.OK)
|
||||
{
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
#region 调用接口生成出库单据
|
||||
var body1 = new SysOutOrderByMatSnRequest()
|
||||
{
|
||||
OrderType = "出库",
|
||||
OrderSource = "WCS前端-库存数据出库",
|
||||
SnList = unLockedMatSns,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser
|
||||
};
|
||||
var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "outstore/sysOutOrderByMatSn", body1, "POST");
|
||||
if (Result1 != null && Result1.Code == 200)
|
||||
{
|
||||
Growl.Success(Result1.Message);
|
||||
}
|
||||
else if (Result1 != null)
|
||||
{
|
||||
Growl.Warning(Result1.Message);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("生成出库单据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
dia.Close();
|
||||
dia.Collapse();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("获取数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("导出失败:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand BtnGenerateStocktakingCommand { get => new DelegateCommand(BtnGenerateStocktaking); }
|
||||
public void BtnGenerateStocktaking()
|
||||
{
|
||||
try
|
||||
{
|
||||
#region 调用接口获取物料SN
|
||||
try
|
||||
{
|
||||
var body = new GetMatInventoryDetailRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
MatSN = MatSN,
|
||||
MatBatch = MatBatch,
|
||||
MatCode = MatCode,
|
||||
StoreCode = StoreCode,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
PageSize = 10000,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<MatInventoryDetailModel>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventoryDetail", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists != null)
|
||||
{
|
||||
//获取搜索条件返回数据中未锁定的物料
|
||||
var unLockedMatSns = Result.Data.Lists.Where(t => t.IsLocked == false)
|
||||
.Select(t => t.MatSN)
|
||||
.ToList();
|
||||
|
||||
if (unLockedMatSns.Count == 0)
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Show("根据您的搜索条件不存在可以盘点的物料!");
|
||||
return;
|
||||
}
|
||||
//提示 是否生成出库单
|
||||
var result = HandyControl.Controls.MessageBox.Show($"根据您的搜索条件,共有{unLockedMatSns.Count}盘未锁定的物料,是否生成盘点单?", "提示", MessageBoxButton.OKCancel);
|
||||
|
||||
if (result == MessageBoxResult.OK)
|
||||
{
|
||||
var dia = Dialog.Show(new TextDialog());
|
||||
try
|
||||
{
|
||||
#region 调用接口生成盘点单据
|
||||
var body1 = new SysStockTakingOrderRequest()
|
||||
{
|
||||
StocktakingOrderType = "snList",
|
||||
StocktakingOrderSource = "WCS前端-库存数据",
|
||||
List = unLockedMatSns,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
UserName = LocalStatic.CurrentUser
|
||||
};
|
||||
var Result1 = ApiHelp.GetDataFromHttp<ResponseCommon>(LocalFile.Config.ApiIpHost + "stockTaking/sysStockTakingOrder", body1, "POST");
|
||||
if (Result1 != null && Result1.Code == 200)
|
||||
{
|
||||
Growl.Success(Result1.Message);
|
||||
}
|
||||
else if (Result1 != null)
|
||||
{
|
||||
Growl.Warning(Result1.Message);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("生成盘点单据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
dia.Close();
|
||||
dia.Collapse();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("获取数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("导出失败:" + ex.Message);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PageOperation 分页操作
|
||||
|
@ -122,28 +122,28 @@ namespace 货架标准上位机.ViewModels
|
||||
}).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();
|
||||
};
|
||||
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);
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -123,14 +123,16 @@ namespace 货架标准上位机.ViewModels
|
||||
public ICommand BtnResetCommand { get => new DelegateCommand(BtnReset); }
|
||||
public void BtnReset()
|
||||
{
|
||||
|
||||
OrderNumber = string.Empty;
|
||||
OrderType = string.Empty;
|
||||
OrderSource = string.Empty;
|
||||
}
|
||||
|
||||
public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
public void BtnDelete()
|
||||
{
|
||||
//public ICommand BtnDeleteCommand { get => new DelegateCommand(BtnDelete); }
|
||||
//public void BtnDelete()
|
||||
//{
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
public ICommand BtnOrderDetailCommand { get => new DelegateCommand(BtnOrderDetail); }
|
||||
public void BtnOrderDetail()
|
||||
|
@ -4,18 +4,25 @@ 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
|
||||
@ -44,169 +51,78 @@ namespace 货架标准上位机.ViewModel
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
}
|
||||
|
||||
public System.Windows.Controls.TextBox textBox { get; set; }
|
||||
RefreshOutOrderList();
|
||||
}
|
||||
|
||||
#region Property
|
||||
private string number;
|
||||
public string Number
|
||||
private OutOrderModel selectedOutOrder;
|
||||
public OutOrderModel SelectedOutOrder
|
||||
{
|
||||
get { return number; }
|
||||
get { return selectedOutOrder; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref number, value);
|
||||
SetProperty(ref selectedOutOrder, value);
|
||||
if (selectedOutOrder != null)
|
||||
{
|
||||
SelectedOutOrderNumber = selectedOutOrder.OrderNumber;
|
||||
RefreshDataGridItemSource();
|
||||
}
|
||||
else
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool isOrderOut;
|
||||
public bool IsOrderOut
|
||||
private string selectedOutOrderNumber;
|
||||
public string SelectedOutOrderNumber
|
||||
{
|
||||
get { return isOrderOut; }
|
||||
get => selectedOutOrderNumber;
|
||||
set
|
||||
{
|
||||
SetProperty(ref isOrderOut, value);
|
||||
//LocalStatic.IsOrderOut = value;
|
||||
SetProperty(ref selectedOutOrderNumber, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string matCode1;
|
||||
public string MatCode1
|
||||
|
||||
private ObservableCollection<OutOrderModel> outOrderList;
|
||||
public ObservableCollection<OutOrderModel> OutOrderList
|
||||
{
|
||||
get { return matCode1; }
|
||||
get => outOrderList;
|
||||
set
|
||||
{
|
||||
SetProperty(ref matCode1, value);
|
||||
SetProperty(ref outOrderList, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int matQty1;
|
||||
public int MatQty1
|
||||
private ObservableCollection<OutOrderMatDetailModel> dataGridItemSource;
|
||||
public ObservableCollection<OutOrderMatDetailModel> DataGridItemSource
|
||||
{
|
||||
get { return matQty1; }
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref matQty1, value);
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
RefreshCount();
|
||||
}
|
||||
}
|
||||
|
||||
private string order_prod_number;
|
||||
public string Order_prod_number
|
||||
//单据总盘数
|
||||
private int totalPan;
|
||||
public int TotalPan
|
||||
{
|
||||
get { return order_prod_number; }
|
||||
set
|
||||
get => totalPan; set
|
||||
{
|
||||
SetProperty(ref order_prod_number, value);
|
||||
SetProperty(ref totalPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string material_code;
|
||||
public string Material_code
|
||||
private int sendedPan;
|
||||
public int SendedPan
|
||||
{
|
||||
get { return material_code; }
|
||||
set
|
||||
get => sendedPan; 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);
|
||||
SetProperty(ref sendedPan, value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,88 +136,17 @@ namespace 货架标准上位机.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
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(() =>
|
||||
{
|
||||
SendedPan = dataGridItemSource.Where(t => t.IsSended).Count();
|
||||
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()
|
||||
{
|
||||
@ -310,69 +155,164 @@ namespace 货架标准上位机.ViewModel
|
||||
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;
|
||||
try
|
||||
{
|
||||
//判断是否选择单据
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
Growl.Warning("未选择单据!");
|
||||
}
|
||||
|
||||
#region 调用接口开始出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
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)
|
||||
{
|
||||
Growl.Warning("已成功开始入库!");
|
||||
}
|
||||
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("未选择单据!");
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region PageOperation
|
||||
private int totalPan;
|
||||
public int TotalPan
|
||||
{
|
||||
get { return totalPan; }
|
||||
set { SetProperty(ref totalPan, value); }
|
||||
#region 调用接口结束出库
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
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)
|
||||
{
|
||||
Growl.Warning("已成功结束入库!");
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("出现异常:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private int sendedPan;
|
||||
public int SendedPan
|
||||
public void RefreshOutOrderList()
|
||||
{
|
||||
get { return sendedPan; }
|
||||
set { SetProperty(ref sendedPan, value); }
|
||||
#region 调用接口获取发料单
|
||||
try
|
||||
{
|
||||
var body = new GetOutOrderListByStatusRequest()
|
||||
{
|
||||
OrderExeStatus = new List<OutOrderExeStatus>() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 }
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<OutOrderModel>>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
OutOrderList = new ObservableCollection<OutOrderModel>(Result.Data.Lists);
|
||||
}
|
||||
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Warning(ex.Message);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
private int unSendedPan;
|
||||
public int UnSendedPan
|
||||
public void RefreshDataGridItemSource()
|
||||
{
|
||||
get { return unSendedPan; }
|
||||
set { SetProperty(ref unSendedPan, value); }
|
||||
}
|
||||
#endregion
|
||||
if (SelectedOutOrder == null)
|
||||
{
|
||||
//选择的单据为空无法进行查询
|
||||
return;
|
||||
}
|
||||
#region 调用接口获取出库单物料明细
|
||||
Task.Run(() =>
|
||||
{
|
||||
var body = new GetOutOrderDetailRequest()
|
||||
{
|
||||
OrderId = selectedOutOrder.Id,
|
||||
OrderNumber = selectedOutOrder.OrderNumber,
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
|
||||
#region private method
|
||||
public bool GrowlCallBack(bool aaa)
|
||||
{
|
||||
return true;
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<OutOrderMatDetailModel>>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderMatDetail", body, "POST");
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
if (Result.Data.Count > 0)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(Result.Data);
|
||||
}
|
||||
else
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
DataGridItemSource?.Clear();
|
||||
});
|
||||
|
||||
Growl.Warning("该单据未查询到发料明细!");
|
||||
}
|
||||
}
|
||||
else if (Result != null)
|
||||
{
|
||||
Growl.Warning(Result.Message);
|
||||
}
|
||||
else
|
||||
{
|
||||
Growl.Warning("调用接口失败!");
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
Reference in New Issue
Block a user