|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
using Admin.Core.IService;
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using Admin.Core.Service;
|
|
|
|
|
using Aucma.Core.BoxFoam.Business;
|
|
|
|
|
using Aucma.Core.BoxFoam.Models;
|
|
|
|
|
using Aucma.Core.BoxFoam.Views.UserPage;
|
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
@ -39,6 +40,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
|
|
|
|
|
_baseSpaceInfoServices = App.ServiceProvider.GetService<IBaseSpaceInfoServices>();
|
|
|
|
|
SetBoxTypeViewModel.RefreshPageEvent += LoadSpaceStoreMedthAsync;
|
|
|
|
|
SelectTypeViewModel.RefreshPageEvent += LoadSpaceStoreMedthAsync;
|
|
|
|
|
InStoreBusiness.RefreshPageDelegateEvent += LoadSpaceStoreMedthAsync;
|
|
|
|
|
this.LoadSpaceStoreMedthAsync();
|
|
|
|
|
}
|
|
|
|
|
#region 参数定义
|
|
|
|
@ -96,48 +98,51 @@ namespace Aucma.Core.BoxFoam.ViewModels
|
|
|
|
|
private void LoadSpaceStoreMedthAsync()
|
|
|
|
|
{
|
|
|
|
|
string storeCode = Appsettings.app("StoreInfo", "BeforeStoreCode");//泡前库code
|
|
|
|
|
|
|
|
|
|
var baseSpaceInfolist = _baseSpaceInfoServices.QueryAsync(d => d.StoreCode==storeCode).Result;//仓库
|
|
|
|
|
|
|
|
|
|
if (baseSpaceInfolist == null) return;
|
|
|
|
|
if (baseSpaceInfolist.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
baseSpaceInfolist = baseSpaceInfolist.OrderBy(x => x.ObjId).ToList();
|
|
|
|
|
}
|
|
|
|
|
Shapes.Clear();
|
|
|
|
|
foreach (var item in baseSpaceInfolist)
|
|
|
|
|
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
SpaceInfoModel model=new SpaceInfoModel();
|
|
|
|
|
model.spaceCode = item.SpaceCode;
|
|
|
|
|
model.spaceStock = item.SpaceStock;
|
|
|
|
|
model.onTheWay = item.OnRouteAmount;
|
|
|
|
|
model.totalAmount = item.SpaceStock + item.OnRouteAmount;
|
|
|
|
|
model.materialType = item.MaterialType;
|
|
|
|
|
model.typeCodeB = item.typeCodeB;
|
|
|
|
|
model.typeCodeC = item.typeCodeC;
|
|
|
|
|
model.typeNameA = GetSubstringBetweenCommas(item.typeNameA);
|
|
|
|
|
model.typeNameB = GetSubstringBetweenCommas(item.typeNameB);
|
|
|
|
|
model.typeNameC = GetSubstringBetweenCommas(item.typeNameC);
|
|
|
|
|
model.unusualFlag = item.UnusualFlag == 2 ? "Red" : "White";
|
|
|
|
|
// 夹具型号
|
|
|
|
|
model.boxType = item.BoxType;
|
|
|
|
|
if (item.SpaceStatus == 2)
|
|
|
|
|
var baseSpaceInfolist = _baseSpaceInfoServices.QueryAsync(d => d.StoreCode == storeCode).Result;//仓库
|
|
|
|
|
|
|
|
|
|
if (baseSpaceInfolist == null) return;
|
|
|
|
|
if (baseSpaceInfolist.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
model.setEnable = "False";
|
|
|
|
|
model.inStoreFlag = "Red";
|
|
|
|
|
model.isFlag = "Red";
|
|
|
|
|
baseSpaceInfolist = baseSpaceInfolist.OrderBy(x => x.ObjId).ToList();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
Shapes.Clear();
|
|
|
|
|
foreach (var item in baseSpaceInfolist)
|
|
|
|
|
{
|
|
|
|
|
model.isFlag = item.IsFlag.ToString(); //禁用状态
|
|
|
|
|
model.inStoreFlag ="White";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.onlyOne = 1;
|
|
|
|
|
model.spaceType = item.SpaceType;
|
|
|
|
|
SpaceInfoModel model = new SpaceInfoModel();
|
|
|
|
|
model.spaceCode = item.SpaceCode;
|
|
|
|
|
model.spaceStock = item.SpaceStock;
|
|
|
|
|
model.onTheWay = item.OnRouteAmount;
|
|
|
|
|
model.totalAmount = item.SpaceStock + item.OnRouteAmount;
|
|
|
|
|
model.materialType = item.MaterialType;
|
|
|
|
|
model.typeCodeB = item.typeCodeB;
|
|
|
|
|
model.typeCodeC = item.typeCodeC;
|
|
|
|
|
model.typeNameA = GetSubstringBetweenCommas(item.typeNameA);
|
|
|
|
|
model.typeNameB = GetSubstringBetweenCommas(item.typeNameB);
|
|
|
|
|
model.typeNameC = GetSubstringBetweenCommas(item.typeNameC);
|
|
|
|
|
model.unusualFlag = item.UnusualFlag == 2 ? "Red" : "White";
|
|
|
|
|
// 夹具型号
|
|
|
|
|
model.boxType = item.BoxType;
|
|
|
|
|
if (item.SpaceStatus == 2)
|
|
|
|
|
{
|
|
|
|
|
model.setEnable = "False";
|
|
|
|
|
model.inStoreFlag = "Red";
|
|
|
|
|
model.isFlag = "Red";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
model.isFlag = item.IsFlag.ToString(); //禁用状态
|
|
|
|
|
model.inStoreFlag = "White";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Shapes.Add(model);
|
|
|
|
|
}
|
|
|
|
|
model.onlyOne = 1;
|
|
|
|
|
model.spaceType = item.SpaceType;
|
|
|
|
|
|
|
|
|
|
Shapes.Add(model);
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|