edit.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="px-3">
  4. <div class="">
  5. <form action="{{ ($product) ? route('catalog.update', $product) : route('catalog.store') }}" method="post">
  6. @csrf
  7. <div class="row">
  8. <div class="col-xl-6">
  9. @include('partials.input', ['name' => 'article', 'title' => 'Артикул', 'required' => true, 'value' => $product->article ?? ''])
  10. @include('partials.input', ['name' => 'nomenclature_number', 'title' => 'Номер номенклатуры', 'required' => true, 'value' => $product->nomenclature_number ?? ''])
  11. @include('partials.input', ['name' => 'name_tz', 'title' => 'Наименование по ТЗ', 'required' => true, 'value' => $product->name_tz ?? ''])
  12. @include('partials.input', ['name' => 'type_tz', 'title' => 'Тип по ТЗ', 'required' => true, 'value' => $product->type_tz ?? ''])
  13. @include('partials.input', ['name' => 'unit', 'title' => 'Ед. изм.', 'required' => true, 'value' => $product->unit ?? ''])
  14. @include('partials.input', ['name' => 'manufacturer', 'title' => 'Производитель', 'required' => true, 'value' => $product->manufacturer ?? ''])
  15. @include('partials.input', ['name' => 'type', 'title' => 'Тип', 'required' => true, 'value' => $product->type ?? ''])
  16. @include('partials.input', ['name' => 'manufacturer_name', 'title' => 'Наименование производителя', 'required' => true, 'value' => $product->manufacturer_name ?? ''])
  17. @include('partials.input', ['name' => 'sizes', 'title' => 'Размеры', 'required' => true, 'value' => $product->sizes ?? ''])
  18. @include('partials.input', ['name' => 'product_price', 'type' => 'number', 'title' => 'Цена товара', 'required' => true, 'value' => $product->product_price ?? ''])
  19. @include('partials.input', ['name' => 'installation_price', 'type' => 'number', 'title' => 'Цена установки', 'required' => true, 'value' => $product->installation_price ?? ''])
  20. @include('partials.input', ['name' => 'total_price', 'type' => 'number', 'title' => 'Итоговая цена', 'required' => true, 'value' => $product->total_price ?? ''])
  21. </div>
  22. <div class="col-xl-6">
  23. <div class="row mb-2">
  24. <label for="note" class="col-form-label my-1">
  25. Примечание <sup>*</sup>
  26. </label>
  27. <div>
  28. <textarea name="note" id="note" rows="15" class="form-control @error('note') is-invalid @enderror" required>{{ old('note', $product->note ?? '') }}</textarea>
  29. @error('note')
  30. <span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
  31. @enderror
  32. </div>
  33. </div>
  34. </div>
  35. <div class="col-12">
  36. @include('partials.submit', ['deleteDisabled' => (!isset($product)), 'offset' => 6, 'delete' => ['form_id' => 'deleteProduct']])
  37. </div>
  38. </div>
  39. </form>
  40. @if($product)
  41. <div class="visually-hidden">
  42. <form action="{{ route('catalog.delete', $product) }}" method="POST" id="deleteProduct">
  43. @csrf
  44. @method('DELETE')
  45. </form>
  46. </div>
  47. @endif
  48. </div>
  49. </div>
  50. @if($errors->any())
  51. @dump($errors)
  52. @endif
  53. @endsection