1.解决TCP添加失败问题
2.所有搜索记录倒叙排 3.优化:出入记录、库存记录增加货架类型分类查询 4.权限 5.优化下载app二维码
This commit is contained in:
@ -29,6 +29,7 @@ using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.ApiModel.InOutRecord;
|
||||
using System.Collections.ObjectModel;
|
||||
using static 货架标准上位机.ViewModel.InOutRecordViewModel;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
@ -36,7 +37,46 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public InOutRecordViewModel()
|
||||
{
|
||||
InitShelfTypeItems();
|
||||
}
|
||||
|
||||
private List<ShelfTypeModel> shelfTypeItems;
|
||||
public List<ShelfTypeModel> ShelfTypeItems
|
||||
{
|
||||
get { return shelfTypeItems; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfTypeItems, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ShelfTypeModel selectedShelfTypeItem;
|
||||
public ShelfTypeModel SelectedShelfTypeItem
|
||||
{
|
||||
get { return selectedShelfTypeItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedShelfTypeItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void InitShelfTypeItems()
|
||||
{
|
||||
//调用接口更新!
|
||||
Task.Run(() =>
|
||||
{
|
||||
var body = new RequestBase()
|
||||
{
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ShelfTypeModel>>(LocalFile.Config.ApiIpHost + "home/getShelfTypes", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists.Count() > 0)
|
||||
{
|
||||
ShelfTypeItems = Result.Data.Lists;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void InitMatCode()
|
||||
@ -195,7 +235,7 @@ namespace 货架标准上位机.ViewModel
|
||||
public class DirectionItem
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public object Value { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
@ -240,6 +280,8 @@ namespace 货架标准上位机.ViewModel
|
||||
StoreCode = StoreCode,
|
||||
Direction = SelectedDirection,
|
||||
|
||||
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
PageNumber = CurrentPage,
|
||||
|
@ -275,6 +275,8 @@ namespace 货架标准上位机.ViewModel
|
||||
//string secondField = Regex.Match(input, @"{[1-9][0]{2,5}[ ]{").Value;
|
||||
string secondField = Regex.Match(input, LocalFile.Config.RegexMatQty).Value;
|
||||
MatQty = Convert.ToInt32(secondField.Replace("{", "").Replace(" ", ""));
|
||||
|
||||
input = input.Replace(secondField, string.Empty);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -326,28 +328,35 @@ namespace 货架标准上位机.ViewModel
|
||||
|
||||
public void UpdateMatSN()
|
||||
{
|
||||
if (MatSNs != null && totalPan > 1)
|
||||
try
|
||||
{
|
||||
MatSNs.Clear();
|
||||
for (int i = 0; i < TotalPan; i++)
|
||||
if (MatSNs != null && MatSNs.Count > 0 && totalPan >= 1)
|
||||
{
|
||||
var newMatSn = ChangelessCode + MatCode + ReservedCode + MatBatch + (MatBaseInfo.SerialNumber + i).ToString("000");
|
||||
MatSNs.Add(newMatSn);
|
||||
}
|
||||
MatSNs.Clear();
|
||||
for (int i = 0; i < TotalPan; i++)
|
||||
{
|
||||
var newMatSn = ChangelessCode + MatCode + ReservedCode + MatBatch + (MatBaseInfo.SerialNumber + i).ToString("000");
|
||||
MatSNs.Add(newMatSn);
|
||||
}
|
||||
|
||||
if (MatSNs == null || MatSNs.Count == 0)
|
||||
{
|
||||
MatSNsStr = string.Empty;
|
||||
}
|
||||
else if (MatSNs.Count == 1)
|
||||
{
|
||||
MatSNsStr = MatSNs[0].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
MatSNsStr = MatSNs[0].ToString() + "\r\n~" + MatSNs[MatSNs.Count - 1].ToString();
|
||||
if (MatSNs == null || MatSNs.Count == 0)
|
||||
{
|
||||
MatSNsStr = string.Empty;
|
||||
}
|
||||
else if (MatSNs.Count == 1)
|
||||
{
|
||||
MatSNsStr = MatSNs[0].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
MatSNsStr = MatSNs[0].ToString() + "~\r\n" + MatSNs[MatSNs.Count - 1].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void GenerateMatSN()
|
||||
|
@ -26,6 +26,7 @@ using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using HandyControl.Tools.Extension;
|
||||
using WCS.Model.ApiModel.Stocktaking;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
@ -33,7 +34,7 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public MatInventoryDetailViewModel()
|
||||
{
|
||||
|
||||
InitShelfTypeItems();
|
||||
}
|
||||
|
||||
public void InitMatCode()
|
||||
@ -171,6 +172,44 @@ namespace 货架标准上位机.ViewModel
|
||||
SetProperty(ref matSN, value);
|
||||
}
|
||||
}
|
||||
|
||||
private List<ShelfTypeModel> shelfTypeItems;
|
||||
public List<ShelfTypeModel> ShelfTypeItems
|
||||
{
|
||||
get { return shelfTypeItems; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfTypeItems, value);
|
||||
}
|
||||
}
|
||||
public void InitShelfTypeItems()
|
||||
{
|
||||
//调用接口更新!
|
||||
Task.Run(() =>
|
||||
{
|
||||
var body = new RequestBase()
|
||||
{
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
DeviceType = LocalFile.Config.DeviceType,
|
||||
};
|
||||
|
||||
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ShelfTypeModel>>(LocalFile.Config.ApiIpHost + "home/getShelfTypes", body, "POST");
|
||||
if (Result != null && Result.Data != null && Result.Data.Lists.Count() > 0)
|
||||
{
|
||||
ShelfTypeItems = Result.Data.Lists;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ShelfTypeModel selectedShelfTypeItem;
|
||||
public ShelfTypeModel SelectedShelfTypeItem
|
||||
{
|
||||
get { return selectedShelfTypeItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedShelfTypeItem, value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
@ -208,6 +247,7 @@ namespace 货架标准上位机.ViewModel
|
||||
MatCode = MatCode,
|
||||
StoreCode = StoreCode,
|
||||
|
||||
ShelfTypeId = SelectedShelfTypeItem == null ? 0 : SelectedShelfTypeItem.Id,
|
||||
ShelfCode = ShelfCode,
|
||||
|
||||
UserName = LocalStatic.CurrentUser,
|
||||
|
@ -117,6 +117,8 @@ namespace 货架标准上位机.ViewModels
|
||||
}
|
||||
var window = new OutInventoryAddMatView(SelectedShelfTypeItem.Id);
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.Topmost = true;
|
||||
|
||||
var result = window.ShowDialog();
|
||||
if (result == true)
|
||||
{
|
||||
|
@ -145,6 +145,7 @@ namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
var window = new OutInventoryAddDucumentView();
|
||||
window.Owner = Application.Current.MainWindow;
|
||||
window.Topmost = true;
|
||||
var result = window.ShowDialog();
|
||||
if (result == true)
|
||||
BtnSearch(true);
|
||||
|
@ -10,6 +10,7 @@ using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -26,6 +27,20 @@ namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class SetViewModel : BindableBase
|
||||
{
|
||||
public SetViewModel()
|
||||
{
|
||||
IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
|
||||
|
||||
IPList = host.AddressList
|
||||
.Where(ipAddress => ipAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork && !IPAddress.IsLoopback(ipAddress))
|
||||
.Select(t => t.ToString()).ToList();
|
||||
if (IPList != null && IPList.Count > 0)
|
||||
{
|
||||
SelectedIP = IPList[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private List<int> SaveLoginCountData_ = new List<int> { 3, 5, 7, 10 };
|
||||
//记忆最大数量下拉框
|
||||
public List<int> SaveLoginCountData { get => SaveLoginCountData_; set { SetProperty(ref SaveLoginCountData_, value); } }
|
||||
@ -39,6 +54,22 @@ namespace 货架标准上位机.ViewModel
|
||||
|
||||
|
||||
#region 页面输入信息
|
||||
private List<string> ipList;
|
||||
public List<string> IPList
|
||||
{
|
||||
get => ipList;
|
||||
set { SetProperty(ref ipList, value); }
|
||||
}
|
||||
|
||||
private string selectedIP;
|
||||
public string SelectedIP
|
||||
{
|
||||
get => selectedIP;
|
||||
set { SetProperty(ref selectedIP, value); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
private List<string> scannerComList;
|
||||
public List<string> ScannerComList
|
||||
{
|
||||
@ -238,7 +269,7 @@ namespace 货架标准上位机.ViewModel
|
||||
if (Result != null && Result.Code == 200)
|
||||
{
|
||||
//拼凑url
|
||||
var downLoadUrl = LocalFile.Config.ApiIpHost + $"fileDownload/downloadApp?fileName={Result.Data}";
|
||||
var downLoadUrl = $"http://{SelectedIP}:8888/" + $"fileDownload/downloadApp?fileName={Result.Data}";
|
||||
//生成二维码
|
||||
var qrCodeImage = GenerateQRCode(downLoadUrl);
|
||||
//展示二维码
|
||||
|
Reference in New Issue
Block a user