|
|
@@ -7,7 +7,7 @@
|
|
|
<h3>МАФ {{ $product->common_name ?? 'Новый МАФ' }}</h3>
|
|
|
</div>
|
|
|
<div class="col-6 text-end">
|
|
|
- @if(isset($product))
|
|
|
+ @if(isset($product) && hasRole('admin'))
|
|
|
<button class="btn btn-sm text-success" onclick="$('#upl-cert').trigger('click');"><i class="bi bi-plus-circle-fill"></i> Загрузить сертификат</button>
|
|
|
|
|
|
<form action="{{ route('catalog.upload-certificate', ['product' => $product, 'previous_url' => $previous_url ?? '']) }}" class="visually-hidden" method="POST" enctype="multipart/form-data">
|
|
|
@@ -24,42 +24,43 @@
|
|
|
@csrf
|
|
|
<div class="row">
|
|
|
<div class="col-xl-6">
|
|
|
- @include('partials.input', ['name' => 'article', 'title' => 'Артикул', 'required' => true, 'value' => $product->article ?? ''])
|
|
|
- @include('partials.input', ['name' => 'nomenclature_number', 'title' => 'Номер номенклатуры', 'required' => true, 'value' => $product->nomenclature_number ?? ''])
|
|
|
- @include('partials.input', ['name' => 'name_tz', 'title' => 'Наименование по ТЗ', 'required' => true, 'value' => $product->name_tz ?? ''])
|
|
|
- @include('partials.input', ['name' => 'type_tz', 'title' => 'Тип по ТЗ', 'required' => true, 'value' => $product->type_tz ?? ''])
|
|
|
- @include('partials.input', ['name' => 'unit', 'title' => 'Ед. изм.', 'required' => true, 'value' => $product->unit ?? ''])
|
|
|
- @include('partials.input', ['name' => 'manufacturer', 'title' => 'Производитель', 'required' => true, 'value' => $product->manufacturer ?? ''])
|
|
|
- @include('partials.input', ['name' => 'type', 'title' => 'Тип', 'required' => true, 'value' => $product->type ?? ''])
|
|
|
- @include('partials.input', ['name' => 'manufacturer_name', 'title' => 'Наименование производителя', 'required' => true, 'value' => $product->manufacturer_name ?? ''])
|
|
|
- @include('partials.input', ['name' => 'sizes', 'title' => 'Размеры', 'required' => true, 'value' => $product->sizes ?? ''])
|
|
|
- @include('partials.input', ['name' => 'product_price', 'type' => 'number', 'title' => 'Цена товара', 'required' => true, 'value' => $product->product_price ?? ''])
|
|
|
- @include('partials.input', ['name' => 'installation_price', 'type' => 'number', 'title' => 'Цена установки', 'required' => true, 'value' => $product->installation_price ?? ''])
|
|
|
- @include('partials.input', ['name' => 'total_price', 'type' => 'number', 'title' => 'Итоговая цена', 'required' => true, 'value' => $product->total_price ?? ''])
|
|
|
- @include('partials.input', ['name' => 'passport_name', 'title' => 'Наименование по паспорту', 'value' => $product->passport_name ?? ''])
|
|
|
- @include('partials.input', ['name' => 'statement_name', 'title' => 'Наименование в ведомости', 'value' => $product->statement_name ?? ''])
|
|
|
+ @include('partials.input', ['name' => 'article', 'title' => 'Артикул', 'required' => true, 'value' => $product->article ?? '', 'disabled' => !hasRole('admin'), 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'nomenclature_number', 'title' => 'Номер номенклатуры', 'required' => true, 'value' => $product->nomenclature_number ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'name_tz', 'title' => 'Наименование по ТЗ', 'required' => true, 'value' => $product->name_tz ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'type_tz', 'title' => 'Тип по ТЗ', 'required' => true, 'value' => $product->type_tz ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'unit', 'title' => 'Ед. изм.', 'required' => true, 'value' => $product->unit ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'manufacturer', 'title' => 'Производитель', 'required' => true, 'value' => $product->manufacturer ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'type', 'title' => 'Тип', 'required' => true, 'value' => $product->type ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'manufacturer_name', 'title' => 'Наименование производителя', 'required' => true, 'value' => $product->manufacturer_name ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'sizes', 'title' => 'Размеры', 'required' => true, 'value' => $product->sizes ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'product_price', 'type' => 'number', 'title' => 'Цена товара', 'required' => true, 'value' => $product->product_price ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'installation_price', 'type' => 'number', 'title' => 'Цена установки', 'required' => true, 'value' => $product->installation_price ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'total_price', 'type' => 'number', 'title' => 'Итоговая цена', 'required' => true, 'value' => $product->total_price ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'passport_name', 'title' => 'Наименование по паспорту', 'value' => $product->passport_name ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'statement_name', 'title' => 'Наименование в ведомости', 'value' => $product->statement_name ?? '', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'service_life', 'title' => 'Срок службы', 'type' => 'number', 'value' => $product?->service_life, 'disabled' => !hasRole('admin')])
|
|
|
+
|
|
|
<input type="hidden" name="previous_url" value="{{ $previous_url ?? '' }}">
|
|
|
</div>
|
|
|
<div class="col-xl-6">
|
|
|
- @if($product->certificate)
|
|
|
+ @if($product?->certificate)
|
|
|
@include('partials.input', ['name' => 'cert', 'title' => 'Сертификат', 'value' => $product->certificate->original_name, 'disabled' => true])
|
|
|
@endif
|
|
|
|
|
|
- @include('partials.input', ['name' => 'service_life', 'title' => 'Срок службы', 'type' => 'number', 'value' => $product->service_life])
|
|
|
- @include('partials.input', ['name' => 'certificate_number', 'title' => 'Номер сертификата', 'value' => $product->certificate_number])
|
|
|
- @include('partials.input', ['name' => 'certificate_date', 'title' => 'Дата сертификата', 'type' => 'date', 'value' => $product->certificate_date])
|
|
|
- @include('partials.input', ['name' => 'certificate_issuer', 'title' => 'Орган сертификации', 'value' => $product->certificate_issuer])
|
|
|
- @include('partials.input', ['name' => 'certificate_type', 'title' => 'Вид сертификации', 'value' => $product->certificate_type])
|
|
|
- @include('partials.input', ['name' => 'weight', 'title' => 'Вес', 'value' => $product->weight, 'type' => 'number', 'step' => '0.01'])
|
|
|
- @include('partials.input', ['name' => 'volume', 'title' => 'Объём', 'value' => $product->volume, 'type' => 'number', 'step' => '0.01'])
|
|
|
- @include('partials.input', ['name' => 'places', 'title' => 'Кол-во мест', 'value' => $product->places, 'type' => 'number', 'step' => '1'])
|
|
|
+ @include('partials.input', ['name' => 'certificate_number', 'title' => 'Номер сертификата', 'value' => $product?->certificate_number, 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'certificate_date', 'title' => 'Дата сертификата', 'type' => 'date', 'value' => $product?->certificate_date, 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'certificate_issuer', 'title' => 'Орган сертификации', 'value' => $product?->certificate_issuer, 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'certificate_type', 'title' => 'Вид сертификации', 'value' => $product?->certificate_type, 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'weight', 'title' => 'Вес', 'value' => $product?->weight, 'type' => 'number', 'step' => '0.01', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'volume', 'title' => 'Объём', 'value' => $product?->volume, 'type' => 'number', 'step' => '0.01', 'disabled' => !hasRole('admin')])
|
|
|
+ @include('partials.input', ['name' => 'places', 'title' => 'Кол-во мест', 'value' => $product?->places, 'type' => 'number', 'step' => '1', 'disabled' => !hasRole('admin')])
|
|
|
|
|
|
<div class="row mb-2">
|
|
|
<label for="note" class="col-form-label my-1">
|
|
|
Примечание <sup>*</sup>
|
|
|
</label>
|
|
|
<div>
|
|
|
- <textarea name="note" id="note" rows="15" class="form-control @error('note') is-invalid @enderror" required>{{ old('note', $product->note ?? '') }}</textarea>
|
|
|
+ <textarea name="note" id="note" rows="15" @disabled(!hasRole('admin')) class="form-control @error('note') is-invalid @enderror" required>{{ old('note', $product->note ?? '') }}</textarea>
|
|
|
@error('note')
|
|
|
<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
|
|
|
@enderror
|
|
|
@@ -67,7 +68,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-12">
|
|
|
- @include('partials.submit', ['deleteDisabled' => (!isset($product) || $product->hasRelations()), 'offset' => 6, 'delete' => ['form_id' => 'deleteProduct']])
|
|
|
+ @include('partials.submit', ['deleteDisabled' => (!isset($product) || $product->hasRelations() || !hasRole('admin')), 'disabled' => !hasRole('admin'), 'offset' => 6, 'delete' => ['form_id' => 'deleteProduct']])
|
|
|
</div>
|
|
|
</div>
|
|
|
|