Memperbaiki missing required pada routes otorisasi penawaran tender
This commit is contained in:
@@ -1,94 +1,89 @@
|
||||
<script tipe="module">
|
||||
function switchProses(id)
|
||||
{
|
||||
removeErrorCssMsg();
|
||||
let c = $('#{{$route[1]}}_check_'+id).val();
|
||||
|
||||
if($('input[name="{{$route[1]}}_check_'+id+'"]').is(':checked'))
|
||||
{
|
||||
// checked
|
||||
// alert('aktif nih');
|
||||
setActiveElement(id);
|
||||
}else
|
||||
{
|
||||
// unchecked
|
||||
//alert('tdk aktif nih');
|
||||
setNonActiveElement(id);
|
||||
}
|
||||
}
|
||||
function switchProses(id) {
|
||||
removeErrorCssMsg();
|
||||
let c = $('#{{ $route[1] }}_check_' + id).val();
|
||||
|
||||
function setActiveElement(id)
|
||||
{
|
||||
$('#{{$route[1]}}_biayaPenawaran_'+id).removeAttr('disabled');
|
||||
$('#{{$route[1]}}_dokumenPersetujuan_'+id).removeAttr('disabled');
|
||||
$('#{{$route[1]}}_icon_update_'+id).removeAttr('disabled');
|
||||
$('#{{$route[1]}}_icon_delete_'+id).removeAttr('disabled');
|
||||
}
|
||||
if ($('input[name="{{ $route[1] }}_check_' + id + '"]').is(':checked')) {
|
||||
// checked
|
||||
// alert('aktif nih');
|
||||
setActiveElement(id);
|
||||
} else {
|
||||
// unchecked
|
||||
//alert('tdk aktif nih');
|
||||
setNonActiveElement(id);
|
||||
}
|
||||
}
|
||||
|
||||
function setNonActiveElement(id)
|
||||
{
|
||||
$('#{{$route[1]}}_biayaPenawaran_'+id).attr('disabled', 'disabled');
|
||||
$('#{{$route[1]}}_dokumenPersetujuan_'+id).attr('disabled', 'disabled');
|
||||
$('#{{$route[1]}}_icon_update_'+id).attr('disabled', 'disabled');
|
||||
$('#{{$route[1]}}_icon_delete_'+id).attr('disabled', 'disabled');
|
||||
}
|
||||
function setActiveElement(id) {
|
||||
$('#{{ $route[1] }}_biayaPenawaran_' + id).removeAttr('disabled');
|
||||
$('#{{ $route[1] }}_dokumenPersetujuan_' + id).removeAttr('disabled');
|
||||
$('#{{ $route[1] }}_icon_update_' + id).removeAttr('disabled');
|
||||
$('#{{ $route[1] }}_icon_delete_' + id).removeAttr('disabled');
|
||||
}
|
||||
|
||||
function otorisasiKJPP(penawaran_id, id, kjpp_id, kjppName, biaya_penawaran) {
|
||||
Swal.fire({
|
||||
title: ' ',
|
||||
text: "Yakin akan Otorisasi "+kjppName+"?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "{{ route($route[0].'.'.$route[1].'.otorisasiPenawaranKJPP','') }}/"+id;
|
||||
let noReg = $("#textReg").text();
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id =id;
|
||||
input_data.penawaran_id =penawaran_id;
|
||||
input_data.kjpp_id =kjpp_id;
|
||||
input_data.kjppName =kjppName;
|
||||
input_data.biaya_penawaran =biaya_penawaran;
|
||||
input_data.noReg =noReg;
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if('success' == response.status)
|
||||
{
|
||||
swal.fire('Sukses Otorisasi!', response.message.message_success[0], 'success').then(() => {
|
||||
var url = "{{ route('otorisasitender.penawaran.index') }}";
|
||||
$(location).attr('href',url);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Swal.fire('Error!', response.message.message_error[0], 'error');
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(response, textStatus, errorThrown) {
|
||||
// var errors = response.responseJSON.errors;
|
||||
// console.log(errors);
|
||||
console.log(response);
|
||||
function setNonActiveElement(id) {
|
||||
$('#{{ $route[1] }}_biayaPenawaran_' + id).attr('disabled', 'disabled');
|
||||
$('#{{ $route[1] }}_dokumenPersetujuan_' + id).attr('disabled', 'disabled');
|
||||
$('#{{ $route[1] }}_icon_update_' + id).attr('disabled', 'disabled');
|
||||
$('#{{ $route[1] }}_icon_delete_' + id).attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
function otorisasiKJPP(penawaran_id, id, kjpp_id, kjppName, biaya_penawaran) {
|
||||
Swal.fire({
|
||||
title: ' ',
|
||||
text: "Yakin akan Otorisasi " + kjppName + "?",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
//define variable
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL =
|
||||
"{{ route($route[0] . '.' . $route[1] . '.otorisasiPenawaranKJPP', ['id' => 'PLACEHOLDER']) }}"
|
||||
.replace('PLACEHOLDER', id);
|
||||
let noReg = $("#textReg").text();
|
||||
var input_data = new Object();
|
||||
input_data._token = token;
|
||||
input_data.id = id;
|
||||
input_data.penawaran_id = penawaran_id;
|
||||
input_data.kjpp_id = kjpp_id;
|
||||
input_data.kjppName = kjppName;
|
||||
input_data.biaya_penawaran = biaya_penawaran;
|
||||
input_data.noReg = noReg;
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
if ('success' == response.status) {
|
||||
swal.fire('Sukses Otorisasi!', response.message.message_success[0],
|
||||
'success').then(() => {
|
||||
var url = "{{ route('otorisasitender.penawaran.index') }}";
|
||||
$(location).attr('href', url);
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message.message_error[0], 'error');
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(response, textStatus, errorThrown) {
|
||||
// var errors = response.responseJSON.errors;
|
||||
// console.log(errors);
|
||||
console.log(response);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -97,7 +97,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('penawaran/setData', 'setData')->name('penawaran.setData');
|
||||
|
||||
// update KJPP data, detail penawaran
|
||||
Route::put('/otorisasiPenawaranKJPP/{penawaran}', 'otorisasiPenawaranKJPP')->name('penawaran.otorisasiPenawaranKJPP');
|
||||
Route::put('/otorisasiPenawaranKJPP/{id}', 'otorisasiPenawaranKJPP')->name('penawaran.otorisasiPenawaranKJPP');
|
||||
|
||||
// revisi penawaran ulang
|
||||
Route::put('/penawaranulang/{penawaranulang}', 'penawaranulang')->name('penawaran.penawaranulang');
|
||||
|
||||
Reference in New Issue
Block a user