Membuat Sub Menu Data Penawaran dari Menu Tender part 1
This commit is contained in:
@@ -1,22 +1,214 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('tender.penawaran') }}
|
||||
{{ Breadcrumbs::render(request()->route()->getName(), request()->route('id')) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<form
|
||||
action="{{ isset($id) ? route('tender.penawaran.updatePenawaran', $id) : route('tender.penawaran.storePenawaran', $id) }}"
|
||||
method="POST">
|
||||
@if (isset($id))
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
@method('PUT')
|
||||
@endif
|
||||
@csrf
|
||||
|
||||
<div class="card pb-2.5">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Tambah Data Penawaran
|
||||
</h3>
|
||||
<div class="card pb-2.5">
|
||||
<div class="card-header" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
{{ isset($id) ? 'Edit' : 'Tambah' }} Data Penawaran
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('tender.penawaran.index') }}" class="btn btn-xs btn-info"><i
|
||||
class="ki-filled ki-exit-left"></i>
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Registrasi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $id }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nomor Penawaran
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('code') border-danger @enderror" type="text" name="code"
|
||||
value="{{ isset($penawaran->id) ? $penawaran->code : old('code') }}">
|
||||
@error('code')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Nama KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select name="nama_kjpp_sebelumnya[]" multiple="multiple"
|
||||
class="input tomselect w-full @error('nama_kjpp_sebelumnya') border-danger @enderror"
|
||||
id="nama_kjpp_sebelumnya_select">
|
||||
<option value="">Pilih Nama KJPP Sebelumnya</option>
|
||||
@foreach ($kjpp as $row)
|
||||
<option value="{{ $row->name }}"
|
||||
{{ isset($penawaran->nama_kjpp_sebelumnya) ? (in_array($row->name, old('nama_kjpp_sebelumnya', json_decode($penawaran->nama_kjpp_sebelumnya, true))) ? 'selected' : '') : (in_array($row->name, old('nama_kjpp_sebelumnya', [])) ? 'selected' : '') }}>
|
||||
{{ $row->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Biaya KJPP Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
@error('biaya_kjpp_sebelumnya')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Penilaian Sebelumnya
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('tanggal_penilaian_sebelumnya') border-danger @enderror"
|
||||
type="date" name="tanggal_penilaian_sebelumnya"
|
||||
value="{{ $penawaran->tanggal_penilaian_sebelumnya ?? old('tanggal_penilaian_sebelumnya') }}">
|
||||
@error('tanggal_penilaian_sebelumnya')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tujuan Penilaian KJPP
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="tujuan_penilaian_kjpp_id"
|
||||
class="select w-full @error('tujuan_penilaian_kjpp_id') border-danger @enderror"
|
||||
name="tujuan_penilaian_kjpp_id">
|
||||
<option value="">Pilih Tujuan Penilaian KJPP</option>
|
||||
@if (isset($tujuan_penilaian_kjpp))
|
||||
@if (isset($penawaran))
|
||||
@foreach ($tujuan_penilaian_kjpp as $tp)
|
||||
<option value="{{ $tp->id }}"
|
||||
{{ old('tujuan_penilaian_kjpp_id', $penawaran->tujuan_penilaian_kjpp_id) == $tp->id ? 'selected' : '' }}>
|
||||
{{ $tp->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach ($tujuan_penilaian_kjpp as $tp)
|
||||
<option value="{{ $tp->id }}"
|
||||
{{ old('tujuan_penilaian_kjpp_id') == $tp->id ? 'selected' : '' }}>
|
||||
{{ $tp->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Jenis Laporan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="jenis_laporan_id"
|
||||
class="select w-full @error('jenis_laporan_id') border-danger @enderror"
|
||||
name="jenis_laporan_id">
|
||||
<option value="">Pilih Jenis Laporan</option>
|
||||
@if (isset($jenis_laporan))
|
||||
@if (isset($penawaran))
|
||||
@foreach ($jenis_laporan as $jl)
|
||||
<option value="{{ $jl->id }}"
|
||||
{{ old('jenis_laporan_id', $penawaran->jenis_laporan_id) == $jl->name ? 'selected' : '' }}>
|
||||
{{ $jl->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach ($jenis_laporan as $jl)
|
||||
<option value="{{ $jl->id }}"
|
||||
{{ old('jenis_laporan_id') == $jl->name ? 'selected' : '' }}>
|
||||
{{ $jl->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Awal
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('start_date') border-danger @enderror" type="date"
|
||||
name="start_date" value="{{ $penawaran->start_date ?? old('start_date') }}">
|
||||
@error('start_date')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
<label class="form-label max-w-56">
|
||||
Tanggal Akhir
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('tanggal_akhir') border-danger @enderror" type="date"
|
||||
name="tanggal_akhir" value="{{ $penawaran->tanggal_akhir ?? old('tanggal_akhir') }}">
|
||||
@error('tanggal_akhir')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea class="textarea @error('catatan') border-danger @enderror" name="catatan" rows="3" id="address">{{ $penawaran->catatan ?? old('catatan') }}</textarea>
|
||||
@error('catatan')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Status</label>
|
||||
<select id="status" class="select w-full @error('status') border-danger @enderror"
|
||||
name="status">
|
||||
<option value="">Pilih Status</option>
|
||||
@if (isset($status))
|
||||
@if (isset($penawaran))
|
||||
@foreach ($status as $s)
|
||||
<option value="{{ $s->name }}"
|
||||
{{ old('status', $penawaran->status) == $s->name ? 'selected' : '' }}>
|
||||
{{ $s->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach ($status as $s)
|
||||
<option value="{{ $s->name }}"
|
||||
{{ old('status') == $s->name ? 'selected' : '' }}>
|
||||
{{ $s->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{-- @include('lpj::debitur.form') --}}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -7,15 +7,156 @@
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="card pb-2.5" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false"
|
||||
id="currency-table" data-api-url="{{ route('basicdata.currency.datatables') }}">
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
data-datatable-state-save="false" id="penawaran-table" data-api-url="{{ route('tender.penawaran.datatables') }}">
|
||||
<div class="card-header py-5 flex-wrap" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Data Penawaran
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search KJPP" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('tender.penawaran.exportPenawaran') }}"> Export to
|
||||
Excel
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="code">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Penawaran </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[250px]" data-datatable-column="nama_kjpp_sebelumnya">
|
||||
<span class="sort"> <span class="sort-label"> Nama KJPP Sebelumnya </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px]" data-datatable-column="tanggal_penilaian_sebelumnya">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Penilaian Sebelumnya </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax(`tender/penawaran/${data}`, {
|
||||
type: 'DELETE'
|
||||
}).then((response) => {
|
||||
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
const element = document.querySelector('#penawaran-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
code: {
|
||||
title: 'Nomor Penawaran',
|
||||
},
|
||||
nama_kjpp_sebelumnya: {
|
||||
title: 'Nama KJPP Sebelumnya',
|
||||
},
|
||||
tanggal_penilaian_sebelumnya: {
|
||||
title: 'Tanggal Penilaian Sebelumnya',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary" href="tender/penawaran/${data.id}">
|
||||
<i class="ki-filled ki-eye"></i>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="tender/penawaran/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user