| | | 1 | | @using OzonDomains.Models |
| | | 2 | | @using OzonOrdersWeb.Areas.Studio2.ViewModels.Grid |
| | | 3 | | @model IEnumerable<ExcludedBitrixWarehouse> |
| | | 4 | | @{ |
| | 0 | 5 | | ViewData["Title"] = "Исключённые склады Bitrix"; |
| | 0 | 6 | | Layout = "~/Views/Shared/_Layout.cshtml"; |
| | 0 | 7 | | var items = Model.ToList(); |
| | 0 | 8 | | var rows = items.Select(x => new { id = x.Id, name = x.Name, comment = x.Comment, isActive = x.IsActive }); |
| | | 9 | | } |
| | | 10 | | |
| | 0 | 11 | | @await Html.PartialAsync("_BsxGridShell") |
| | | 12 | | |
| | | 13 | | <div class="container-fluid py-3 bsx-surface"> |
| | | 14 | | <div class="app-section-hero app-section-hero--import d-flex flex-wrap justify-content-between align-items-start gap |
| | | 15 | | <div> |
| | | 16 | | <h1><i class="fas fa-ban me-2 text-primary"></i>Исключённые склады Bitrix</h1> |
| | | 17 | | <div class="subtitle">Склады, не участвующие в выгрузке остатков</div> |
| | | 18 | | <div class="app-section-hero__quick-links"> |
| | | 19 | | <a asp-area="Studio2" asp-controller="Warehouse" asp-action="Index"><i class="fas fa-warehouse"></i>Скла |
| | | 20 | | <a asp-area="Studio2" asp-controller="WarehouseMapping" asp-action="Index"><i class="fas fa-link"></i>Св |
| | | 21 | | <a asp-area="Studio2" asp-controller="BitrixStock" asp-action="Index"><i class="fas fa-boxes"></i>Синхро |
| | | 22 | | </div> |
| | | 23 | | </div> |
| | | 24 | | <div class="d-flex flex-wrap gap-2 align-items-center"> |
| | | 25 | | <div class="bsx-dir-stats"> |
| | 0 | 26 | | <span class="bsx-dir-stat">Всего <b>@items.Count</b></span> |
| | 0 | 27 | | <span class="bsx-dir-stat">Активных <b>@items.Count(x => x.IsActive)</b></span> |
| | | 28 | | </div> |
| | | 29 | | <a asp-action="Create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i>Добавить исключение</a |
| | | 30 | | </div> |
| | | 31 | | </div> |
| | | 32 | | |
| | 0 | 33 | | @if (TempData["SuccessMessage"] != null) |
| | | 34 | | { |
| | | 35 | | <div class="alert alert-success alert-dismissible fade show" role="alert"> |
| | 0 | 36 | | <i class="fas fa-check-circle me-2"></i>@TempData["SuccessMessage"] |
| | | 37 | | <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
| | | 38 | | </div> |
| | | 39 | | } |
| | | 40 | | |
| | 0 | 41 | | @await Html.PartialAsync("_BsxDirectoryGrid", new BsxDirectoryGridViewModel("excludedBitrix", "Список исключений", " |
| | | 42 | | </div> |
| | | 43 | | |
| | | 44 | | @section Scripts { |
| | | 45 | | <script src="~/js/Studio2/Grid/bsx-directory.js" asp-append-version="true"></script> |
| | | 46 | | <script> |
| | | 47 | | (function () { |
| | | 48 | | const D = window.BsxDirectory; |
| | | 49 | | D.grid({ |
| | | 50 | | key: 'dirExcludedBitrix', |
| | | 51 | | prefix: 'excludedBitrix', |
| | 0 | 52 | | rows: @Json.Serialize(rows), |
| | | 53 | | columnDefs: [ |
| | | 54 | | D.numCol({ field: 'id', headerName: 'ID', width: 90 }), |
| | | 55 | | { field: 'name', headerName: 'Название склада', width: 280, sort: 'asc', cellClass: 'fw-semibold' }, |
| | | 56 | | { field: 'comment', headerName: 'Комментарий', flex: 1, minWidth: 260, tooltipField: 'comment', |
| | | 57 | | cellRenderer: p => p.value ? BsxGrid.esc(p.value) : '<span class="bsx-muted">Нет комментария</span>' } |
| | | 58 | | D.boolCol({ field: 'isActive', headerName: 'Статус', width: 130, filterParams: { labels: { 'true': 'Акти |
| | | 59 | | cellRenderer: p => D.yesNo(p.value, 'Активен', 'Неактивен') }), |
| | | 60 | | D.actionsCol(r => [ |
| | | 61 | | { icon: 'fa-trash', title: 'Удалить из исключений', kind: 'danger', post: true, |
| | 0 | 62 | | href: '@Url.Action("Delete", "ExcludedBitrixWarehouse", new { area = "Studio2" })/' + r.id, fields |
| | | 63 | | confirm: 'Удалить склад «' + r.name + '» из исключений?' } |
| | | 64 | | ], { width: 80 }) |
| | | 65 | | ] |
| | | 66 | | }); |
| | | 67 | | })(); |
| | | 68 | | </script> |
| | | 69 | | } |