| | | 1 | | @using OzonOrdersWeb.Areas.Studio2.ViewModels.Grid |
| | | 2 | | @{ |
| | 0 | 3 | | var total = (int)(ViewBag.TotalCount ?? 0); |
| | 0 | 4 | | ViewData["Title"] = $"Товары ({total} шт.)"; |
| | 0 | 5 | | Layout = "~/Views/Shared/_Layout.cshtml"; |
| | | 6 | | } |
| | | 7 | | |
| | 0 | 8 | | @await Html.PartialAsync("_BsxGridShell") |
| | | 9 | | |
| | | 10 | | <div class="container-fluid py-3 bsx-surface"> |
| | | 11 | | <div class="app-section-hero app-section-hero--import d-flex flex-wrap justify-content-between align-items-start gap |
| | | 12 | | <div> |
| | | 13 | | <h1><i class="fas fa-box me-2 text-primary"></i>Товары и цены</h1> |
| | | 14 | | <div class="subtitle">Карточки товаров Ozon: SKU FBO/FBS, категория, объём, вес и текущая цена</div> |
| | | 15 | | <div class="app-section-hero__quick-links"> |
| | | 16 | | <a asp-area="Studio2" asp-controller="PriceHistory" asp-action="Index"><i class="fas fa-chart-line"></i> |
| | | 17 | | <a asp-area="Studio2" asp-controller="Manufacturers" asp-action="Index"><i class="fas fa-tag"></i>Произв |
| | | 18 | | </div> |
| | | 19 | | </div> |
| | | 20 | | <div class="d-flex flex-wrap gap-2 align-items-center"> |
| | 0 | 21 | | <div class="bsx-dir-stats"><span class="bsx-dir-stat">Всего <b>@total.ToString("N0")</b></span></div> |
| | | 22 | | <a asp-action="Create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i>Добавить</a> |
| | | 23 | | </div> |
| | | 24 | | </div> |
| | | 25 | | |
| | 0 | 26 | | @await Html.PartialAsync("_BsxDirectoryGrid", new BsxDirectoryGridViewModel("product", "Товары", "fa-box", "Поиск по |
| | 0 | 27 | | "Фильтры и сортировка — по всем товарам на сервере. Двойной клик — карточка товара.")) |
| | | 28 | | </div> |
| | | 29 | | |
| | | 30 | | @section Scripts { |
| | | 31 | | <script src="~/js/Studio2/Grid/bsx-directory.js" asp-append-version="true"></script> |
| | | 32 | | <script> |
| | | 33 | | (function () { |
| | | 34 | | const D = window.BsxDirectory; |
| | 0 | 35 | | const url = (action, id) => '@Url.Action("Index", "Products", new { area = "Studio2" })/' + action + '/' + id; |
| | | 36 | | const txt = { filter: 'agTextColumnFilter' }; |
| | | 37 | | const num = { filter: 'agNumberColumnFilter', type: 'rightAligned' }; |
| | | 38 | | const text = p => p.value || '—'; |
| | | 39 | | const dec = digits => p => p.value == null ? '—' : Number(p.value).toLocaleString('ru-RU', { maximumFractionDigi |
| | | 40 | | |
| | | 41 | | D.serverGrid({ |
| | | 42 | | key: 'dirProduct', |
| | | 43 | | prefix: 'product', |
| | | 44 | | url: '/Studio2/Products/grid', |
| | | 45 | | facetsUrl: '/Studio2/Products/grid/facets', |
| | | 46 | | rowUrl: r => url('Details', r.id), |
| | | 47 | | columnDefs: [ |
| | | 48 | | Object.assign({ field: 'article', headerName: 'Артикул', width: 200, pinned: 'left', cellClass: 'fw-semi |
| | | 49 | | Object.assign({ field: 'ozonProductId', headerName: 'Ozon Product ID', width: 150, valueFormatter: text |
| | | 50 | | Object.assign({ field: 'fboOzonSkuId', headerName: 'SKU FBO', width: 140, valueFormatter: text }, txt), |
| | | 51 | | Object.assign({ field: 'fbsOzonSkuId', headerName: 'SKU FBS', width: 140, valueFormatter: text }, txt), |
| | | 52 | | D.setCol({ field: 'commercialCategory', headerName: 'Коммерческая категория', flex: 1, minWidth: 220, |
| | | 53 | | filterParams: { facets: true, labels: { '': '(не задана)' } }, valueFormatter: text }), |
| | | 54 | | Object.assign({ field: 'barcode', headerName: 'Штрихкод', width: 150, hide: true, valueFormatter: text } |
| | | 55 | | Object.assign({ field: 'volume', headerName: 'Объём, л', width: 110, valueFormatter: dec(3) }, num), |
| | | 56 | | Object.assign({ field: 'volumetricWeight', headerName: 'Объёмный вес, кг', width: 140, valueFormatter: d |
| | | 57 | | Object.assign({ field: 'weight', headerName: 'Вес, кг', width: 110, hide: true, valueFormatter: dec(3) } |
| | | 58 | | Object.assign({ field: 'currentPriceWithDiscount', headerName: 'Цена со скидкой, ₽', width: 150, valueFo |
| | | 59 | | Object.assign({ field: 'replacementArticle', headerName: 'Замена', headerTooltip: 'Артикул товара-замены |
| | | 60 | | Object.assign({ field: 'id', headerName: 'ID', width: 100, hide: true }, num), |
| | | 61 | | D.actionsCol(r => [ |
| | | 62 | | { icon: 'fa-pencil-alt', title: 'Изменить', href: url('Edit', r.id) }, |
| | | 63 | | { icon: 'fa-eye', title: 'Карточка', kind: 'view', href: url('Details', r.id) }, |
| | | 64 | | { icon: 'fa-trash', title: 'Удалить', kind: 'danger', href: url('Delete', r.id) } |
| | | 65 | | ], { width: 130 }) |
| | | 66 | | ] |
| | | 67 | | }); |
| | | 68 | | })(); |
| | | 69 | | </script> |
| | | 70 | | } |