|
|
@@ -8,12 +8,15 @@
|
|
|
<h3>Площадка {{ $order->object_address }}</h3>
|
|
|
</div>
|
|
|
<div class="col-6 text-end">
|
|
|
- @if($order->order_status_id == App\Models\Order::STATUS_NEW)
|
|
|
- <a href="{{ route('order.get-maf', $order) }}" class="btn btn-primary @disabled($order->ready_to_mount == 'Нет' )" >Привязать МАФы к заказу</a>
|
|
|
- @endif
|
|
|
+ <a href="{{ route('order.get-maf', $order) }}"
|
|
|
+ class="btn btn-primary @disabled($order->ready_to_mount == 'Нет' )">Привязать МАФы</a>
|
|
|
+
|
|
|
+ <a href="{{ route('order.revert-maf', $order) }}"
|
|
|
+ class="btn btn-primary">Отвязать МАФы</a>
|
|
|
<a href="{{ route('order.edit', $order) }}" class="btn btn-primary">Редактировать</a>
|
|
|
@if(hasRole('admin') && ($order->order_status_id == App\Models\Order::STATUS_NEW))
|
|
|
- <a href="#" onclick="if(confirm('Удалить площадку?')) $('form#destroy').submit();" class="btn btn-danger">Удалить</a>
|
|
|
+ <a href="#" onclick="if(confirm('Удалить площадку?')) $('form#destroy').submit();"
|
|
|
+ class="btn btn-danger">Удалить</a>
|
|
|
<form action="{{ route('order.destroy', $order) }}" method="post" class="d-none" id="destroy">
|
|
|
@csrf
|
|
|
@method('DELETE')
|
|
|
@@ -82,7 +85,7 @@
|
|
|
<td>{{ $p->manufacture_date }}</td>
|
|
|
<td>{{ $p->service_life }}</td>
|
|
|
<td class="text-center">
|
|
|
- @if($order->order_status_id > 1)
|
|
|
+ @if($p->maf_order?->order_number)
|
|
|
<i class="bi bi-check-all text-success fw-bold"></i>
|
|
|
@else
|
|
|
@if($needs[$p->product_id]['sku']-- > 0)
|
|
|
@@ -97,14 +100,13 @@
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<div>
|
|
|
- <button class="btn btn-primary btn-sm revert-maf">Вернуть на склад</button>
|
|
|
+ <button class="btn btn-primary btn-sm ">Перенести МАФы</button>
|
|
|
</div>
|
|
|
@endif
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
@endsection
|
|
|
@@ -118,8 +120,8 @@
|
|
|
|
|
|
$('.revert-maf').on('click', function () {
|
|
|
let ids = Array();
|
|
|
- $('.check-maf').each(function (){
|
|
|
- if($(this).prop('checked')) {
|
|
|
+ $('.check-maf').each(function () {
|
|
|
+ if ($(this).prop('checked')) {
|
|
|
ids.push($(this).attr('data-maf-id'));
|
|
|
}
|
|
|
});
|
|
|
@@ -129,10 +131,10 @@
|
|
|
'_token': $('meta[name=csrf-token]').attr('content'),
|
|
|
ids: JSON.stringify(ids),
|
|
|
},
|
|
|
- function (){
|
|
|
- // console.log(data);
|
|
|
- location.reload();
|
|
|
- }
|
|
|
+ function () {
|
|
|
+ // console.log(data);
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
);
|
|
|
});
|
|
|
|