账册添加精一、精二药品类型查询
This commit is contained in:
		
							parent
							
								
									f1d784a099
								
							
						
					
					
						commit
						eed6d5d0e9
					
				| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace DM_Weight.Models
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class DrugType
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public int TypeValue { get; set; }
 | 
				
			||||||
 | 
					        public string TypeName { get; set; }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -180,7 +180,32 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                RequestData();
 | 
					                RequestData();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// 药品类型
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        private List<DrugType> _drugTypeList = new List<DrugType>()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            new DrugType{ TypeValue=1,TypeName="精一"},
 | 
				
			||||||
 | 
					            new DrugType{TypeValue=2,TypeName="精二"}
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        public List<DrugType>? DrugTypeList
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drugTypeList;
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _drugTypeList, value);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        private DrugType? _drugType;
 | 
				
			||||||
 | 
					        public DrugType? _DrugType
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get => _drugType; set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SetProperty(ref _drugType, value);
 | 
				
			||||||
 | 
					                RequestData();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        //MachineRecordService _machineRecordService;
 | 
					        //MachineRecordService _machineRecordService;
 | 
				
			||||||
        IEventAggregator _eventAggregator;
 | 
					        IEventAggregator _eventAggregator;
 | 
				
			||||||
        ////private SqlSugarScope SqlSugarHelper.Db;
 | 
					        ////private SqlSugarScope SqlSugarHelper.Db;
 | 
				
			||||||
| 
						 | 
					@ -194,7 +219,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        void RequestData()
 | 
					        void RequestData()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            int totalCount = 0;
 | 
					            int totalCount = 0;
 | 
				
			||||||
            AccountList = ReportAccountBook(StartDate, EndDate, AccountType == null ? 0 : AccountType.AccountTypeValue, DrugInfo == null ? "" : DrugInfo.DrugId.ToString() ?? "");
 | 
					            AccountList = ReportAccountBook(StartDate, EndDate, AccountType == null ? 0 : AccountType.AccountTypeValue, _DrugType == null ? 0 : _DrugType.TypeValue, DrugInfo == null ? "" : DrugInfo.DrugId.ToString() ?? "");
 | 
				
			||||||
            //for (int i = 0; i < accountList.Count; i++)
 | 
					            //for (int i = 0; i < accountList.Count; i++)
 | 
				
			||||||
            //{
 | 
					            //{
 | 
				
			||||||
            //    if (accountList[i].DrugInfo is null)
 | 
					            //    if (accountList[i].DrugInfo is null)
 | 
				
			||||||
| 
						 | 
					@ -293,7 +318,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private List<AccountBookG2> ReportAccountBook(DateTime? startDate, DateTime? endDate, int type, string drug_id = "")
 | 
					        private List<AccountBookG2> ReportAccountBook(DateTime? startDate, DateTime? endDate, int type,int drugType, string drug_id = "")
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
					            DateTime? p_startDate = startDate ?? Convert.ToDateTime("2010-1-1");
 | 
				
			||||||
            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
					            DateTime? p_endDate = endDate ?? DateTime.Now.AddDays(1);
 | 
				
			||||||
| 
						 | 
					@ -312,21 +337,25 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (type == 1)
 | 
					                if (type == 1)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    SQL += " WHERE ac.add_quantity>0 ";
 | 
					                    SQL += "  AND ac.add_quantity>0 ";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (type == 2)
 | 
					                if (type == 2)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    SQL += " WHERE ac.out_quantity>0 ";
 | 
					                    SQL += " AND ac.out_quantity>0 ";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (type == 3)
 | 
					                if (type == 3)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    SQL += " WHERE type=3 ";
 | 
					                    SQL += " AND type=3 ";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (type == 4)
 | 
					                if (type == 4)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    SQL += " WHERE type=4  ";
 | 
					                    SQL += " AND type=4  ";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            if (drugType > 0)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                SQL += $" AND di.Drug_type={drugType}";
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            SQL += " ORDER BY ac.create_date desc,ac.drug_id";
 | 
					            SQL += " ORDER BY ac.create_date desc,ac.drug_id";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,13 +63,21 @@
 | 
				
			||||||
                    SelectedItem="{Binding DrugInfo}"
 | 
					                    SelectedItem="{Binding DrugInfo}"
 | 
				
			||||||
                    DisplayMemberPath="DrugName"
 | 
					                    DisplayMemberPath="DrugName"
 | 
				
			||||||
                />-->
 | 
					                />-->
 | 
				
			||||||
            <ComboBox
 | 
					            <!--<ComboBox
 | 
				
			||||||
                    Margin="6 0 6 0"
 | 
					                    Margin="6 0 6 0"
 | 
				
			||||||
                    Grid.Column="2"
 | 
					                    Grid.Column="2"
 | 
				
			||||||
                    materialDesign:HintAssist.Hint="药品名称/拼音码/药品编码"
 | 
					                    materialDesign:HintAssist.Hint="药品名称/拼音码/药品编码"
 | 
				
			||||||
                    ItemsSource="{Binding DrugInfos}"
 | 
					                    ItemsSource="{Binding DrugInfos}"
 | 
				
			||||||
                    SelectedItem="{Binding DrugInfo}"
 | 
					                    SelectedItem="{Binding DrugInfo}"
 | 
				
			||||||
                    DisplayMemberPath="DrugName" IsEditable="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
 | 
					                    DisplayMemberPath="DrugName" IsEditable="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
 | 
				
			||||||
 | 
					                />-->
 | 
				
			||||||
 | 
					            <ComboBox
 | 
				
			||||||
 | 
					                    Margin="6 0 6 0"
 | 
				
			||||||
 | 
					                    Grid.Column="2"
 | 
				
			||||||
 | 
					                    materialDesign:HintAssist.Hint="药品类型"
 | 
				
			||||||
 | 
					                    ItemsSource="{Binding DrugTypeList}"
 | 
				
			||||||
 | 
					                    SelectedItem="{Binding _DrugType}"
 | 
				
			||||||
 | 
					                    DisplayMemberPath="TypeName" IsEditable="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
 | 
				
			||||||
                />
 | 
					                />
 | 
				
			||||||
            <ComboBox
 | 
					            <ComboBox
 | 
				
			||||||
                    Margin="12 0 0 0"
 | 
					                    Margin="12 0 0 0"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue