fix sedikit2

This commit is contained in:
MUHD HAFIFIE
2021-07-14 16:43:49 +08:00
parent c8c93c38ad
commit 68b2cd63cc
8 changed files with 161 additions and 30 deletions
+25 -14
View File
@@ -688,23 +688,33 @@
}
}
function ulangcetakagh()
function ulangcetakagh(e)
{
if($("input[name='options']:checked").val() == 'belum_tebus'){
var komen2 = $(e).data('komen2');
if(komen2 !== null)
{
if($("input[name='options']:checked").val() == 'belum_tebus'){
let histid = $('input[name="belum"]:checked').val();
if(histid == null){
Swal.fire({
icon: 'error',
title: 'Amaran',
text: 'Sila pilih salah satu SAG'
});
}else{
let urlroute = '{{ route("agh.ulangcetak", ":id") }}';
urlroute = urlroute.replace(':id', histid);
window.open(urlroute, '_blank');
swal.close();
if(histid == null){
Swal.fire({
icon: 'error',
title: 'Amaran',
text: 'Sila pilih salah satu SAG'
});
}else{
let urlroute = '{{ route("agh.ulangcetak", ":id") }}';
urlroute = urlroute.replace(':id', histid);
window.open(urlroute, '_blank');
swal.close();
}
}
}else{
$('#AGHModalEdit').modal('show');
swal.close();
}
return;
}
function saghilangfunc()
@@ -724,6 +734,7 @@
data:{ "norujukan" : histid,"kodcaw" : kodcaw},
success:function(data)
{
var count = Object.keys(data).length;
if(count > 0)
@@ -735,7 +746,7 @@
showConfirmButton: false,
html: "<br>" +
'<button type="button" role="button" tabindex="0" class="btn btn-primary mr-1" onclick="swal.close()">' + 'Okay' + '</button>' +
'<button type="button" role="button" tabindex="0" class="btn btn-primary" onclick="ulangcetakagh()">' + 'Ulang Cetak' + '</button>',
'<button type="button" role="button" tabindex="0" class="btn btn-primary" onclick="ulangcetakagh(this)" data-komen2="' + data[0].komen2 + '">' + 'Ulang Cetak' + '</button>',
icon: 'error',
title: 'Surat Akuan Gadaian Hilang telah dikeluarkan!'
});