diff --git a/CutList.Web/Components/Pages/Jobs/Edit.razor b/CutList.Web/Components/Pages/Jobs/Edit.razor index fe33313..ae055c8 100644 --- a/CutList.Web/Components/Pages/Jobs/Edit.razor +++ b/CutList.Web/Components/Pages/Jobs/Edit.razor @@ -17,6 +17,19 @@ } +@if (!IsNew && job.IsLocked) +{ +
+
+ + This job is locked — materials ordered on @job.LockedAt!.Value.ToLocalTime().ToString("g"). Unlock to make changes. +
+ +
+} + @if (loading) {

Loading...

@@ -286,6 +299,15 @@ else private bool IsNew => !Id.HasValue; + private async Task UnlockJob() + { + if (Id.HasValue) + { + await JobService.UnlockAsync(Id.Value); + job = (await JobService.GetByIdAsync(Id.Value))!; + } + } + protected override async Task OnInitializedAsync() { materials = await MaterialService.GetAllAsync(); @@ -322,55 +344,57 @@ else
- @if (!IsNew) - { +
+ @if (!IsNew) + { +
+ + +
+ } +
- - + +
- } -
- - -
+
+ + +
-
- - -
+
+ + + + @foreach (var tool in cuttingTools) + { + + } + +
-
- - - - @foreach (var tool in cuttingTools) - { - - } - -
+
+ + +
-
- - -
+ @if (!string.IsNullOrEmpty(jobErrorMessage)) + { +
@jobErrorMessage
+ } - @if (!string.IsNullOrEmpty(jobErrorMessage)) - { -
@jobErrorMessage
- } - -
- - Back -
+
+ + Back +
+
@@ -381,7 +405,10 @@ else
Parts to Cut
- + @if (!job.IsLocked) + { + + }
@if (job.Parts.Count == 0) @@ -413,8 +440,11 @@ else @part.Quantity @(string.IsNullOrWhiteSpace(part.Name) ? "-" : part.Name) - - + @if (!job.IsLocked) + { + + + } } @@ -545,16 +575,19 @@ else
Stock for This Job
-
- -
- - + @if (!job.IsLocked) + { +
+ +
+ + +
-
+ }
@if (showStockForm) @@ -731,8 +764,11 @@ else } - - + @if (!job.IsLocked) + { + + + } } diff --git a/CutList.Web/Components/Pages/Jobs/Index.razor b/CutList.Web/Components/Pages/Jobs/Index.razor index c672121..b44ca70 100644 --- a/CutList.Web/Components/Pages/Jobs/Index.razor +++ b/CutList.Web/Components/Pages/Jobs/Index.razor @@ -50,7 +50,13 @@ else @foreach (var job in pagedJobs) { - @job.JobNumber + + @job.JobNumber + @if (job.IsLocked) + { + + } + @(job.Name ?? "-") @(job.Customer ?? "-") @(job.CuttingTool?.Name ?? "-")