fix(form-penilai): perbaiki ID input dan tambahkan penanganan null
- Mengubah ID input dari 'luas_npw_' menjadi 'ls_npw_' untuk konsistensi. - Menambahkan penanganan null pada elemen telepon di informasi pembanding. - Memastikan bahwa elemen total nilai pasar wajar diperbarui dengan benar.
This commit is contained in:
@@ -242,7 +242,7 @@
|
||||
placeholder="Nama NPW">
|
||||
|
||||
<input type="text"
|
||||
id="luas_npw_${npwCounter}"
|
||||
id="ls_npw_${npwCounter}"
|
||||
class="input w-full "
|
||||
name="luas_npw_${npwCounter}"
|
||||
placeholder="Luas NPW"
|
||||
@@ -319,7 +319,7 @@
|
||||
placeholder="Nama NPW"
|
||||
value="${npw.name || ''}">
|
||||
<input type="text"
|
||||
id="luas_npw_${npwCounter}"
|
||||
id="ls_npw_${npwCounter}"
|
||||
class="input w-full currency-format"
|
||||
name="luas_npw_${npwCounter}"
|
||||
placeholder="Luas NPW"
|
||||
@@ -445,6 +445,7 @@
|
||||
const kategoriItems = document.querySelectorAll('[id^="luas_"]');
|
||||
|
||||
kategoriItems.forEach(item => {
|
||||
|
||||
const kategori = item.id.replace('luas_', '');
|
||||
const luasInput = document.getElementById(`luas_${kategori}`);
|
||||
const nilaiInput = document.querySelector(`input[name="nilai_${kategori}_1"]`);
|
||||
@@ -463,7 +464,7 @@
|
||||
// Tambahkan perhitungan untuk NPW tambahan
|
||||
const npwRows = document.querySelectorAll('.npw-row');
|
||||
npwRows.forEach(row => {
|
||||
const luasInput = row.querySelector('input[id^="luas_npw_"]');
|
||||
const luasInput = row.querySelector('input[id^="ls_npw_"]');
|
||||
const nilaiInput = row.querySelector('input[id^="nilai_npw_"][id$="_1"]');
|
||||
const outputElement = row.querySelector('input[id^="nilai_npw_"][id$="_2"]');
|
||||
|
||||
@@ -480,6 +481,7 @@
|
||||
// Update total nilai pasar wajar
|
||||
const totalElement = document.getElementById('total_nilai_pasar_wajar');
|
||||
if (totalElement) {
|
||||
|
||||
totalElement.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Penjual (HP)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['telepon'] }}</span>
|
||||
<span>{{ $item['telepon'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
|
||||
Reference in New Issue
Block a user