取药、加药页面添加下拉入库存不入库存

This commit is contained in:
maqiao 2024-12-10 18:22:52 +08:00
parent ce6d519b93
commit 7b2f72db15
13 changed files with 239 additions and 8 deletions

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DM_Weight.Models
{
/// <summary>
/// 取药或加药用途字段(如果是补库存则不加入到报表中)
/// </summary>
public class UseFor
{
/// <summary>
/// 96不用于入账册
/// </summary>
public int UseId { get; set; }
/// <summary>
/// (入账册/不入账册)
/// </summary>
public string UseName { get; set; }
}
}

View File

@ -25,6 +25,33 @@ namespace DM_Weight.ViewModels
{
public class AddDrugControlViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
{
public static List<UseFor> SelectUseList = new()
{
new UseFor{UseId=0,UseName="入账册"},
new UseFor { UseId = 96, UseName = "不入账册" }
};
private List<UseFor> _selects = SelectUseList;
public List<UseFor> Selects
{
get { return _selects; }
set
{
SetProperty(ref _selects, value);
}
}
private UseFor _selectedItem = SelectUseList[0];
/// <summary>
/// 取药或加药用途字段
/// </summary>
public UseFor SelectedItem
{
get { return _selectedItem; }
set
{
SetProperty(ref _selectedItem, value);
}
}
private readonly ILog logger = LogManager.GetLogger(typeof(AddDrugControlViewModel));
private List<int> _drawerNoList = new List<int>();
public static AddDrugControlViewModel vm;
@ -325,7 +352,7 @@ namespace DM_Weight.ViewModels
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = it.AddQuantity,
Type = 1,
Type = SelectedItem.UseId == 0 ? 1 : SelectedItem.UseId,
InvoiceId = InvoiceId,
StockQuantity = nowChannels.Sum(it => it.Quantity),
ManunoQuantity = nowChannels.FindAll(it2 => it2.ManuNo == it.ManuNo).Sum(it => it.Quantity)

View File

@ -26,6 +26,34 @@ namespace DM_Weight.ViewModels
{
public class CheckStockNewWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
{
public static List<UseFor> SelectUseList = new()
{
new UseFor{UseId=0,UseName="入账册"},
new UseFor { UseId = 96, UseName = "不入账册" }
};
private List<UseFor> _selectsUseFor = SelectUseList;
public List<UseFor> SelectsUseFor
{
get { return _selectsUseFor; }
set
{
SetProperty(ref _selectsUseFor, value);
}
}
private UseFor _selectedItemUseFor = SelectUseList[0];
/// <summary>
/// 取药或加药用途字段
/// </summary>
public UseFor SelectedItemUseFor
{
get { return _selectedItemUseFor; }
set
{
SetProperty(ref _selectedItemUseFor, value);
}
}
//public static CheckStockNewWindowViewModel vm;
private readonly ILog logger = LogManager.GetLogger(typeof(CheckStockNewWindowViewModel));
public string drugId;
@ -416,7 +444,7 @@ namespace DM_Weight.ViewModels
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = it.CheckQuantity - it.Quantity,
Type = 4,
Type = SelectedItemUseFor.UseId==0? 4: SelectedItemUseFor.UseId,
InvoiceId = InvoiceId,
StockQuantity = nowChannels.Sum(it => it.Quantity),
CheckQuantity = it.CheckQuantity,

View File

@ -22,6 +22,34 @@ namespace DM_Weight.ViewModels
{
public class DrawerAddDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
{
public static List<UseFor> SelectUseList = new()
{
new UseFor{UseId=0,UseName="入账册"},
new UseFor { UseId = 96, UseName = "不入账册" }
};
private List<UseFor> _selectsUseFor = SelectUseList;
public List<UseFor> SelectsUseFor
{
get { return _selectsUseFor; }
set
{
SetProperty(ref _selectsUseFor, value);
}
}
private UseFor _selectedItemUseFor = SelectUseList[0];
/// <summary>
/// 取药或加药用途字段
/// </summary>
public UseFor SelectedItemUseFor
{
get { return _selectedItemUseFor; }
set
{
SetProperty(ref _selectedItemUseFor, value);
}
}
private readonly ILog logger = LogManager.GetLogger(typeof(DrawerAddDrugWindowViewModel));
private List<int> _drawerNoList = new List<int>();
@ -276,7 +304,7 @@ namespace DM_Weight.ViewModels
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = it.AddQuantity,
Type = 1,
Type = SelectedItemUseFor.UseId == 0 ? 1 : SelectedItemUseFor.UseId,
InvoiceId = InvoiceId,
StockQuantity = nowChannels.Sum(it => it.Quantity),
ManunoQuantity = nowChannels.FindAll(it2 => it2.ManuNo == it.ManuNo).Sum(it => it.Quantity),

View File

@ -26,6 +26,34 @@ namespace DM_Weight.ViewModels
{
public class DrawerTakeDrugWindowViewModel : BindableBase, IConfirmNavigationRequest, IRegionMemberLifetime
{
public static List<UseFor> SelectUseList = new()
{
new UseFor{UseId=0,UseName="入账册"},
new UseFor { UseId = 96, UseName = "不入账册" }
};
private List<UseFor> _selectsUseFor = SelectUseList;
public List<UseFor> SelectsUseFor
{
get { return _selectsUseFor; }
set
{
SetProperty(ref _selectsUseFor, value);
}
}
private UseFor _selectedItemUseFor = SelectUseList[0];
/// <summary>
/// 取药或加药用途字段
/// </summary>
public UseFor SelectedItemUseFor
{
get { return _selectedItemUseFor; }
set
{
SetProperty(ref _selectedItemUseFor, value);
}
}
private readonly ILog logger = LogManager.GetLogger(typeof(DrawerTakeDrugWindowViewModel));
private List<ChannelStock> _channelStocks = new List<ChannelStock>();
@ -253,7 +281,7 @@ namespace DM_Weight.ViewModels
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = it.TakeQuantity,
Type = 2,
Type = SelectedItemUseFor.UseId == 0 ? 2 : SelectedItemUseFor.UseId,
InvoiceId = InvoiceId,
StockQuantity = nowChannels.Sum(it => it.Quantity),
ManunoQuantity = nowChannels.FindAll(it2 => it2.ManuNo == it.ManuNo).Sum(it => it.Quantity),

View File

@ -24,8 +24,35 @@ using System.Configuration;
namespace DM_Weight.ViewModels
{
public class SelfAddDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime
{
public static List<UseFor> SelectUseList = new()
{
new UseFor{UseId=0,UseName="入账册"},
new UseFor { UseId = 96, UseName = "不入账册" }
};
private List<UseFor> _selectsUseFor = SelectUseList;
public List<UseFor> SelectsUseFor
{
get { return _selectsUseFor; }
set
{
SetProperty(ref _selectsUseFor, value);
}
}
private UseFor _selectedItemUseFor = SelectUseList[0];
/// <summary>
/// 取药或加药用途字段
/// </summary>
public UseFor SelectedItemUseFor
{
get { return _selectedItemUseFor; }
set
{
SetProperty(ref _selectedItemUseFor, value);
}
}
private readonly ILog logger = LogManager.GetLogger(typeof(SelfAddDialogViewModel));
public string Title => "自选加药";
@ -349,7 +376,7 @@ namespace DM_Weight.ViewModels
Reviewer = HomeWindowViewModel.Reviewer?.Id,
OperationTime = DateTime.Now,
Quantity = it.AddQuantity,
Type = 1,
Type = SelectedItemUseFor.UseId == 0 ? 1 : SelectedItemUseFor.UseId,
InvoiceId = InvoiceId,
StockQuantity = nowChannels.Sum(it => it.Quantity),
ManunoQuantity = nowChannels.FindAll(it2 => it2.ManuNo == it.ManuNo).Sum(it => it.Quantity),

View File

@ -22,8 +22,35 @@ using System.Configuration;
namespace DM_Weight.ViewModels
{
public class SelfTakeDialogViewModel : BindableBase, IDialogAware, IRegionMemberLifetime
{
public static List<UseFor> SelectUseList = new()
{
new UseFor{UseId=0,UseName="入账册"},
new UseFor { UseId = 96, UseName = "不入账册" }
};
private List<UseFor> _selects = SelectUseList;
public List<UseFor> Selects
{
get { return _selects; }
set
{
SetProperty(ref _selects, value);
}
}
private UseFor _selectedItem = SelectUseList[0];
/// <summary>
/// 取药或加药用途字段
/// </summary>
public UseFor SelectedItem
{
get { return _selectedItem; }
set
{
SetProperty(ref _selectedItem, value);
}
}
private readonly ILog logger = LogManager.GetLogger(typeof(SelfTakeDialogViewModel));
public string Title => "自选取药";
@ -308,7 +335,7 @@ namespace DM_Weight.ViewModels
OperationTime = DateTime.Now,
Quantity = it.TakeQuantity,
Reviewer = HomeWindowViewModel.Reviewer?.Id,
Type = 2,
Type = SelectedItem.UseId == 0 ? 2 : SelectedItem.UseId,
InvoiceId = InvoiceId,
StockQuantity = nowChannels.Sum(it => it.Quantity),
ManunoQuantity = nowChannels.FindAll(it2 => it2.ManuNo == it.ManuNo).Sum(it => it.Quantity),

View File

@ -175,7 +175,14 @@
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
Style="{StaticResource MaterialDesignOutlinedLightButton}"
Content="加药" />
<ComboBox Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
Grid.Column="0"
Margin="0 0 6 0"
Style="{StaticResource MaterialDesignOutlinedComboBox}"
SelectedItem="{Binding SelectedItem}"
DisplayMemberPath="UseName"
ItemsSource="{Binding Selects}"
/>
<TextBox Text="{Binding PZH, UpdateSourceTrigger=PropertyChanged}" materialDesign:HintAssist.Hint="凭证号"
materialDesign:HintAssist.IsFloating="True" Width="100"
Margin="0 0 3 0"

View File

@ -42,6 +42,13 @@
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
Style="{StaticResource MaterialDesignOutlinedLightButton}"
Content="盘点" />
<ComboBox Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
Grid.Column="0"
Margin="0 0 6 0"
Style="{StaticResource MaterialDesignOutlinedComboBox}"
SelectedItem="{Binding SelectedItemUseFor}"
DisplayMemberPath="UseName"
ItemsSource="{Binding SelectsUseFor}"/>
<Button
Margin="0 0 3 0"
VerticalAlignment="Center"

View File

@ -121,6 +121,13 @@
Content="加药"
Command="{Binding OpenDrawer}">
</Button>
<ComboBox Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
Grid.Column="0"
Margin="0 6 6 6"
Style="{StaticResource MaterialDesignOutlinedComboBox}"
SelectedItem="{Binding SelectedItemUseFor}"
DisplayMemberPath="UseName"
ItemsSource="{Binding SelectsUseFor}"/>
<TextBox Text="{Binding PZH, UpdateSourceTrigger=PropertyChanged}" materialDesign:HintAssist.Hint="凭证号"
materialDesign:HintAssist.IsFloating="True" Width="100"
Margin="2"

View File

@ -121,6 +121,14 @@
Content="取药"
Command="{Binding OpenDrawer}">
</Button>
<ComboBox Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
Grid.Column="0"
Margin="0 6 6 6"
Style="{StaticResource MaterialDesignOutlinedComboBox}"
SelectedItem="{Binding SelectedItem}"
DisplayMemberPath="UseName"
ItemsSource="{Binding Selects}"
/>
<Button
Margin="2"
Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"

View File

@ -161,7 +161,13 @@
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
Style="{StaticResource MaterialDesignOutlinedLightButton}"
Content="加药" />
<ComboBox Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
Grid.Column="0"
Margin="0 0 6 0"
Style="{StaticResource MaterialDesignOutlinedComboBox}"
SelectedItem="{Binding SelectedItemUseFor}"
DisplayMemberPath="UseName"
ItemsSource="{Binding SelectsUseFor}"/>
<TextBox Text="{Binding PZH, UpdateSourceTrigger=PropertyChanged}" materialDesign:HintAssist.Hint="凭证号"
materialDesign:HintAssist.IsFloating="True" Width="100"
Margin="0 0 3 0"

View File

@ -157,6 +157,13 @@
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
Style="{StaticResource MaterialDesignOutlinedLightButton}"
Content="取药" />
<ComboBox Visibility="{Binding Status, Converter={StaticResource StatusConverter}, ConverterParameter=CompleteBtn}"
Grid.Column="0"
Margin="0 0 6 0"
Style="{StaticResource MaterialDesignOutlinedComboBox}"
SelectedItem="{Binding SelectedItemUseFor}"
DisplayMemberPath="UseName"
ItemsSource="{Binding SelectsUseFor}"/>
<Button
Margin="0 0 3 0"
VerticalAlignment="Center"