WIP: customer order

This commit is contained in:
Frede Hundewadt 2023-10-26 03:41:10 +02:00
parent 59cb830dcd
commit 614df811a2
4 changed files with 84 additions and 1 deletions

View file

@ -66,7 +66,18 @@
@item.Sku
</div>
<div class="col-sm-2 text-sm-start">
@item.ShortName
<div class="position-relative">
@* OnDemand flag 2023-08-15 *@
@item.ShortName
@if (item.OnDemand)
{
<span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-warning">
Skaffevare
<span class="visually-hidden">Skaffevare</span>
</span>
}
</div>
@* @item.ShortName *@
</div>
<div class="col-sm-1 text-center">
@item.BoxSize

View file

@ -58,6 +58,37 @@
</div>
@if (DraftProvider.Draft.Items.Any())
{
<table class="table table-striped">
<thead>
<tr>
<th>Varenr</th>
<th>Beskrivelse</th>
<th>Antal</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var line in DraftProvider.Draft.Items)
{
<tr>
<td>@line.Item.Sku</td>
<td>@line.Item.Name</td>
<td>@line.Quantity</td>
<td><button class="btn btn-danger" @onclick="() => RemoveItem(line.Item.Sku)" >Slet</button></td>
</tr>
}
<tr>
<td></td>
<td></td>
<td></td>
<td><button class="btn btn-primary">Send bestilling</button></td>
</tr>
</tbody>
</table>
}
@if (_productInventory.Any())
{
<div class="row row-cols-1 row-cols-md-2 g-2">

View file

@ -0,0 +1 @@
@page "/b2b/{countryCode}/{companyId}/order/new"

View file

@ -0,0 +1,40 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Options;
using Wonky.Client.HttpInterceptors;
using Wonky.Client.HttpRepository;
using Wonky.Client.Models;
using Wonky.Client.OverlayB2B;
using Wonky.Client.Shared;
using Wonky.Entity.Configuration;
using Wonky.Entity.DTO;
using Wonky.Entity.Views;
namespace Wonky.Client.Pages;
#pragma warning disable CS8618
public partial class BusinessOrderViewPage
{
// ##############################################################
[Inject] public HttpInterceptorService Interceptor { get; set; }
[Inject] public IB2BRepository B2BRepo { get; set; }
[Inject]
public ICountryCatalogRepository Catalog { get; set; }
[Inject] private IOptions<ApiConfig> Config { get; set; }
// ##############################################################
[CascadingParameter] private DraftStateProvider DraftProvider { get; set; } = new();
[Parameter] public string CountryCode { get; set; } = "";
[Parameter] public string CompanyId { get; set; } = "";
// ##############################################################
private B2BBusinessInfo _businessInfo = new();
private B2BAdvisorInfo _advisorInfo = new();
private List<ProductHistoryView> _productHistory = new();
private List<ProductInventoryItemView> _productInventory = new();
private ApiConfig _config = new();
private B2BProductPriceHistoryOverlay PriceHistoryOverlay { get; set; }
private ItemSelect _selectedItem = new();
private ActivityDto Activity { get; set; } = new();
}