| | | 1 | | @using OzonOrdersWeb.Areas.Studio2.ViewHelpers |
| | | 2 | | @model OzonOrdersWeb.ViewModels.OrderViewModels.MultiplayEditOrderViewModel |
| | | 3 | | @{ |
| | 0 | 4 | | var fieldMap = Model.OrderListFieldReadAccess; |
| | 0 | 5 | | bool Col(string fieldName) => fieldMap == null || fieldMap.GetValueOrDefault(fieldName, true); |
| | | 6 | | } |
| | | 7 | | |
| | | 8 | | |
| | | 9 | | <thead> |
| | | 10 | | <tr> |
| | 0 | 11 | | @if (Col("ShipmentNumber")) |
| | | 12 | | { |
| | | 13 | | <th id="thShipmentNumber" data-column="shipmentNumber"> |
| | | 14 | | <div class="two-row-cell"> |
| | | 15 | | <div id="thShipmentNumberSort" class="cell-row"> |
| | | 16 | | <small>Номер заказа</small> |
| | | 17 | | <input id="shipmentNumberFilter" class="form-control form-control-sm" readonly data-tx-locked title= |
| | | 18 | | </div> |
| | | 19 | | <div id="thDeliverySort" class="cell-row text-muted"> |
| | | 20 | | <small>Доставка</small> |
| | | 21 | | <input id="deliveryFilter" class="form-control form-control-sm" autocomplete="off" readonly data-tx- |
| | | 22 | | </div> |
| | | 23 | | </div> |
| | | 24 | | </th> |
| | | 25 | | } |
| | | 26 | | <th data-column="client"> |
| | | 27 | | <div class="two-row-cell"> |
| | 0 | 28 | | @if (Col("OzonClient")) |
| | | 29 | | { |
| | | 30 | | <div id="thOzonClient" class="cell-row"> |
| | | 31 | | <small>Клиент</small> |
| | | 32 | | <input id="ozonClientFilterInput" class="form-control form-control-sm" autocomplete="off" readonly data- |
| | | 33 | | </div> |
| | | 34 | | } |
| | 0 | 35 | | @if (Col("DeliveryCity")) |
| | | 36 | | { |
| | | 37 | | <div id="thDeliveryCity" class="text-muted cell-row"> |
| | | 38 | | <small>Город</small> |
| | | 39 | | <input id="deliveryCityFilter" class="form-control form-control-sm" readonly data-tx-locked title="Поле |
| | | 40 | | </div> |
| | | 41 | | } |
| | | 42 | | </div> |
| | | 43 | | </th> |
| | | 44 | | <th data-column="dates"> |
| | | 45 | | <div class="two-row-cell"> |
| | 0 | 46 | | @if (Col("ProcessingDate")) |
| | | 47 | | { |
| | | 48 | | <div id="thProcessingDate" class="cell-row"> |
| | | 49 | | <small>Принят</small> |
| | | 50 | | <input id="processingDateFilter" class="form-control form-control-sm" type="date" readonly data-tx-locke |
| | | 51 | | </div> |
| | | 52 | | } |
| | 0 | 53 | | @if (Col("ShippingDate")) |
| | | 54 | | { |
| | | 55 | | <div id="thShippingDate" class="text-muted cell-row"> |
| | | 56 | | <small>Дата отгр.</small> |
| | | 57 | | <input id="shippingDateFilter" class="form-control form-control-sm" type="date" readonly data-tx-locked |
| | | 58 | | </div> |
| | | 59 | | } |
| | | 60 | | </div> |
| | | 61 | | </th> |
| | | 62 | | |
| | | 63 | | <th data-column="period"> |
| | | 64 | | <div class="two-row-cell"> |
| | 0 | 65 | | @if (Col("DeliveryPeriod")) |
| | | 66 | | { |
| | | 67 | | <div id="thDeliveryPeriod" class="cell-row"> |
| | | 68 | | <small>Срок</small> |
| | | 69 | | <input id="deliveryPeriodInput" class="form-control form-control-sm" type="text" placeholder="1 д. 1 ч." |
| | | 70 | | </div> |
| | | 71 | | } |
| | 0 | 72 | | @if (Col("DeliveryPeriod")) |
| | | 73 | | { |
| | | 74 | | <div id="thTimeLeft" class="text-muted cell-row"> |
| | | 75 | | <small>Остал.</small> |
| | | 76 | | <input id="timeLeftDayInput" class="form-control form-control-sm" type="number" placeholder="1 д." reado |
| | | 77 | | </div> |
| | | 78 | | } |
| | | 79 | | </div> |
| | | 80 | | </th> |
| | | 81 | | |
| | | 82 | | <th class="orders-product-col" data-column="productInfo"> |
| | | 83 | | <div class="two-row-cell w-100"> |
| | | 84 | | <div class="cell-row orders-product-head-row1"> |
| | | 85 | | <div id="thArticle" class="orders-product-pair"> |
| | | 86 | | <small>Key</small> |
| | | 87 | | <input id="articleFilter" type="text" class="form-control form-control-sm" readonly data-tx-locked t |
| | | 88 | | </div> |
| | | 89 | | <div id="thManufacturer" class="orders-product-pair orders-product-pair-center"> |
| | | 90 | | <small>Производитель</small> |
| | | 91 | | <input id="manufacturerFilter" type="text" class="form-control form-control-sm" readonly data-tx-loc |
| | | 92 | | </div> |
| | | 93 | | <div id="thArticle2" class="orders-product-pair orders-product-pair-end"> |
| | | 94 | | <small>Код товара</small> |
| | | 95 | | <input id="articleFilter2" type="text" class="form-control form-control-sm" readonly data-tx-locked |
| | | 96 | | </div> |
| | | 97 | | </div> |
| | | 98 | | <div id="thProductName" class="cell-row text-muted"> |
| | | 99 | | <small>Наименование товара</small> |
| | | 100 | | <input id="productNameFilter" type="text" class="form-control form-control-sm" readonly data-tx-locked t |
| | | 101 | | </div> |
| | | 102 | | </div> |
| | | 103 | | </th> |
| | | 104 | | |
| | | 105 | | <th class="permanent-col actions-col-head" data-column="actionsCol"> |
| | | 106 | | <span class="visually-hidden">Действия</span> |
| | | 107 | | </th> |
| | | 108 | | |
| | | 109 | | <th class="status-column-head" data-column="status"> |
| | | 110 | | <div class="two-row-cell px-1"> |
| | 0 | 111 | | @if (Col("ClientStatus")) |
| | | 112 | | { |
| | | 113 | | <div id="thStatusOzon" class="cell-row"> |
| | | 114 | | <small>Статус клиента</small> |
| | | 115 | | <input id="statusFilter" class="form-control form-control-sm statusFilter" style="width: 100%;" auto |
| | | 116 | | </div> |
| | | 117 | | } |
| | 0 | 118 | | @if (Col("AppStatus")) |
| | | 119 | | { |
| | | 120 | | <div id="thStatus" class="text-muted cell-row tx-bulk-row"> |
| | | 121 | | <small><span>Статус</span><span class="tx-bulk-hint" title="Значение применяется ко всем строкам док |
| | | 122 | | <div class="position-relative w-100"> |
| | | 123 | | <select class="form-control form-control-sm status-select custom-select-init" id="statusSelect" data |
| | | 124 | | onchange="handleStatusSelectChange(this)"> |
| | | 125 | | <option value="">Выберите значение</option> |
| | 0 | 126 | | @if (ViewBag.AppStatuses is IEnumerable<SelectListItem> appStatuses) |
| | | 127 | | { |
| | 0 | 128 | | foreach (var status in appStatuses) |
| | | 129 | | { |
| | 0 | 130 | | var color = ViewBag.StatusColors != null |
| | 0 | 131 | | ? ViewBag.StatusColors[status.Value] as string |
| | 0 | 132 | | : "#ffffff"; |
| | 0 | 133 | | <option value="@status.Value" data-color="@color" |
| | | 134 | | style="background-color: @color; color: @StatusColorContrast.GetTextColor(color) |
| | 0 | 135 | | @status.Text |
| | | 136 | | </option> |
| | | 137 | | } |
| | | 138 | | } |
| | | 139 | | <option value="create" class="link-option">Создать статус</option> |
| | | 140 | | </select> |
| | | 141 | | </div> |
| | | 142 | | </div> |
| | | 143 | | } |
| | | 144 | | </div> |
| | | 145 | | </th> |
| | | 146 | | |
| | | 147 | | <th data-column="warehouse"> |
| | | 148 | | <div class="two-row-cell"> |
| | 0 | 149 | | @if (Col("ShipmentWarehouse")) |
| | | 150 | | { |
| | 0 | 151 | | @if (ViewBag.ShowWarehouseSelect == true) |
| | | 152 | | { |
| | | 153 | | <div id="thShipmentWarehouse" class="cell-row tx-bulk-row"> |
| | | 154 | | <small><span>Склад отгрузки</span><span class="tx-bulk-hint" title="Значение применяется ко всем стр |
| | | 155 | | <div class="position-relative w-100"> |
| | | 156 | | <select class="form-control form-control-sm universalSelect custom-select-init" id="universalWarehou |
| | | 157 | | onchange="handleWarehouseSelectChange(this)"> |
| | | 158 | | <option value="">Выберите значение</option> |
| | 0 | 159 | | @foreach (var warehouse in Model.Warehouses) |
| | | 160 | | { |
| | 0 | 161 | | <option value="@warehouse.Id">@warehouse.Name</option> |
| | | 162 | | } |
| | | 163 | | </select> |
| | | 164 | | </div> |
| | | 165 | | </div> |
| | | 166 | | |
| | | 167 | | <script> |
| | | 168 | | function handleWarehouseSelectChange(selectElement) { |
| | | 169 | | if (!selectElement) return; |
| | | 170 | | var warehouseId = selectElement.value; |
| | | 171 | | if (!warehouseId) return; |
| | | 172 | | document.querySelectorAll('.warehouse-select').forEach(function (warehouseSelect) { |
| | | 173 | | if (warehouseSelect) { |
| | | 174 | | warehouseSelect.value = warehouseId; |
| | | 175 | | warehouseSelect.dispatchEvent(new Event('change')); |
| | | 176 | | } |
| | | 177 | | }); |
| | | 178 | | } |
| | | 179 | | </script> |
| | | 180 | | } |
| | | 181 | | else |
| | | 182 | | { |
| | | 183 | | <div id="thShipmentWarehouse" class="cell-row"> |
| | | 184 | | <small>Склад отгрузки</small> |
| | | 185 | | <input id="shipmentWarehouseFilter" class="form-control form-control-sm" autocomplete="off" style="w |
| | | 186 | | </div> |
| | | 187 | | } |
| | | 188 | | } |
| | 0 | 189 | | @if (Col("ShipmentWarehouse")) |
| | | 190 | | { |
| | | 191 | | <div id="thZasylBulk" class="cell-row text-muted tx-bulk-row"> |
| | | 192 | | <small><span>Засыл</span><span class="tx-bulk-hint" title="Значение применяется ко всем строкам документ |
| | | 193 | | <div class="position-relative w-100"> |
| | | 194 | | <select class="form-control form-control-sm universalSelect custom-select-init" id="universalZasylSe |
| | | 195 | | onchange="handleZasylSelectChange(this)"> |
| | | 196 | | <option value="">Выберите значение</option> |
| | 0 | 197 | | @foreach (var warehouse in Model.Warehouses) |
| | | 198 | | { |
| | 0 | 199 | | <option value="@warehouse.Name">@warehouse.Name</option> |
| | | 200 | | } |
| | | 201 | | </select> |
| | | 202 | | </div> |
| | | 203 | | </div> |
| | | 204 | | |
| | | 205 | | <script> |
| | | 206 | | function handleZasylSelectChange(selectElement) { |
| | | 207 | | if (!selectElement) return; |
| | | 208 | | var zasylName = selectElement.value; |
| | | 209 | | if (!zasylName) return; |
| | | 210 | | document.querySelectorAll('.zasyl-input').forEach(function (zasylInput) { |
| | | 211 | | if (!zasylInput || zasylInput.disabled || zasylInput.readOnly) return; |
| | | 212 | | // Скрытые поля (LostByCommissioner, нулевые строки OrderedToSeller) массово не заполняем. |
| | | 213 | | if (zasylInput.offsetParent === null) return; |
| | | 214 | | if (zasylInput.value === zasylName) return; |
| | | 215 | | zasylInput.value = zasylName; |
| | | 216 | | // Только change: событие input открыло бы выпадающий список Combobox у каждой строки. |
| | | 217 | | zasylInput.dispatchEvent(new Event('change', { bubbles: true })); |
| | | 218 | | }); |
| | | 219 | | } |
| | | 220 | | </script> |
| | | 221 | | } |
| | | 222 | | </div> |
| | | 223 | | </th> |
| | | 224 | | |
| | | 225 | | <th data-column="supplier"> |
| | | 226 | | <div class="two-row-cell"> |
| | 0 | 227 | | @if (Col("Supplier")) |
| | | 228 | | { |
| | | 229 | | <div id="thSupplier" class="cell-row tx-bulk-row"> |
| | | 230 | | <small><span>Поставщик</span><span class="tx-bulk-hint" title="Значение применяется ко всем строкам |
| | | 231 | | <div class="position-relative w-100"> |
| | | 232 | | <select class="form-control form-control-sm universalSelect custom-select-init" id="universalSel |
| | | 233 | | onchange="handleSelectChange(this)"> |
| | | 234 | | <option value="">Выберите значение</option> |
| | 0 | 235 | | @foreach (var supplier in Model.Suppliers) |
| | | 236 | | { |
| | 0 | 237 | | <option value="@supplier.Id" data-currency-code="@supplier.CurrencyCode" |
| | 0 | 238 | | data-cost-factor="@supplier.CostFactor"> |
| | 0 | 239 | | @supplier.Name - @supplier.CurrencyCode |
| | | 240 | | </option> |
| | | 241 | | } |
| | 0 | 242 | | <option value="create" class="link-option" data-url="@Url.Action("Create", "Supplier")"> |
| | | 243 | | Создать поставщика |
| | | 244 | | </option> |
| | | 245 | | </select> |
| | | 246 | | </div> |
| | | 247 | | </div> |
| | | 248 | | |
| | | 249 | | <script> |
| | | 250 | | function handleSelectChange(selectElement) { |
| | | 251 | | if (!selectElement) return; |
| | | 252 | | if (selectElement.value === "create") { |
| | 0 | 253 | | window.location.href = '@Url.Action("Create", "Supplier")'; |
| | | 254 | | return; |
| | | 255 | | } |
| | | 256 | | if (!selectElement.options || selectElement.selectedIndex < 0) return; |
| | | 257 | | var selectedOption = selectElement.options[selectElement.selectedIndex]; |
| | | 258 | | if (!selectedOption) return; |
| | | 259 | | var supplierId = selectedOption.value; |
| | | 260 | | if (!supplierId) return; |
| | | 261 | | var currencyCode = selectedOption.getAttribute('data-currency-code') || ''; |
| | | 262 | | document.querySelectorAll('.supplier-select').forEach(function (supplierSelect) { |
| | | 263 | | if (supplierSelect) { |
| | | 264 | | supplierSelect.value = supplierId; |
| | | 265 | | supplierSelect.dispatchEvent(new Event('change')); |
| | | 266 | | var currencySpan = supplierSelect.closest('td')?.querySelector('.currency-code'); |
| | | 267 | | if (currencySpan) currencySpan.textContent = currencyCode || ''; |
| | | 268 | | } |
| | | 269 | | }); |
| | | 270 | | } |
| | | 271 | | </script> |
| | | 272 | | } |
| | | 273 | | |
| | 0 | 274 | | @if (Col("SupplierOrderNumber")) |
| | | 275 | | { |
| | | 276 | | <div id="thOrderNumberToSupplierSort" class="text-muted cell-row tx-bulk-row" |
| | | 277 | | title="Номер заказа поставщику"> |
| | | 278 | | <small><span>Номер зак. п.</span><span class="tx-bulk-hint" title="Значение применяется ко всем стро |
| | | 279 | | <input type="text" class="form-control form-control-sm universalOrderNumberToSupplie" |
| | | 280 | | id="universalOrderNumberToSupplier" data-tx-bulk title="Введённый номер будет проставлен во в |
| | | 281 | | placeholder="Номер зак. п."/> |
| | | 282 | | </div> |
| | | 283 | | } |
| | | 284 | | </div> |
| | | 285 | | </th> |
| | | 286 | | |
| | | 287 | | <th data-column="category"> |
| | | 288 | | <div class="two-row-cell"> |
| | 0 | 289 | | @if (Col("Category")) |
| | | 290 | | { |
| | | 291 | | <div id="thCategory" class="cell-row"> |
| | | 292 | | <small>Категория</small> |
| | | 293 | | <input id="commercialCategoryFilter" class="form-control form-control-sm" readonly data-tx-locked ti |
| | | 294 | | </div> |
| | | 295 | | } |
| | 0 | 296 | | @if (Col("VolumeWeight")) |
| | | 297 | | { |
| | | 298 | | <div id="thVolume" class="text-muted cell-row"> |
| | | 299 | | <small>Вес V</small> |
| | | 300 | | <input id="volumetricWeightFilter" class="form-control form-control-sm" readonly data-tx-locked titl |
| | | 301 | | </div> |
| | | 302 | | } |
| | | 303 | | </div> |
| | | 304 | | </th> |
| | | 305 | | |
| | | 306 | | <th data-column="sitePrice"> |
| | | 307 | | <div class="two-row-cell"> |
| | 0 | 308 | | @if (Col("SitePrice")) |
| | | 309 | | { |
| | | 310 | | <div id="thPurchasePrice" class="cell-row"> |
| | | 311 | | <small>Цена с.</small> |
| | | 312 | | <input id="currentPriceWithDiscountFilter" class="form-control form-control-sm" readonly data-tx-locked |
| | | 313 | | </div> |
| | | 314 | | } |
| | 0 | 315 | | @if (Col("Quantity")) |
| | | 316 | | { |
| | | 317 | | <div id="thQuantity" class="text-muted cell-row"> |
| | | 318 | | <small>Кол.</small> |
| | | 319 | | <input id="quantityFilter" class="form-control form-control-sm" readonly data-tx-locked title="Поле недо |
| | | 320 | | </div> |
| | | 321 | | } |
| | | 322 | | </div> |
| | | 323 | | </th> |
| | | 324 | | |
| | | 325 | | <th data-column="price"> |
| | | 326 | | <div class="two-row-cell"> |
| | 0 | 327 | | @if (Col("Price")) |
| | | 328 | | { |
| | | 329 | | <div id="thPrice" class="cell-row"> |
| | | 330 | | <small>Цена</small> |
| | | 331 | | <input id="priceFilter" class="form-control form-control-sm" readonly data-tx-locked title="Поле недосту |
| | | 332 | | </div> |
| | | 333 | | } |
| | 0 | 334 | | @if (Col("ShipmentTotal")) |
| | | 335 | | { |
| | | 336 | | <div id="thShipmentAmount" class="text-muted cell-row"> |
| | | 337 | | <small>Сумма о.</small> |
| | | 338 | | <input id="shipmentAmountFilter" class="form-control form-control-sm" readonly data-tx-locked title="Пол |
| | | 339 | | </div> |
| | | 340 | | } |
| | | 341 | | </div> |
| | | 342 | | </th> |
| | | 343 | | |
| | | 344 | | <th data-column="purchasePrice"> |
| | | 345 | | <div class="two-row-cell"> |
| | 0 | 346 | | @if (Col("PurchasePrice")) |
| | | 347 | | { |
| | | 348 | | <div id="thCurrentPrice" class="cell-row"> |
| | | 349 | | <small>Цена заку.</small> |
| | | 350 | | <input id="purchasePriceFilter" class="form-control form-control-sm" readonly data-tx-locked title="Поле |
| | | 351 | | </div> |
| | | 352 | | } |
| | 0 | 353 | | @if (Col("Cost")) |
| | | 354 | | { |
| | | 355 | | <div id="thCostPrice" class="text-muted cell-row"> |
| | | 356 | | <small>Себест.</small> |
| | | 357 | | <input id="costPriceFilter" class="form-control form-control-sm" readonly data-tx-locked title="Поле нед |
| | | 358 | | </div> |
| | | 359 | | } |
| | | 360 | | </div> |
| | | 361 | | </th> |
| | | 362 | | |
| | | 363 | | <th id="thExtraExpenses" data-column="extraExpenses" style="display: none;"> |
| | | 364 | | <div class="two-row-cell"> |
| | | 365 | | <small>Доп. расходы</small> |
| | | 366 | | </div> |
| | | 367 | | </th> |
| | | 368 | | |
| | 0 | 369 | | @if (Col("OzonCommission")) |
| | | 370 | | { |
| | | 371 | | <th id="thOzonCommission" data-column="commission" class="tx-metric-col"> |
| | | 372 | | <div class="two-row-cell"> |
| | | 373 | | <div class="cell-row"> |
| | | 374 | | <small>Комис.</small> |
| | | 375 | | <input id="ozonCommissionFilter" class="form-control form-control-sm" readonly data-tx-locked title= |
| | | 376 | | </div> |
| | | 377 | | <div class="text-muted cell-row tx-metric-hint"> |
| | | 378 | | <small>min / max</small> |
| | | 379 | | </div> |
| | | 380 | | </div> |
| | | 381 | | </th> |
| | | 382 | | } |
| | 0 | 383 | | @if (Col("Profit")) |
| | | 384 | | { |
| | | 385 | | <th id="thProfit" data-column="profit" class="tx-metric-col"> |
| | | 386 | | <div class="two-row-cell"> |
| | | 387 | | <div class="cell-row"> |
| | | 388 | | <small>Приб.</small> |
| | | 389 | | <input id="profitFilter" class="form-control form-control-sm" readonly data-tx-locked title="Поле не |
| | | 390 | | </div> |
| | | 391 | | <div class="text-muted cell-row tx-metric-hint"> |
| | | 392 | | <small>min / max</small> |
| | | 393 | | </div> |
| | | 394 | | </div> |
| | | 395 | | </th> |
| | | 396 | | } |
| | 0 | 397 | | @if (Col("MarkupPercent")) |
| | | 398 | | { |
| | | 399 | | <th id="thDiscount" data-column="markup" class="tx-metric-col"> |
| | | 400 | | <div class="two-row-cell"> |
| | | 401 | | <div class="cell-row"> |
| | | 402 | | <small>Нацен.%</small> |
| | | 403 | | <input id="discountFilter" class="form-control form-control-sm" readonly data-tx-locked title="Поле |
| | | 404 | | </div> |
| | | 405 | | <div class="text-muted cell-row tx-metric-hint"> |
| | | 406 | | <small>min / max</small> |
| | | 407 | | </div> |
| | | 408 | | </div> |
| | | 409 | | </th> |
| | | 410 | | } |
| | | 411 | | </tr> |
| | | 412 | | </thead> |