fix(pembanding): handle kordinat di data pembanding dan tampilan actifity team
This commit is contained in:
@@ -777,7 +777,7 @@ class SurveyorController extends Controller
|
||||
]);
|
||||
|
||||
|
||||
if($permohonan->jenisPenilaian->name=="External") {
|
||||
if ($permohonan->jenisPenilaian->name == "External") {
|
||||
LaporanExternal::updateOrCreate(
|
||||
['permohonan_id' => $permohonan->id],
|
||||
[
|
||||
@@ -904,10 +904,10 @@ class SurveyorController extends Controller
|
||||
'waktu_penilaian' => $validate['waktu_penilaian'],
|
||||
'deskripsi_penilaian' => $validate['deskripsi_penilaian'],
|
||||
]);
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil kirim jadwal kunjungan'
|
||||
], 200);
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil kirim jadwal kunjungan'
|
||||
], 200);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return response()->json([
|
||||
@@ -1384,13 +1384,37 @@ class SurveyorController extends Controller
|
||||
|
||||
// dd($request->all());
|
||||
$maxSize = getMaxFileSize('Foto');
|
||||
$validator = $request->validate([
|
||||
$validator = $request->validate(
|
||||
[
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'type' => 'nullable|string',
|
||||
'dokument_id' => 'required',
|
||||
'name_foto_objek' => 'nullable|string',
|
||||
'nomor_registrasi' => 'required|string',
|
||||
]);
|
||||
'kordinat_lat' => [
|
||||
'nullable',
|
||||
'regex:/^(-?[1-8]?[0-9](\.\d+)?|90(\.0+)?)$/'
|
||||
],
|
||||
'kordinat_long' => [
|
||||
'nullable',
|
||||
'regex:/^(-?(1[0-7][0-9]|[1-9]?[0-9])(\.\d+)?|180(\.0+)?)$/'
|
||||
],
|
||||
'kordinat_lat_pembanding.*' => [
|
||||
'nullable',
|
||||
'regex:/^(-?[1-8]?[0-9](\.\d+)?|90(\.0+)?)$/'
|
||||
],
|
||||
'kordinat_lng_pembanding.*' => [
|
||||
'nullable',
|
||||
'regex:/^(-?(1[0-7][0-9]|[1-9]?[0-9])(\.\d+)?|180(\.0+)?)$/'
|
||||
],
|
||||
],
|
||||
[
|
||||
'kordinat_lat.regex' => 'Format koordinat latitude tidak valid.',
|
||||
'kordinat_long.regex' => 'Format koordinat longitude tidak valid.',
|
||||
'kordinat_lat_pembanding.*.regex' => 'Format koordinat latitude pembanding tidak valid.',
|
||||
'kordinat_lng_pembanding.*.regex' => 'Format koordinat longitude pembanding tidak valid.',
|
||||
]
|
||||
);
|
||||
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT', 'MESIN'];
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div>
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
|
||||
@@ -721,10 +721,11 @@
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
hideLoadingSwal();
|
||||
console.error('Error:', error);
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
console.error('Error:', response.message);
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: 'Terjadi kesalahan pada server',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
|
||||
@@ -267,17 +267,17 @@
|
||||
<td class="px-4 py-2">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<input type="text" name="kordinat_lat" class="input" placeholder="Latitude"
|
||||
value="{{ $inspectionData['asset']['kordinat_lat'] ?? '' }}">
|
||||
value="{{ $inspectionData['asset']['kordinat_lat'] ?? '' }}" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
<input type="text" name="kordinat_lng" class="input" placeholder="Longitude"
|
||||
value="{{ $inspectionData['asset']['kordinat_lng'] ?? '' }}">
|
||||
value="{{ $inspectionData['asset']['kordinat_lng'] ?? '' }}" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<input type="text" name="kordinat_lat_pembanding[]" class="input"
|
||||
placeholder="Latitude">
|
||||
placeholder="Latitude" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
<input type="text" name="kordinat_lng_pembanding[]" class="input"
|
||||
placeholder="Longitude">
|
||||
placeholder="Longitude" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user