From 5c304cb974ee9764a1297a908d95d8173b675ccf Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Thu, 24 Oct 2024 15:46:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E7=93=B6=E5=9B=9E=E6=94=B6=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=A1=8C=E5=88=99=E5=A4=8D=E9=80=89=E6=A1=86=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=BA=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/ReturnEmptyDialogViewModel.cs | 34 +++++++++++++++++++ DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml | 6 ++++ 2 files changed, 40 insertions(+) diff --git a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs index 9ac9304..a5fbc69 100644 --- a/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs +++ b/DM_Weight/ViewModels/ReturnEmptyDialogViewModel.cs @@ -136,6 +136,14 @@ namespace DM_Weight.ViewModels SetProperty(ref _machineRecords, value); } } + + private MachineRecord _machineRecord=new(); + + public MachineRecord _MachineRecord + { + get=> _machineRecord; + set=>SetProperty(ref _machineRecord, value); + } private ChannelStock _channelStock; @@ -205,6 +213,32 @@ namespace DM_Weight.ViewModels .ToList(); MachineRecords = queryData; } + + + + public DelegateCommand RowSelected + { + get => new DelegateCommand(() => + { + + if (MachineRecords != null && MachineRecords.Count>0) + { + MachineRecords = MachineRecords.Select(x => + { + if (x.Id == _MachineRecord.Id) + { + x.IsSelected = !x.IsSelected; + } + return x; + }).ToList(); + //DialogParameters dialogParameters = new DialogParameters(); + //dialogParameters.Add("channel", Channel); + //DialogServiceExtensions.ShowDialogHost(_dialogService, "ReturnEmptyDialog", dialogParameters, DoDialogResult, "RootDialog"); + } + }); + } + + //选中药品将要返还的数量添加到文本框 private void CheckboxChecked() { diff --git a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml index 0a9349c..3ed4c2c 100644 --- a/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml +++ b/DM_Weight/Views/Dialog/ReturnEmptyDialog.xaml @@ -140,6 +140,7 @@ @@ -152,6 +153,11 @@ + + + + +