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