| | | 1 | | @using OzonDomains.Models |
| | | 2 | | @using OzonOrdersWeb.Areas.Studio2.ViewModels.Grid |
| | | 3 | | @model List<WarehouseMapping> |
| | | 4 | | @{ |
| | 0 | 5 | | ViewData["Title"] = $"Связи складов ({Model.Count})"; |
| | 0 | 6 | | Layout = "~/Views/Shared/_Layout.cshtml"; |
| | 0 | 7 | | var rows = Model.Select(m => new |
| | 0 | 8 | | { |
| | 0 | 9 | | id = m.Id, |
| | 0 | 10 | | clientName = m.OzonClientId.HasValue ? m.OzonClient?.Name : "Не указан", |
| | 0 | 11 | | supplierName = m.Supplier?.Name, |
| | 0 | 12 | | bitrixWarehouseName = m.BitrixWarehouseName, |
| | 0 | 13 | | returnBitrixWarehouseName = m.ReturnBitrixWarehouseName, |
| | 0 | 14 | | transitBitrixWarehouseName = m.TransitBitrixWarehouseName, |
| | 0 | 15 | | ozonWarehouseName = m.OzonWarehouseName, |
| | 0 | 16 | | ozonWarehouseId = m.OzonWarehouseId, |
| | 0 | 17 | | deliveryType = m.DeliveryType, |
| | 0 | 18 | | priority = m.Priority |
| | 0 | 19 | | }); |
| | | 20 | | } |
| | | 21 | | |
| | 0 | 22 | | @await Html.PartialAsync("_BsxGridShell") |
| | | 23 | | |
| | | 24 | | <div class="container-fluid py-3 bsx-surface"> |
| | | 25 | | <div class="app-section-hero app-section-hero--import d-flex flex-wrap justify-content-between align-items-start gap |
| | | 26 | | <div> |
| | | 27 | | <h1><i class="fas fa-link me-2 text-primary"></i>Связи складов</h1> |
| | | 28 | | <div class="subtitle">Соответствие складов 1С (Bitrix) и Ozon по клиентам</div> |
| | | 29 | | <div class="subtitle-help mt-1"> |
| | | 30 | | Название склада в Ozon и в 1С обычно разное — по этой связи система понимает, какой физический склад 1С |
| | | 31 | | стоит за складом Ozon у конкретного клиента: для создания документов в 1С и синхронизации остатков с Bit |
| | | 32 | | Если на один склад Ozon заведено несколько связей — используется запись с наименьшим приоритетом. |
| | | 33 | | </div> |
| | | 34 | | <div class="app-section-hero__quick-links"> |
| | | 35 | | <a asp-area="Studio2" asp-controller="Warehouse" asp-action="Index"><i class="fas fa-warehouse"></i>Скла |
| | | 36 | | <a asp-area="Studio2" asp-controller="InterpartsWarehouseLogin" asp-action="Index"><i class="fas fa-user |
| | | 37 | | <a asp-area="Studio2" asp-controller="InterpartsSutCurrency" asp-action="Index"><i class="fas fa-exchang |
| | | 38 | | <a asp-area="Studio2" asp-controller="ExcludedBitrixWarehouse" asp-action="Index"><i class="fas fa-ban"> |
| | | 39 | | </div> |
| | | 40 | | </div> |
| | | 41 | | <div class="d-flex flex-wrap gap-2 align-items-center"> |
| | | 42 | | <div class="bsx-dir-stats"> |
| | 0 | 43 | | <span class="bsx-dir-stat">Всего <b>@Model.Count</b></span> |
| | 0 | 44 | | <span class="bsx-dir-stat">Клиентов <b>@Model.Select(m => m.OzonClientId).Distinct().Count()</b></span> |
| | | 45 | | </div> |
| | | 46 | | <a asp-action="Create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i>Новая связь</a> |
| | | 47 | | </div> |
| | | 48 | | </div> |
| | | 49 | | |
| | 0 | 50 | | @if (TempData["SuccessMessage"] is string successMessage) |
| | | 51 | | { |
| | | 52 | | <div class="alert alert-success alert-dismissible fade show" role="alert"> |
| | 0 | 53 | | <i class="fas fa-check-circle me-2"></i>@successMessage |
| | | 54 | | <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
| | | 55 | | </div> |
| | | 56 | | } |
| | 0 | 57 | | @if (TempData["ErrorMessage"] is string errorMessage) |
| | | 58 | | { |
| | | 59 | | <div class="alert alert-danger alert-dismissible fade show" role="alert"> |
| | 0 | 60 | | <i class="fas fa-exclamation-circle me-2"></i>@errorMessage |
| | | 61 | | <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
| | | 62 | | </div> |
| | | 63 | | } |
| | | 64 | | |
| | 0 | 65 | | @await Html.PartialAsync("_BsxDirectoryGrid", new BsxDirectoryGridViewModel("warehouseMapping", "Связи складов", "fa |
| | 0 | 66 | | "Фильтры в колонках: клиент, поставщик, склады 1С и Ozon, тип доставки. Двойной клик — страница изменения.")) |
| | | 67 | | </div> |
| | | 68 | | |
| | | 69 | | @section Scripts { |
| | | 70 | | <script src="~/js/Studio2/Grid/bsx-directory.js" asp-append-version="true"></script> |
| | | 71 | | <script> |
| | | 72 | | (function () { |
| | | 73 | | const D = window.BsxDirectory; |
| | 0 | 74 | | const editUrl = id => '@Url.Action("Edit", "WarehouseMapping", new { area = "Studio2" })/' + id; |
| | | 75 | | const text = p => p.value || '—'; |
| | | 76 | | const empty = { '': '(не задан)' }; |
| | | 77 | | |
| | | 78 | | D.grid({ |
| | | 79 | | key: 'dirWarehouseMapping', |
| | | 80 | | prefix: 'warehouseMapping', |
| | 0 | 81 | | rows: @Json.Serialize(rows), |
| | | 82 | | rowUrl: r => editUrl(r.id), |
| | | 83 | | columnDefs: [ |
| | | 84 | | D.numCol({ field: 'id', headerName: 'ID', width: 80, valueFormatter: p => '#' + p.value }), |
| | | 85 | | D.setCol({ field: 'clientName', headerName: 'Клиент', headerTooltip: 'Клиент Ozon', width: 190, filterPa |
| | | 86 | | D.setCol({ field: 'supplierName', headerName: 'Поставщик', width: 170, filterParams: { labels: empty }, |
| | | 87 | | D.setCol({ field: 'bitrixWarehouseName', headerName: 'Склад 1С', headerTooltip: 'Склад Bitrix / 1С', wid |
| | | 88 | | D.setCol({ field: 'returnBitrixWarehouseName', headerName: 'Склад возврата', headerTooltip: 'Склад возвр |
| | | 89 | | D.setCol({ field: 'transitBitrixWarehouseName', headerName: 'Транзитный склад', headerTooltip: 'Транзитн |
| | | 90 | | D.setCol({ field: 'ozonWarehouseName', headerName: 'Склад Ozon', flex: 1, minWidth: 200 }), |
| | | 91 | | { field: 'ozonWarehouseId', headerName: 'ID Ozon', headerTooltip: 'Warehouse ID', width: 150, cellClass: |
| | | 92 | | D.setCol({ field: 'deliveryType', headerName: 'Доставка', headerTooltip: 'Тип доставки', width: 150, fil |
| | | 93 | | D.numCol({ field: 'priority', headerName: 'Приоритет', headerTooltip: 'Меньше — важнее', width: 110, |
| | | 94 | | cellRenderer: p => D.tone(String(p.value), p.value === 0 ? 'accent' : 'muted') }), |
| | | 95 | | D.actionsCol(r => [ |
| | | 96 | | { icon: 'fa-pencil-alt', title: 'Изменить', href: editUrl(r.id) }, |
| | 0 | 97 | | { icon: 'fa-eye', title: 'Детали', kind: 'view', href: '@Url.Action("Details", "WarehouseMapping", n |
| | 0 | 98 | | { icon: 'fa-trash', title: 'Удалить', kind: 'danger', href: '@Url.Action("Delete", "WarehouseMapping |
| | | 99 | | ], { width: 130 }) |
| | | 100 | | ] |
| | | 101 | | }); |
| | | 102 | | })(); |
| | | 103 | | </script> |
| | | 104 | | } |