OutboundFinishedPage.xaml.cs
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using IndustrialControl.Services;
using IndustrialControl.ViewModels;
namespace IndustrialControl.Pages
{
public partial class OutboundFinishedPage : ContentPage
{
private readonly ScanService _scanSvc;
private readonly OutboundFinishedViewModel _vm;
public OutboundFinishedPage(OutboundFinishedViewModel vm, ScanService scanSvc)
{
InitializeComponent();
BindingContext = vm;
_scanSvc = scanSvc;
_vm = vm;
}
protected override void OnAppearing()
{
base.OnAppearing();
_scanSvc.Attach(ScanEntry);
ScanEntry.Focus();
}
/// <summary>
/// 清空扫描记录
/// </summary>
void OnClearClicked(object sender, EventArgs e)
{
_vm.ClearScan();
ScanEntry.Text = string.Empty;
ScanEntry.Focus();
}
/// <summary>
/// 预留摄像头扫码
/// </summary>
async void OnScanClicked(object sender, EventArgs e)
{
await DisplayAlert("提示", "此按钮预留摄像头扫码;硬件扫描直接扣扳机。", "确定");
}
/// <summary>
/// 点击“出库单明细”Tab
/// </summary>
void OnPendingTabClicked(object sender, EventArgs e)
{
_vm.ShowPendingCommand.Execute(null);
}
/// <summary>
/// 点击“扫描明细”Tab
/// </summary>
void OnScannedTabClicked(object sender, EventArgs e)
{
_vm.ShowScannedCommand.Execute(null);
}
/// <summary>
/// 扫描通过
/// </summary>
void OnPassScanClicked(object sender, EventArgs e)
{
_vm.PassScanCommand.Execute(null);
}
/// <summary>
/// 取消扫描
/// </summary>
void OnCancelScanClicked(object sender, EventArgs e)
{
_vm.CancelScanCommand.Execute(null);
}
/// <summary>
/// 确认出库
/// </summary>
async void OnConfirmClicked(object sender, EventArgs e)
{
_vm.ConfirmCommand.Execute(null);
}
}
}