| | | 1 | | @using OzonOrdersWeb.ViewModels.SupplierViewModels |
| | | 2 | | @model EditSupplierViewModel |
| | | 3 | | @{ |
| | 0 | 4 | | var model = Model!; |
| | 0 | 5 | | ViewData["Title"] = $"Редактирование — {model.Supplier?.Name ?? "поставщик"}"; |
| | 0 | 6 | | Layout = "~/Views/Shared/_Layout.cshtml"; |
| | | 7 | | } |
| | | 8 | | |
| | | 9 | | <link rel="stylesheet" href="~/css/Studio2/Supplier/supplier-form.css" asp-append-version="true"/> |
| | | 10 | | |
| | 0 | 11 | | @await Html.PartialAsync("_BsxGridShell") |
| | | 12 | | |
| | | 13 | | <div class="container sp-form-page py-3 bsx-surface"> |
| | | 14 | | <div class="back-link-row d-flex flex-wrap justify-content-between align-items-center gap-2"> |
| | | 15 | | <a asp-action="Index" class="text-primary text-decoration-none small"> |
| | | 16 | | <i class="fas fa-arrow-left me-1"></i>К списку поставщиков |
| | | 17 | | </a> |
| | 0 | 18 | | <span class="text-muted small">ID #@(model.Supplier?.Id)</span> |
| | | 19 | | </div> |
| | | 20 | | |
| | | 21 | | <div class="card"> |
| | | 22 | | <div class="card-header d-flex flex-wrap justify-content-between align-items-center gap-2"> |
| | | 23 | | <h2 class="mb-0 fs-4"> |
| | 0 | 24 | | <i class="fas fa-truck-loading me-2 text-primary"></i>@(model.Supplier?.Name) |
| | | 25 | | </h2> |
| | | 26 | | </div> |
| | | 27 | | <div class="card-body"> |
| | | 28 | | <div class="sp-intro"> |
| | | 29 | | <i class="fas fa-circle-info"></i> |
| | | 30 | | <div class="sp-intro-text"> |
| | | 31 | | Изменения применяются ко всем <strong>новым</strong> расчётам заказов с этим поставщиком. |
| | | 32 | | Коэффициенты влияют на закупку и себестоимость, ИНН — на проводки в 1С, |
| | | 33 | | CSV URL — на подгрузку остатков. Быстрые правки отдельных полей можно сделать |
| | | 34 | | прямо в <a asp-action="Index">таблице списка</a>. |
| | | 35 | | </div> |
| | | 36 | | </div> |
| | | 37 | | |
| | | 38 | | <form asp-area="Studio2" asp-controller="Supplier" asp-action="Edit" method="post"> |
| | | 39 | | <div asp-validation-summary="ModelOnly" class="alert alert-danger"></div> |
| | | 40 | | <input type="hidden" asp-for="Supplier.Id"/> |
| | | 41 | | |
| | | 42 | | <div class="row g-3"> |
| | | 43 | | <div class="section-title">Основное</div> |
| | | 44 | | |
| | | 45 | | <div class="col-md-12"> |
| | | 46 | | <label asp-for="Supplier.Name" class="form-label">Название поставщика<span class="required-mark" |
| | | 47 | | <input asp-for="Supplier.Name" class="form-control"/> |
| | | 48 | | <div class="field-hint">Отображается в заказах и фильтрах. При переименовании проверьте совпаден |
| | | 49 | | <span asp-validation-for="Supplier.Name" class="text-danger small"></span> |
| | | 50 | | </div> |
| | | 51 | | |
| | | 52 | | <div class="col-md-12"> |
| | | 53 | | <label asp-for="Supplier.INNCode" class="form-label">ИНН контрагента 1С</label> |
| | | 54 | | <div class="inn-ac-wrap"> |
| | | 55 | | <input type="text" id="innSearch" class="form-control" |
| | | 56 | | placeholder="Введите ИНН или название для поиска в 1С…" autocomplete="off"/> |
| | | 57 | | <input type="hidden" asp-for="Supplier.INNCode" id="innHidden"/> |
| | | 58 | | <div class="inn-ac-results" id="innResults"></div> |
| | | 59 | | </div> |
| | | 60 | | <div class="field-hint">Контрагент в 1С Fresh — для документов заказа/приёмки от поставщика. В с |
| | | 61 | | <span asp-validation-for="Supplier.INNCode" class="text-danger small"></span> |
| | | 62 | | </div> |
| | | 63 | | |
| | | 64 | | <div class="section-title">Цены и валюта</div> |
| | | 65 | | |
| | | 66 | | <div class="col-md-6"> |
| | | 67 | | <label asp-for="Supplier.CostFactor" class="form-label">Коэффициент себестоимости</label> |
| | | 68 | | <input asp-for="Supplier.CostFactor" class="form-control"/> |
| | | 69 | | <div class="field-hint">Множитель при конвертации закупочной цены в рубли. Должен быть > 0.</ |
| | | 70 | | <span asp-validation-for="Supplier.CostFactor" class="text-danger small"></span> |
| | | 71 | | </div> |
| | | 72 | | |
| | | 73 | | <div class="col-md-6"> |
| | | 74 | | <label asp-for="Supplier.CurrencyCode" class="form-label">Валюта закупки</label> |
| | | 75 | | <select asp-for="Supplier.CurrencyCode" class="form-select" asp-items="model.CurrencyCodes"></se |
| | | 76 | | <div class="field-hint">Валюта цены в отчёте — пересчёт по курсу ЦБ/Interparts.</div> |
| | | 77 | | <span asp-validation-for="Supplier.CurrencyCode" class="text-danger small"></span> |
| | | 78 | | </div> |
| | | 79 | | |
| | | 80 | | <div class="col-md-6"> |
| | | 81 | | <label asp-for="Supplier.WeightFactor" class="form-label">Стоимость за кг</label> |
| | | 82 | | <input asp-for="Supplier.WeightFactor" class="form-control"/> |
| | | 83 | | <div class="field-hint">Себестоимость = закупка + (вес × ставка в рублях). 0 — только закупка бе |
| | | 84 | | <span asp-validation-for="Supplier.WeightFactor" class="text-danger small"></span> |
| | | 85 | | </div> |
| | | 86 | | |
| | | 87 | | <div class="col-md-6"> |
| | | 88 | | <label asp-for="Supplier.WeightFactorCurrencyCode" class="form-label">Валюта стоимости за кг</la |
| | | 89 | | <select asp-for="Supplier.WeightFactorCurrencyCode" class="form-select" asp-items="model.Currenc |
| | | 90 | | <div class="field-hint">Валюта поля «стоимость за кг» перед пересчётом в рубли.</div> |
| | | 91 | | <span asp-validation-for="Supplier.WeightFactorCurrencyCode" class="text-danger small"></span> |
| | | 92 | | </div> |
| | | 93 | | |
| | | 94 | | <div class="section-title">Интеграции и сроки</div> |
| | | 95 | | |
| | | 96 | | <div class="col-md-12"> |
| | | 97 | | <label asp-for="Supplier.CsvUrl" class="form-label">URL CSV с остатками</label> |
| | | 98 | | <input asp-for="Supplier.CsvUrl" class="form-control" type="url" placeholder="https://…/stock.cs |
| | | 99 | | <div class="field-hint">Ссылка на CSV остатков — используется сервисом проверки наличия. Формат: |
| | | 100 | | <span asp-validation-for="Supplier.CsvUrl" class="text-danger small"></span> |
| | | 101 | | </div> |
| | | 102 | | |
| | | 103 | | <div class="col-md-8"> |
| | | 104 | | <label asp-for="Supplier.Site" class="form-label">Сайт поставщика</label> |
| | | 105 | | <input asp-for="Supplier.Site" class="form-control" type="url" placeholder="https://…"/> |
| | | 106 | | <div class="field-hint">Справочная ссылка для сотрудников.</div> |
| | | 107 | | <span asp-validation-for="Supplier.Site" class="text-danger small"></span> |
| | | 108 | | </div> |
| | | 109 | | |
| | | 110 | | <div class="col-md-4"> |
| | | 111 | | <label asp-for="Supplier.AdditionalTerm" class="form-label">Доп. срок (дней)</label> |
| | | 112 | | <input asp-for="Supplier.AdditionalTerm" class="form-control" type="number" min="0"/> |
| | | 113 | | <div class="field-hint">Добавляется к сроку из отчёта при предзаказе через SetAdditionalTerm.</d |
| | | 114 | | <span asp-validation-for="Supplier.AdditionalTerm" class="text-danger small"></span> |
| | | 115 | | </div> |
| | | 116 | | <div class="col-md-4"> |
| | | 117 | | <label asp-for="Supplier.ExpectedDeliveryHours" class="form-label">Норматив поставки (ч.)</label |
| | | 118 | | <input asp-for="Supplier.ExpectedDeliveryHours" class="form-control" type="number" min="1" place |
| | | 119 | | <div class="field-hint">По этому сроку SLA определяет просроченный приход от поставщика.</div> |
| | | 120 | | <span asp-validation-for="Supplier.ExpectedDeliveryHours" class="text-danger small"></span> |
| | | 121 | | </div> |
| | | 122 | | |
| | | 123 | | <div class="section-title">Опции</div> |
| | | 124 | | |
| | | 125 | | <div class="col-md-6"> |
| | | 126 | | <div class="option-block"> |
| | | 127 | | <div class="form-check form-switch"> |
| | | 128 | | <input asp-for="Supplier.IsVatApplicable" class="form-check-input" role="switch"/> |
| | | 129 | | <label asp-for="Supplier.IsVatApplicable" class="form-check-label fw-semibold"></label> |
| | | 130 | | </div> |
| | | 131 | | <div class="field-hint ms-0 mt-1">Поставщик работает с НДС — признак для учёта и фильтрации |
| | | 132 | | </div> |
| | | 133 | | </div> |
| | | 134 | | |
| | | 135 | | <div class="col-md-6"> |
| | | 136 | | <div class="option-block"> |
| | | 137 | | <div class="form-check form-switch"> |
| | | 138 | | <input asp-for="Supplier.IsReSeller" class="form-check-input" role="switch"/> |
| | | 139 | | <label asp-for="Supplier.IsReSeller" class="form-check-label fw-semibold"></label> |
| | | 140 | | </div> |
| | | 141 | | <div class="field-hint ms-0 mt-1">Реализатор (перепродажа) — служебный флаг, не влияет на ра |
| | | 142 | | </div> |
| | | 143 | | </div> |
| | | 144 | | </div> |
| | | 145 | | |
| | | 146 | | <div class="mt-4 d-flex flex-wrap gap-2"> |
| | | 147 | | <button type="submit" class="btn btn-primary"> |
| | | 148 | | <i class="fas fa-save me-1"></i>Сохранить |
| | | 149 | | </button> |
| | | 150 | | <a asp-action="Index" class="btn btn-outline-secondary">Отмена</a> |
| | | 151 | | </div> |
| | | 152 | | </form> |
| | | 153 | | </div> |
| | | 154 | | </div> |
| | | 155 | | </div> |
| | | 156 | | |
| | | 157 | | @section Scripts { |
| | 0 | 158 | | @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } |
| | | 159 | | <script src="~/js/inn-autocomplete.js" asp-append-version="true"></script> |
| | | 160 | | <script> |
| | | 161 | | document.addEventListener('DOMContentLoaded', function () { |
| | | 162 | | window.innAutocomplete({ |
| | | 163 | | searchInputId: 'innSearch', |
| | | 164 | | hiddenInputId: 'innHidden', |
| | | 165 | | resultsId: 'innResults', |
| | | 166 | | endpoint: '/Studio2/Supplier/SearchCounterparties' |
| | | 167 | | }); |
| | | 168 | | }); |
| | | 169 | | </script> |
| | | 170 | | } |