built v.072.2

This commit is contained in:
Frede Hundewadt 2022-12-01 17:05:35 +01:00
parent e6b7e658b3
commit 2cc9d55220
4 changed files with 15 additions and 8 deletions

View file

@ -149,7 +149,7 @@ public partial class CrmActivityNewPage : IDisposable
PoFormInvalid = false; PoFormInvalid = false;
} }
Working = false; Working = false;
StateHasChanged(); //StateHasChanged();
} }
/// <summary> /// <summary>

View file

@ -52,7 +52,7 @@
<tbody> <tbody>
<tr> <tr>
<td> <td>
<InputSelect id="dayType" class="form-select text-bg-primary bg-primary" <select id="dayType" class="form-select text-bg-primary bg-primary"
@bind-Value="Report.DayTypeEnum" @bind-Value:event="onchange"> @bind-Value="Report.DayTypeEnum" @bind-Value:event="onchange">
<option value="">&rarr; TAG MIG &larr;</option> <option value="">&rarr; TAG MIG &larr;</option>
<option value="sales">Salgsdag</option> <option value="sales">Salgsdag</option>
@ -61,7 +61,7 @@
<option value="supervisor">Medkørende Supervisor</option> <option value="supervisor">Medkørende Supervisor</option>
<option value="sickLeave">Sygdom</option> <option value="sickLeave">Sygdom</option>
<option value="leave">Ferie</option> <option value="leave">Ferie</option>
</InputSelect> </select>
<ValidationMessage For="@(() => Report.DayTypeEnum)"/> <ValidationMessage For="@(() => Report.DayTypeEnum)"/>
</td> </td>
@if (Report.DayTypeEnum.ToLower().Contains("leave")) @if (Report.DayTypeEnum.ToLower().Contains("leave"))

View file

@ -84,7 +84,6 @@ public partial class CrmReportNewPage : IDisposable
Report.Figures.Distance = 0; Report.Figures.Distance = 0;
Report.Figures.DistancePrivateMonth = 0; Report.Figures.DistancePrivateMonth = 0;
await GetKeyFigures(); await GetKeyFigures();
Working = false;
} }
/// <summary> /// <summary>
@ -94,7 +93,6 @@ public partial class CrmReportNewPage : IDisposable
/// <param name="e"></param> /// <param name="e"></param>
private void HandleFieldChanged(object sender, FieldChangedEventArgs e) private void HandleFieldChanged(object sender, FieldChangedEventArgs e)
{ {
Console.WriteLine($"e Model => {e.FieldIdentifier.Model}");
Console.WriteLine($"e FieldName => {e.FieldIdentifier.FieldName}"); Console.WriteLine($"e FieldName => {e.FieldIdentifier.FieldName}");
FormInvalid = !ReportContext.Validate(); FormInvalid = !ReportContext.Validate();
StateHasChanged(); StateHasChanged();
@ -109,6 +107,7 @@ public partial class CrmReportNewPage : IDisposable
{ {
FormInvalid = false; FormInvalid = false;
ReportContext.OnFieldChanged -= HandleFieldChanged; ReportContext.OnFieldChanged -= HandleFieldChanged;
ReportContext.OnValidationStateChanged -= ValidationChanged;
ReportContext = new EditContext(Report); ReportContext = new EditContext(Report);
ReportContext.OnFieldChanged += HandleFieldChanged; ReportContext.OnFieldChanged += HandleFieldChanged;
ReportContext.OnValidationStateChanged += ValidationChanged; ReportContext.OnValidationStateChanged += ValidationChanged;
@ -139,7 +138,7 @@ public partial class CrmReportNewPage : IDisposable
// attempt to eliminate doubled click on submit button // attempt to eliminate doubled click on submit button
if (Working) if (Working)
return; return;
// check daytype // check day type
if (string.IsNullOrWhiteSpace(Report.DayTypeEnum)) if (string.IsNullOrWhiteSpace(Report.DayTypeEnum))
{ {
Toaster.ShowError("Dagtype skal vælges", "Dag type mangler"); Toaster.ShowError("Dagtype skal vælges", "Dag type mangler");
@ -222,14 +221,22 @@ public partial class CrmReportNewPage : IDisposable
private async Task GetKeyFigures() private async Task GetKeyFigures()
{ {
Working = true; Working = true;
Report.Figures = new ReportFiguresDto();
InitialValues = new ReportFiguresDto();
Activities = new List<ReportItemView>();
var data = await CrmReportRepo.InitializeReportData($"{_workDate:yyyy-MM-dd}"); var data = await CrmReportRepo.InitializeReportData($"{_workDate:yyyy-MM-dd}");
if(data.ReportClosed) if(data.ReportClosed)
Navigator.NavigateTo($"/sales-reports/view/{_workDate:yyyy-MM-dd}"); Navigator.NavigateTo($"/sales-reports/view/{_workDate:yyyy-MM-dd}");
Report.Figures = data.ReportData; Report.Figures = data.ReportData;
InitialValues = data.ReportData; InitialValues = data.ReportData;
Activities = data.ReportItems; Activities = data.ReportItems;
if(!Report.DayTypeEnum.ToLower().Contains("leave")) if(!Report.DayTypeEnum.ToLower().Contains("leave"))
Report.Figures.KmMorning = Preferences.KmMorning; Report.Figures.KmMorning = Preferences.KmMorning;
NoFigures = false; NoFigures = false;
Working = false; Working = false;
} }

View file

@ -1,13 +1,13 @@
{ {
"appInfo": { "appInfo": {
"name": "Wonky Client", "name": "Wonky Client",
"version": "0.72.1", "version": "0.72.2",
"rc": true, "rc": true,
"sandBox": false, "sandBox": false,
"image": "grumpy-coder.png" "image": "grumpy-coder.png"
}, },
"apiConfig": { "apiConfig": {
"baseUrl": "https://dev.innotec.dk", "baseUrl": "https://zeta.innotec.dk",
"catalog": "api/v2/catalog", "catalog": "api/v2/catalog",
"crmCustomers": "api/v2/crm/companies", "crmCustomers": "api/v2/crm/companies",
"crmInventoryExt": "history/inventory", "crmInventoryExt": "history/inventory",