<?php include_once('../../../config.php') ?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Sisplan Web | Cadastro de Representante</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.255.15.1">
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.255.15.1">
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="../dist/css/dataTables.bootstrap4.min.css?versao=3.255.15.1" />
    <link href='../dist/css/bootstrap.min.css?versao=3.255.15.1'>
    <link rel="stylesheet" href="../dist/css/custom.css?versao=3.255.15.1">
    <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.255.15.1">
    <link rel="stylesheet" href="../dist/css/PesquisaVariosSelect2.css?versao=3.255.15.1">
    <link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.255.15.1">
    <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.255.15.1">
    <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.255.15.1">
    <link rel="stylesheet" href="../plugins/select2/css/select2.min.css?versao=3.255.15.1">
    <link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.255.15.1">
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.255.15.1">
    <!-- Toastr -->
    <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.255.15.1">
    <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.255.15.1" />
    <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.255.15.1">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <style>
        .borda {
            padding: 10px;
            border: solid #e0e4e6;
            border-radius: 4px;
            border-width: 1px;
        }

        .card {
            box-shadow: none !important;
            border-radius: 0 !important;
            margin-bottom: 0 !important;
        }

        .card-header {
            box-shadow: 0px 1px rgb(0 0 0 / 20%) !important;
        }

        .card.card-header {
            border-bottom: 1px dashed #ddd;
            box-shadow: none !important;
        }

        .card-body {
            padding-left: 1.25rem !important;
            padding-top: 0px;
            padding-bottom: 0px;
            padding-right: 1.25rem !important;
        }

        .fa-angle-right,
        .fa-angle-down {
            color: #343a40;
        }

        .table.dataTable tbody td,
        .table.dataTable thead {
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }

        .border-Field {
            border: 1px solid var(--font-color) !important;
            padding: 0 0 0 1.0em !important;
            margin: 0 0 1.0em 0 !important;
            -webkit-box-shadow: 0px 0px 0px 0px #000;
            box-shadow: 0px 0px 0px 0px #000;
            border-radius: 3px;
        }

        .border-Field .textoBorda {
            font-size: 1.1em !important;
            text-align: left !important;
            width: auto;
            padding: 0 10px;
            border-bottom: none;
        }
    </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <?php
        ?>
        <div id="myModal" class="modal" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 id="myModalLabel" class="modal-title"></h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <p id="myModalText"></p>
                    </div>
                    <div class="modal-footer">
                        <button id="btnYes" type="button" class="btn btn-primary">Sim</button>
                        <button id="btnNo" type="button" class="btn btn-secondary" data-dismiss="modal">Não</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-wrapper">
            <section class="content">
                <div class="content-header">
                    <div class="row justify-content-center mt-0">
                        <div class="col-12 text-center p-0 mt-3 mb-2">
                            <div class="card px-0 pt-4 pb-0 mt-3 mb-3">
                                <div class="card-header text-center flex" style="border: none!important;box-shadow:none!important;">
                                    <h2>Cadastro de Característica
                                        <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                                            <i class="fas fa-question-circle"></i>
                                        </button>
                                    </h2>
                                </div>
                                <fieldset>
                                    <div class="card-body">
                                        <form style="text-align:left!important;" id="msform" name="msform">
                                            <div class="card card-header" role="tab" id="geral">
                                                <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample1" href="#multiCollapseExample1" aria-expanded="true" aria-controls="collapseOne1">
                                                    <div class="row">
                                                        <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                                            <i class="fas fa-angle-down"></i>
                                                        </div>
                                                        <div class="col-11">
                                                            <h4 class="title-page">
                                                                Dados Gerais
                                                            </h4>
                                                        </div>
                                                    </div>
                                                </a>
                                            </div>
                                            <div class="collapse show" id="multiCollapseExample1">
                                                <div class="card">
                                                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                                                        <div class="form-card m-3" id="formcard1">
                                                            <div class="form-row col-xl-12 col-12">
                                                                <input type="text" class="input-default focus form-control d-none" id="txtIdGeral" name="txtIdGeral" placeholder="Linha">
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtLinhaGeral">Linha: *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtLinhaGeral" name="txtLinhaGeral" placeholder="Linha">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnLinhaGeral" name="btnLinhaGeral" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger" id="btnLimpaLinhaGeral" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtGrupoGeral">Grupo: *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtGrupoGeral" name="txtGrupoGeral" placeholder="Grupo">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnGrupoGeral" name="btnGrupoGeral" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger" id="btnLimpaGrupoGeral" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtEtiquetaGeral">Etiqueta: *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtEtiquetaGeral" name="txtEtiquetaGeral" placeholder="Etiqueta">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnEtiquetaGeral" name="btnEtiquetaGeral" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger" id="btnLimpaEtiquetaGeral" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtFaixaGeral">Faixa:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtFaixaGeral" name="txtFaixaGeral" placeholder="Faixa">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnFaixaGeral" name="btnFaixaGeral" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger" id="btnLimpaFaixaGeral" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtMarkupGeral">Markup:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtMarkupGeral" name="txtMarkupGeral" placeholder="Markup">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnMarkupGeral" name="btnMarkupGeral" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger" id="btnLimpaMarkupGeral" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtNCMGeral">NCM:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtNCMGeral" name="txtNCMGeral" placeholder="NCM">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnNCMGeral" name="btnNCMGeral" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger" id="btnLimpaNCMGeral" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-6 col-12">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtDescricaoGeral">Descrição:</label>
                                                                    <input type="text" class="input-default focus form-control" id="txtDescricaoGeral" name="txtDescricaoGeral" class="form-control" placeholder="Descrição">
                                                                </div>
                                                                <div class="form-group col-xl-2 col-4">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtTempoCosturaGeral">Tempo Costura:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais" id="txtTempoCosturaGeral" name="txtTempoCosturaGeral" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-2 col-4">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtValorCosturaGeral">Valor Costura:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais" id="txtValorCosturaGeral" name="txtValorCosturaGeral" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-2 col-4">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtValorLinhaGeral">Valor Linha:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais" id="txtValorLinhaGeral" name="txtValorLinhaGeral" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-2 col-4">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtMExtraGeral">M. Extra:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais" id="txtMExtraGeral" name="txtMExtraGeral" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-2 col-4">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtViradaGeral">Virada:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais" id="txtViradaGeral" name="txtViradaGeral" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-2 col-4 d-flex align-items-end">
                                                                    <div class="icheck-primary"><input type="checkbox" checked id="cbAtivoGeral"><label for="cbAtivoGeral">Ativo</label></div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="card card-header" role="tab" id="geral">
                                                <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample2" href="#multiCollapseExample2" aria-expanded="true" aria-controls="collapseOne2">
                                                    <div class="row">
                                                        <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                                            <i class="fas fa-angle-down"></i>
                                                        </div>
                                                        <div class="col-11">
                                                            <h4 class="title-page">
                                                                Consumo
                                                            </h4>
                                                        </div>
                                                    </div>
                                                </a>
                                            </div>
                                            <div class="collapse" id="multiCollapseExample2">
                                                <div class="card">
                                                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                                                        <div class="form-card m-3">
                                                            <div class="form-row col-xl-12 col-12">
                                                                <div class="col-3 form">
                                                                    <fieldset class="form border-Field p-0" style="margin-bottom: 0.7em !important;">
                                                                        <legend class="textoBorda pb-0 mb-0">Tipo</legend>
                                                                        <div class="form-row">
                                                                            <div class="d-flex">
                                                                                <div class="radio-group form-radio icheck-primary"><input type="radio" id="radioProduto" name="tipoItem"><label for="radioProduto">Produto</label></div>
                                                                                <div class="radio-group form-radio icheck-primary ml-5"><input type="radio" id="radioMaterial" name="tipoItem" checked><label for="radioMaterial">Material</label></div>
                                                                            </div>
                                                                        </div>
                                                                    </fieldset>
                                                                </div>
                                                                <div class="col-9 form">
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtMaterialConsumo">Material:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control consumoControl" id="txtMaterialConsumo" name="txtMaterialConsumo" placeholder="Material">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger consumoControl" id="btnMaterialConsumo" name="btnMaterialConsumo" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger consumoControl" id="btnLimpaMaterialConsumo" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtCorConsumo">Cor:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control consumoControl" id="txtCorConsumo" name="txtCorConsumo" placeholder="Cor">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger consumoControl" id="btnCorConsumo" name="btnCorConsumo" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger consumoControl" id="btnLimpaCorConsumo" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtSetorConsumo">Setor:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control consumoControl" id="txtSetorConsumo" name="txtSetorConsumo" placeholder="Setor">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger consumoControl" id="btnSetorConsumo" name="btnSetorConsumo" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger consumoControl" id="btnLimpaSetorConsumo" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtFaixaConsumo">Faixa:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control consumoControl" id="txtFaixaConsumo" name="txtFaixaConsumo" placeholder="Faixa">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger consumoControl" id="btnFaixaConsumo" name="btnFaixaConsumo" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger consumoControl" id="btnLimpaFaixaConsumo" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-1 col-3">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtQuantidadeConsumo">Qtde:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 4casasDecimais consumoControl" id="txtQuantidadeConsumo" name="txtQuantidadeConsumo" class="form-control" placeholder="0.0000">
                                                                </div>
                                                                <div class="form-group col-xl-1 col-3">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtCustoUniConsumo">Custo Uni:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais consumoControl" id="txtCustoUniConsumo" name="txtCustoUniConsumo" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-2 col-3 flex align-items-end justify-content-around">
                                                                    <div class="icheck-primary"><input class="consumoControl" type="checkbox" id="cbAtivoConsumo"><label for="cbAtivoConsumo">Ativo</label></div>
                                                                    <div class="icheck-primary"><input class="consumoControl" type="checkbox" id="cbPrecoConsumo"><label for="cbPrecoConsumo">Preço</label></div>
                                                                </div>
                                                                <div class="form-group col-xl-8 col-6 flex align-items-end" style="gap: 8px">
                                                                    <button type="button" class="btn btn-primary btn-sisp addButton" id="btnIncluirConsumo"></span> Incluir</button>
                                                                    <button type="button" class="btn btn-primary btn-sisp d-none" id="btnConfirmarConsumo"></span> Confirmar</button>
                                                                    <button type="button" class="btn bg-gradient-danger btn-sisp d-none" id="btnDesistirConsumo"></span> Desistir</button>
                                                                </div>
                                                                <div class="row col-xl-12 col-12 mt-4">
                                                                    <div class="col-xl-12 col-12 table-responsive">
                                                                        <table id="tabelaConsumos" class="table table-sm table-select table-hover w-100">
                                                                            <thead>
                                                                            </thead>
                                                                            <tbody>
                                                                            </tbody>
                                                                        </table>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="card card-header" role="tab" id="geral">
                                                <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample3" href="#multiCollapseExample3" aria-expanded="true" aria-controls="collapseOne3">
                                                    <div class="row">
                                                        <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                                            <i class="fas fa-angle-down"></i>
                                                        </div>
                                                        <div class="col-11">
                                                            <h4 class="title-page">
                                                                Tecido
                                                            </h4>
                                                        </div>
                                                    </div>
                                                </a>
                                            </div>
                                            <div class="collapse" id="multiCollapseExample3">
                                                <div class="card">
                                                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                                                        <div class="form-card m-3">
                                                            <div class="form-row col-xl-12 col-12">
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtMaterialTecido">Material:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control tecidoControl" id="txtMaterialTecido" name="txtMaterialTecido" placeholder="Material">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger tecidoControl" id="btnMaterialTecido" name="btnMaterialTecido" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger tecidoControl" id="btnLimpaMaterialTecido" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-9 col-6 flex align-items-end" style="gap: 8px">
                                                                    <button type="button" class="btn btn-primary btn-sisp addButton" id="btnIncluirTecido"></span> Incluir</button>
                                                                    <button type="button" class="btn btn-primary btn-sisp d-none" id="btnConfirmarTecido"></span> Confirmar</button>
                                                                    <button type="button" class="btn bg-gradient-danger btn-sisp d-none" id="btnDesistirTecido"></span> Desistir</button>
                                                                </div>
                                                                <div class="row col-xl-12 col-12 mt-4">
                                                                    <div class="col-xl-12 col-12 table-responsive">
                                                                        <table id="tabelaTecidos" class="table table-sm table-select table-hover w-100">
                                                                            <thead>
                                                                            </thead>
                                                                            <tbody>
                                                                            </tbody>
                                                                        </table>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="card card-header" role="tab" id="geral">
                                                <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample4" href="#multiCollapseExample4" aria-expanded="true" aria-controls="collapseOne4">
                                                    <div class="row">
                                                        <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                                            <i class="fas fa-angle-down"></i>
                                                        </div>
                                                        <div class="col-11">
                                                            <h4 class="title-page">
                                                                Característica
                                                            </h4>
                                                        </div>
                                                    </div>
                                                </a>
                                            </div>
                                            <div class="collapse" id="multiCollapseExample4">
                                                <div class="card">
                                                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                                                        <div class="form-card m-3">
                                                            <div class="form-row col-xl-12 col-12">
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtAplicacaoSubcaracteristica">Aplicação: *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control caracteristicaControl" id="txtAplicacaoSubcaracteristica" name="txtAplicacaoSubcaracteristica" placeholder="Aplicação">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger caracteristicaControl" id="btnAplicacaoSubcaracteristica" name="btnAplicacaoSubcaracteristica" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger caracteristicaControl" id="btnLimpaAplicacaoSubcaracteristica" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtCaracteristicaSubcaracteristica">Subcaracterística: *</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control caracteristicaControl" id="txtCaracteristicaSubcaracteristica" name="txtCaracteristicaSubcaracteristica" placeholder="Subcaracterística">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger caracteristicaControl" id="btnCaracteristicaSubcaracteristica" name="btnCaracteristicaSubcaracteristica" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger caracteristicaControl" id="btnLimpaCaracteristicaSubcaracteristica" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-1 col-3">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtValorVendaSubcaracteristica">Valor Venda:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais caracteristicaControl" id="txtValorVendaSubcaracteristica" name="txtValorVenda" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-1 col-3">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtTempoAdcCosturaSubcaracteristica">Tempo:</label>
                                                                    <input type="text" class="input-default focus form-control text-right 2casasDecimais caracteristicaControl" id="txtTempoAdcCosturaSubcaracteristica" name="txtTempoAdcCosturaSubcaracteristica" class="form-control" placeholder="0.00">
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6 flex align-items-end justify-content-around">
                                                                    <div class="icheck-primary"><input class="caracteristicaControl" type="checkbox" checked id="cbAtivoSubcaracteristica"><label for="cbAtivoSubcaracteristica">Ativo</label></div>
                                                                    <div class="icheck-primary"><input class="caracteristicaControl" type="checkbox" id="cbPadraoSubcaracteristica"><label for="cbPadraoSubcaracteristica">Padrão</label></div>
                                                                    <div class="icheck-primary"><input class="caracteristicaControl" type="checkbox" id="cbImprimeNFeSubcaracteristica"><label for="cbImprimeNFeSubcaracteristica">Imprime na NF-e</label></div>
                                                                </div>
                                                                <div class="form-group col-xl-6 col-6 flex align-items-end" style="gap: 8px">
                                                                    <button type="button" class="btn btn-primary btn-sisp addButton" id="btnIncluirSubcaracteristica"></span> Incluir</button>
                                                                    <button type="button" class="btn btn-primary btn-sisp d-none" id="btnConfirmarSubcaracteristica"></span> Confirmar</button>
                                                                    <button type="button" class="btn bg-gradient-danger btn-sisp d-none" id="btnDesistirSubcaracteristica"></span> Desistir</button>
                                                                </div>
                                                                <div class="row col-xl-12 col-12 mt-4">
                                                                    <div class="col-xl-12 col-12 table-responsive">
                                                                        <table id="tabelaSubcaracteristicas" class="table table-sm table-select table-hover w-100">
                                                                            <thead>
                                                                            </thead>
                                                                            <tbody>
                                                                            </tbody>
                                                                        </table>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-12 col-12 borda mt-4 d-none" id="divVincular">
                                                                    <div class="col-xl-12 col-12 py-2">
                                                                        <nav>
                                                                            <div class="nav nav-tabs justify-content-center" id="nav-tab" role="tablist" style="text-decoration: none">
                                                                                <a class="nav-link abaLink active" id="tabAplicacao" data-toggle="tab" href="#divAplicacao" role="tab" aria-controls="divAplicacao" aria-selected="true">Aplicação</a>
                                                                                <a class="nav-link abaLink" id="tabConsumo" data-toggle="tab" href="#divConsumo" role="tab" aria-controls="divConsumo" aria-selected="false">Consumo</a>
                                                                            </div>
                                                                        </nav>
                                                                    </div>
                                                                    <div class="tab-content" id="nav-tabContent">
                                                                        <div class="tab-pane fade show active" id="divAplicacao" role="tabpanel" aria-labelledby="tabAplicacao">
                                                                            <div class="card">
                                                                                <div class="form-row col-xl-12 col-12">
                                                                                    <div class="form-group col-xl-3 col-6">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtTecidoFixoAplicacoesCaracteristica">Tecido Fixo:</label>
                                                                                        <div class="input-group">
                                                                                            <input type="text" class="input-default focus form-control aplicacoesCaracteristicaControl" id="txtTecidoFixoAplicacoesCaracteristica" name="txtTecidoFixo" placeholder="Tecido">
                                                                                            <div class="input-group-append">
                                                                                                <button class="btn bg-danger aplicacoesCaracteristicaControl" id="btnTecidoFixoAplicacoesCaracteristica" name="btnTecidoFixoAplicacoesCaracteristica" data-button="absolute" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                                                                </button>
                                                                                                <button class="btn bg-danger aplicacoesCaracteristicaControl" id="btnLimpaTecidoFixoAplicacoesCaracteristica" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-trash"></i>
                                                                                                </button>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-1 col-2">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtQuantidadeAplicacoesCaracteristica">Qtde:</label>
                                                                                        <input type="text" class="input-default focus form-control text-right 3casasDecimais aplicacoesCaracteristicaControl" id="txtQuantidadeAplicacoesCaracteristica" name="txtQuantidadeAplicacoesCaracteristica" class="form-control" placeholder="0.000">
                                                                                    </div>
                                                                                    <div class="form-group col-xl-1 col-2">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtQuantidadeTecidoAplicacoesCaracteristica">Qtde Tecido:</label>
                                                                                        <input type="text" class="input-default focus form-control text-right 3casasDecimais aplicacoesCaracteristicaControl" id="txtQuantidadeTecidoAplicacoesCaracteristica" name="txtQuantidadeTecidoAplicacoesCaracteristica" class="form-control" placeholder="0.000">
                                                                                    </div>
                                                                                    <div class="form-group col-xl-1 col-2 flex align-items-end justify-content-start">
                                                                                        <div class="icheck-primary"><input class="aplicacoesCaracteristicaControl" type="checkbox" id="cbSubstituirAplicacoesCaracteristica"><label for="cbSubstituirAplicacoesCaracteristica">Substituir</label></div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-6 col-6 flex align-items-end" style="gap: 8px">
                                                                                        <button type="button" class="btn btn-primary btn-sisp addButton" id="btnIncluirAplicacoesCaracteristica"></span> Incluir</button>
                                                                                        <button type="button" class="btn btn-primary btn-sisp d-none" id="btnConfirmarAplicacoesCaracteristica"></span> Confirmar</button>
                                                                                        <button type="button" class="btn bg-gradient-danger btn-sisp d-none" id="btnDesistirAplicacoesCaracteristica"></span> Desistir</button>
                                                                                    </div>
                                                                                    <div class="row col-xl-12 col-12 mt-4">
                                                                                        <div class="col-xl-12 col-12 table-responsive">
                                                                                            <table id="tabelaAplicacoesCaracteristicas" class="table table-sm table-select table-hover w-100">
                                                                                                <thead>
                                                                                                </thead>
                                                                                                <tbody>
                                                                                                </tbody>
                                                                                            </table>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                        <div class="tab-pane fade" id="divConsumo" role="tabpanel" aria-labelledby="tabConsumo">
                                                                            <div class="card">
                                                                                <div class="form-row col-xl-12 col-12">
                                                                                    <div class="form-group col-xl-3 col-6">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtMaterialConsumosCaracteristica">Material:</label>
                                                                                        <div class="input-group">
                                                                                            <input type="text" class="input-default focus form-control consumosCaracteristicaControl" id="txtMaterialConsumosCaracteristica" name="txtMaterial" placeholder="Material">
                                                                                            <div class="input-group-append">
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnMaterialConsumosCaracteristica" name="btnMaterialConsumosCaracteristica" data-button="absolute" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                                                                </button>
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnLimpaMaterialConsumosCaracteristica" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-trash"></i>
                                                                                                </button>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-3 col-6">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtCorConsumosCaracteristica">Cor:</label>
                                                                                        <div class="input-group">
                                                                                            <input type="text" class="input-default focus form-control consumosCaracteristicaControl" id="txtCorConsumosCaracteristica" name="txtCorConsumosCaracteristica" placeholder="Cor">
                                                                                            <div class="input-group-append">
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnCorConsumosCaracteristica" name="btnCorConsumosCaracteristica" data-button="absolute" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                                                                </button>
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnLimpaCorConsumosCaracteristica" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-trash"></i>
                                                                                                </button>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-3 col-6">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtSetorConsumosCaracteristica">Setor:</label>
                                                                                        <div class="input-group">
                                                                                            <input type="text" class="input-default focus form-control consumosCaracteristicaControl" id="txtSetorConsumosCaracteristica" name="txtSetorConsumosCaracteristica" placeholder="Setor">
                                                                                            <div class="input-group-append">
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnSetorConsumosCaracteristica" name="btnSetorConsumosCaracteristica" data-button="absolute" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                                                                </button>
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnLimpaSetorConsumosCaracteristica" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-trash"></i>
                                                                                                </button>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-3 col-6">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtFaixaConsumosCaracteristica">Faixa:</label>
                                                                                        <div class="input-group">
                                                                                            <input type="text" class="input-default focus form-control consumosCaracteristicaControl" id="txtFaixaConsumosCaracteristica" name="txtFaixaConsumosCaracteristica" placeholder="Faixa">
                                                                                            <div class="input-group-append">
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnFaixaConsumosCaracteristica" name="btnFaixaConsumosCaracteristica" data-button="absolute" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                                                                </button>
                                                                                                <button class="btn bg-danger consumosCaracteristicaControl" id="btnLimpaFaixaConsumosCaracteristica" type="button">
                                                                                                    <i class="m-0 p-0 fas fa-trash"></i>
                                                                                                </button>
                                                                                            </div>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-1 col-3">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtQuantidadeConsumosCaracteristica">Qtde:</label>
                                                                                        <input type="text" class="input-default focus form-control text-right 4casasDecimais consumosCaracteristicaControl" id="txtQuantidadeConsumosCaracteristica" name="txtQuantidadeConsumosCaracteristica" class="form-control" placeholder="0.0000">
                                                                                    </div>
                                                                                    <div class="form-group col-xl-1 col-3">
                                                                                        <label data-error="wrong" class="labelGeral" data-success="right" for="txtCustoUniFixoConsumosCaracteristica">Custo Uni.:</label>
                                                                                        <input type="text" class="input-default focus form-control text-right 4casasDecimais consumosCaracteristicaControl" id="txtCustoUniFixoConsumosCaracteristica" name="txtCustoUniFixoConsumosCaracteristica" class="form-control" placeholder="0.0000">
                                                                                    </div>
                                                                                    <div class="form-group col-xl-3 col-4">
                                                                                        <label data-error="wrong" data-success="right" for="selectSubstituirConsumosCaracteristica">Substituir:</label>
                                                                                        <div class="input-group">
                                                                                            <select style="width:100%;" id="selectSubstituirConsumosCaracteristica" class="input-default form-control focus consumosCaracteristicaControl text-sm" id="dropdown" class="custom-select focus">
                                                                                            </select>
                                                                                        </div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-1 col-2 flex align-items-end justify-content-start">
                                                                                        <div class="icheck-primary"><input class="consumosCaracteristicaControl" type="checkbox" id="cbPrecoConsumosCaracteristica"><label for="cbPrecoConsumosCaracteristica">Preço</label></div>
                                                                                    </div>
                                                                                    <div class="form-group col-xl-6 col-4 flex align-items-end" style="gap: 8px">
                                                                                        <button type="button" class="btn btn-primary btn-sisp addButton" id="btnIncluirConsumosCaracteristica"></span> Incluir</button>
                                                                                        <button type="button" class="btn btn-primary btn-sisp d-none" id="btnConfirmarConsumosCaracteristica"></span> Confirmar</button>
                                                                                        <button type="button" class="btn bg-gradient-danger btn-sisp d-none" id="btnDesistirConsumosCaracteristica"></span> Desistir</button>
                                                                                    </div>
                                                                                    <div class="row col-xl-12 col-12 mt-4">
                                                                                        <div class="col-xl-12 col-12 table-responsive">
                                                                                            <table id="tabelaConsumosCaracteristicas" class="table table-sm table-select table-hover w-100">
                                                                                                <thead>
                                                                                                </thead>
                                                                                                <tbody>
                                                                                                </tbody>
                                                                                            </table>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="card card-header" role="tab" id="geral">
                                                <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample5" href="#multiCollapseExample5" aria-expanded="true" aria-controls="collapseOne5">
                                                    <div class="row">
                                                        <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                                            <i class="fas fa-angle-down"></i>
                                                        </div>
                                                        <div class="col-11">
                                                            <h4 class="title-page">
                                                                Fluxo
                                                            </h4>
                                                        </div>
                                                    </div>
                                                </a>
                                            </div>
                                            <div class="collapse" id="multiCollapseExample5">
                                                <div class="card">
                                                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                                                        <div class="form-card m-3">
                                                            <div class="form-row col-xl-12 col-12">
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtParteFluxo">Parte:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control fluxoControl" id="txtParteFluxo" name="txtParteFluxo" placeholder="Parte">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger fluxoControl" id="btnParteFluxo" name="btnParteFluxo" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger fluxoControl" id="btnLimpaParteFluxo" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-3 col-6">
                                                                    <label data-error="wrong" class="labelGeral" data-success="right" for="txtFluxoFluxo">Fluxo:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control fluxoControl" id="txtFluxoFluxo" name="txtFluxoFluxo" placeholder="Fluxo">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger fluxoControl" id="btnFluxoFluxo" name="btnFluxoFluxo" data-button="absolute" type="button">
                                                                                <i class="m-0 p-0 fas fa-search"></i>
                                                                            </button>
                                                                            <button class="btn bg-danger fluxoControl" id="btnLimpaFluxoFluxo" type="button">
                                                                                <i class="m-0 p-0 fas fa-trash"></i>
                                                                            </button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-xl-6 col-6 flex align-items-end" style="gap: 8px">
                                                                    <button type="button" class="btn btn-primary btn-sisp addButton" id="btnIncluirFluxo"></span> Incluir</button>
                                                                    <button type="button" class="btn btn-primary btn-sisp d-none" id="btnConfirmarFluxo"></span> Confirmar</button>
                                                                    <button type="button" class="btn bg-gradient-danger btn-sisp d-none" id="btnDesistirFluxo"></span> Desistir</button>
                                                                </div>
                                                            </div>
                                                            <div class="row col-xl-12 col-12 mt-4">
                                                                <div class="col-xl-12 col-12 table-responsive">
                                                                    <table id="tabelaFluxos" class="table table-sm table-select table-hover w-100">
                                                                        <thead>
                                                                        </thead>
                                                                        <tbody>
                                                                        </tbody>
                                                                    </table>
                                                                </div>
                                                            </div>
                                                            <div class="row col-xl-12 col-12 mt-4">
                                                                <div class="col-xl-12 col-12 table-responsive">
                                                                    <table id="tabelaSetores" class="table table-sm table-select table-hover w-100">
                                                                        <thead>
                                                                        </thead>
                                                                        <tbody>
                                                                        </tbody>
                                                                    </table>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row my-3 justify-content-end">
                                                <button type="button" id="btnVoltar" class="btn-sisp action-button-previous previous my-0" data-dismiss="modal">Voltar</button>
                                                <button type="button" id="btnGravar" class="btn-sisp action-button my-0" data-dismiss="modal">Gravar</button>
                                            </div>
                                        </form>
                                    </div>
                                </fieldset>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>

    <?php
    include_once('../../../modais.php');
    ?>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
    </aside>
    <!-- /.control-sidebar -->
    </div>

    <!-- jQuery -->
    <script src="../plugins/jquery/jquery.min.js?versao=3.255.15.1"></script>
    <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.255.15.1"></script>
    <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.255.15.1"></script>
    <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.255.15.1"></script>
    <!-- SweetAlert2 -->
    <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.255.15.1"></script>
    <script src="../plugins/toastr/toastr.min.js?versao=3.255.15.1"></script>

    <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>

    <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.255.15.1"></script>
    <script src="../dist/js/adminlte.min.js?versao=3.255.15.1"></script>
    <script src="../dist/js/requisicoes.js?versao=3.255.15.1"></script>
    <script src="../dist/js/cliente/entidade.js?versao=3.255.15.1"></script>
    <script src="../dist/js/loadingoverlay.min.js?versao=3.255.15.1"></script>
    <script src="../dist/js/valida_cpf_cnpj.js?versao=3.255.15.1"></script>
    <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.255.15.1"></script>
    <script src="../dist/js/sisplan.js?versao=3.255.15.1"></script>
    <script src="../utils/funcoes.js?versao=3.255.15.1"></script>
    <script src="../utils/cookies.js?versao=3.255.15.1"></script>
    <script src="../dist/js/driver.min.js?versao=3.255.15.1"></script>
    <script src="../dist/js/jquery.maskMoney.min.js?versao=3.255.15.1"></script>
    <script src="../dist/js/jquery.mask.min.js?versao=3.255.15.1"></script>
    <script src="../dist/js/dataTables.keyTable2.js?versao=3.255.15.1"></script>
    <script type="text/javascript" src="../config.js?versao=3.255.15.1"></script>
    <script src="../pages/cadcaracteristica/cadastro_cadcaracteristica/abas/aba_consumos.js?versao=3.255.15.1"></script>
    <script src="../pages/cadcaracteristica/cadastro_cadcaracteristica/abas/aba_tecidos.js?versao=3.255.15.1"></script>
    <script src="../pages/cadcaracteristica/cadastro_cadcaracteristica/abas/aba_subcaracteristicas.js?versao=3.255.15.1"></script>
    <script src="../pages/cadcaracteristica/cadastro_cadcaracteristica/abas/aba_aplicacoes_caracteristicas.js?versao=3.255.15.1"></script>
    <script src="../pages/cadcaracteristica/cadastro_cadcaracteristica/abas/aba_consumos_caracteristicas.js?versao=3.255.15.1"></script>
    <script src="../pages/cadcaracteristica/cadastro_cadcaracteristica/abas/aba_fluxos.js?versao=3.255.15.1"></script>
    <script src="../plugins/select2/js/select2.full.min.js?versao=3.255.15.1"></script>

    <script>
        $(document).ready(async function() {
            if (getCookie('usuario') == "") {
                window.location.href = `${BASE_URI}/login`;
                return;
            }

            let usuario = getCookie('usuario');
            let empresa = getCookie('empresa');

            ipInterno = IP_INTERNO;
            ipExterno = IP_EXTERNO;
            basicAuth = BASIC_AUTH;

            const temAcesso = await temAcessoTela('CADCARACTERISTICA');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            const permissaoUsuarioLogado = await permissaoAcessos("CADCARACTERISTICA");

            if (permissaoUsuarioLogado.INCLUI == 'N') {
                await criaMensagemErro("Sem permissão para incluir!", () => {
                    window.location.href = `${BASE_URI}/cadcaracteristica`
                });
                return;
            }

            const queryString = window.location.href;
            const parametros = queryString.split("/");
            const cadcaracteristica = parametros[parametros.length - 1];

            $(window).on("beforeunload", function(e) {
                // e.preventDefault();
                e.stopPropagation();
                deletaRegistro("CADCARACTERISTICA", getCookie("usuario"), cadcaracteristica);
                return undefined;
            });

            sArquivo = `${BASE_URI}/pages/cadcaracteristica/cadastro_cadcaracteristica/cadcaracteristica.js?versao=3.255.15.1`;
            insereJavaScriptPagina(sArquivo);

            const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');
            habilitaCamposObrigatoriosTela(nomeTela);

            $(function() {
                $('[data-toggle="tooltip"]').tooltip()
            })
        });
    </script>
</body>

</html>