| Server IP : 162.214.74.102 / Your IP : 216.73.216.192 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/hexagon/application/plugins/module_fish/assets/js/ |
Upload File : |
/* global ind_mil, bootbox, _L, _url */
$(document).ready(function ()
{
findDataSelect(".associated_select", $("#_client_view").val()+'module_fish/ajax/Associated', '');
findDataSelect("#module_fish_species_id", $("#_client_view").val()+'module_fish/ajax/species', '');
findDataSelect(".program_select", $("#_client_view").val()+'module_fish/ajax/programAssociated/'+ $("#crm_accounts_id").val(), '');
findDataSelect(".tank_select", $("#_client_view").val()+'module_fish/ajax/tankAssociated/' + $("#crm_accounts_id").val(), '');
$('.number').autoNumeric('init', {aSep: '', aDec: ind_decimal, mDec: 0, aSign: ''});
var rowNum = $("#rowNum").val();
$("#emsg").hide();
$("#submit").on('click', function (e) {
e.preventDefault();
$("#ibox-form").block({message: block_msg});
if(verifyLote()){
$.post($("#_url").val()+$("#_client_view").val() + "module_fish/settlement/post", $("#form-settlement").serialize())
.done(function (retorno) {
var data = JSON.parse(retorno);
if (data.status == 'OK') {
location.reload();
} else {
$("#ibox-form").unblock();
var body = $("html, body");
body.animate({scrollTop: 0}, '1000', 'swing');
$("#emsgbody").html(data.msg);
$("#emsg").show("slow");
}
});
} else {
bootbox.alert(_L['Module_Fish Insert the information lote']);
}
});
function verifyLote(){
var qtds = document.getElementsByName('tank[]');
if (qtds.length > 0) {
return true;
}else{
return false;
}
}
$('#crm_accounts_id').on("change", function (e) {
var qtds = document.getElementsByName('tank[]');
if (qtds.length > 0) {
bootbox.confirm(_L['Module_Fish Delete Lote Msg Associated'], function (result) {
if (result) {
$("#settlement_itens").find('tbody').html("");
}
});
}
});
$('#item-add').on('click', function () {
if ($("#crm_accounts_id").val() != "" && $("#crm_accounts_id").val() != null) {
$("#settlement_itens").find('tbody')
.append(
'<tr class="">\n\
<td class="middle">\n\
<input type="hidden" name="module_fish_lots_distribution_program_id[]" value="0"><input type="hidden" name="lote_id[]" value="0"><select data-row="' + rowNum + '" id="program_' + rowNum + '" name="program[]" class="form-control program_select" style="width:100%"></select>\n\
</td> \n\
\n\<td class="middle">\n\
<select data-row="' + rowNum + '" id="tank_' + rowNum + '" name="tank[]" class="form-control tank_select" style="width:100%"></select>\n\
</td> \n\
<td class="middle">\n\
<input type="text" class="form-control qty" value="1" name="qty[]" id="qty_' + rowNum + '">\n\
</td> \n\\n\
<td class="middle col-xs-1"> <span class="btn btn-danger btn-xs delete_lot" data-row="' + rowNum + '" ><i class="fa fa-trash"></i> </span></td></tr>'
);
$('#qty_' + rowNum).autoNumeric('init', {aSep: '', aDec: ind_decimal, mDec: 0, aSign: ''});
$('[data-toggle="tooltip"]').tooltip();
findDataSelect("#program_" + rowNum, $("#_client_view").val() + 'module_fish/ajax/programAssociated/'+ $("#crm_accounts_id").val(), '');
findDataSelect("#tank_" + rowNum, $("#_client_view").val() + 'module_fish/ajax/tankAssociated/' + $("#crm_accounts_id").val(), '');
rowNum++;
} else {
bootbox.alert(_L['Module_Fish Select Associated']);
}
});
$("#settlement_itens").on("click", ".delete_lot", function (e) {
if($("#lote_id_"+$(this).attr("data-row")).val()!=""){
$("#loteIdDeleted").val($("#loteIdDeleted").val()+","+$("#lote_id_"+$(this).attr("data-row")).val());
}
$(this).closest('tr').remove();
});
});