perbaikana perhitungan npw dan nl otomatis, dan perbaikan otorisator
This commit is contained in:
@@ -436,54 +436,115 @@
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label max-w-56">Luas Tanah</label>
|
||||
<input type="text" class="input w-full" name="luas_tanah"
|
||||
value="{{ old('luas_tanah', $lpjData['luas_tanah'] ?? null) }}">
|
||||
<input type="text" id="luas_tanah" class="input w-full currency-format"
|
||||
name="luas_tanah"
|
||||
value="{{ old('luas_tanah', $lpjData['luas_tanah'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="nilai_tanah_1"
|
||||
value="{{ old('nilai_tanah_1', $lpjData['nilai_tanah_1'] ?? null) }}">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" id="nilai_tanah_1" class=" w-full currency-format"
|
||||
name="nilai_tanah_1"
|
||||
value="{{ old('nilai_tanah_1', $lpjData['nilai_tanah_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="nilai_tanah_2"
|
||||
value="{{ old('nilai_tanah_2', $lpjData['nilai_tanah_2'] ?? null) }}">
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input id="nilai_tanah_2" type="text" class=" w-full currency-format"
|
||||
name="nilai_tanah_2"
|
||||
value="{{ old('nilai_tanah_2', $lpjData['nilai_tanah_2'] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label max-w-56">Luas Bangunan</label>
|
||||
<input type="text" class="input w-full" name="luas_bangunan"
|
||||
value="{{ old('luas_bangunan', $lpjData['luas_bangunan'] ?? null) }}">
|
||||
<input type="text" class="input w-full currency-format" id="luas_bangunan" name="luas_bangunan"
|
||||
value="{{ old('luas_bangunan', $lpjData['luas_bangunan'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="nilai_bangunan_1"
|
||||
value="{{ old('nilai_bangunan_1', $lpjData['nilai_bangunan_1'] ?? null) }}">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format"
|
||||
id="nilai_bangunan_1"
|
||||
name="nilai_bangunan_1"
|
||||
value="{{ old('nilai_bangunan_1', $lpjData['nilai_bangunan_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="nilai_bangunan_2"
|
||||
value="{{ old('nilai_bangunan_2', $lpjData['nilai_bangunan_2'] ?? null) }}">
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format"
|
||||
id="nilai_bangunan_2"
|
||||
name="nilai_bangunan_2"
|
||||
value="{{ old('nilai_bangunan_2', $lpjData['nilai_bangunan_2'] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label max-w-56">Sarana Pelengkap</label>
|
||||
<input type="text" class="input w-full" name="sarana_pelengkap"
|
||||
value="{{ old('sarana_pelengkap', $lpjData['sarana_pelengkap'] ?? null) }}">
|
||||
<input type="text" class="input w-full currency-format"
|
||||
id="sarana_pelengkap"
|
||||
name="sarana_pelengkap"
|
||||
value="{{ old('sarana_pelengkap', $lpjData['sarana_pelengkap'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="nilai_sarana_pelengkap_1"
|
||||
value="{{ old('nilai_sarana_pelengkap_1', $lpjData['nilai_sarana_pelengkap_1'] ?? null) }}">
|
||||
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format"
|
||||
id="nilai_sarana_pelengkap_1"
|
||||
name="nilai_sarana_pelengkap_1"
|
||||
value="{{ old('nilai_sarana_pelengkap_1', $lpjData['nilai_sarana_pelengkap_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="nilai_sarana_pelengkap_2"
|
||||
value="{{ old('nilai_sarana_pelengkap_2', $lpjData['nilai_sarana_pelengkap_2'] ?? null) }}">
|
||||
<div class="grid gap-5 w-full">
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class="w-full currency-format"
|
||||
id="nilai_sarana_pelengkap_2"
|
||||
name="nilai_sarana_pelengkap_2"
|
||||
value="{{ old('nilai_sarana_pelengkap_2', $lpjData['nilai_sarana_pelengkap_2'] ?? null) }}">
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
|
||||
<label for="province" class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format"
|
||||
id="total_nilai_pasar_wajar"
|
||||
name="total_nilai_pasar_wajar"
|
||||
value="{{ old('total_nilai_pasar_wajar', $lpjData['total_nilai_pasar_wajar'] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -495,25 +556,35 @@
|
||||
<div class="card-body grid gap-2.5 w-full">
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<input type="text" name="likuidasi" class="input w-full"
|
||||
value="{{ old('likuidasi', $lpjData['likuidasi'] ?? null) }}">
|
||||
<input type="text"
|
||||
id="likuidasi"
|
||||
name="likuidasi" class="input w-full currency-format"
|
||||
value="{{ old('likuidasi', $lpjData['likuidasi'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="likuidasi_nilai_1"
|
||||
value="{{ old('likuidasi_nilai_1', $lpjData['likuidasi_nilai_1'] ?? null) }}">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format"
|
||||
id="likuidasi_nilai_1"
|
||||
name="likuidasi_nilai_1"
|
||||
value="{{ old('likuidasi_nilai_1', $lpjData['likuidasi_nilai_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
<div class="grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="likuidasi_nilai_2"
|
||||
value="{{ old('likuidasi_nilai_2', $lpjData['likuidasi_nilai_2'] ?? null) }}">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="likuidasi_nilai_3"
|
||||
value="{{ old('likuidasi_nilai_3', $lpjData['likuidasi_nilai_3'] ?? null) }}">
|
||||
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class=" w-full currency-format"
|
||||
name="likuidasi_nilai_2"
|
||||
value="{{ old('likuidasi_nilai_2', $lpjData['likuidasi_nilai_2'] ?? null) }}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -535,19 +606,33 @@
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label">Luas Bangunan</label>
|
||||
<input type="text" class="input w-full" name="asuransi_luas_bangunan"
|
||||
value="{{ old('asuransi_luas_bangunan', $lpjData['asuransi_luas_bangunan'] ?? null) }}">
|
||||
<input type="text" class="input w-full currency-format"
|
||||
id="asuransi_luas_bangunan"
|
||||
name="asuransi_luas_bangunan"
|
||||
value="{{ old('asuransi_luas_bangunan', $lpjData['asuransi_luas_bangunan'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="asuransi_nilai_1"
|
||||
value="{{ old('asuransi_nilai_1', $lpjData['asuransi_nilai_1'] ?? null) }}">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class="input w-full currency-format"
|
||||
id="asuransi_nilai_1"
|
||||
name="asuransi_nilai_1"
|
||||
value="{{ old('asuransi_nilai_1', $lpjData['asuransi_nilai_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">Rp</label>
|
||||
<input type="text" class="input w-full" name="asuransi_nilai_2"
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class="input w-full currency-format"
|
||||
name="asuransi_nilai_2"
|
||||
value="{{ old('asuransi_nilai_2', $lpjData['asuransi_nilai_2'] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -565,90 +650,164 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@include('lpj::surveyor.js.utils')
|
||||
<script type="text/javascript">
|
||||
function saveLpjSederhanadanStandard() {
|
||||
const form = document.getElementById('form-lpj');
|
||||
const formData = new FormData(form);
|
||||
|
||||
const jsonData = {
|
||||
luas_tanah: formData.get('luas_tanah'),
|
||||
nilai_tanah_1: formData.get('nilai_tanah_1'),
|
||||
nilai_tanah_2: formData.get('nilai_tanah_2'),
|
||||
luas_bangunan: formData.get('luas_bangunan'),
|
||||
nilai_bangunan_1: formData.get('nilai_bangunan_1'),
|
||||
nilai_bangunan_2: formData.get('nilai_bangunan_2'),
|
||||
sarana_pelengkap: formData.get('sarana_pelengkap'),
|
||||
nilai_sarana_pelengkap_1: formData.get('nilai_sarana_pelengkap_1'),
|
||||
nilai_sarana_pelengkap_2: formData.get('nilai_sarana_pelengkap_2'),
|
||||
likuidasi: formData.get('likuidasi'),
|
||||
likuidasi_nilai_1: formData.get('likuidasi_nilai_1'),
|
||||
likuidasi_nilai_2: formData.get('likuidasi_nilai_2'),
|
||||
likuidasi_nilai_3: formData.get('likuidasi_nilai_3'),
|
||||
asuransi_luas_bangunan: formData.get('asuransi_luas_bangunan'),
|
||||
asuransi_nilai_1: formData.get('asuransi_nilai_1'),
|
||||
asuransi_nilai_2: formData.get('asuransi_nilai_2')
|
||||
};
|
||||
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const requestUrl = `{{ route('penilai.storeLpjSederhanadanStandard') }}`;
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
lpj: jsonData,
|
||||
}),
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
hideLoadingSwal();
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.href =
|
||||
'{{ route('penilai.show', ['id' => $permohonan->id]) }}';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
toastrErrorBuild(value[0]);
|
||||
});
|
||||
}
|
||||
hideLoadingSwal();
|
||||
console.log(errors);
|
||||
}
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('.currency-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatCurrency(this);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
});
|
||||
|
||||
document.querySelectorAll('.number-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatNumber(this);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function calculateTotal() {
|
||||
// Fungsi untuk menghapus format ribuan/koma
|
||||
const parseInput = (value) => parseFloat(value.replace(/[^0-9]/g, '')) || 0;
|
||||
|
||||
// Ambil elemen input dan parse nilainya
|
||||
let luasTanah = parseInput(document.getElementById('luas_tanah').value);
|
||||
let hargaPerMeterTanah = parseInput(document.querySelector('input[name="nilai_tanah_1"]').value);
|
||||
let totalLuasTanah = document.querySelector('input[name="nilai_tanah_2"]');
|
||||
|
||||
let luasBangunan = parseInput(document.getElementById('luas_bangunan').value);
|
||||
let hargaPerMeterBangunan = parseInput(document.querySelector('input[name="nilai_bangunan_1"]').value);
|
||||
let totalLuasBangunan = document.querySelector('input[name="nilai_bangunan_2"]');
|
||||
|
||||
let saranaPelengkap = parseInput(document.getElementById('sarana_pelengkap').value);
|
||||
let hargaPerMeterSarana = parseInput(document.querySelector('input[name="nilai_sarana_pelengkap_1"]').value);
|
||||
let totalLuasSarana = document.querySelector('input[name="nilai_sarana_pelengkap_2"]');
|
||||
|
||||
// Bagian Likuidasi
|
||||
let persentaseLikuidasi = parseInput(document.getElementById('likuidasi').value);
|
||||
let totalNilaiPasarLikuidasi = document.querySelector('input[name="likuidasi_nilai_1"]');
|
||||
let totalLikuidasi = document.querySelector('input[name="likuidasi_nilai_2"]');
|
||||
|
||||
// Bagian Asuransi
|
||||
let luasBangunanAsuransi = parseInput(document.getElementById('asuransi_luas_bangunan').value);
|
||||
let hargaPerMeterAsuransi = parseInput(document.querySelector('input[name="asuransi_nilai_1"]').value);
|
||||
let totalNilaiAsuransi = document.querySelector('input[name="asuransi_nilai_2"]');
|
||||
|
||||
let total = document.querySelector('input[name="total_nilai_pasar_wajar"]');
|
||||
|
||||
// Hitung hasil
|
||||
const hasilTanah = luasTanah * hargaPerMeterTanah;
|
||||
const hasilBangunan = luasBangunan * hargaPerMeterBangunan;
|
||||
const hasilSarana = saranaPelengkap * hargaPerMeterSarana;
|
||||
|
||||
const totalNilaiPasarWajar = hasilTanah + hasilBangunan + hasilSarana;
|
||||
|
||||
// Perhitungan Likuidasi
|
||||
const hasilLikuidasi = (persentaseLikuidasi / 100) * totalNilaiPasarWajar;
|
||||
|
||||
// Perhitungan Asuransi
|
||||
const hasilAsuransi = luasBangunanAsuransi * hargaPerMeterAsuransi;
|
||||
|
||||
// Tampilkan hasil dalam format currency
|
||||
totalLuasTanah.value = formatCurrency(hasilTanah.toString());
|
||||
totalLuasBangunan.value = formatCurrency(hasilBangunan.toString());
|
||||
totalLuasSarana.value = formatCurrency(hasilSarana.toString());
|
||||
total.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
|
||||
// Tampilkan nilai likuidasi dan asuransi
|
||||
totalNilaiPasarLikuidasi.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
totalNilaiAsuransi.value = formatCurrency(hasilAsuransi.toString());
|
||||
|
||||
// Total likuidasi (total nilai pasar wajar + nilai likuidasi)
|
||||
// const totalPasarWajarDenganLikuidasi = totalNilaiPasarWajar + hasilLikuidasi;
|
||||
totalLikuidasi.value = formatCurrency(hasilLikuidasi.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
function saveLpjSederhanadanStandard() {
|
||||
const form = document.getElementById('form-lpj');
|
||||
const formData = new FormData(form);
|
||||
|
||||
const jsonData = {
|
||||
luas_tanah: formData.get('luas_tanah'),
|
||||
nilai_tanah_1: formData.get('nilai_tanah_1'),
|
||||
nilai_tanah_2: formData.get('nilai_tanah_2'),
|
||||
luas_bangunan: formData.get('luas_bangunan'),
|
||||
nilai_bangunan_1: formData.get('nilai_bangunan_1'),
|
||||
nilai_bangunan_2: formData.get('nilai_bangunan_2'),
|
||||
sarana_pelengkap: formData.get('sarana_pelengkap'),
|
||||
nilai_sarana_pelengkap_1: formData.get('nilai_sarana_pelengkap_1'),
|
||||
nilai_sarana_pelengkap_2: formData.get('nilai_sarana_pelengkap_2'),
|
||||
total_nilai_pasar_wajar: formData.get('total_nilai_pasar_wajar'),
|
||||
likuidasi: formData.get('likuidasi'),
|
||||
likuidasi_nilai_1: formData.get('likuidasi_nilai_1'),
|
||||
likuidasi_nilai_2: formData.get('likuidasi_nilai_2'),
|
||||
asuransi_luas_bangunan: formData.get('asuransi_luas_bangunan'),
|
||||
asuransi_nilai_1: formData.get('asuransi_nilai_1'),
|
||||
asuransi_nilai_2: formData.get('asuransi_nilai_2')
|
||||
};
|
||||
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const requestUrl = `{{ route('penilai.storeLpjSederhanadanStandard') }}`;
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
lpj: jsonData,
|
||||
}),
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
hideLoadingSwal();
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.href =
|
||||
'{{ route('penilai.show', ['id' => $permohonan->id]) }}';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
$.each(errors, function(key, value) {
|
||||
$(`#error-${key}`).text(value[0]);
|
||||
toastrErrorBuild(value[0]);
|
||||
});
|
||||
}
|
||||
hideLoadingSwal();
|
||||
console.log(errors);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
@@ -5,92 +5,92 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
data-datatable-state-save="false" id="penilai-table" data-api-url="{{ route('penilai.dataForTables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Penilai
|
||||
</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 Penilai" 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="#"> Export to Excel </a>
|
||||
</div>
|
||||
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5"
|
||||
data-datatable-state-save="false" id="penilai-table" data-api-url="{{ route('penilai.dataForTables') }}">
|
||||
<div class="card-header py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Penilai
|
||||
</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 Penilai" 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="#"> Export to Excel </a>
|
||||
</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="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="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon(Cabang/Direktorat) </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"> AO </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="jenis_fasilitas_kredit_id">
|
||||
<span class="sort"> <span class="sort-label"> Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_survei">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Survei </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="due_date_sla">
|
||||
<span class="sort"> <span class="sort-label"> Due Date SLA </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 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="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="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon(Cabang/Direktorat) </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"> AO </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="jenis_fasilitas_kredit_id">
|
||||
<span class="sort"> <span class="sort-label"> Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_survei">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Survei </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="due_date_sla">
|
||||
<span class="sort"> <span class="sort-label"> Due Date SLA </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
|
||||
|
||||
@@ -181,12 +181,22 @@
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `
|
||||
|
||||
if (data.status === 'done') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a class="btn btn-sm btn-outline btn-info" href="penilai/${data.id}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
} else {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-success" onclick="showLoadingSwal('Masih Menunggu proses inspeksi dari surveyor...')">
|
||||
<i class="ki-filled ki-watch"></i>
|
||||
</a>
|
||||
</div>`
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -200,4 +210,22 @@
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function showLoadingSwal(message, duration = 5000) {
|
||||
Swal.fire({
|
||||
title: message,
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
},
|
||||
timer: duration, // Durasi dalam milidetik
|
||||
timerProgressBar: true, // Menampilkan progres bar timer
|
||||
}).then((result) => {
|
||||
if (result.dismiss === Swal.DismissReason.timer) {
|
||||
console.log('Dialog loading otomatis ditutup.');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -258,23 +258,17 @@
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-5">
|
||||
|
||||
<a class="btn btn-success" href="#">
|
||||
REPORT
|
||||
</a>
|
||||
<a class="btn btn-success" href="#">
|
||||
PRINT OUT
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="flex justify-start gap-5">
|
||||
<a class="btn btn-success" onclick="savePenilai()">
|
||||
SAVE
|
||||
REPORT
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user