Memperbaiki missing required pada routes otorisasi penawaran tender
This commit is contained in:
@@ -1,94 +1,89 @@
|
|||||||
<script tipe="module">
|
<script tipe="module">
|
||||||
function switchProses(id)
|
function switchProses(id) {
|
||||||
{
|
removeErrorCssMsg();
|
||||||
removeErrorCssMsg();
|
let c = $('#{{ $route[1] }}_check_' + id).val();
|
||||||
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 setActiveElement(id)
|
if ($('input[name="{{ $route[1] }}_check_' + id + '"]').is(':checked')) {
|
||||||
{
|
// checked
|
||||||
$('#{{$route[1]}}_biayaPenawaran_'+id).removeAttr('disabled');
|
// alert('aktif nih');
|
||||||
$('#{{$route[1]}}_dokumenPersetujuan_'+id).removeAttr('disabled');
|
setActiveElement(id);
|
||||||
$('#{{$route[1]}}_icon_update_'+id).removeAttr('disabled');
|
} else {
|
||||||
$('#{{$route[1]}}_icon_delete_'+id).removeAttr('disabled');
|
// unchecked
|
||||||
}
|
//alert('tdk aktif nih');
|
||||||
|
setNonActiveElement(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setNonActiveElement(id)
|
function setActiveElement(id) {
|
||||||
{
|
$('#{{ $route[1] }}_biayaPenawaran_' + id).removeAttr('disabled');
|
||||||
$('#{{$route[1]}}_biayaPenawaran_'+id).attr('disabled', 'disabled');
|
$('#{{ $route[1] }}_dokumenPersetujuan_' + id).removeAttr('disabled');
|
||||||
$('#{{$route[1]}}_dokumenPersetujuan_'+id).attr('disabled', 'disabled');
|
$('#{{ $route[1] }}_icon_update_' + id).removeAttr('disabled');
|
||||||
$('#{{$route[1]}}_icon_update_'+id).attr('disabled', 'disabled');
|
$('#{{ $route[1] }}_icon_delete_' + id).removeAttr('disabled');
|
||||||
$('#{{$route[1]}}_icon_delete_'+id).attr('disabled', 'disabled');
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function otorisasiKJPP(penawaran_id, id, kjpp_id, kjppName, biaya_penawaran) {
|
function setNonActiveElement(id) {
|
||||||
Swal.fire({
|
$('#{{ $route[1] }}_biayaPenawaran_' + id).attr('disabled', 'disabled');
|
||||||
title: ' ',
|
$('#{{ $route[1] }}_dokumenPersetujuan_' + id).attr('disabled', 'disabled');
|
||||||
text: "Yakin akan Otorisasi "+kjppName+"?",
|
$('#{{ $route[1] }}_icon_update_' + id).attr('disabled', 'disabled');
|
||||||
icon: 'warning',
|
$('#{{ $route[1] }}_icon_delete_' + id).attr('disabled', 'disabled');
|
||||||
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 otorisasiKJPP(penawaran_id, id, kjpp_id, kjppName, biaya_penawaran) {
|
||||||
});
|
Swal.fire({
|
||||||
|
title: ' ',
|
||||||
}
|
text: "Yakin akan Otorisasi " + kjppName + "?",
|
||||||
})
|
icon: 'warning',
|
||||||
}
|
showCancelButton: true,
|
||||||
</script>
|
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');
|
Route::post('penawaran/setData', 'setData')->name('penawaran.setData');
|
||||||
|
|
||||||
// update KJPP data, detail penawaran
|
// update KJPP data, detail penawaran
|
||||||
Route::put('/otorisasiPenawaranKJPP/{penawaran}', 'otorisasiPenawaranKJPP')->name('penawaran.otorisasiPenawaranKJPP');
|
Route::put('/otorisasiPenawaranKJPP/{id}', 'otorisasiPenawaranKJPP')->name('penawaran.otorisasiPenawaranKJPP');
|
||||||
|
|
||||||
// revisi penawaran ulang
|
// revisi penawaran ulang
|
||||||
Route::put('/penawaranulang/{penawaranulang}', 'penawaranulang')->name('penawaran.penawaranulang');
|
Route::put('/penawaranulang/{penawaranulang}', 'penawaranulang')->name('penawaran.penawaranulang');
|
||||||
|
|||||||
Reference in New Issue
Block a user