FIX_actions
This commit is contained in:
parent
79ee88ddd8
commit
436499e21a
@ -484,13 +484,24 @@
|
|||||||
if(policy_value == 0 || insurer_or_tpa == 'tpa' || action_type == 'import'){
|
if(policy_value == 0 || insurer_or_tpa == 'tpa' || action_type == 'import'){
|
||||||
$("#event_type").removeAttr("multiple");
|
$("#event_type").removeAttr("multiple");
|
||||||
$("#event_type").attr("name", "event_type");
|
$("#event_type").attr("name", "event_type");
|
||||||
if ($.fn.select2 && $('#event_type').data('select2')) {
|
|
||||||
$('#event_type').select2('destroy');
|
|
||||||
}
|
|
||||||
$("#event_type").select2('destroy');
|
$("#event_type").select2('destroy');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**This function updates the download link based on the selected option in the dropdown menu. **/
|
||||||
|
$('#event_type').on('change', function() {
|
||||||
|
|
||||||
|
var selectedValue = $(this).val();
|
||||||
|
if (selectedValue !== '') {
|
||||||
|
$('#import_excel_download').show();
|
||||||
|
var fullURL = '<?= base_url("util/download_import_excel/"); ?>' + selectedValue;
|
||||||
|
$('#import_excel_download').attr('href', fullURL);
|
||||||
|
} else {
|
||||||
|
$('#import_excel_download').hide();
|
||||||
|
$('#import_excel_download').removeAttr('href');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#event_type').on('change', function() {
|
$('#event_type').on('change', function() {
|
||||||
|
|
||||||
var selectedVal = $(this).val();
|
var selectedVal = $(this).val();
|
||||||
@ -517,6 +528,34 @@
|
|||||||
console.log('tpa_api_sevice type', typeof tpa_api_sevice);
|
console.log('tpa_api_sevice type', typeof tpa_api_sevice);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#action_type').on('change', function() {
|
||||||
|
|
||||||
|
var selectedValue = $(this).val();
|
||||||
|
var insurer_or_tpa = $('#insurer_or_tpa').val()
|
||||||
|
// console.log(selectedValue);
|
||||||
|
|
||||||
|
if (selectedValue == '') {
|
||||||
|
$('#import_excel_btn').hide();
|
||||||
|
$('#export_excel_btn').hide();
|
||||||
|
} else if (selectedValue == 'import') {
|
||||||
|
$('#import_file').prop('required', true);
|
||||||
|
$('#import_file').attr('name', 'import_file_data');
|
||||||
|
$('#import_excel_btn').show();
|
||||||
|
$('#export_excel_btn').hide();
|
||||||
|
} else if (selectedValue == 'export') {
|
||||||
|
$('#import_file').removeAttr('name');
|
||||||
|
$('#import_file').prop('required', false);
|
||||||
|
$('#import_excel_btn').hide();
|
||||||
|
$('#export_excel_btn').show();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tpa_api_sevice == 0 || selectedValue == 'export' || insurer_or_tpa == "insurer") {
|
||||||
|
$('.fetch_tpa').hide();
|
||||||
|
} else {
|
||||||
|
$('.fetch_tpa').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#insurer_or_tpa').on('change', function() {
|
$('#insurer_or_tpa').on('change', function() {
|
||||||
|
|
||||||
var insurer_or_tpa = $(this).val()
|
var insurer_or_tpa = $(this).val()
|
||||||
@ -538,18 +577,12 @@
|
|||||||
|
|
||||||
$("#event_type").removeAttr("multiple");
|
$("#event_type").removeAttr("multiple");
|
||||||
$("#event_type").attr("name", "event_type");
|
$("#event_type").attr("name", "event_type");
|
||||||
if ($.fn.select2 && $('#event_type').data('select2')) {
|
|
||||||
$('#event_type').select2('destroy');
|
|
||||||
}
|
|
||||||
$("#event_type").select2('destroy');
|
$("#event_type").select2('destroy');
|
||||||
|
|
||||||
}else if(insurer_or_tpa == 'insurer' && action_type == 'import'){
|
}else if(insurer_or_tpa == 'insurer' && action_type == 'import'){
|
||||||
|
|
||||||
$("#event_type").removeAttr("multiple");
|
$("#event_type").removeAttr("multiple");
|
||||||
$("#event_type").attr("name", "event_type");
|
$("#event_type").attr("name", "event_type");
|
||||||
if ($.fn.select2 && $('#event_type').data('select2')) {
|
|
||||||
$('#event_type').select2('destroy');
|
|
||||||
}
|
|
||||||
$("#event_type").select2('destroy');
|
$("#event_type").select2('destroy');
|
||||||
|
|
||||||
}else if(insurer_or_tpa == 'insurer' && action_type == 'export' && event_type_data == 1){
|
}else if(insurer_or_tpa == 'insurer' && action_type == 'export' && event_type_data == 1){
|
||||||
@ -562,9 +595,6 @@
|
|||||||
|
|
||||||
$("#event_type").removeAttr("multiple");
|
$("#event_type").removeAttr("multiple");
|
||||||
$("#event_type").attr("name", "event_type");
|
$("#event_type").attr("name", "event_type");
|
||||||
if ($.fn.select2 && $('#event_type').data('select2')) {
|
|
||||||
$('#event_type').select2('destroy');
|
|
||||||
}
|
|
||||||
$("#event_type").select2('destroy');
|
$("#event_type").select2('destroy');
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@ -596,18 +626,12 @@
|
|||||||
|
|
||||||
$("#event_type").removeAttr("multiple");
|
$("#event_type").removeAttr("multiple");
|
||||||
$("#event_type").attr("name", "event_type");
|
$("#event_type").attr("name", "event_type");
|
||||||
if ($.fn.select2 && $('#event_type').data('select2')) {
|
|
||||||
$('#event_type').select2('destroy');
|
|
||||||
}
|
|
||||||
$("#event_type").select2('destroy');
|
$("#event_type").select2('destroy');
|
||||||
|
|
||||||
} else if(action_type == 'export' && insurer_or_tpa == 'tpa'){
|
} else if(action_type == 'export' && insurer_or_tpa == 'tpa'){
|
||||||
|
|
||||||
$("#event_type").removeAttr("multiple");
|
$("#event_type").removeAttr("multiple");
|
||||||
$("#event_type").attr("name", "event_type");
|
$("#event_type").attr("name", "event_type");
|
||||||
if ($.fn.select2 && $('#event_type').data('select2')) {
|
|
||||||
$('#event_type').select2('destroy');
|
|
||||||
}
|
|
||||||
$("#event_type").select2('destroy');
|
$("#event_type").select2('destroy');
|
||||||
|
|
||||||
}else if(action_type == 'export' && insurer_or_tpa == 'insurer' && event_type_data == 1){
|
}else if(action_type == 'export' && insurer_or_tpa == 'insurer' && event_type_data == 1){
|
||||||
@ -620,9 +644,6 @@
|
|||||||
|
|
||||||
$("#event_type").removeAttr("multiple");
|
$("#event_type").removeAttr("multiple");
|
||||||
$("#event_type").attr("name", "event_type");
|
$("#event_type").attr("name", "event_type");
|
||||||
if ($.fn.select2 && $('#event_type').data('select2')) {
|
|
||||||
$('#event_type').select2('destroy');
|
|
||||||
}
|
|
||||||
$("#event_type").select2('destroy');
|
$("#event_type").select2('destroy');
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@ -634,48 +655,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**This function updates the download link based on the selected option in the dropdown menu. **/
|
|
||||||
$('#event_type').on('change', function() {
|
|
||||||
|
|
||||||
var selectedValue = $(this).val();
|
|
||||||
if (selectedValue !== '') {
|
|
||||||
$('#import_excel_download').show();
|
|
||||||
var fullURL = '<?= base_url("util/download_import_excel/"); ?>' + selectedValue;
|
|
||||||
$('#import_excel_download').attr('href', fullURL);
|
|
||||||
} else {
|
|
||||||
$('#import_excel_download').hide();
|
|
||||||
$('#import_excel_download').removeAttr('href');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#action_type').on('change', function() {
|
|
||||||
|
|
||||||
var selectedValue = $(this).val();
|
|
||||||
var insurer_or_tpa = $('#insurer_or_tpa').val()
|
|
||||||
// console.log(selectedValue);
|
|
||||||
|
|
||||||
if (selectedValue == '') {
|
|
||||||
$('#import_excel_btn').hide();
|
|
||||||
$('#export_excel_btn').hide();
|
|
||||||
} else if (selectedValue == 'import') {
|
|
||||||
$('#import_file').prop('required', true);
|
|
||||||
$('#import_file').attr('name', 'import_file_data');
|
|
||||||
$('#import_excel_btn').show();
|
|
||||||
$('#export_excel_btn').hide();
|
|
||||||
} else if (selectedValue == 'export') {
|
|
||||||
$('#import_file').removeAttr('name');
|
|
||||||
$('#import_file').prop('required', false);
|
|
||||||
$('#import_excel_btn').hide();
|
|
||||||
$('#export_excel_btn').show();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tpa_api_sevice == 0 || selectedValue == 'export' || insurer_or_tpa == "insurer") {
|
|
||||||
$('.fetch_tpa').hide();
|
|
||||||
} else {
|
|
||||||
$('.fetch_tpa').show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Function to convert object to query parameters
|
// Function to convert object to query parameters
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user