Browse Source

setpackService

qianyi
连坤 林 2 years ago
parent
commit
4357045982
  1. 2
      BBWY.Client/APIServices/PackTaskService.cs
  2. 7
      BBWY.Client/Models/PackTask/PackItemModel.cs
  3. 30
      BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
  4. 6
      BBWY.Client/Views/PackTask/ServiceWindow.xaml
  5. 1
      BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs

2
BBWY.Client/APIServices/PackTaskService.cs

@ -95,7 +95,7 @@ namespace BBWY.Client.APIServices
{ {
HttpClientHelper helper = new HttpClientHelper(globalContext.QKApiHost); HttpClientHelper helper = new HttpClientHelper(globalContext.QKApiHost);
string url = $"{globalContext.QKApiHost}/api/PackTask/SearchProduct?skuId={skuId}&ShopId={globalContext.User.Shop.ShopId.ToString()}"; string url = $"{globalContext.QKApiHost}/api/PackTask/SearchProduct?skuId={skuId}&ShopId={globalContext.User.Shop.ShopId}";
var data = helper.Get(url); var data = helper.Get(url);
return JsonConvert.DeserializeObject<ApiResponse<ProductSkuResponse>>(data); return JsonConvert.DeserializeObject<ApiResponse<ProductSkuResponse>>(data);

7
BBWY.Client/Models/PackTask/PackItemModel.cs

@ -53,15 +53,18 @@ namespace BBWY.Client.Models.PackTask
) )
{ {
DeleteServiceCommand = new RelayCommand<ObservableCollection<PackItemModel>>(DeleteService); DeleteServiceCommand = new RelayCommand<object>(DeleteService);
this. IncreateServiceList = IncreateServiceList; this. IncreateServiceList = IncreateServiceList;
this.PackServiceList = PackServiceList; this.PackServiceList = PackServiceList;
this.MemberList = MemberList; this.MemberList = MemberList;
this.ConsumableList = ConsumableList; this.ConsumableList = ConsumableList;
} }
private void DeleteService(ObservableCollection<PackItemModel> list) private void DeleteService(object obj)
{ {
ObservableCollection<PackItemModel> list= obj as ObservableCollection<PackItemModel>;
list.Remove(this); list.Remove(this);
} }

30
BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs

