| | | 1 | | @model OzonOrdersWeb.Areas.OneCFresh.ViewModels.NomenclatureViewModel |
| | | 2 | | @{ |
| | 0 | 3 | | ViewData["Title"] = "Номенклатура"; |
| | 0 | 4 | | var totalPages = Model.TotalCount == 0 ? 1 : (int)Math.Ceiling(Model.TotalCount / (double)Model.PageSize); |
| | | 5 | | } |
| | | 6 | | |
| | | 7 | | <div class="d-flex align-items-center gap-2 mb-3"> |
| | | 8 | | <h5 class="mb-0 fw-semibold"> |
| | 0 | 9 | | <i class="bi bi-box-seam me-2 text-primary"></i>@ViewData["Title"] |
| | | 10 | | </h5> |
| | 0 | 11 | | <span class="badge bg-secondary">@Model.TotalCount всего</span> |
| | 0 | 12 | | <span class="text-muted small">показано @Model.Items.Count</span> |
| | | 13 | | </div> |
| | | 14 | | |
| | 0 | 15 | | @if (TempData["Error"] is string err) |
| | | 16 | | { |
| | 0 | 17 | | <div class="alert alert-danger py-2 small">@err</div> |
| | | 18 | | } |
| | | 19 | | |
| | | 20 | | <form method="get" asp-area="OneCFresh" asp-controller="Catalog" asp-action="Nomenclature" class="row g-2 align-items-en |
| | | 21 | | <div class="col-12 col-md-5"> |
| | | 22 | | <input class="form-control form-control-sm" name="search" value="@Model.Search" placeholder="Поиск по артикулу и |
| | | 23 | | </div> |
| | | 24 | | <div class="col-auto"> |
| | | 25 | | <button type="submit" class="btn btn-primary btn-sm"> |
| | | 26 | | <i class="bi bi-search me-1"></i>Найти |
| | | 27 | | </button> |
| | 0 | 28 | | @if (!string.IsNullOrWhiteSpace(Model.Search)) |
| | | 29 | | { |
| | | 30 | | <a asp-area="OneCFresh" asp-controller="Catalog" asp-action="Nomenclature" class="btn btn-outline-secondary |
| | | 31 | | <i class="bi bi-x"></i> |
| | | 32 | | </a> |
| | | 33 | | } |
| | | 34 | | </div> |
| | | 35 | | </form> |
| | | 36 | | |
| | | 37 | | <div class="table-responsive"> |
| | | 38 | | <table class="table table-sm table-hover onec-table border"> |
| | | 39 | | <thead class="table-light"> |
| | | 40 | | <tr> |
| | | 41 | | <th>Артикул</th> |
| | | 42 | | <th>Наименование</th> |
| | | 43 | | <th>GUID</th> |
| | | 44 | | <th>Статус</th> |
| | | 45 | | </tr> |
| | | 46 | | </thead> |
| | | 47 | | <tbody> |
| | 0 | 48 | | @foreach (var item in Model.Items) |
| | | 49 | | { |
| | | 50 | | <tr class="@(item.DeletionMark ? "text-muted" : "")"> |
| | 0 | 51 | | <td class="font-monospace fw-semibold">@item.Article</td> |
| | 0 | 52 | | <td>@item.Description</td> |
| | 0 | 53 | | <td class="font-monospace text-muted" style="font-size:.75rem">@item.RefKey.ToString().ToUpper()</td |
| | | 54 | | <td> |
| | 0 | 55 | | @if (item.DeletionMark) |
| | | 56 | | { |
| | | 57 | | <span class="badge badge-deleted"><i class="bi bi-trash me-1"></i>Удалён</span> |
| | | 58 | | } |
| | | 59 | | else |
| | | 60 | | { |
| | | 61 | | <span class="badge bg-success"><i class="bi bi-check-circle me-1"></i>Активна</span> |
| | | 62 | | } |
| | | 63 | | </td> |
| | | 64 | | </tr> |
| | | 65 | | } |
| | 0 | 66 | | @if (!Model.Items.Any()) |
| | | 67 | | { |
| | | 68 | | <tr><td colspan="4" class="text-center text-muted py-3">Записи не найдены</td></tr> |
| | | 69 | | } |
| | | 70 | | </tbody> |
| | | 71 | | </table> |
| | | 72 | | </div> |
| | | 73 | | |
| | 0 | 74 | | @if (totalPages > 1) |
| | | 75 | | { |
| | | 76 | | <nav> |
| | | 77 | | <ul class="pagination pagination-sm"> |
| | 0 | 78 | | @for (var i = 1; i <= Math.Min(totalPages, 20); i++) |
| | | 79 | | { |
| | | 80 | | <li class="page-item @(i == Model.Page ? "active" : "")"> |
| | | 81 | | <a class="page-link" asp-area="OneCFresh" asp-controller="Catalog" asp-action="Nomenclature" |
| | 0 | 82 | | asp-route-search="@Model.Search" asp-route-page="@i" asp-route-pageSize="@Model.PageSize">@i</a> |
| | | 83 | | </li> |
| | | 84 | | } |
| | | 85 | | </ul> |
| | | 86 | | </nav> |
| | | 87 | | } |