桌面端原材料入场记录完善
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Tools.Extension;
|
||||
using Prism.Events;
|
||||
using Prism.Navigation;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
@@ -12,7 +12,6 @@ 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;
|
||||
|
||||
@@ -80,7 +79,9 @@ public class RawMaterialEntryListViewModel : BaseViewModel
|
||||
await LoadAsync();
|
||||
});
|
||||
AddCommand = new DelegateCommand(OpenAddPage);
|
||||
EditCommand = new DelegateCommand<MesXslRawMaterialEntry>(async e => await ShowEditDialogAsync(e));
|
||||
//update-begin---author:jiangxh ---date:20260731 for:【原料入场】编辑改为打开与新增相同的操作页-----------
|
||||
EditCommand = new DelegateCommand<MesXslRawMaterialEntry>(OpenEditPage);
|
||||
//update-end---author:jiangxh ---date:20260731 for:【原料入场】编辑改为打开与新增相同的操作页-----------
|
||||
DeleteCommand = new DelegateCommand<MesXslRawMaterialEntry>(async e => await DeleteAsync(e));
|
||||
PrevPageCommand = new DelegateCommand(async () => { if (PageNo > 1) { PageNo--; await LoadAsync(); } });
|
||||
NextPageCommand = new DelegateCommand(async () => { if ((long)PageNo * PageSize < Total) { PageNo++; await LoadAsync(); } });
|
||||
@@ -161,18 +162,21 @@ public class RawMaterialEntryListViewModel : BaseViewModel
|
||||
});
|
||||
}
|
||||
|
||||
private async Task ShowEditDialogAsync(MesXslRawMaterialEntry entry)
|
||||
//update-begin---author:jiangxh ---date:20260731 for:【原料入场】编辑改为打开与新增相同的操作页-----------
|
||||
private void OpenEditPage(MesXslRawMaterialEntry? entry)
|
||||
{
|
||||
if (entry == null) return;
|
||||
try
|
||||
if (entry == null || string.IsNullOrWhiteSpace(entry.Id)) return;
|
||||
|
||||
var label = string.IsNullOrWhiteSpace(entry.Barcode) ? entry.Id : entry.Barcode;
|
||||
_eventAggregator.GetEvent<TabSourceSelectedEvent>().Publish(new TabSource
|
||||
{
|
||||
var result = await HandyControl.Controls.Dialog.Show<RawMaterialEntryEditDialogView>()
|
||||
.Initialize<RawMaterialEntryEditDialogViewModel>(vm => vm.InitializeForEdit(entry))
|
||||
.GetResultAsync<bool>();
|
||||
if (result) await LoadAsync();
|
||||
}
|
||||
catch (Exception ex) { Growl.Error($"打开编辑对话框失败:{ex.Message}"); }
|
||||
Name = $"编辑原料入场记录 {label}",
|
||||
Icon = "\ue7ce",
|
||||
ViewName = "RawMaterialEntryOperationView",
|
||||
NavigationParameter = new NavigationParameters { { "editEntryId", entry.Id } }
|
||||
});
|
||||
}
|
||||
//update-end---author:jiangxh ---date:20260731 for:【原料入场】编辑改为打开与新增相同的操作页-----------
|
||||
|
||||
private async Task DeleteAsync(MesXslRawMaterialEntry entry)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user