@ -39,13 +39,18 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand SetAllCountCommand { get; set; } public ICommand SetAllCountCommand { get; set; }
readonly PackTaskService packTaskService;
readonly ConsumableService consumableService;
private ObservableCollection<PackItemModel> increateList = new ObservableCollection<PackItemModel>();
public ObservableCollection<PackItemModel> IncreateList { get => increateList; set { Set(ref increateList, value); } } //
PackTaskService packTaskService; private ObservableCollection<PackItemModel>
ConsumableService consumableService; packList = new ObservableCollection<PackItemModel>();
public ObservableCollection<PackItemModel> PackList { get => packList; set { Set(ref packList, value); } } //
public ObservableCollection<PackItemModel> IncreateList { get; set; } = new ObservableCollection<PackItemModel>(); private ObservableCollection<PackItemModel>
public ObservableCollection<PackItemModel> PackList { get; set; } = new ObservableCollection<PackItemModel>(); consumableServiceList = new ObservableCollection<PackItemModel>();
public ObservableCollection<PackItemModel> ConsumableServiceList { get; set; } = new ObservableCollection<PackItemModel>(); public ObservableCollection<PackItemModel> ConsumableServiceList { get => consumableServiceList; set { Set(ref consumableServiceList, value); } } //
@ -54,9 +59,9 @@ namespace BBWY.Client.ViewModels.PackTask
public ObservableCollection<ConsumableModel> ConsumableList { get; set; } = new ObservableCollection<ConsumableModel>(); public ObservableCollection<ConsumableModel> ConsumableList { get; set; } = new ObservableCollection<ConsumableModel>();
public ObservableCollection<WorkProcessModel> PackServiceList { get; set; } = new ObservableCollection<WorkProcessModel>(); public ObservableCollection<WorkProcessModel> PackServiceList { get; set; } = new ObservableCollection<WorkProcessModel>();
readonly WorkProcessService workProcessService;
IncreateServiceService increateService; readonly IncreateServiceService increateService;
public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateService, long taskId) public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateService, long taskId)
{ {
TaskId = taskId; TaskId = taskId;
@ -68,7 +73,7 @@ namespace BBWY.Client.ViewModels.PackTask
var increateRes = increateService.SearchAll(); var increateRes = this.increateService.SearchAll();
if (increateRes.Success) if (increateRes.Success)
{ {
if (increateRes.Data != null && increateRes.Data.Count() > 0) if (increateRes.Data != null && increateRes.Data.Count() > 0)
@ -84,7 +89,7 @@ namespace BBWY.Client.ViewModels.PackTask
} }
} }
var result = workProcessService.SearchAll(); var result = this.workProcessService.SearchAll();
if (result.Success) if (result.Success)
{ {
if (result.Data != null && result.Data.Count() > 0) if (result.Data != null && result.Data.Count() > 0)
@ -100,7 +105,7 @@ namespace BBWY.Client.ViewModels.PackTask
} }
} }
var res = packTaskService.GetPackMembers(); var res = this.packTaskService.GetPackMembers();
if (res.Success) if (res.Success)
{ {
foreach (var item in res.Data) foreach (var item in res.Data)
@ -134,7 +139,6 @@ namespace BBWY.Client.ViewModels.PackTask
Length = item.Length, Length = item.Length,
Heigth = item.Heigth, Heigth = item.Heigth,
Id = item.Id Id = item.Id
}); });
}); });
} }
@ -584,7 +588,7 @@ namespace BBWY.Client.ViewModels.PackTask
ItemCount = TaskCount ItemCount = TaskCount
}); });
} }
WorkProcessService workProcessService;
private void AddIncreateService() private void AddIncreateService()
{ {
IncreateList.Add(new PackItemModel(IncreateServiceList, MemberList) IncreateList.Add(new PackItemModel(IncreateServiceList, MemberList)

6
BBWY.Client/Views/PackTask/ServiceWindow.xaml

@ -59,7 +59,7 @@
<Label Content="操作" Width="40" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="303,56,0,0" /> <Label Content="操作" Width="40" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="303,56,0,0" />
<StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="140" Width="322" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent"> <StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="140" Width="322" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent">
<ListBox ItemsSource="{Binding IncreateList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" <ListBox ItemsSource="{Binding IncreateList}" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}" BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0" MaxHeight="100" BorderThickness="1,1,1,0" MaxHeight="100"
Foreground="{StaticResource Text.Color}" Foreground="{StaticResource Text.Color}"
@ -118,7 +118,7 @@
<StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="140" Width="322" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent"> <StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="140" Width="322" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent">
<ListBox <ListBox
ItemsSource="{Binding PackList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" MaxHeight="100" ItemsSource="{Binding PackList}" MaxHeight="100"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}" BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0" BorderThickness="1,1,1,0"
@ -182,7 +182,7 @@
<StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="160" Width="260" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent"> <StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="160" Width="260" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent">
<ListBox MaxHeight="120" Name="consumable_listBox" <ListBox MaxHeight="120" Name="consumable_listBox"
ItemsSource="{Binding ConsumableServiceList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding ConsumableServiceList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}" BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0" BorderThickness="1,1,1,0"

1
BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs

@ -35,7 +35,6 @@ namespace BBWY.Client.Views.PackTask
this.workProcessService = workProcessService; this.workProcessService = workProcessService;
this.packTaskService = packTaskService; this.packTaskService = packTaskService;
this.increateService = increateService; this.increateService = increateService;
model = new PackServiceViewModel(packTaskService, consumableService, workProcessService, increateService, taskId); model = new PackServiceViewModel(packTaskService, consumableService, workProcessService, increateService, taskId);
model.TaskId = taskId; model.TaskId = taskId;
model.TaskCount = taskCount; model.TaskCount = taskCount;

Loading…
Cancel
Save