药品管理页面修改bug

This commit is contained in:
马巧 2025-07-18 09:36:20 +08:00
parent 4768ff39f3
commit abae0a0d61
3 changed files with 7 additions and 6 deletions

View File

@ -15,7 +15,7 @@ namespace DM_Weight.Models
public class DrugBase:BindableBase public class DrugBase:BindableBase
{ {
private int _baseId = 0; private int _baseId = 0;
[SugarColumn(ColumnName = "id", IsPrimaryKey = true)] [SugarColumn(ColumnName = "baseid", IsPrimaryKey = true)]
public int BaseId { get=> _baseId; set { SetProperty(ref _baseId, value); } } public int BaseId { get=> _baseId; set { SetProperty(ref _baseId, value); } }
private string _drugId; private string _drugId;
[SugarColumn(ColumnName = "drugid")] [SugarColumn(ColumnName = "drugid")]
@ -24,7 +24,7 @@ namespace DM_Weight.Models
[SugarColumn(ColumnName = "machine_id")] [SugarColumn(ColumnName = "machine_id")]
public string MachineId { get => _machineId; set { SetProperty(ref _machineId, value); } } public string MachineId { get => _machineId; set { SetProperty(ref _machineId, value); } }
private int _baseQuantity = 0; private int _baseQuantity = 0;
[SugarColumn(ColumnName = "base_quantity")] [SugarColumn(ColumnName = "basequantity")]
public int BaseQuantity { get=>_baseQuantity; set{ SetProperty(ref _baseQuantity, value); } } public int BaseQuantity { get=>_baseQuantity; set{ SetProperty(ref _baseQuantity, value); } }
} }

View File

@ -84,7 +84,7 @@ namespace DM_Weight.Models
public int? StockQuantity { get; set; } public int? StockQuantity { get; set; }
private DrugBase _base; private DrugBase _base;
[Navigate(NavigateType.OneToOne, nameof(DrugBase.DrugId), nameof(DrugId))] [Navigate(NavigateType.OneToOne, nameof(DrugBase.DrugId), nameof(DrugId),whereSql:" machine_id='DM1'")]
public DrugBase drugBase public DrugBase drugBase
{ {
get=> _base; get=> _base;

View File

@ -283,7 +283,8 @@ namespace DM_Weight.ViewModels
} }
else else
{ {
SqlSugarHelper.Db.Updateable(new DrugBase() { BaseQuantity = SelectedDrug.drugBase.BaseQuantity }).UpdateColumns(bs => new { bs.BaseQuantity }).Where(bs => bs.BaseId == SelectedDrug.drugBase.BaseId).ExecuteCommand(); drugBase.BaseQuantity = SelectedDrug.drugBase.BaseQuantity;
SqlSugarHelper.Db.Updateable(drugBase).UpdateColumns(bs => new { bs.BaseQuantity }).Where(bs => bs.BaseId == SelectedDrug.drugBase.BaseId).ExecuteCommand();
} }
} }
}); });
@ -306,7 +307,7 @@ namespace DM_Weight.ViewModels
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg); _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
} }
RequestData(); RequestData();
}, () => SelectedDrug.DrugId==null).ObservesProperty(() => SelectedDrug); }, () => SelectedDrug.DrugId!=null).ObservesProperty(() => SelectedDrug);
} }
public DelegateCommand AddManuCommand public DelegateCommand AddManuCommand
@ -322,7 +323,7 @@ namespace DM_Weight.ViewModels
GetManuNos(); GetManuNos();
} }
}, () => SelectedDrug.DrugId == null).ObservesProperty(() => SelectedDrug); }, () => SelectedDrug.DrugId != null).ObservesProperty(() => SelectedDrug);
} }
public DelegateCommand EditManuCommand public DelegateCommand EditManuCommand