| | | 1 | | @using OzonOrdersWeb.Areas.Studio2.ViewModels.Grid |
| | | 2 | | @model List<OzonDomains.Models.ExcludedArticle> |
| | | 3 | | @{ |
| | 0 | 4 | | ViewData["Title"] = $"Исключённые артикулы ({Model.Count})"; |
| | 0 | 5 | | Layout = "~/Views/Shared/_Layout.cshtml"; |
| | 0 | 6 | | var rows = Model.Select(a => new { id = a.Id, article = a.Article, clientName = a.OzonClient?.Name }); |
| | | 7 | | } |
| | | 8 | | |
| | 0 | 9 | | @await Html.PartialAsync("_BsxGridShell") |
| | | 10 | | |
| | | 11 | | <div class="container-fluid py-3 bsx-surface"> |
| | | 12 | | <div class="app-section-hero app-section-hero--import d-flex flex-wrap justify-content-between align-items-start gap |
| | | 13 | | <div> |
| | | 14 | | <h1><i class="fas fa-ban me-2 text-primary"></i>Исключённые артикулы</h1> |
| | | 15 | | <div class="subtitle">Товары, исключённые из отдельных процессов</div> |
| | | 16 | | <div class="app-section-hero__quick-links"> |
| | | 17 | | <a asp-area="Studio2" asp-controller="Products" asp-action="Index"><i class="fas fa-box"></i>Товары</a> |
| | | 18 | | <a asp-area="Studio2" asp-controller="OzonClients" asp-action="Index"><i class="fas fa-store"></i>Клиент |
| | | 19 | | </div> |
| | | 20 | | </div> |
| | | 21 | | <div class="d-flex flex-wrap gap-2 align-items-center"> |
| | 0 | 22 | | <div class="bsx-dir-stats"><span class="bsx-dir-stat">Всего <b>@Model.Count</b></span></div> |
| | | 23 | | <a asp-action="Create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i>Добавить артикул</a> |
| | | 24 | | </div> |
| | | 25 | | </div> |
| | | 26 | | |
| | 0 | 27 | | @await Html.PartialAsync("_BsxDirectoryGrid", new BsxDirectoryGridViewModel("excludedArticle", "Исключения", "fa-ban |
| | 0 | 28 | | "Двойной клик — страница изменения.")) |
| | | 29 | | </div> |
| | | 30 | | |
| | | 31 | | @section Scripts { |
| | | 32 | | <script src="~/js/Studio2/Grid/bsx-directory.js" asp-append-version="true"></script> |
| | | 33 | | <script> |
| | | 34 | | (function () { |
| | | 35 | | const D = window.BsxDirectory; |
| | 0 | 36 | | const editUrl = id => '@Url.Action("Edit", "ExcludedArticles", new { area = "Studio2" })/' + id; |
| | | 37 | | D.grid({ |
| | | 38 | | key: 'dirExcludedArticle', |
| | | 39 | | prefix: 'excludedArticle', |
| | 0 | 40 | | rows: @Json.Serialize(rows), |
| | | 41 | | rowUrl: r => editUrl(r.id), |
| | | 42 | | columnDefs: [ |
| | | 43 | | D.numCol({ field: 'id', headerName: 'ID', width: 90, sort: 'desc' }), |
| | | 44 | | { field: 'article', headerName: 'Артикул', flex: 1, minWidth: 220, cellClass: 'fw-semibold' }, |
| | | 45 | | D.setCol({ field: 'clientName', headerName: 'Клиент', flex: 1, minWidth: 220, filterParams: { labels: { |
| | | 46 | | D.actionsCol(r => [ |
| | | 47 | | { icon: 'fa-pencil-alt', title: 'Изменить', href: editUrl(r.id) }, |
| | 0 | 48 | | { icon: 'fa-trash', title: 'Удалить', kind: 'danger', href: '@Url.Action("Delete", "ExcludedArticles |
| | | 49 | | ], { width: 100 }) |
| | | 50 | | ] |
| | | 51 | | }); |
| | | 52 | | })(); |
| | | 53 | | </script> |
| | | 54 | | } |