新增原料入场记录独立页面,更新导航和菜单配置以支持新功能。优化原料入场记录编辑对话框,增强物料选择和显示逻辑,提升用户体验。

This commit is contained in:
geht
2026-05-09 18:25:34 +08:00
parent 068d44c53e
commit 0e89648e8a
16 changed files with 1624 additions and 51 deletions

View File

@@ -9,7 +9,9 @@ using YY.Admin.Core.Events;
using YY.Admin.Core.Helper;
using YY.Admin.Core.Entity;
using YY.Admin.Core.Services;
using YY.Admin.Event;
using YY.Admin.Services.Service;
using YY.Admin.Module;
using YY.Admin.Views.RawMaterialEntry;
namespace YY.Admin.ViewModels.RawMaterialEntry;
@@ -77,7 +79,7 @@ public class RawMaterialEntryListViewModel : BaseViewModel
PageNo = 1;
await LoadAsync();
});
AddCommand = new DelegateCommand(async () => await ShowAddDialogAsync());
AddCommand = new DelegateCommand(OpenAddPage);
EditCommand = new DelegateCommand<MesXslRawMaterialEntry>(async e => await ShowEditDialogAsync(e));
DeleteCommand = new DelegateCommand<MesXslRawMaterialEntry>(async e => await DeleteAsync(e));
PrevPageCommand = new DelegateCommand(async () => { if (PageNo > 1) { PageNo--; await LoadAsync(); } });
@@ -149,16 +151,14 @@ public class RawMaterialEntryListViewModel : BaseViewModel
finally { IsLoading = false; }
}
private async Task ShowAddDialogAsync()
private void OpenAddPage()
{
try
_eventAggregator.GetEvent<TabSourceSelectedEvent>().Publish(new TabSource
{
var result = await HandyControl.Controls.Dialog.Show<RawMaterialEntryEditDialogView>()
.Initialize<RawMaterialEntryEditDialogViewModel>(vm => vm.InitializeForAdd())
.GetResultAsync<bool>();
if (result) await LoadAsync();
}
catch (Exception ex) { Growl.Error($"打开新增对话框失败:{ex.Message}"); }
Name = "新增原料入场记录",
Icon = "\ue7ce",
ViewName = "RawMaterialEntryOperationView"
});
}
private async Task ShowEditDialogAsync(MesXslRawMaterialEntry entry)