抽屉加药、抽屉取药页面添加开药盒按钮及功能
This commit is contained in:
parent
58174569e9
commit
7027494352
|
@ -0,0 +1,32 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace DM_Weight.Converter
|
||||||
|
{
|
||||||
|
internal class OpenBoxConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
bool status = bool.Parse(value.ToString());
|
||||||
|
if (status)
|
||||||
|
{
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,6 +33,13 @@ namespace DM_Weight.ViewModels
|
||||||
set => SetProperty(ref _channelStocks, value);
|
set => SetProperty(ref _channelStocks, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _openBoxVisibility = false;
|
||||||
|
public bool OpenBoxVisibility
|
||||||
|
{
|
||||||
|
get => _openBoxVisibility;
|
||||||
|
set => SetProperty(ref _openBoxVisibility, value);
|
||||||
|
}
|
||||||
|
|
||||||
private static readonly DateTime Jan1st1970 = new DateTime
|
private static readonly DateTime Jan1st1970 = new DateTime
|
||||||
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||||
|
|
||||||
|
@ -137,7 +144,7 @@ namespace DM_Weight.ViewModels
|
||||||
_portUtil.WindowName = "DrawerAddDrugWindow";
|
_portUtil.WindowName = "DrawerAddDrugWindow";
|
||||||
_portUtil.Operate = true;
|
_portUtil.Operate = true;
|
||||||
_portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1;
|
_portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1;
|
||||||
_portUtil.ColNos = singleChannels.Select(it => it.ColNo).ToArray();
|
_portUtil.ColNos = singleChannels.Where(it => it.AddQuantity > 0).Select(it => it.ColNo).ToArray(); //singleChannels.Select(it => it.ColNo).ToArray();
|
||||||
_portUtil.DrawerNo = DrawerNo;
|
_portUtil.DrawerNo = DrawerNo;
|
||||||
_portUtil.Start();
|
_portUtil.Start();
|
||||||
|
|
||||||
|
@ -441,6 +448,11 @@ namespace DM_Weight.ViewModels
|
||||||
.Where(cs => cs.DrugId != null)
|
.Where(cs => cs.DrugId != null)
|
||||||
.OrderBy(cs => cs.ColNo)
|
.OrderBy(cs => cs.ColNo)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
if (queryData != null && queryData.Count > 0)
|
||||||
|
{
|
||||||
|
OpenBoxVisibility = queryData[0].BoardType == 3 ? true : queryData[0].BoardType == 35 ? true : false;
|
||||||
|
}
|
||||||
ChannelStocks = queryData.Select(cs =>
|
ChannelStocks = queryData.Select(cs =>
|
||||||
{
|
{
|
||||||
cs.drugManuNo = cs.DrugInfo.DrugManuNos.Find(it => it.ManuNo.Equals(cs.ManuNo));
|
cs.drugManuNo = cs.DrugInfo.DrugManuNos.Find(it => it.ManuNo.Equals(cs.ManuNo));
|
||||||
|
|
|
@ -35,7 +35,12 @@ namespace DM_Weight.ViewModels
|
||||||
get => _channelStocks;
|
get => _channelStocks;
|
||||||
set => SetProperty(ref _channelStocks, value);
|
set => SetProperty(ref _channelStocks, value);
|
||||||
}
|
}
|
||||||
|
private bool _openBoxVisibility = false;
|
||||||
|
public bool OpenBoxVisibility
|
||||||
|
{
|
||||||
|
get => _openBoxVisibility;
|
||||||
|
set => SetProperty(ref _openBoxVisibility, value);
|
||||||
|
}
|
||||||
private static readonly DateTime Jan1st1970 = new DateTime
|
private static readonly DateTime Jan1st1970 = new DateTime
|
||||||
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||||
|
|
||||||
|
@ -145,7 +150,7 @@ namespace DM_Weight.ViewModels
|
||||||
|
|
||||||
_portUtil.WindowName = "DrawerTakeDrugWindow";
|
_portUtil.WindowName = "DrawerTakeDrugWindow";
|
||||||
_portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1;
|
_portUtil.BoardType = singleChannels.Count > 0 ? singleChannels[0].BoardType : 1;
|
||||||
_portUtil.ColNos = singleChannels.Select(it => it.ColNo).ToArray();
|
_portUtil.ColNos = singleChannels.Where(it=>it.TakeQuantity>0).Select(it => it.ColNo).ToArray();
|
||||||
_portUtil.DrawerNo = DrawerNo;
|
_portUtil.DrawerNo = DrawerNo;
|
||||||
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal, () => _portUtil.Start())
|
Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal, () => _portUtil.Start())
|
||||||
;
|
;
|
||||||
|
@ -446,6 +451,11 @@ namespace DM_Weight.ViewModels
|
||||||
.Where(cs => cs.Quantity > 0)
|
.Where(cs => cs.Quantity > 0)
|
||||||
.OrderBy(cs => cs.ColNo)
|
.OrderBy(cs => cs.ColNo)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
if (queryData != null && queryData.Count > 0)
|
||||||
|
{
|
||||||
|
OpenBoxVisibility = queryData[0].BoardType == 3 ? true : queryData[0].BoardType == 35 ? true : false;
|
||||||
|
}
|
||||||
ChannelStocks = queryData;
|
ChannelStocks = queryData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ namespace DM_Weight.ViewModels
|
||||||
List<OrderInfo> queryData = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
List<OrderInfo> queryData = SqlSugarHelper.Db.Queryable<OrderInfo>()
|
||||||
.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
.InnerJoin<OrderDetail>((oi, od) => oi.OrderNo == od.OrderNo)
|
||||||
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
|
.InnerJoin(SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType == 1).Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId)
|
||||||
.WhereIF(OrderDate != null, oi => oi.OrderDate.ToString("yyyy-MM-dd") == OrderDate)
|
.WhereIF(OrderDate != null, oi => oi.ChargeDate.ToString("yyyy-MM-dd") == OrderDate)
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("OrderNo"), oi => oi.OrderNo == SearchValue)
|
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("OrderNo"), oi => oi.OrderNo == SearchValue)
|
||||||
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PatientId"), oi => oi.PatientId == SearchValue)
|
.WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PatientId"), oi => oi.PatientId == SearchValue)
|
||||||
.WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"])
|
.WhereIF(!String.IsNullOrEmpty(ConfigurationManager.AppSettings["storage"]), oi => oi.Pharmacy == ConfigurationManager.AppSettings["storage"])
|
||||||
|
@ -233,7 +233,7 @@ namespace DM_Weight.ViewModels
|
||||||
.Where(oi => oi.HisDispFlag == 0)
|
.Where(oi => oi.HisDispFlag == 0)
|
||||||
.Where(oi => oi.CancelFlag == 0)
|
.Where(oi => oi.CancelFlag == 0)
|
||||||
.Where(oi=>oi.Pharmacy.Equals(ConfigurationManager.AppSettings["storage"] ?? ""))
|
.Where(oi=>oi.Pharmacy.Equals(ConfigurationManager.AppSettings["storage"] ?? ""))
|
||||||
.GroupBy(oi => oi.OrderDate)
|
.GroupBy(oi => oi.ChargeDate)
|
||||||
.Select(oi => oi)
|
.Select(oi => oi)
|
||||||
.ToPageList(PageNum, PageSize, ref totalCount);
|
.ToPageList(PageNum, PageSize, ref totalCount);
|
||||||
//.ToList();
|
//.ToList();
|
||||||
|
|
|
@ -12,8 +12,10 @@
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
|
<convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
|
||||||
<convert:StatusConverter x:Key="StatusConverter" />
|
<convert:StatusConverter x:Key="StatusConverter" />
|
||||||
|
<convert:OpenBoxConverter x:Key="OpenBoxConverter" />
|
||||||
<convert:InputQuantityConverter x:Key="InputQuantityConverter" />
|
<convert:InputQuantityConverter x:Key="InputQuantityConverter" />
|
||||||
<convert:QuantityCountConverter x:Key="QuantityCountConverter"/>
|
<convert:QuantityCountConverter x:Key="QuantityCountConverter"/>
|
||||||
|
<FrameworkElement x:Key="ProxyElement" DataContext="{Binding}"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
@ -21,7 +23,7 @@
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<ContentControl Content="{StaticResource ProxyElement}" Visibility="Collapsed"/>
|
||||||
<Grid Margin="0" Grid.Column="0" Width="280" Height="570" Visibility="{Binding Is8Drawer, Converter={StaticResource BooleanToVisibilityConverter}}">
|
<Grid Margin="0" Grid.Column="0" Width="280" Height="570" Visibility="{Binding Is8Drawer, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
<Grid.Background>
|
<Grid.Background>
|
||||||
<ImageBrush ImageSource="/Images/box.png" />
|
<ImageBrush ImageSource="/Images/box.png" />
|
||||||
|
@ -294,7 +296,14 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="100"
|
||||||
|
Header="操作" Visibility="{Binding DataContext.OpenBoxVisibility,Source={StaticResource ProxyElement},Converter={StaticResource OpenBoxConverter}}">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Button Content="开药盒" Command="{Binding DataContext.OpenBoxCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}" CommandParameter="{Binding}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<!--<ListView
|
<!--<ListView
|
||||||
|
|
|
@ -13,13 +13,16 @@
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
|
<convert:DrawerSelectConverter x:Key="DrawerSelectConverter" />
|
||||||
<convert:StatusConverter x:Key="StatusConverter" />
|
<convert:StatusConverter x:Key="StatusConverter" />
|
||||||
|
<convert:OpenBoxConverter x:Key="OpenBoxConverter" />
|
||||||
<convert:InputQuantityConverter x:Key="InputQuantityConverter" />
|
<convert:InputQuantityConverter x:Key="InputQuantityConverter" />
|
||||||
|
<FrameworkElement x:Key="ProxyElement" DataContext="{Binding}"/>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<ContentControl Content="{StaticResource ProxyElement}" Visibility="Collapsed"/>
|
||||||
<Grid Margin="0" Grid.Column="0" Width="280" Height="570" Visibility="{Binding Is8Drawer, Converter={StaticResource BooleanToVisibilityConverter}}">
|
<Grid Margin="0" Grid.Column="0" Width="280" Height="570" Visibility="{Binding Is8Drawer, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
<Grid.Background>
|
<Grid.Background>
|
||||||
<ImageBrush ImageSource="/Images/box.png" />
|
<ImageBrush ImageSource="/Images/box.png" />
|
||||||
|
@ -259,7 +262,14 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn Width="100"
|
||||||
|
Header="操作" Visibility="{Binding DataContext.OpenBoxVisibility,Source={StaticResource ProxyElement},Converter={StaticResource OpenBoxConverter}}">
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Button Content="开药盒" Command="{Binding DataContext.OpenBoxCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}" CommandParameter="{Binding}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
Loading…
Reference in New Issue