Merged in featnota_arcc (pull request #314)
add nota arcc di maklumat pelanggan
This commit is contained in:
@@ -227,6 +227,7 @@ class CustomersController extends Controller
|
||||
'nota'=>$request->nota,
|
||||
'kodkerja'=>$request->pekerjaan,
|
||||
'nota_pekerjaan'=>$request->nota_pekerjaan,
|
||||
'notaarcc'=>$request->notaarcc,
|
||||
'tujuangadai'=>$request->tujuan_gadai,
|
||||
]);
|
||||
|
||||
|
||||
@@ -119,15 +119,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 d-flex justify-content-end mt-3">
|
||||
{{-- <div class="col-md-12 d-flex justify-content-end mt-3">
|
||||
<button class="btn btn-primary" data-toggle="modal" data-target="#customer_detail">Maklumat Pelanggan</button>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12 mt-md-3 justify-content-between form-group row">
|
||||
<div class="btn-group btn-group-toggle col-md-6" data-toggle="buttons">
|
||||
<label class="btn btn-primary">
|
||||
<label class="btn btn-secondary">
|
||||
<input type="radio" name="options" id="option1" value="belum_tebus" autocomplete="off" checked>Pembiayaan Belum Selesai
|
||||
</label>
|
||||
<label class="btn btn-secondary">
|
||||
@@ -136,6 +135,7 @@
|
||||
<label class="btn btn-secondary">
|
||||
<input type="radio" name="options" id="option3" value="lelong" autocomplete="off">Lelong
|
||||
</label>
|
||||
<button class="btn btn-secondary" data-toggle="modal" data-target="#arcc_detail">Maklumat Pelanggan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
@endphp
|
||||
<a class="nav-item nav-link {{ $activate_tab_SAG_baru }}" id="nav-tawarruq-tab" data-toggle="tab" href="#nav-tawarruq" role="tab" aria-controls="nav-tawarruq" aria-selected="{{ $aria_selected_SAG_baru }}">SAG Baru</a>
|
||||
<a class="nav-item nav-link {{ $activate_tab_SAG_lama }}" " id="nav-xtawarruq-tab" data-toggle="tab" href="#nav-xtawarruq" role="tab" aria-controls="nav-xtawarruq" aria-selected="{{ $aria_selected_SAG_lama }}"><span id="textnavsag">SAG Lama</span></a>
|
||||
<a class="nav-item nav-link {{ $activate_tab_SAG_lama }}" id="nav-xtawarruq-tab" data-toggle="tab" href="#nav-xtawarruq" role="tab" aria-controls="nav-xtawarruq" aria-selected="{{ $aria_selected_SAG_lama }}"><span id="textnavsag">SAG Lama</span></a>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="tab-content" id="navtawarruqdannottawarruq">
|
||||
@@ -255,6 +255,52 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="arcc_detail" tabindex="-1" aria-labelledby="arcc_detailLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="arcc_detailLabel">Maklumat Pelanggan</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- Maklumat Pelanggan -->
|
||||
@php
|
||||
if($customer_info['kpbaru'] != null){
|
||||
$noic = $customer_info['kpbaru'];
|
||||
} else {
|
||||
$noic = $customer_info['kplama'];
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="bg-light p-3 rounded border">
|
||||
<p><strong>Nama:</strong> {{ $customer_info['nama'] }}</p>
|
||||
<p><strong>No. K/P:</strong> {{ $noic }}</p>
|
||||
<p><strong>No. Telefon:</strong> {{ $customer_info['telefon'] ? $customer_info['telefon'] : '' }}</p>
|
||||
<p><strong>Alamat:</strong> {{ $customer_info['alamat1'] }}</p>
|
||||
<p><strong>No. Pelanggan:</strong> {{ $customer_info['nopelanggan'] }}</p>
|
||||
<p><strong>Nota Pelanggan:</strong> {{ $customer_info['nota'] }}</p>
|
||||
|
||||
<div class="ms-12 mt-2">
|
||||
<strong>Nota Arcc:</strong>
|
||||
<textarea style="resize:none; width:100%; padding: 10px;" name="nota_arcc" id="nota_arcc" rows="2" readonly class="form-control">{{ $customer_info['nota_arcc'] }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" onclick="kemaskinifunc()" id="btnkemaskini">Ubah</button>
|
||||
<button type="button" class="btn btn-primary" onclick="kemaskinipelanggan()" id="btnsave">Terima</button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="customer_detail" tabindex="-1" aria-labelledby="customer_detailLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl">
|
||||
@@ -399,34 +445,34 @@
|
||||
<div class='col-md-4'>
|
||||
Daerah
|
||||
</div>
|
||||
<div class='col-md-8'>
|
||||
{{-- <div class='col-md-8'>
|
||||
@php
|
||||
$poskod = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/poskod/'. $customer_info['poskod'])->json();
|
||||
if(empty($poskod)){
|
||||
$poskod = array('koddaerah'=>'NIL','kodnegeri' => 'NIL');
|
||||
}
|
||||
$daerah = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/daerah/' . $poskod['koddaerah'])->json();
|
||||
@endphp
|
||||
@endphp --}}
|
||||
{{-- <input type="text" readonly name='koddaerah' id='koddaerah' value="{{ $daerah ? $daerah['namadaerah'] : 'NIL' }}" class='form-control'> --}}
|
||||
<label id="koddaerah" class="form-control" style="background: none; border: none; padding-left: 0;">
|
||||
{{-- <label id="koddaerah" class="form-control" style="background: none; border: none; padding-left: 0;">
|
||||
{{ $daerah ? $daerah['namadaerah'] : 'NIL' }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group row col-md-12'>
|
||||
</div> --}}
|
||||
{{-- <div class='form-group row col-md-12'>
|
||||
<div class='col-md-4'>
|
||||
Negeri
|
||||
</div>
|
||||
<div class='col-md-8'>
|
||||
@php
|
||||
$negeri = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/negeri/' . $poskod['kodnegeri'])->json();
|
||||
@endphp
|
||||
@endphp --}}
|
||||
{{-- <input type="text" readonly name='kodnegeri' id='kodnegeri' value="{{ $negeri ? $negeri['negeri'] : 'NIL' }}" class='form-control'> --}}
|
||||
<label id="kodnegeri" class="form-control" style="background: none; border: none; padding-left: 0;">
|
||||
{{-- <label id="kodnegeri" class="form-control" style="background: none; border: none; padding-left: 0;">
|
||||
{{ $negeri ? $negeri['negeri'] : 'NIL' }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class='form-group row col-md-12'>
|
||||
<div class='col-md-4'>
|
||||
Nota
|
||||
@@ -442,8 +488,8 @@
|
||||
</div>
|
||||
</form>
|
||||
<div class="mr-5 form-group float-right">
|
||||
{{-- <button type="button" class="btn btn-primary" onclick="kemaskinifunc()" id="btnkemaskini">Ubah</button> --}}
|
||||
<button type="button" class="btn btn-primary" onclick="kemaskinipelanggan()" id="btnsave">Terima</button>
|
||||
{{-- <button type="button" class="btn btn-primary" onclick="kemaskinifunc()" id="btnkemaskini">Ubah</button>
|
||||
<button type="button" class="btn btn-primary" onclick="kemaskinipelanggan()" id="btnsave">Terima</button> --}}
|
||||
{{-- <button type="button" class="btn btn-primary" id="btnotp">Daftar Akaun Online</button> --}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -2396,6 +2442,7 @@
|
||||
$('#kodbank').attr('disabled', false);
|
||||
$('#noakaun').attr('readonly', false);
|
||||
$('#nota').attr('readonly', false);
|
||||
$('#nota_arcc').attr('readonly', false);
|
||||
$('#alamat').attr('readonly', false);
|
||||
$('#poskod').attr('readonly', false);
|
||||
|
||||
@@ -2417,6 +2464,7 @@
|
||||
$('#kodbank').attr('disabled', true);
|
||||
$('#noakaun').attr('readonly', true);
|
||||
$('#nota').attr('readonly', true);
|
||||
$('#nota_arcc').attr('readonly', true);
|
||||
$('#alamat').attr('readonly', true);
|
||||
$('#poskod').attr('readonly', true);
|
||||
}
|
||||
@@ -2424,18 +2472,20 @@
|
||||
$("#kemaskiniform").submit(function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var nokp = $('#icno').val();
|
||||
var nokp = $('#noic').val();
|
||||
var telefon1 = $('#telefon').val();
|
||||
var telefon2 = $('#telefon2').val();
|
||||
var kodbank = $('#kodbank').val();
|
||||
var noakaun = $('#noakaun').val();
|
||||
var nota = $('#nota').val();
|
||||
var nota_arcc = $('#nota_arcc').val();
|
||||
var alamat = $('#alamat').val();
|
||||
var poskod = $('#poskod').val();
|
||||
|
||||
$.ajax({
|
||||
method:"put",
|
||||
url: api_url + "/api/customers/update/kaunter/" + nokp,
|
||||
// url: api_url + "/api/customers/update/kaunter/" + nokp + "/" + kodcaw,
|
||||
url: api_url + "/api/callcenter/customers/update/kaunter/" + nokp + "/" + kodcaw,
|
||||
data:{
|
||||
"namateller" : "{{ Auth::user()->name }}",
|
||||
"telefon1": telefon1,
|
||||
@@ -2443,6 +2493,7 @@
|
||||
"kodbank":kodbank,
|
||||
"noakaun":noakaun,
|
||||
'nota':nota,
|
||||
'nota_arcc':nota_arcc,
|
||||
'alamat':alamat,
|
||||
'poskod':poskod
|
||||
},
|
||||
@@ -2479,94 +2530,119 @@
|
||||
});
|
||||
});
|
||||
|
||||
// function kemaskinipelanggan(){
|
||||
|
||||
// var errortelefon1 = 0;
|
||||
// var errortelefon2 = 0;
|
||||
|
||||
// if(!($('#telefon').val().length >= 9 && $('#telefon').val().length < 12)){
|
||||
// $('#errortelefon').show();
|
||||
// $('#errortelefon').text("*lebih kecil dari 10 dan lebih besar dari 12");
|
||||
// $('#telefon').addClass('is-invalid');
|
||||
// errortelefon1++;
|
||||
// }else{
|
||||
// $('#errortelefon').hide();
|
||||
// $('#telefon').removeClass('is-invalid');
|
||||
// errortelefon1--;
|
||||
// }
|
||||
|
||||
// if($('#telefon2').val() != ''){
|
||||
// if(!($('#telefon2').val().length >= 9 && $('#telefon2').val().length < 12)){
|
||||
// $('#errortelefon2').show();
|
||||
// $('#errortelefon2').text("*lebih kecil dari 10 dan lebih besar dari 12");
|
||||
// $('#telefon2').addClass('is-invalid');
|
||||
// errortelefon2++;
|
||||
// }else{
|
||||
// $('#errortelefon2').hide();
|
||||
// $('#telefon2').removeClass('is-invalid');
|
||||
// errortelefon2--;
|
||||
// }
|
||||
// }else{
|
||||
// $('#errortelefon2').hide();
|
||||
// $('#telefon2').removeClass('is-invalid');
|
||||
// errortelefon2--;
|
||||
// }
|
||||
|
||||
// if(errortelefon1 <= 0 && errortelefon2 <= 0){
|
||||
// $('#btnkemaskini').removeClass('btn-danger');
|
||||
// $('#btnkemaskini').addClass('btn-primary');
|
||||
// $('#btnkemaskini').text('Ubah');
|
||||
// $('#btnkemaskini').attr('onclick','kemaskinifunc()');
|
||||
// $('#btnotp').text('Daftar Akuan Online');
|
||||
// $('#btnotp').attr('onclick','#');
|
||||
|
||||
// //attribute nak readonly false
|
||||
// $('#telefon').attr('readonly', true);
|
||||
// $('#telefon2').attr('readonly', true);
|
||||
// $('#noakaun').attr('readonly', true);
|
||||
// $('#kodbank').attr('readonly', true);
|
||||
// $('#nota').attr('readonly', true);
|
||||
// $('#nota_arcc').attr('readonly', true);
|
||||
// $('#alamat').attr('readonly', true);
|
||||
// $('#poskod').attr('readonly', true);
|
||||
|
||||
// $('#kemaskiniform').trigger('submit');
|
||||
// }
|
||||
// }
|
||||
|
||||
// $('#btnotp').click(function(){
|
||||
// $('#customer_detail').modal('hide');
|
||||
// var noic = $('#noic').val();
|
||||
// $('#noic_otp').val(noic);
|
||||
// $('#opt_modal').modal('show');
|
||||
// });
|
||||
|
||||
// $('#jana_otp').click(function(){
|
||||
// var noic = $('#noic_otp').val();
|
||||
|
||||
// $.ajax({
|
||||
// method:'get',
|
||||
// url: "{{ route('customer.otp') }}",
|
||||
// data:{
|
||||
// 'noic_otp' : noic
|
||||
// },
|
||||
// dataType:'json',
|
||||
// success: function(otp_token){
|
||||
// if(otp_token['error']){
|
||||
// Swal.fire({
|
||||
// icon: 'error',
|
||||
// title: 'Amaran!',
|
||||
// text: otp_token['error']
|
||||
// });
|
||||
// }else if(otp_token['otp']){
|
||||
// $('#otp_form').hide();
|
||||
// $('#otp_generate').show();
|
||||
// $('#otp_number').text(otp_token['otp']);
|
||||
// }
|
||||
// },
|
||||
// error: function(xhRequest, ErrorText, thrownError){
|
||||
// console.log(xhRequest);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
function kemaskinipelanggan(){
|
||||
// Tukar butang "Batal" jadi "Ubah" semula
|
||||
$('#btnkemaskini').removeClass('btn-danger');
|
||||
$('#btnkemaskini').addClass('btn-primary');
|
||||
$('#btnkemaskini').text('Ubah');
|
||||
$('#btnkemaskini').attr('onclick','kemaskinifunc()');
|
||||
$('#btnotp').text('Daftar Akuan Online');
|
||||
$('#btnotp').attr('onclick','#');
|
||||
|
||||
var errortelefon1 = 0;
|
||||
var errortelefon2 = 0;
|
||||
// Lock balik semua field
|
||||
$('#telefon').attr('readonly', true);
|
||||
$('#telefon2').attr('readonly', true);
|
||||
$('#noakaun').attr('readonly', true);
|
||||
$('#kodbank').attr('disabled', true);
|
||||
$('#nota').attr('readonly', true);
|
||||
$('#nota_arcc').attr('readonly', true);
|
||||
$('#alamat').attr('readonly', true);
|
||||
$('#poskod').attr('readonly', true);
|
||||
|
||||
if(!($('#telefon').val().length >= 9 && $('#telefon').val().length < 12)){
|
||||
$('#errortelefon').show();
|
||||
$('#errortelefon').text("*lebih kecil dari 10 dan lebih besar dari 12");
|
||||
$('#telefon').addClass('is-invalid');
|
||||
errortelefon1++;
|
||||
}else{
|
||||
$('#errortelefon').hide();
|
||||
$('#telefon').removeClass('is-invalid');
|
||||
errortelefon1--;
|
||||
}
|
||||
console.log("👉 Hantar form kemaskini (nota_arcc)");
|
||||
$('#kemaskiniform').trigger('submit');
|
||||
}
|
||||
|
||||
if($('#telefon2').val() != ''){
|
||||
if(!($('#telefon2').val().length >= 9 && $('#telefon2').val().length < 12)){
|
||||
$('#errortelefon2').show();
|
||||
$('#errortelefon2').text("*lebih kecil dari 10 dan lebih besar dari 12");
|
||||
$('#telefon2').addClass('is-invalid');
|
||||
errortelefon2++;
|
||||
}else{
|
||||
$('#errortelefon2').hide();
|
||||
$('#telefon2').removeClass('is-invalid');
|
||||
errortelefon2--;
|
||||
}
|
||||
}else{
|
||||
$('#errortelefon2').hide();
|
||||
$('#telefon2').removeClass('is-invalid');
|
||||
errortelefon2--;
|
||||
}
|
||||
|
||||
if(errortelefon1 <= 0 && errortelefon2 <= 0){
|
||||
$('#btnkemaskini').removeClass('btn-danger');
|
||||
$('#btnkemaskini').addClass('btn-primary');
|
||||
$('#btnkemaskini').text('Ubah');
|
||||
$('#btnkemaskini').attr('onclick','kemaskinifunc()');
|
||||
$('#btnotp').text('Daftar Akuan Online');
|
||||
$('#btnotp').attr('onclick','#');
|
||||
|
||||
//attribute nak readonly false
|
||||
$('#telefon').attr('readonly', true);
|
||||
$('#telefon2').attr('readonly', true);
|
||||
$('#noakaun').attr('readonly', true);
|
||||
$('#kodbank').attr('disabled', true);
|
||||
$('#nota').attr('readonly', true);
|
||||
$('#alamat').attr('readonly', true);
|
||||
$('#poskod').attr('readonly', true);
|
||||
|
||||
$('#kemaskiniform').trigger('submit');
|
||||
}
|
||||
}
|
||||
|
||||
$('#btnotp').click(function(){
|
||||
$('#customer_detail').modal('hide');
|
||||
var noic = $('#noic').val();
|
||||
$('#noic_otp').val(noic);
|
||||
$('#opt_modal').modal('show');
|
||||
});
|
||||
|
||||
$('#jana_otp').click(function(){
|
||||
var noic = $('#noic_otp').val();
|
||||
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('customer.otp') }}",
|
||||
data:{
|
||||
'noic_otp' : noic
|
||||
},
|
||||
dataType:'json',
|
||||
success: function(otp_token){
|
||||
if(otp_token['error']){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: otp_token['error']
|
||||
});
|
||||
}else if(otp_token['otp']){
|
||||
$('#otp_form').hide();
|
||||
$('#otp_generate').show();
|
||||
$('#otp_number').text(otp_token['otp']);
|
||||
}
|
||||
},
|
||||
error: function(xhRequest, ErrorText, thrownError){
|
||||
console.log(xhRequest);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -404,6 +404,9 @@
|
||||
<div class='col-md-8'>
|
||||
@php
|
||||
$poskod = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/poskod/'. $customer_info['poskod'])->json();
|
||||
// $data = $poskod;
|
||||
// $poskod2 = array('koddaerah'=>'NIL','kodnegeri' => 'NIL');
|
||||
// dd($poskod,$poskod2,$data,$customer_info);
|
||||
if(empty($poskod)){
|
||||
$poskod = array('koddaerah'=>'NIL','kodnegeri' => 'NIL');
|
||||
}
|
||||
@@ -431,6 +434,14 @@
|
||||
<textarea style="resize:none" name="nota" id="nota" cols="30" rows="3" readonly class='form-control'>{{ $customer_info['nota'] }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
{{-- <div class='form-group row col-md-12'>
|
||||
<div class='col-md-4'>
|
||||
Nota Arcc
|
||||
</div>
|
||||
<div class='col-md-8'>
|
||||
<textarea style="resize:none" name="nota_arcc" id="nota_arcc" cols="30" rows="3" readonly class='form-control'>{{ $customer_info['nota_arcc'] }}</textarea>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -2531,6 +2542,7 @@
|
||||
$('#nota_pekerjaan').attr('disabled', false);
|
||||
$('#noakaun').attr('readonly', false);
|
||||
$('#nota').attr('readonly', false);
|
||||
// $('#nota_arcc').attr('readonly', false);
|
||||
$('#alamat').attr('readonly', false);
|
||||
$('#poskod').attr('readonly', false);
|
||||
|
||||
@@ -2554,6 +2566,7 @@
|
||||
$('#nota_pekerjaan').attr('disabled', true);
|
||||
$('#noakaun').attr('readonly', true);
|
||||
$('#nota').attr('readonly', true);
|
||||
// $('#nota_arcc').attr('readonly', true);
|
||||
$('#alamat').attr('readonly', true);
|
||||
$('#poskod').attr('readonly', true);
|
||||
}
|
||||
@@ -2569,6 +2582,7 @@
|
||||
var nota_pekerjaan = $('#nota_pekerjaan').val();
|
||||
var noakaun = $('#noakaun').val();
|
||||
var nota = $('#nota').val();
|
||||
// var nota_arcc = $('#nota_arcc').val();
|
||||
var alamat = $('#alamat').val();
|
||||
var poskod = $('#poskod').val();
|
||||
|
||||
@@ -2584,6 +2598,7 @@
|
||||
"nota_pekerjaan":nota_pekerjaan,
|
||||
"noakaun":noakaun,
|
||||
'nota':nota,
|
||||
// 'nota_arcc':nota_arcc,
|
||||
'alamat':alamat,
|
||||
'poskod':poskod
|
||||
},
|
||||
@@ -2669,6 +2684,7 @@
|
||||
$('#kodkerja').attr('disabled', true);
|
||||
$('#nota_pekerjaan').attr('disabled', true);
|
||||
$('#nota').attr('readonly', true);
|
||||
// $('#nota_arcc').attr('readonly', true);
|
||||
$('#alamat').attr('readonly', true);
|
||||
$('#poskod').attr('readonly', true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user