This commit is contained in:
Frede Hundewadt 2022-06-15 17:03:49 +02:00
parent dd94209194
commit 3bde1eb06a
6 changed files with 21 additions and 29 deletions

View file

@ -47,8 +47,7 @@
<div class="row mb-1">
<label for="activityType" class="col-md-2 col-form-label">Ordre Type</label>
<div class="col-md-4">
<InputSelect id="activityType" class="form-select"
@bind-Value="@_poDraft.ActivityTypeEnum">
<InputSelect id="activityType" class="form-select" @bind-Value="@_poDraft.ActivityTypeEnum">
<option value="">ORDRE TYPE</option>
<option value="onSite">Besøg</option>
<option value="phone">Telefon</option>
@ -57,8 +56,7 @@
</div>
<label for="statusType" class="col-md-2 col-form-label">Status</label>
<div class="col-md-4">
<InputSelect id="statusType" class="form-select"
@bind-Value="@_poDraft.ActivityStatusEnum">
<InputSelect id="statusType" class="form-select" @bind-Value="@_poDraft.ActivityStatusEnum">
<option value="noSale" selected>Ingen salg</option>
<option value="order">Bestilling</option>
<option value="quote">Tilbud</option>
@ -324,36 +322,31 @@
<div class="row mb-1">
<label for="dlvName" class="col-md-2 col-form-label">Lev. Navn</label>
<div class="col-md-10">
<InputText id="dlvName" class="form-control"
@bind-Value="_poDraft.DlvName"/>
<InputText id="dlvName" class="form-control" @bind-Value="_poDraft.DlvName"/>
</div>
</div>
<div class="row mb-1">
<label for="dlvAddress1" class="col-md-2 col-form-label">Lev. Adresse</label>
<div class="col-md-10">
<InputText id="dlvAddress1" class="form-control"
@bind-Value="_poDraft.DlvAddress1"/>
<InputText id="dlvAddress1" class="form-control" @bind-Value="_poDraft.DlvAddress1"/>
</div>
</div>
<div class="row mb-1">
<label for="dlvAddress2" class="col-md-2 col-form-label">Lev. Adresse</label>
<div class="col-md-10">
<InputText id="dlvAddress2" class="form-control"
@bind-Value="_poDraft.DlvAddress2"/>
<InputText id="dlvAddress2" class="form-control" @bind-Value="_poDraft.DlvAddress2"/>
</div>
</div>
<div class="row mb-1">
<label for="dlvZipCode" class="col-md-2 col-form-label">Lev. Postnr</label>
<div class="col-md-10">
<InputText id="dlvZipCode" class="form-control"
@bind-Value="_poDraft.DlvZipCode"/>
<InputText id="dlvZipCode" class="form-control" @bind-Value="_poDraft.DlvZipCode"/>
</div>
</div>
<div class="row mb-1">
<label for="dlvCity" class="col-md-2 col-form-label">Lev. Bynavn</label>
<div class="col-md-10">
<InputText id="dlvCity" class="form-control"
@bind-Value="_poDraft.DlvCity"/>
<InputText id="dlvCity" class="form-control" @bind-Value="_poDraft.DlvCity"/>
</div>
</div>
</div>

View file

@ -32,6 +32,7 @@ namespace Wonky.Client.Pages;
public partial class ActivityCreate : IDisposable
{
// todo: prevent creating activity for workDate with closed report
[Inject] public ILogger<ActivityCreate> _logger { get; set; }
[Inject] public IToastService ToastService { get; set; }
[Inject] public NavigationManager NavigationManager { get; set; }

View file

@ -197,7 +197,7 @@
<button type="submit" class="btn btn-success">Gem</button>
</div>
<div class="col">
<a class="btn btn-primary" href="/company/@CompanyId">Til Oversigt</a>
<a class="btn btn-primary" href="/companies">Til Oversigt</a>
</div>
<div class="col">
<a class="btn btn-primary" href="/company/@CompanyId">Tilbage</a>

View file

@ -67,12 +67,10 @@
@if (_report.DayTypeEnum.ToLower().Contains("leave"))
{
<td>
<InputDate class="form-control"
@bind-Value="_leaveBegin" @bind-Value:event="oninput" @onchange="OnLeaveChanged"/>
<InputDate class="form-control" @bind-Value="_leaveBegin" />
</td>
<td>
<InputDate class="form-control"
@bind-Value="_leaveEnd" @bind-Value:event="oninput" @onchange="OnLeaveChanged"/>
<InputDate class="form-control" @bind-Value="_leaveEnd" />
</td>
}
else

View file

@ -47,8 +47,8 @@ public partial class ReportCreate
private DateTime _workDate { get; set; } = DateTime.Now;
private TimeOnly _timestampIn { get; set; } = new(12, 0);
private TimeOnly _timestampOut { get; set; } = new(12, 0);
private DateOnly _leaveBegin { get; set; } = DateOnly.FromDateTime(DateTime.Now);
private DateOnly _leaveEnd { get; set; } = DateOnly.FromDateTime(DateTime.Now);
private DateTime _leaveBegin { get; set; } = DateTime.Now;
private DateTime _leaveEnd { get; set; } = DateTime.Now;
protected override async Task OnInitializedAsync()
{
@ -61,7 +61,8 @@ public partial class ReportCreate
_prefs = await UserPrefs.GetPreferences();
if (!string.IsNullOrWhiteSpace(_prefs.WorkDate))
_workDate = DateTime.Parse(_prefs.WorkDate);
_leaveBegin = DateOnly.FromDateTime(_workDate);
_leaveBegin = _workDate;
_leaveEnd = _workDate;
_report.FromDateTime = $"{_workDate:yyyy-MM-dd 12:00}";
_report.ToDateTime = $"{_workDate:yyyy-MM-dd 12:00}";
@ -112,15 +113,14 @@ public partial class ReportCreate
_fetching = true;
var result = await ReportRepo.PostReport($"{_workDate:yyyy-MM-dd}", _report);
if (result.IsSuccess)
{
_toast.ShowInfo($"Rapport oprettet {_workDate}");
}
_fetching = false;
Navigator.NavigateTo("/home");
}
private void OnLeaveChanged()
{
}
private void OnTimeChanged()
{
var x = new DateTime(_workDate.Year, _workDate.Month, _workDate.Day, _timestampIn.Hour, _timestampIn.Minute,0);

View file

@ -18,12 +18,12 @@
},
"appInfo": {
"name": "Wonky Client",
"version": "0.8.1",
"version": "0.8.4",
"isBeta": true,
"image": "grumpy-coder.png"
},
"apiConfig": {
"baseAddress": "https://dev.innotec.dk",
"baseAddress": "https://staging.innotec.dk",
"tokenPath": "token",
"userInfo": "api/auth/userinfo",
"customerEndpoint": "api/v2/crm/companies",