| | | 1 | | @using Services.ApiServices.AvdApi |
| | | 2 | | @model IReadOnlyList<AvdOrder> |
| | | 3 | | |
| | | 4 | | @{ |
| | 0 | 5 | | var orders = Model ?? Array.Empty<AvdOrder>(); |
| | 0 | 6 | | ViewData["Title"] = $"Заказы АВД ({orders.Count} шт.)"; |
| | 0 | 7 | | Layout = "~/Views/Shared/_Layout.cshtml"; |
| | | 8 | | } |
| | | 9 | | |
| | | 10 | | <div class="container"> |
| | | 11 | | <div class="row"> |
| | | 12 | | <div> |
| | | 13 | | <div class="card"> |
| | | 14 | | <div class="card-header"> |
| | | 15 | | <div> |
| | | 16 | | <h2>Заказы АВД</h2> |
| | | 17 | | <div class="nav-links"> |
| | | 18 | | <a asp-action="Index">Корзина АВД</a> |
| | | 19 | | </div> |
| | | 20 | | </div> |
| | | 21 | | </div> |
| | | 22 | | |
| | | 23 | | <div class="card-body"> |
| | 0 | 24 | | @if (TempData["ErrorMessage"] is string errorMessage) |
| | | 25 | | { |
| | 0 | 26 | | <div class="alert alert-danger"><i class="fas fa-triangle-exclamation me-2"></i>@errorMessage</d |
| | | 27 | | } |
| | | 28 | | |
| | | 29 | | <div class="filter-form" style="background-color:#f8f9fa;border-radius:.25rem;padding:.75rem;margin- |
| | | 30 | | <form asp-action="Orders" method="get" class="row g-3 align-items-end"> |
| | | 31 | | <div class="col-md-3"> |
| | | 32 | | <label class="form-label small">Дата с</label> |
| | | 33 | | <input type="date" name="dateBegin" value="@Context.Request.Query["dateBegin"]" class="f |
| | | 34 | | </div> |
| | | 35 | | <div class="col-md-3"> |
| | | 36 | | <label class="form-label small">Дата по</label> |
| | | 37 | | <input type="date" name="dateEnd" value="@Context.Request.Query["dateEnd"]" class="form- |
| | | 38 | | </div> |
| | | 39 | | <div class="col-md-2"> |
| | | 40 | | <label class="form-label small">Номер заказа</label> |
| | | 41 | | <input type="text" name="number" value="@Context.Request.Query["number"]" class="form-co |
| | | 42 | | </div> |
| | | 43 | | <div class="col-md-4"> |
| | | 44 | | <button type="submit" class="btn btn-primary btn-sm">Применить фильтр</button> |
| | | 45 | | </div> |
| | | 46 | | </form> |
| | | 47 | | </div> |
| | | 48 | | |
| | | 49 | | <div class="table-responsive"> |
| | | 50 | | <table class="table table-hover"> |
| | | 51 | | <thead class="bg-light"> |
| | | 52 | | <tr> |
| | | 53 | | <th>Артикул</th> |
| | | 54 | | <th>Наименование</th> |
| | | 55 | | <th>Поставщик АВД</th> |
| | | 56 | | <th class="text-end">Цена</th> |
| | | 57 | | <th class="text-end">Кол-во</th> |
| | | 58 | | <th>Статус</th> |
| | | 59 | | <th>Обновлён</th> |
| | | 60 | | </tr> |
| | | 61 | | </thead> |
| | | 62 | | <tbody> |
| | 0 | 63 | | @if (orders.Any()) |
| | | 64 | | { |
| | 0 | 65 | | foreach (var order in orders) |
| | | 66 | | { |
| | | 67 | | <tr class="table-light"> |
| | | 68 | | <td colspan="7"> |
| | 0 | 69 | | <strong>Заказ @order.OrderNumber</strong> |
| | 0 | 70 | | <span class="text-muted">от @order.OrderDate</span> |
| | 0 | 71 | | <span class="text-muted">— сумма @order.Summa.ToString("0.##")</span> |
| | 0 | 72 | | @if (!string.IsNullOrWhiteSpace(order.OrderInfo)) |
| | | 73 | | { |
| | 0 | 74 | | <span class="text-muted"> · @order.OrderInfo</span> |
| | | 75 | | } |
| | | 76 | | </td> |
| | | 77 | | </tr> |
| | 0 | 78 | | foreach (var item in order.Items) |
| | | 79 | | { |
| | | 80 | | <tr> |
| | 0 | 81 | | <td>@item.ItemNumber</td> |
| | 0 | 82 | | <td>@item.ItemName</td> |
| | 0 | 83 | | <td>@item.SupplierName</td> |
| | 0 | 84 | | <td class="text-end">@(item.Price?.ToString("0.##") ?? "-")</td> |
| | 0 | 85 | | <td class="text-end">@(item.Quantity?.ToString("0.##") ?? "-")</td> |
| | 0 | 86 | | <td><span class="badge bg-secondary">@item.Status</span></td> |
| | 0 | 87 | | <td>@item.StatusDate</td> |
| | | 88 | | </tr> |
| | | 89 | | } |
| | | 90 | | } |
| | | 91 | | } |
| | | 92 | | else |
| | | 93 | | { |
| | | 94 | | <tr class="st2-empty-state-row"><td colspan="7"><div class="st2-empty-state st2-empty-st |
| | | 95 | | } |
| | | 96 | | </tbody> |
| | | 97 | | </table> |
| | | 98 | | </div> |
| | | 99 | | </div> |
| | | 100 | | </div> |
| | | 101 | | </div> |
| | | 102 | | </div> |
| | | 103 | | </div> |