add remarks 1
This commit is contained in:
@@ -94,23 +94,19 @@
|
||||
@if (auth()->user()->can('approval.approve') && $form->status == 'On Progress')
|
||||
<button type="button" class="btn btn-success final-approve-modal" data-id="{{ route('forms.vehicle.approve', $form->id) }}">Approve 1</button>
|
||||
|
||||
<form action="{{ route('forms.vehicle.reject', $form->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
<button type="button"
|
||||
class="btn btn-danger open-reject-modal"
|
||||
data-action="{{ route('forms.vehicle.reject', $form->id) }}">
|
||||
Reject
|
||||
</button>
|
||||
@elseif(auth()->user()->can('approval2.approve') && $form->status == 'Approved 1')
|
||||
<button type="button" class="btn btn-success open-approve-modal" data-id="{{ route('forms.vehicle.approve2', $form->id) }}">Approve 2</button>
|
||||
|
||||
<form action="{{ route('forms.vehicle.reject', $form->id) }}" method="POST" class="d-inline" onsubmit="return confirm('Are you sure you want to approve this item?');">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button type="submit" class="btn btn-danger">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
<button type="button"
|
||||
class="btn btn-danger open-reject-modal"
|
||||
data-action="{{ route('forms.vehicle.reject', $form->id) }}">
|
||||
Reject
|
||||
</button>
|
||||
@elseif(auth()->user()->can('final_approval.approve') && $form->status == 'Approved 2')
|
||||
<button type="button" class="btn btn-primary open-approve-modal" data-id="{{ route('forms.vehicle.final-approve', $form->id) }}">Final Approve</button>
|
||||
@endif
|
||||
@@ -265,6 +261,35 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<form id="rejectForm" method="POST" action="">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="rejectModalLabel">Reject Expense</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="rejectRemarks">Remarks <span class="text-danger">*</span></label>
|
||||
<textarea class="form-control" name="remarks" id="rejectRemarks" rows="3" required></textarea>
|
||||
</div>
|
||||
<p class="mb-0 text-muted small">Pengajuan akan ditolak setelah Anda mengirimkan catatan ini.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-danger">Reject</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@@ -279,6 +304,22 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).on('click', '.open-reject-modal', function () {
|
||||
const rejectUrl = $(this).data('action');
|
||||
$('#rejectForm').attr('action', rejectUrl);
|
||||
$('#rejectRemarks').val('');
|
||||
$('#rejectModal').modal('show');
|
||||
});
|
||||
|
||||
$('#rejectModal').on('shown.bs.modal', function () {
|
||||
$('#rejectRemarks').trigger('focus');
|
||||
});
|
||||
|
||||
$('#rejectModal').on('hidden.bs.modal', function () {
|
||||
$('#rejectForm').attr('action', '');
|
||||
$('#rejectRemarks').val('');
|
||||
});
|
||||
|
||||
$(document).on('click', '.open-approve-modal', function() {
|
||||
const approveUrl = $(this).data('id');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user