| | | 1 | | @using OzonOrdersWeb.WebServices.SupplierCart |
| | | 2 | | @* |
| | | 3 | | Корзина поставщиков на AG Grid: оболочка страницы. Вкладка поставщика (гриды «Корзина» и «Заказы», действия) |
| | | 4 | | строится скриптами supplier-cart-*.js по JSON эндпоинта Grid. Описание — docs/supplier-cart-ag-grid.md. |
| | | 5 | | *@ |
| | | 6 | | @{ |
| | 0 | 7 | | ViewData["Title"] = "Корзина поставщиков"; |
| | 0 | 8 | | Layout = "~/Views/Shared/_Layout.cshtml"; |
| | 0 | 9 | | var logos = new Dictionary<string, string> |
| | 0 | 10 | | { |
| | 0 | 11 | | ["avd"] = "/images/avd-logo.svg", |
| | 0 | 12 | | ["armtek"] = "/images/armtek-logo.svg", |
| | 0 | 13 | | ["armtekby"] = "/images/armtek-logo.svg", |
| | 0 | 14 | | ["mlauto"] = "https://www.ml-auto.by/media/files/settings/inside-placeholder-logo-mobile.png", |
| | 0 | 15 | | ["mlautoru"] = "https://ml-auto.ru/media/files/settings/inside-placeholder-logo-mobile.png", |
| | 0 | 16 | | ["forumauto"] = "/images/forum-auto-logo.svg", |
| | 0 | 17 | | ["forumautointerparts"] = "/images/forum-auto-logo.svg", |
| | 0 | 18 | | ["forumautopiter"] = "/images/forum-auto-logo.svg", |
| | 0 | 19 | | ["forumautorostov"] = "/images/forum-auto-logo.svg", |
| | 0 | 20 | | ["forumautoistra"] = "/images/forum-auto-logo.svg", |
| | 0 | 21 | | ["favoritparts"] = "/images/favorit-parts-logo.png", |
| | 0 | 22 | | ["favoritpartsistra"] = "/images/favorit-parts-logo.png", |
| | 0 | 23 | | ["favoritpartsrostov"] = "/images/favorit-parts-logo.png", |
| | 0 | 24 | | ["moskvorechieistra"] = "/images/moskvorechie-logo.gif", |
| | 0 | 25 | | ["motex"] = "/images/motex-logo.png", |
| | 0 | 26 | | ["shatem"] = "/images/shate-m-logo.svg", |
| | 0 | 27 | | ["profitliga"] = "/images/profit-liga-logo.svg", |
| | 0 | 28 | | ["nikei"] = "/images/nikei-logo.svg", |
| | 0 | 29 | | ["mikadomskhod20"] = "https://mikado-parts.ru/img/MikadoLogo.svg", |
| | 0 | 30 | | ["zzapmoscow"] = "/images/zzap-logo.svg", |
| | 0 | 31 | | ["japarts"] = "/images/japarts-logo.jpg", |
| | 0 | 32 | | ["berg"] = "/images/berg-logo-2026.png" |
| | 0 | 33 | | }; |
| | 0 | 34 | | string Url0(string action) => Url.Action(action, "SupplierCart", new { area = "Studio2" }) ?? string.Empty; |
| | 0 | 35 | | var config = new Dictionary<string, string?> |
| | 0 | 36 | | { |
| | 0 | 37 | | ["grid"] = Url0("Grid"), |
| | 0 | 38 | | ["summary"] = Url0("Summary"), |
| | 0 | 39 | | ["orders"] = Url.Action("Index", "Orders", new { area = "Studio2" }), |
| | 0 | 40 | | ["settings"] = Url.Action("Index", "ApiSupplierSettings", new { area = "Studio2" })?.TrimEnd('/').Replace("/Inde |
| | 0 | 41 | | ["nikeiDeliveryOptions"] = Url0("NikeiDeliveryOptions"), |
| | 0 | 42 | | ["shateMCheckoutData"] = "/ShateM/CheckoutData", |
| | 0 | 43 | | ["shateMAvailableDates"] = "/ShateM/AvailableDates" |
| | 0 | 44 | | }; |
| | 0 | 45 | | foreach (var action in new[] |
| | 0 | 46 | | { |
| | 0 | 47 | | "RemoveAvdBasketItems", "CreateAvdOrder", |
| | 0 | 48 | | "RemoveArmtekCartItems", "TestArmtekOrder", "PrepareArmtekCheckout", "CreateArmtekOrder", "UpdateArmtekDeliveryA |
| | 0 | 49 | | "TestMlAutoOrder", "CreateMlAutoOrder", "RemoveMlAutoCartItems", "UpdateMlAutoDeliveryAddress", "RequoteMlAutoCa |
| | 0 | 50 | | "TestMlAutoRuOrder", "CreateMlAutoRuOrder", "RemoveMlAutoRuCartItems", "UpdateMlAutoRuDeliveryAddress", |
| | 0 | 51 | | "TestForumAutoOrder", "CreateForumAutoOrder", "RemoveForumAutoCartItems", |
| | 0 | 52 | | "TestFavoritPartsOrder", "CreateFavoritPartsOrder", "RemoveFavoritPartsCartItems", |
| | 0 | 53 | | "TestFavoritPartsIstraOrder", "CreateFavoritPartsIstraOrder", "RemoveFavoritPartsIstraCartItems", |
| | 0 | 54 | | "TestFavoritPartsRostovOrder", "CreateFavoritPartsRostovOrder", "RemoveFavoritPartsRostovCartItems", |
| | 0 | 55 | | "TestMoskvorechieIstraOrder", "CreateMoskvorechieIstraOrder", "RemoveMoskvorechieIstraCartItems", "ImportMoskvor |
| | 0 | 56 | | "CreateMotexOrder", "RemoveMotexCartItems", |
| | 0 | 57 | | "RemoveShateMCartItems", "CheckoutShateMCartItems", |
| | 0 | 58 | | "TestProfitLigaOrder", "CreateProfitLigaOrder", "RemoveProfitLigaCartItems", |
| | 0 | 59 | | "CreateNikeiOrder", "RemoveNikeiCartItems", |
| | 0 | 60 | | "TestMikadoCartItems", "RemoveMikadoCartItems", |
| | 0 | 61 | | "TestZZapMoscowOrder", "CreateZZapMoscowOrder", "RemoveZZapMoscowCartItems", "CancelZZapMoscowOrder", |
| | 0 | 62 | | "TestBergOrder", "CreateBergOrder", "RemoveBergCartItems" |
| | 0 | 63 | | }) |
| | | 64 | | { |
| | 0 | 65 | | config[char.ToLowerInvariant(action[0]) + action[1..]] = Url0(action); |
| | | 66 | | } |
| | 0 | 67 | | config["japartsRemove"] = "/SupplierCart/Japarts/Remove"; |
| | 0 | 68 | | config["japartsCheckout"] = "/SupplierCart/Japarts/Checkout"; |
| | | 69 | | } |
| | | 70 | | |
| | 0 | 71 | | @await Html.PartialAsync("_BsxGridShell") |
| | | 72 | | <link rel="stylesheet" href="~/css/Studio2/SupplierCart/supplier-cart.css" asp-append-version="true"/> |
| | 0 | 73 | | <script>window.supplierCartConfig = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(config));</script> |
| | | 74 | | |
| | | 75 | | <div class="container-fluid py-3 sc-page bsx-surface"> |
| | | 76 | | <section class="app-section-hero app-section-hero--import d-flex flex-wrap justify-content-between align-items-start |
| | | 77 | | <div> |
| | | 78 | | <h1><i class="fas fa-cart-shopping me-2"></i>Корзина поставщиков</h1> |
| | | 79 | | <div class="subtitle">Фактические позиции, уже добавленные в API-поставщиков</div> |
| | | 80 | | <div class="subtitle-help"> |
| | | 81 | | Здесь отображается удалённая корзина поставщика, а не временный выбор в окне проведения. |
| | | 82 | | Заказ Studio2 определяется по комментарию, который система передаёт при добавлении позиции. |
| | | 83 | | </div> |
| | | 84 | | <div class="app-section-hero__quick-links"> |
| | | 85 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="Avd"><i class="fas fa-gear"></i>А |
| | | 86 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="Armtek"><i class="fas fa-gear"></ |
| | | 87 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="ArmtekBy"><i class="fas fa-gear"> |
| | | 88 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="ShateM"><i class="fas fa-gear"></ |
| | | 89 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="Berg"><i class="fas fa-gear"></i> |
| | | 90 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="Motex"><i class="fas fa-gear"></i |
| | | 91 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="MlAuto"><i class="fas fa-gear"></ |
| | | 92 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="MlAutoRu"><i class="fas fa-gear"> |
| | | 93 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="ForumAuto"><i class="fas fa-gear" |
| | | 94 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="ForumAutoInterparts"><i class="fa |
| | | 95 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="ForumAutoPiter"><i class="fas fa- |
| | | 96 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="ForumAutoRostov"><i class="fas fa |
| | | 97 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="ForumAutoIstra"><i class="fas fa- |
| | | 98 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="FavoritParts"><i class="fas fa-ge |
| | | 99 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="FavoritPartsIstra"><i class="fas |
| | | 100 | | <a asp-area="Studio2" asp-controller="ApiSupplierSettings" asp-action="MoskvorechieIstra"><i class="fas |
| | | 101 | | </div> |
| | | 102 | | </div> |
| | | 103 | | <div class="d-flex flex-wrap gap-2 align-items-center"> |
| | | 104 | | <div class="bsx-dir-stats"> |
| | | 105 | | <span class="bsx-dir-stat">Позиций <b data-supplier-cart-total>—</b></span> |
| | | 106 | | <span class="bsx-dir-stat">Поставщиков <b data-supplier-cart-providers>—</b></span> |
| | | 107 | | </div> |
| | | 108 | | <a asp-action="Index" class="btn btn-sm btn-outline-primary sc-refresh-button"><i class="fas fa-rotate me-1" |
| | | 109 | | </div> |
| | | 110 | | </section> |
| | | 111 | | |
| | | 112 | | <nav class="sc-provider-tabs" aria-label="Поставщики"> |
| | 0 | 113 | | @foreach (var provider in SupplierCartGridRows.Providers) |
| | | 114 | | { |
| | 0 | 115 | | <a class="sc-provider-tab" asp-action="Index" asp-route-provider="@provider.Route" asp-route-supplierTab="ba |
| | | 116 | | <span class="sc-provider-logo"><img src="@logos[provider.Route]" alt="" loading="lazy"/></span> |
| | 0 | 117 | | <span class="sc-provider-name">@provider.Name</span> |
| | 0 | 118 | | <span class="sc-provider-tab-metrics" data-supplier-cart-metrics="@provider.Route" title="Позиций в корз |
| | | 119 | | <i class="fas fa-cart-shopping"></i><span data-cart-count>—</span> |
| | | 120 | | <i class="fas fa-receipt"></i><span data-order-count>—</span> |
| | | 121 | | </span> |
| | | 122 | | </a> |
| | | 123 | | } |
| | | 124 | | </nav> |
| | | 125 | | |
| | | 126 | | <div id="scProviderContent" class="sc-provider-content"></div> |
| | | 127 | | </div> |
| | | 128 | | |
| | | 129 | | <div class="modal fade" id="avdOrderConfirmModal" tabindex="-1" aria-labelledby="avdOrderConfirmModalLabel" aria-hidden= |
| | | 130 | | <div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable"> |
| | | 131 | | <div class="modal-content"> |
| | | 132 | | <div class="modal-header"><h5 class="modal-title" id="avdOrderConfirmModalLabel"><i class="fas fa-triangle-e |
| | | 133 | | <div class="modal-body"> |
| | | 134 | | <p class="mb-2">Будет создан реальный заказ в АВД. Это действие нельзя отменить в Studio2.</p> |
| | | 135 | | <div class="sc-order-confirm-totals" id="avdOrderConfirmTotals"></div> |
| | | 136 | | <div id="avdOrderConfirmGrid" class="bsx-grid bsx-grid--modal"></div> |
| | | 137 | | <label for="avdOrderComment" class="form-label mt-3">Комментарий к заказу АВД</label> |
| | | 138 | | <textarea id="avdOrderComment" class="form-control" rows="2" maxlength="500" placeholder="Необязательно" |
| | | 139 | | </div> |
| | | 140 | | <div class="modal-footer"><button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">От |
| | | 141 | | </div> |
| | | 142 | | </div> |
| | | 143 | | </div> |
| | | 144 | | |
| | | 145 | | <div class="modal fade" id="scItemsModal" tabindex="-1" aria-labelledby="scItemsModalLabel" aria-hidden="true"> |
| | | 146 | | <div class="modal-dialog modal-xl modal-dialog-centered"> |
| | | 147 | | <div class="modal-content"> |
| | | 148 | | <div class="modal-header"><h5 class="modal-title" id="scItemsModalLabel">Позиции заказа</h5><button type="bu |
| | | 149 | | <div class="modal-body"><div id="scItemsGrid" class="bsx-grid bsx-grid--modal-tall"></div></div> |
| | | 150 | | </div> |
| | | 151 | | </div> |
| | | 152 | | </div> |
| | | 153 | | |
| | | 154 | | <div class="modal fade" id="scOffersModal" tabindex="-1" aria-labelledby="scOffersModalLabel" aria-hidden="true"> |
| | | 155 | | <div class="modal-dialog modal-xl modal-dialog-centered"> |
| | | 156 | | <div class="modal-content"> |
| | | 157 | | <div class="modal-header"><h5 class="modal-title" id="scOffersModalLabel">Новая проценка</h5><button type="b |
| | | 158 | | <div class="modal-body"><p class="sc-modal-intro" id="scOffersIntro"></p><div id="scOffersGrid" class="bsx-g |
| | | 159 | | </div> |
| | | 160 | | </div> |
| | | 161 | | </div> |
| | | 162 | | |
| | | 163 | | @* Одна модалка подтверждения и одна модалка результата на всю страницу: системные alert/confirm не используются. *@ |
| | | 164 | | <div class="modal fade" id="scConfirmModal" tabindex="-1" aria-labelledby="scConfirmModalLabel" aria-hidden="true"> |
| | | 165 | | <div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="moda |
| | | 166 | | </div> |
| | | 167 | | |
| | | 168 | | <div class="modal fade" id="scResultModal" tabindex="-1" aria-labelledby="scResultModalLabel" aria-hidden="true"> |
| | | 169 | | <div class="modal-dialog modal-dialog-centered"><div class="modal-content"><div class="modal-header"><h5 class="moda |
| | | 170 | | </div> |
| | | 171 | | |
| | | 172 | | @section Scripts { |
| | | 173 | | <script src="~/js/Studio2/Grid/bsx-directory.js" asp-append-version="true"></script> |
| | | 174 | | <script src="~/js/Studio2/supplier-order-conflict.js" asp-append-version="true"></script> |
| | | 175 | | <script src="~/js/Studio2/SupplierCart/supplier-cart-ui.js" asp-append-version="true"></script> |
| | | 176 | | <script src="~/js/Studio2/SupplierCart/supplier-cart-columns.js" asp-append-version="true"></script> |
| | | 177 | | <script src="~/js/Studio2/SupplierCart/supplier-cart-page.js" asp-append-version="true"></script> |
| | | 178 | | <script src="~/js/Studio2/SupplierCart/supplier-cart-providers-avd.js" asp-append-version="true"></script> |
| | | 179 | | <script src="~/js/Studio2/SupplierCart/supplier-cart-providers-armtek-mlauto.js" asp-append-version="true"></script> |
| | | 180 | | <script src="~/js/Studio2/SupplierCart/supplier-cart-providers-forum-favorit.js" asp-append-version="true"></script> |
| | | 181 | | <script src="~/js/Studio2/SupplierCart/supplier-cart-providers-other.js" asp-append-version="true"></script> |
| | | 182 | | <script>document.addEventListener('DOMContentLoaded', function () { window.SupplierCart.start(); });</script> |
| | | 183 | | } |