提交代码
This commit is contained in:
@ -278,11 +278,11 @@ namespace 货架标准上位机.Api
|
||||
try
|
||||
{
|
||||
if (isSaveLog)
|
||||
Logs.Write($"【{guid}】开始请求调用接口 url:{url} 请求方式:{httpMethod} 数据:{data}");
|
||||
Logs.Write($"【{guid}】开始请求调用接口 url:{url} 请求方式:{httpMethod} 数据:{data}",LogsType.Api);
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = httpMethod;
|
||||
request.ContentType = "application/json";
|
||||
request.Timeout = 100000;
|
||||
request.Timeout = 10000;
|
||||
|
||||
if (!string.IsNullOrEmpty(data))
|
||||
{
|
||||
@ -303,7 +303,7 @@ namespace 货架标准上位机.Api
|
||||
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
|
||||
string retString = reader.ReadToEnd();
|
||||
if (isSaveLog)
|
||||
Logs.Write($"【{guid}】请求调用接口结束 返回数据为{retString}");
|
||||
Logs.Write($"【{guid}】请求调用接口结束 返回数据为{retString}", LogsType.Api);
|
||||
return JsonConvert.DeserializeObject<T>(retString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -40,10 +40,6 @@ namespace 货架标准上位机
|
||||
Scanners.Add(Scanner);
|
||||
return EasyTask.CompletedTask;
|
||||
};
|
||||
client.Received = async (c, e) =>
|
||||
{
|
||||
;
|
||||
};
|
||||
client.Setup(new TouchSocket.Core.TouchSocketConfig()
|
||||
.SetSerialPortOption(new SerialPortOption()
|
||||
{
|
||||
|
@ -35,7 +35,11 @@ namespace 货架标准上位机
|
||||
/// <summary>
|
||||
/// 扫码枪
|
||||
/// </summary>
|
||||
Scanner
|
||||
Scanner,
|
||||
/// <summary>
|
||||
/// Api接口调用
|
||||
/// </summary>
|
||||
Api
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -108,8 +108,21 @@
|
||||
Content=" 导 出" FontFamily="{StaticResource IconFont}"
|
||||
Style="{StaticResource ButtonWarning}" Background="DarkOrange">
|
||||
</Button>
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnGenerateOutstoreCommand}"
|
||||
Content=" 搜索结果出库" FontFamily="{StaticResource IconFont}"
|
||||
Style="{StaticResource ButtonWarning}" Background="IndianRed">
|
||||
</Button>
|
||||
|
||||
<Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnGenerateStocktakingCommand}"
|
||||
Content=" 搜索结果盘点" FontFamily="{StaticResource IconFont}"
|
||||
Style="{StaticResource ButtonWarning}" Background="IndianRed">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
@ -123,9 +136,7 @@
|
||||
<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="R" Binding="{Binding R}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="C" Binding="{Binding C}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="True" Header="位" Binding="{Binding Wei}"></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>
|
||||
|
@ -31,12 +31,12 @@
|
||||
|
||||
|
||||
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
|
||||
Grid.Column="3" MinHeight="45" FontSize="28" Content="完整发料" FontFamily="{StaticResource IconFont}"
|
||||
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}"
|
||||
Grid.Column="4" MinHeight="45" FontSize="28" Content="暂停发料" FontFamily="{StaticResource IconFont}"
|
||||
Command="{Binding BtnPauseCommand}">
|
||||
</Button>
|
||||
</Grid>
|
||||
@ -64,7 +64,7 @@
|
||||
<StackPanel Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<TextBlock FontSize="26" Text="发料单号:">
|
||||
</TextBlock>
|
||||
<TextBlock FontSize="26" Text="{Binding SelectedPickBillNumber}">
|
||||
<TextBlock FontSize="26" Text="{Binding SelectedOutOrderNumber}">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
@ -88,12 +88,21 @@
|
||||
<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 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 OrderNumber}"/>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
@ -102,18 +111,18 @@
|
||||
<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="1*"></RowDefinition>-->
|
||||
<RowDefinition Height="12*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" >
|
||||
<TextBlock Text="订单号:" FontSize="24">
|
||||
<!--<StackPanel VerticalAlignment="Center" Orientation="Horizontal" >
|
||||
<TextBlock FontSize="24">
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding OrderProdNumber}" FontSize="24">
|
||||
<TextBlock Text="{Binding SelectedOutOrderNumber}" FontSize="24">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>-->
|
||||
|
||||
<DataGrid Grid.Row="2"
|
||||
<DataGrid Grid.Row="0"
|
||||
SelectedCellsChanged="DataGrid_SelectedCellsChanged"
|
||||
ItemsSource="{Binding DataGridItemSource}"
|
||||
RowHeight="40"
|
||||
@ -121,39 +130,22 @@
|
||||
<DataGrid.Resources>
|
||||
<货架标准上位机:WorkItemBackgroundConverter x:Key="converter"/>
|
||||
</DataGrid.Resources>
|
||||
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="{Binding Path=IsSend, Converter={StaticResource converter}}"/>
|
||||
<Setter Property="Background" Value="{Binding Path=IsSended, 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 MatQty}"></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>
|
||||
|
||||
<DataGridTextColumn IsReadOnly="True" Header="已取料" Binding="{Binding IsSendedStr}"></DataGridTextColumn>
|
||||
<DataGridTextColumn IsReadOnly="False" Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
@ -19,10 +19,11 @@ namespace 货架标准上位机
|
||||
{
|
||||
public partial class OutVentoryView : UserControlBase
|
||||
{
|
||||
public static OutInventoryViewModel viewModel = new OutInventoryViewModel();
|
||||
public OutVentoryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new OutInventoryViewModel();
|
||||
this.DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void DataGrid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
@ -34,12 +35,7 @@ namespace 货架标准上位机
|
||||
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();
|
||||
}
|
||||
@ -49,46 +45,6 @@ namespace 货架标准上位机
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
|
@ -74,14 +74,14 @@ namespace 货架标准上位机
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseBase<UserModel>>(LocalFile.Config.ApiIpHost + "user/userLogin",
|
||||
body, "POST");
|
||||
if (Result.Code != 200 || Result.Data == null)
|
||||
if (Result!= null && Result.Code != 200)
|
||||
{
|
||||
HandyControl.Controls.MessageBox.Warning(Result.Message, "提示");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewModel.User = Result.Data;
|
||||
viewModel.User = Result?.Data;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -56,13 +56,12 @@ namespace 货架标准上位机
|
||||
m_logger.Info(e.DataFrame.ToText());
|
||||
if (!client.Client.IsClient)
|
||||
{
|
||||
client.Send("我已收到");
|
||||
client.Send("已收到");
|
||||
}
|
||||
//返回的报警信息 出入库盘点等日志信息
|
||||
else
|
||||
{
|
||||
TextBoxLog.AddLog(e.DataFrame.ToText(), "123", DateTime.Now);
|
||||
//Growl.Error(e.DataFrame.ToText());
|
||||
TextBoxLog.AddLog(e.DataFrame.ToText(), "InstoreLog", DateTime.Now);
|
||||
}
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user