绑定库位页面中药品下拉添加批号及厂家信息

This commit is contained in:
maqiao 2024-11-02 15:32:50 +08:00
parent f477287bc7
commit 289a26f341
3 changed files with 8 additions and 3 deletions

View File

@ -97,6 +97,8 @@ namespace DM_Weight.Models
set { SetProperty(ref _base, value); } set { SetProperty(ref _base, value); }
} }
[SugarColumn(IsIgnore = true)]
public string drug_name_spec { get; set; }
} }

View File

@ -165,8 +165,11 @@ namespace DM_Weight.ViewModels
private void GetAllDrugInfos() private void GetAllDrugInfos()
{ {
var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList(); //var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
DrugInfos = list; //DrugInfos = list;
string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
} }
private void GetChannelsByDrawerNo() private void GetChannelsByDrawerNo()

View File

@ -52,7 +52,7 @@
IsEditable="True" IsEditable="True"
ItemsSource="{Binding DrugInfos}" ItemsSource="{Binding DrugInfos}"
SelectedItem="{Binding DrugInfo}" SelectedItem="{Binding DrugInfo}"
DisplayMemberPath="DrugName" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp" DisplayMemberPath="drug_name_spec" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
/> />
<ComboBox <ComboBox
Grid.Column="1" Grid.Column="1"