integarasi admin ke so dan penambahan menu otorisator so

This commit is contained in:
majid
2024-10-08 14:35:59 +07:00
parent 0b5820375b
commit 0fbbb8f081
8 changed files with 619 additions and 96 deletions

View File

@@ -163,7 +163,7 @@
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
Laporan
</h3>
</div>
<div data-accordion="true">
@@ -283,21 +283,12 @@
<input type="hidden" name="nomor_registrasi"
value="{{ $penilaian->nomor_registrasi ?? $permohonan->nomor_registrasi }}">
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
name="jenis_penilaian_id" id="jenis_penilaian_id">
<option value="">Jenis Penilaian</option>
@foreach ($jenisPenilaian as $item)
@if (isset($penilaian->nomor_registrasi))
<option value="{{ $item->id }}"
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
{{ $item->name }}</option>
@else
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endif
@endforeach
</select>
<input class="input"
type="hidden" name="jenis_penilaian_id" value="{{ $jenisPenilaian->id }}"
>
<input class="input @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
type="text" value="{{ $jenisPenilaian->name }}"
readonly>
@error('jenis_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
@@ -309,20 +300,11 @@
Tim Penilai yang di tunjuk
</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('teams_id') border-danger bg-danger-light @enderror"
name="teams_id" id="teams_id">
<option value="">Pilih Tim Penilai</option>
@foreach ($teamPenilai as $item)
@if (isset($penilaian->nomor_registrasi))
<option value="{{ $item->id }}"
{{ $penilaian->teams_id == $item->id ? 'selected' : '' }}>
{{ $item->regions->name }}</option>
@else
<option value="{{ $item->id }}">{{ $item->regions->name }}</option>
@endif
@endforeach
</select>
<input class="input"
type="hidden" name="teams_id" value="{{ $regionName->id }}"
>
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
type="text" value="{{ $regionName->name }}" readonly>
@error('teams_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
@@ -335,8 +317,11 @@
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="surveyor_id" name="surveyor_id"
class="select input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
class="tomselect input @error('surveyor_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Surveyor</option>
@foreach ($teamPenilai->first()->teamsUsers as $item)
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
@endforeach
</select>
@error('surveyor_id')
@@ -351,8 +336,11 @@
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="penilaian_id" name="penilaian_id"
class="input select @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
class="input tomselect @error('penilaian_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Penilai</option>
@foreach ($teamPenilai->first()->teamsUsers as $item)
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
@endforeach
</select>
@error('penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@@ -366,8 +354,11 @@
</label>
<div class="flex flex-wrap items-baseline w-full">
<select id="penilai_surveyor_id" name="penilai_surveyor_id"
class="input select @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
class="input tomselect @error('penilai_surveyor_id') border-danger bg-danger-light @enderror w-full">
<option value="">Pilih Surveyor dan Penilai</option>
@foreach ($teamPenilai->first()->teamsUsers as $item)
<option value="{{ $item->user->id }}">{{ $item->user->name }}</option>
@endforeach
</select>
@error('penilai_surveyor_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@@ -482,7 +473,7 @@
</div>
@endsection
@push('scripts')
<script>
{{-- <script>
document.addEventListener('DOMContentLoaded', function() {
let teamsSelect = document.getElementById('teams_id');
let penilaiSelect = document.getElementById('penilaian_id');
@@ -570,48 +561,48 @@
fetchPenilai(selectedTeamId);
}
});
</script>
</script> --}}
<script>
document.addEventListener('DOMContentLoaded', function() {
const revisiForm = document.getElementById('revisiForm');
const btnSubmit = document.getElementById('btnSubmit');
<script>
document.addEventListener('DOMContentLoaded', function() {
const revisiForm = document.getElementById('revisiForm');
const btnSubmit = document.getElementById('btnSubmit');
btnSubmit.addEventListener('click', function(event) {
// Cegah form dari pengiriman default
event.preventDefault();
btnSubmit.addEventListener('click', function(event) {
// Cegah form dari pengiriman default
event.preventDefault();
// Ambil nilai dari input dan textarea
const dokumenRevisi = document.getElementById('dokumen').value;
const keteranganRevisi = document.getElementById('keterangan').value.trim();
// Ambil nilai dari input dan textarea
const dokumenRevisi = document.getElementById('dokumen').value;
const keteranganRevisi = document.getElementById('keterangan').value.trim();
// Bersihkan pesan kesalahan sebelumnya
document.querySelectorAll('.alert.text-danger').forEach(el => el.remove());
// Bersihkan pesan kesalahan sebelumnya
document.querySelectorAll('.alert.text-danger').forEach(el => el.remove());
// Validasi: jika ada field kosong, tampilkan pesan kesalahan
let isValid = true;
// Validasi: jika ada field kosong, tampilkan pesan kesalahan
let isValid = true;
if (!dokumenRevisi) {
const errorMessage = document.createElement('em');
errorMessage.className = 'alert text-danger text-sm';
errorMessage.innerText = 'Dokumen Revisi harus diisi.';
document.getElementById('dokumen').parentElement.appendChild(errorMessage);
isValid = false; // Set isValid ke false
}
if (!dokumenRevisi) {
const errorMessage = document.createElement('em');
errorMessage.className = 'alert text-danger text-sm';
errorMessage.innerText = 'Dokumen Revisi harus diisi.';
document.getElementById('dokumen').parentElement.appendChild(errorMessage);
isValid = false; // Set isValid ke false
}
if (!keteranganRevisi) {
const errorMessage = document.createElement('em');
errorMessage.className = 'alert text-danger text-sm';
errorMessage.innerText = 'Catatan harus diisi.';
document.getElementById('keterangan').parentElement.appendChild(errorMessage);
isValid = false; // Set isValid ke false
}
if (!keteranganRevisi) {
const errorMessage = document.createElement('em');
errorMessage.className = 'alert text-danger text-sm';
errorMessage.innerText = 'Catatan harus diisi.';
document.getElementById('keterangan').parentElement.appendChild(errorMessage);
isValid = false; // Set isValid ke false
}
// Jika semua field valid, kirim form
if (isValid) {
revisiForm.submit();
}
// Jika semua field valid, kirim form
if (isValid) {
revisiForm.submit();
}
});
});
});
</script>
</script>
@endpush

View File

@@ -7,13 +7,10 @@
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<div class="card-title flex flex-row gap-1.5">
Daftar Penilaian
</div>
<div class=" card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('penilaian.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
{{-- Daftar {{}} --}}
Daftar assignment
</h3>
<div class="flex flex-wrap gap-2 lg:gap-5">
<div class="flex">
@@ -27,9 +24,6 @@
</div>
</div>
</div>
</div>
<div class=" card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('penilaian.datatables') }}">
<div class="card-body">
<div class="scrollable-x-auto">

View File

@@ -0,0 +1,163 @@
@extends('layouts.main')
{{-- @section('breadcrumbs')
{{ Breadcrumbs::render('penilaian') }}
@endsection --}}
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class=" card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('otorisator.datatables', ['otorisator' => $header ]) }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar {{$header}}
</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 Penilaian" 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('permohonan.export') }}"> 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-[150px]" data-datatable-column="nomor_registrasi">
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="user_id">
<span class="sort"> <span class="sort-label"> User Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="branch_id">
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="debitur_id">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="status">
<span class="sort"> <span class="sort-label"> Status </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>
</div>
@endsection
@push('scripts')
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="module">
const element = document.querySelector('#permohonan-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();
},
},
nomor_registrasi: {
title: 'Nomor Registrasi',
},
tanggal_permohonan: {
title: 'Tanggal Permohonan'
},
user_id: {
title: 'User Pemohon',
render: (item, data) => {
return `${data.user.name}`;
},
},
branch_id: {
title: 'Cabang Pemohon',
render: (item, data) => {
return `${data.branch.name}`;
},
},
debitur_id: {
title: 'Debitur',
render: (item, data) => {
return `${data.debiture.name}`;
},
},
tujuan_penilaian_id: {
title: 'Tujuan Penilaian',
render: (item, data) => {
return `${data.tujuan_penilaian.name}`;
},
},
status: {
title: 'Status'
},
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="otorisator/show/${data.id}">
<i class="ki-outline ki-eye"></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

View File

@@ -0,0 +1,173 @@
@extends('layouts.main')
{{-- @section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection --}}
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card">
<div class="card-header" id="advanced_settings_appearance">
<h3 class="card-title">
Data Permohonan
</h3>
</div>
<div class="card-body lg:py-7.5 grid grid-cols-3">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Nomor Register Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->nomor_registrasi }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemohon:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Detail Debutur
</h3>
</div>
<div class="card-table scrollable-x-auto pb-3">
<div class="grid grid-cols-1 xl:grid-cols-2 gap-5 lg:gap-7.5">
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-2 text-gray-600 font-normal">
Name
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Email
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->email ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Phone
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->phone ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Address
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->address ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
&nbsp;
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->village->name ?? "" }}, {{ $permohonan->debiture->district->name ?? "" }}, {{ $permohonan->debiture->city->name ?? "" }}, {{ $permohonan->debiture->province->name ?? "" }} - {{ $permohonan->debiture->village->postal_code ?? "" }}
</td>
</tr>
</table>
</div>
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-3 text-gray-600 font-normal">
Cabang
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->branch->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
CIF
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->cif ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Nomor Rekening
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->nomor_rekening ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
NPWP
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->npwp ?? "" }}
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Laporan
</h3>
</div>
</div>
<div class="card">
<form action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
<input type="hidden" name="_method" value="PUT">
@csrf
<div class="card-body lg:py-7.5">
<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" rows="3" type="number" id="address" name="address"></textarea>
</div>
</div>
</div>
<div class="card-footer flex justify-end">
<button type="submit" name="status" value="preregister" class="btn btn-success">
Approve
</button>
<button type="submit" name="status" value="revisi" class="btn btn-warning ml-3">
Revisi
</button>
</div>
</form>
</div>
</div>
@endsection