solve keanggotaan kelompok tani

This commit is contained in:
2026-08-18 14:05:46 +07:00
parent ac8b370248
commit 8fbf68e6ef
3 changed files with 33 additions and 8 deletions
@@ -1064,6 +1064,9 @@
const pernahJualHargaLebihTinggiPernah = @json($pernahJualHargaLebihTinggiPernahValue);
const panutanPetaniSuksesTidakAda = String(@json($panutanPetaniSuksesTidakAdaValue));
const terdaftarKelompokTaniYa = @json($terdaftarKelompokTaniYaValue);
const keaktifanPertemuanKelompokLowest = String(@json($keaktifanPertemuanKelompokLowestValue));
const peranDalamKelompokLowest = String(@json($peranDalamKelompokLowestValue));
const manfaatKelompokTaniLowest = String(@json($manfaatKelompokTaniLowestValue));
const statusRekeningTidakPunya = String(@json($statusRekeningTidakPunyaValue));
const pengalamanKreditPerluAlasan = @json($pengalamanKreditPerluAlasanValues).map(String);
const alasanKreditLainnya = @json($alasanKreditLainnyaValue);
@@ -1475,12 +1478,17 @@
function syncTerdaftarKelompokFields() {
const isTerdaftar = $('input[name="terdaftar_kelompok_tani"]:checked').val() === terdaftarKelompokTaniYa;
const $fields = $('#nama-kelompok-tani, #lama-bergabung-kelompok, #kedekatan-sesama-anggota');
const $fields = $('#nama-kelompok-tani, #lama-bergabung-kelompok, #kedekatan-sesama-anggota, #topik-biasa-dibahas')
.add('input[name="keaktifan_pertemuan_kelompok"], input[name="peran_dalam_kelompok"], input[name="manfaat_kelompok_tani"]');
$fields.prop('disabled', !isTerdaftar);
if (!isTerdaftar) {
$fields.val('');
$('#nama-kelompok-tani, #lama-bergabung-kelompok, #topik-biasa-dibahas').val('');
$('input[name="keaktifan_pertemuan_kelompok"][value="' + keaktifanPertemuanKelompokLowest + '"]').prop('checked', true);
$('input[name="peran_dalam_kelompok"][value="' + peranDalamKelompokLowest + '"]').prop('checked', true);
$('input[name="manfaat_kelompok_tani"][value="' + manfaatKelompokTaniLowest + '"]').prop('checked', true);
$('#kedekatan-sesama-anggota').val('');
$('#kedekatan-sesama-anggota').trigger('change.select2');
}
}
@@ -1060,6 +1060,9 @@
const pernahJualHargaLebihTinggiPernah = @json($pernahJualHargaLebihTinggiPernahValue);
const panutanPetaniSuksesTidakAda = String(@json($panutanPetaniSuksesTidakAdaValue));
const terdaftarKelompokTaniYa = @json($terdaftarKelompokTaniYaValue);
const keaktifanPertemuanKelompokLowest = String(@json($keaktifanPertemuanKelompokLowestValue));
const peranDalamKelompokLowest = String(@json($peranDalamKelompokLowestValue));
const manfaatKelompokTaniLowest = String(@json($manfaatKelompokTaniLowestValue));
const statusRekeningTidakPunya = String(@json($statusRekeningTidakPunyaValue));
const pengalamanKreditPerluAlasan = @json($pengalamanKreditPerluAlasanValues).map(String);
const alasanKreditLainnya = @json($alasanKreditLainnyaValue);
@@ -1471,12 +1474,17 @@
function syncTerdaftarKelompokFields() {
const isTerdaftar = $('input[name="terdaftar_kelompok_tani"]:checked').val() === terdaftarKelompokTaniYa;
const $fields = $('#nama-kelompok-tani, #lama-bergabung-kelompok, #kedekatan-sesama-anggota');
const $fields = $('#nama-kelompok-tani, #lama-bergabung-kelompok, #kedekatan-sesama-anggota, #topik-biasa-dibahas')
.add('input[name="keaktifan_pertemuan_kelompok"], input[name="peran_dalam_kelompok"], input[name="manfaat_kelompok_tani"]');
$fields.prop('disabled', !isTerdaftar);
if (!isTerdaftar) {
$fields.val('');
$('#nama-kelompok-tani, #lama-bergabung-kelompok, #topik-biasa-dibahas').val('');
$('input[name="keaktifan_pertemuan_kelompok"][value="' + keaktifanPertemuanKelompokLowest + '"]').prop('checked', true);
$('input[name="peran_dalam_kelompok"][value="' + peranDalamKelompokLowest + '"]').prop('checked', true);
$('input[name="manfaat_kelompok_tani"][value="' + manfaatKelompokTaniLowest + '"]').prop('checked', true);
$('#kedekatan-sesama-anggota').val('');
$('#kedekatan-sesama-anggota').trigger('change.select2');
}
}