feat(auth): set default employee password to 123456 and sync employee profile in super admin
This commit is contained in:
@@ -218,7 +218,13 @@
|
||||
@endif
|
||||
<div>
|
||||
<p class="font-bold text-slate-900 text-xs">{{ $user->name }}</p>
|
||||
<p class="text-[11px] text-slate-400 font-mono">@<span>{{ $user->username }}</span></p>
|
||||
<div class="flex items-center gap-1.5 text-[11px] text-slate-400">
|
||||
<span class="font-mono">@<span>{{ $user->username }}</span></span>
|
||||
@if($user->employee && ($user->employee->position || $user->employee->unit_kerja))
|
||||
<span>•</span>
|
||||
<span class="text-slate-500 font-medium">{{ $user->employee->position ?: $user->employee->unit_kerja }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -349,6 +355,51 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Section: Data Profil Karyawan & Penugasan (Selaras Master HSE) -->
|
||||
<div class="pt-3 border-t border-slate-100 space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<label class="text-xs font-bold text-slate-700 flex items-center gap-1.5">
|
||||
<i class="fa-solid fa-id-badge text-indigo-600"></i>
|
||||
<span>Data Profil Karyawan & Penugasan</span>
|
||||
</label>
|
||||
<span class="text-[10px] text-slate-400 font-medium">(Opsional)</span>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Unit Kerja</label>
|
||||
<select name="unit_kerja" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700">
|
||||
<option value="">-- Pilih Unit Kerja --</option>
|
||||
<option value="Pembangkit">Pembangkit</option>
|
||||
<option value="Bendungan">Bendungan</option>
|
||||
<option value="Teknik">Teknik</option>
|
||||
<option value="Umum">Umum</option>
|
||||
<option value="Logistik">Logistik</option>
|
||||
<option value="HSE">HSE</option>
|
||||
<option value="QMA">QMA</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Divisi</label>
|
||||
<input type="text" name="division" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Operasi / Keuangan">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Posisi / Jabatan</label>
|
||||
<input type="text" name="position" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Driver / Staff Finance">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Operator / Driver</label>
|
||||
<select name="is_operator" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700">
|
||||
<option value="0">TIDAK (Bukan Driver)</option>
|
||||
<option value="1">YA (Aktif Mengemudi)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-4 border-t border-slate-100 flex items-center justify-end gap-2.5">
|
||||
<button type="button" onclick="closeCreateUserModal()" class="px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-600 rounded-xl text-xs font-bold transition">
|
||||
Batal
|
||||
@@ -430,6 +481,51 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Section: Data Profil Karyawan & Penugasan (Selaras Master HSE) -->
|
||||
<div class="pt-3 border-t border-slate-100 space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<label class="text-xs font-bold text-slate-700 flex items-center gap-1.5">
|
||||
<i class="fa-solid fa-id-badge text-indigo-600"></i>
|
||||
<span>Data Profil Karyawan & Penugasan</span>
|
||||
</label>
|
||||
<span class="text-[10px] text-slate-400 font-medium">(Opsional)</span>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Unit Kerja</label>
|
||||
<select id="edit_unit_kerja" name="unit_kerja" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700">
|
||||
<option value="">-- Pilih Unit Kerja --</option>
|
||||
<option value="Pembangkit">Pembangkit</option>
|
||||
<option value="Bendungan">Bendungan</option>
|
||||
<option value="Teknik">Teknik</option>
|
||||
<option value="Umum">Umum</option>
|
||||
<option value="Logistik">Logistik</option>
|
||||
<option value="HSE">HSE</option>
|
||||
<option value="QMA">QMA</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Divisi</label>
|
||||
<input type="text" id="edit_division" name="division" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Operasi / Keuangan">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Posisi / Jabatan</label>
|
||||
<input type="text" id="edit_position" name="position" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700" placeholder="Contoh: Driver / Staff Finance">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-[11px] font-semibold text-slate-600 mb-1">Operator / Driver</label>
|
||||
<select id="edit_is_operator" name="is_operator" class="w-full px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs focus:ring-2 focus:ring-indigo-500 focus:bg-white text-slate-700">
|
||||
<option value="0">TIDAK (Bukan Driver)</option>
|
||||
<option value="1">YA (Aktif Mengemudi)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Accordion: Izin Tambahan Khusus (Direct Permissions) -->
|
||||
<div class="border border-slate-200 rounded-xl overflow-hidden bg-slate-50/50">
|
||||
<button type="button"
|
||||
@@ -674,6 +770,16 @@
|
||||
const editGateEl = document.getElementById('edit_gate_id');
|
||||
if (editGateEl) editGateEl.value = user.gate_id || '';
|
||||
|
||||
const emp = user.employee || {};
|
||||
const editUnitKerja = document.getElementById('edit_unit_kerja');
|
||||
if (editUnitKerja) editUnitKerja.value = emp.unit_kerja || '';
|
||||
const editDivision = document.getElementById('edit_division');
|
||||
if (editDivision) editDivision.value = emp.division || '';
|
||||
const editPosition = document.getElementById('edit_position');
|
||||
if (editPosition) editPosition.value = emp.position || '';
|
||||
const editIsOperator = document.getElementById('edit_is_operator');
|
||||
if (editIsOperator) editIsOperator.value = (emp.is_operator ? '1' : '0');
|
||||
|
||||
const editPhotoPreview = document.getElementById('editUserPhotoPreview');
|
||||
const editPhotoPlaceholder = document.getElementById('editUserPhotoPlaceholder');
|
||||
const editPhotoInput = document.getElementById('editUserPhotoInput');
|
||||
|
||||
Reference in New Issue
Block a user