12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427 |
- <%
- /**** Pagina de login do site ****/
- // Local cLSite := "./" // Site
- Local cLTitle := "" // Titulo da pagina
- Local cLPagina := "" // Nome da página
- // Local cLHeader := ""
- Local cLTopo := ""
- Local cLMenus := ""
- Local cLWidgets := ""
- Local cLColunas := ""
- Local cLItens := ""
- Local cLJavaScr := ""
- Local aLStatGrid := {}
- local lLSidebar := .t.
- Local cLCodLogin := ""
- Local nInd
- if type("cSite") <> "U"
- cLSite := cSite
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cSite")
- Endif
- if type("cTitle") <> "U"
- cLTitle := cTitle
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cTitle")
- Endif
- if type("cPagina") <> "U"
- cLPagina := cPagina
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cPagina")
- Endif
- if type("cMenus") <> "U"
- cLMenus := cMenus
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cMenus")
- Endif
- if type("cWidgets") <> "U"
- cLWidgets := cWidgets
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cWidgets")
- Endif
- if type("cTopo") <> "U"
- cLTopo := cTopo
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cTopo")
- Endif
- if type("cColunas") <> "U"
- cLColunas := cColunas
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cColunas")
- Endif
- if type("cItens") <> "U"
- cLItens := cItens
- else
- conout(dtoc(date())+" " + time() + " Portal "+procname(1)+"("+cValToChar(procline(1))+") Faltou cItens")
- Endif
- if type("lSidebar") = "L"
- lLSidebar := lSidebar
- endif
- if type("aStatGrid") = "A"
- aLStatGrid := aclone(aStatGrid)
- Endif
- if type ("cCodLogin") <> "U"
- cLCodLogin := cCodLogin
- Endif
- if type("cJavaScr") <> "U"
- cLJavaScr := cJavaScr
- endif
- %>
- <!DOCTYPE html>
- <%if lLSidebar%>
- <html class="fixed">
- <%else%>
- <html class="fixed sidebar-left-collapsed">
- <%endif%>
- <head>
- <!-- Basic -->
- <meta charset="iso-8859-1">
- <link rel="shortcut icon" href="images/favicon.png" type="image/x-icon" />
- <title><%=cLTitle%></title>
- <meta name="keywords" content="<%=cLTitle%>" />
- <meta name="description" content="Portal <%=cLTitle%>">
- <meta name="author" content="SMSTI">
- <!-- Mobile Metas -->
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
- <!-- Web Fonts -->
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">
- <!-- Vendor CSS -->
- <!-- <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.css" /> -->
- <!-- 20210106 -->
- <link rel="stylesheet" href="ndtb/Bootstrap-3.3.7/css/bootstrap.css" />
- <link rel="stylesheet" href="ndtb/datatables.css" />
- <link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.css" />
- <link rel="stylesheet" href="assets/vendor/magnific-popup/magnific-popup.css" />
- <link rel="stylesheet" href="assets/vendor/bootstrap-datepicker/css/bootstrap-datepicker3.css" />
- <!-- Specific Page Vendor CSS -->
- <link rel="stylesheet" href="assets/vendor/select2/css/select2.css" />
- <link rel="stylesheet" href="assets/vendor/select2-bootstrap-theme/select2-bootstrap.min.css" />
- <link rel="stylesheet" href="assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />
- <link rel="stylesheet" href="assets/vendor/dropzone/basic.css" />
- <link rel="stylesheet" href="assets/vendor/dropzone/dropzone.css" />
- <!-- 20210106 -->
- <link rel="stylesheet" href="ndtb/DataTables-1.10.23/css/dataTables.bootstrap.min.css" />
- <link rel="stylesheet" href="ndtb/Buttons-1.6.5/css/buttons.dataTables.min.css" />
- <!-- Theme CSS -->
- <link rel="stylesheet" href="assets/stylesheets/theme.css" />
- <!-- Skin CSS -->
- <link rel="stylesheet" href="assets/stylesheets/skins/default.css" />
- <!-- Theme Custom CSS -->
- <link rel="stylesheet" href="assets/stylesheets/theme-custom.css">
- <!-- Head Libs -->
- <script src="assets/vendor/modernizr/modernizr.js"></script>
- </head>
- <section class="body">
- <!-- start: header -->
- <header class="header">
- <div class="logo-container">
- <a href="<%= cLSite %>" class="logo pull-left">
- <img src="images/<%='logo'+cEmpAnt%>.png" alt="<%= cLTitle %>" height="45"/>
- </a>
- </div>
- <div class="header-right">
- <span class="separator"></span>
- <div id="userbox" class="userbox">
- <a href="#" data-toggle="dropdown">
- <div class="profile-info" data-lock-name="<%= HttpSession->Nome %>">
- <span class="name"><%= HttpSession->NomeFull %></span>
- <span class="role"><%= HttpSession->Perfil %></span>
- <span class="role"><%= HttpSession->NomeEmpresa %></span>
- </div>
- <i class="fa custom-caret"></i>
- </a>
- <div class="dropdown-menu">
- <ul class="list-unstyled">
- <li>
- <a role="menuitem" tabindex="-1" href="U_PortalLogin.apw"><i class="fa fa-power-off"></i>Sair</a>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </header>
- <!-- end: header -->
- <div class="inner-wrapper">
- <!-- start: sidebar -->
- <aside id="sidebar-left" class="sidebar-left">
-
- <div class="sidebar-header">
- <div class="sidebar-title">
- Menu
- </div>
- <%if lLSidebar%>
- <div class="sidebar-toggle" data-toggle-class="sidebar-left-opened" data-target="html" data-fire-event="sidebar-left-opened">
- <%else%>
- <div class="sidebar-toggle hidden-xs"data-toggle-class="sidebar-left-collapsed" data-target="html" data-fire-event="sidebar-left-toggle">
- <%endif%>
- <i class="fa fa-bars" aria-label="Toggle sidebar"></i>
- </div>
- </div>
-
- <div class="nano">
- <div class="nano-content">
- <nav id="menu" class="nav-main" role="navigation">
-
- <ul class="nav nav-main">
- <%=cLMenus%>
- </ul>
- </nav>
- </div>
-
- <script>
- // Maintain Scroll Position
- if (typeof localStorage !== 'undefined') {
- if (localStorage.getItem('sidebar-left-position') !== null) {
- var initialPosition = localStorage.getItem('sidebar-left-position'),
- sidebarLeft = document.querySelector('#sidebar-left .nano-content');
-
- sidebarLeft.scrollTop = initialPosition;
- }
- }
- </script>
- </div>
-
- </aside>
- <!-- end: sidebar -->
- <section role="main" class="content-body">
- <header class="page-header">
- <h2><%=cLPagina%></h2>
- <div class="right-wrapper pull-right">
- </div>
- </header>
- <!-- start: page -->
- <section class="panel">
- <!--
- <header class="panel-heading">
- <div class="panel-actions">
- <a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
- <a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
- </div>
-
- <h2 class="panel-title">Basic with Table Tools</h2>
- </header>
-
- -->
- <div class="panel-body">
- <%=cLTopo%>
- <br>
- <br>
- <%if lTableTools%>
- <table class="table table-bordered table-striped mb-none table-hover" id="datatable-tabletools" style="width: 100%;">
- <%else%>
- <table class="table table-bordered mb-none" style="width: 100%;">
- <%endif%>
- <thead>
- <tr>
- <%=cLColunas%>
- </tr>
- </thead>
- <tbody>
- <%=cLItens%>
- </tbody>
- </table>
- </div>
- <%if len(aLStatGrid) > 0 %>
- <div class="panel-footer">
- <table class="table">
- <tr>
- <% for nInd := 1 to len(aLStatGrid)
- if (nInd % 2) = 1 %>
- <th align="right"><span class="smcircle sm<%= aLStatGrid[nInd, 1] %>"></span></th><th><%= aLStatGrid[nInd, 2] %></th>
- <% else %>
- <th><span class="smcircle sm<%= aLStatGrid[nInd, 1] %>"></span></th><th><%= aLStatGrid[nInd, 2] %></th>
- <% endif
- next %>
- </tr>
- </table>
- </div>
- <% endif %>
-
- <div class="modal fade" id="dialogCancel" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title" id="myModalLabel">Cancelar Orçamento</h4>
- </div>
- <div class="modal-body">
- <div class="row form-group">
- <div class="">
- <div class="col-lg-9">
- <label class="control-label">Motivo do Cancelamento</label>
- </div>
- <div class="col-lg-9">
- <select data-plugin-selectTwo class="form-control populate placeholder mb-md" name="CJ_CODPERD" id="CJ_CODPERD" data-plugin-options='{"placeholder":"Selecione um estado"}' required="" aria-required="true">
- <%=cPerda%>
- </select>
- <input type="hidden" id="numOrc"/>
- <input type="hidden" id="recOrc"/>
- </div>
- </div>
- <br>
- <div class="">
- <div class="col-lg-1"></div>
- <div class="col-lg-9">
- <label class="control-label">Concorrente</label>
- </div>
- <div class="col-lg-9">
- <select class="form-control populate placeholder mb-md" value="" name="CJ_CDCONCO" id="CJ_CDCONCO" required="" aria-required="true">
- <%=cConcorrente%>
- </select>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
- <button type="button" class="btn btn-primary" onclick="javascript:confirmCanc($('#numOrc').val(),$('#recOrc').val());">Confirmar</button>
- </div>
- </div>
- </div>
- </div>
- </section>
- <!-- end: page -->
-
- </section>
- <footer class="panel-footer text-right">
- Desenvolvido por <img src="images/sms.png" />
- </footer>
- </div>
- </section>
- <!-- Vendor -->
- <script src="assets/vendor/jquery/jquery.js"></script>
- <!-- 20210106 -->
- <script src="ndtb/jQuery-3.5.1/jquery-3.5.1.js"></script>
- <script src="ndtb/datatables.js"></script>
- <script src="assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
- <script src="assets/vendor/bootstrap/js/bootstrap.js"></script>
- <!-- 20210106 -->
- <script src="ndtb/Bootstrap-3.3.7/js/bootstrap.js"></script>
- <script src="assets/vendor/nanoscroller/nanoscroller.js"></script>
- <script src="assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
- <script src="assets/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.min.js"></script>
- <script src="assets/vendor/magnific-popup/jquery.magnific-popup.js"></script>
- <script src="assets/vendor/jquery-placeholder/jquery-placeholder.js"></script>
-
- <!-- Custom -->
- <script src="custom/js/bootbox.js"></script>
- <script src="custom/js/moeda.js"></script>
-
- <!-- Specific Page Vendor -->
- <script src="assets/vendor/select2/js/select2.js"></script>
- <script src="assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
- <script src="assets/vendor/bootstrap-fileupload/bootstrap-fileupload.min.js"></script>
- <!-- 20210106 -->
- <script src="ndtb/DataTables-1.10.23/js/jquery.dataTables.js"></script>
- <script src="assets/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js"></script>
- <script src="assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
- <!-- 20210106 -->
- <script src="ndtb/DataTables-1.10.23/js/dataTables.bootstrap.js"></script>
- <script src="ndtb/Buttons-1.6.5/js/dataTables.buttons.min.js"></script>
- <script src="ndtb/JSZip-3.1.3/jszip.min.js"></script>
- <script src="ndtb/pdfmake-0.1.53/pdfmake.min.js"></script>
- <script src="ndtb/pdfmake-0.1.53/vfs_fonts.js"></script>
- <script src="ndtb/Buttons-1.6.5/js/buttons.html5.js"></script>
- <script src="ndtb/Buttons-1.6.5/js/buttons.print.min.js"></script>
- <script src="assets/vendor/dropzone/dropzone.js"></script>
- <script src="custom/js/dropzone.js"></script>
- <!-- Theme Base, Components and Settings -->
- <script src="assets/javascripts/theme.js"></script>
-
- <!-- Theme Initialization Files -->
- <script src="assets/javascripts/theme.init.js"></script>
- <!--
- <script src="assets/javascripts/tables/examples.datatables.default.js"></script>
- <script src="assets/javascripts/tables/examples.datatables.row.with.details.js"></script>
- <script src="js/examples/examples.advanced.form.js"></script>
- <%if lTableTools%>
- <script src="assets/javascripts/tables/examples.datatables.tabletools.js"></script>
- <%else%>
- <script src="assets/javascripts/tables/examples.datatables.tabletools.nd.js"></script>
- <%endif%>
- -->
- <!-- Theme Custom -->
- <script src="assets/javascripts/theme.custom.js"></script>
- <script src="custom/js/datebr.js"></script>
-
- <script>
- $(document).ready( function() {
- $("#datatable-tabletools").attr("role","button");
- // Antigamente
- // var oTable = $('#datatable-tabletools').dataTable();
-
- // Criacao da datatable
- var oTable = $('#datatable-tabletools').dataTable( {
- dom: 'lBfrtip',
- buttons: [
- 'excel', 'pdf', 'print'
- ]
- <%if ! lTableTools%>
- , "ordering": false
- , "searching": false
- <%endif%>
- , "scrollX": true
- });
- var url_atual = window.location.href;
-
- //Ordenacao da tabela
- oTable.fnSort( [ ] );
-
- if( url_atual.match('orcamento.apw') || url_atual.match('Orcamento.apw'))
- {
- oTable.fnSort( [1, 'desc' ] );
- }
-
- //Valida os percentuais no bot�o filtrar para curva ABC
- $('#btFiltroP').click(function() {
- var nPercA = parseFloat($("#PERC_A").val());
- var nPercB = parseFloat($("#PERC_B").val());
- var nPercC = parseFloat($("#PERC_C").val());
-
- if (nPercA+nPercB+nPercC != 100){
- bootbox.alert("A soma dos percentuais de A, B e C deve ser 100!");
- $(this).removeAttr('disabled');
- return false;
- }
- });
- $(window).on('sidebar-left-toggle', function() {
- $($.fn.dataTable.tables(true)).DataTable().columns.adjust();
- })
- /*
- Modal Dismiss
- */
- // $(document).on('click', '.modal-dismiss', function (e) {
- // $('.modal-dismiss').on('click touch touchstart', function (e) {
- // e.preventDefault();
- // $.magnificPopup.close();
- // });
- /*
- Modal Confirm
- */
- // $(document).on('click', '.modal-confirm', function (e) {
- // e.preventDefault();
- // $.magnificPopup.close();
- // var cemail = $("input[name='email']").val();
- // var cdoc = $("input[name='nrdoc']").val();
- // var cform = $("input[name='formDest']").val();
- //
- // var dialogMail = bootbox.dialog({
- // message: '<p class="text-center"><i class="fa fa-spin fa-spinner"></i> Enviando e-mail... Aguarde...</p>',
- // closeButton: false
- // });
- //
- // //Envio de e-mail
- // $.ajax({
- // url: "U_"+cform+"?PR=<%=cLCodLogin%>",
- // data: 'email='+cemail+'&pagina='+cform+'&doc='+cdoc,
- // type: "POST",
- // async: false,
- // success:
- // function(retorno) {
- // dialogMail.modal('hide');
- // if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- // $("html").html(retorno);
- // return;
- // }
- // bootbox.alert(retorno);
- // }
- // });
- //});
-
- /*
- Form
- */
- $('.modal-email').magnificPopup({
- type: 'inline',
- preloader: false,
- focus: '#email',
- modal: true,
-
- // When elemened is focused, some mobile browsers in some cases zoom in
- // It looks not nice, so we disable it:
- callbacks: {
- beforeOpen: function() {
- if($(window).width() < 700) {
- this.st.focus = false;
- } else {
- this.st.focus = '#email';
- }
- },
- elementParse: function(item) {
- // Function will fire for each target element
- // "item.el" is a target DOM element (if present)
- // "item.src" is a source that you may modify
- console.log('Parsing content. Item object that is being parsed:', item);
- if (item.el && item.el.attr("id")) {
- $("input[name='nrdoc']").val(item.el.attr("id").substr(2));
- }
- }
- }
- });
-
- });
-
- function abreEmail(cParm,cEmail) {
- $("input[name='nrdoc']").val(cParm);
- $("input[name='email']").val(cEmail);
-
- $('.modal-email').magnificPopup({
- items: {
- src: '#modalEmail'
- },
- type: 'inline',
- preloader: false,
- focus: '#email',
- modal: true
- }).magnificPopup('open');
- }
- function fecharEmail() {
- $.magnificPopup.close();
- return false;
- };
- function enviarEmail() {
- $.magnificPopup.close();
- var cemail = $("input[name='email']").val();
- var cdoc = $("input[name='nrdoc']").val();
- var cform = $("input[name='formDest']").val();
-
- var dialogMail = bootbox.dialog({
- message: '<p class="text-center"><i class="fa fa-spin fa-spinner"></i> Enviando e-mail... Aguarde...</p>',
- closeButton: false
- });
-
- //Envio de e-mail
- $.ajax({
- url: "U_"+cform+"?PR=<%=cLCodLogin%>",
- data: 'email='+cemail+'&pagina='+cform+'&doc='+cdoc,
- type: "POST",
- async: false,
- success:
- function(retorno) {
- dialogMail.modal('hide');
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retorno);
- return;
- }
- bootbox.alert(retorno);
- }
- });
- return false;
- }
-
- /*
- Efetivação do orçamento
- */
- function efetivaOrc(cNumOrc,cRecOrc) {
- bootbox.dialog({
- title: "Efetivar Orçamento",
- message: "Confirma a efetivação do orçamento "+cNumOrc+"?",
- buttons: {
- cancel: {
- label: 'Não'
- },
- sucess: {
- label: 'Sim',
- callback: function () {
- $('.bootbox.modal').modal('hide');
- var dialogEftv = bootbox.dialog({
- message: '<p class="text-center"><i class="fa fa-spin fa-spinner"></i> Efetivando orçamento. Aguarde...</p>',
- closeButton: false
- });
- //Efetiva o orçamento
- $.ajax({
- url: "U_GeraEfetiva.apw?PR=<%=cLCodLogin%>",
- type: "POST",
- data: 'recorc='+cRecOrc,
- cache: false,
- success:
- function(retorno) {
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- dialogEftv.modal('hide');
- $("html").html(retorno);
- return;
- }
- if (retorno == "") {
- dialogEftv.modal('hide');
- bootbox.alert('Falha ao efetivar o orçamento. Tente novamente mais tarde.');
- }else{
- dialogEftv.modal('hide');
-
- bootbox.confirm({
- title: "Efetivação do Orçamento",
- message: retorno,
- buttons: {
- cancel: {
- label: 'Cancelar'
- },
- confirm: {
- label: 'OK'
- }
- },
- callback: function (result) {
- if (result){
- location.href='u_Orcamento.apw?PR=<%=cLCodLogin%>'
- }
- }
- });
- }
- }
- });
- }
- }
- }
- });
- }
- /*
- Cancelamento do orçamento
- */
- function cancelaOrc(cNumOrc, cRecOrc) {
- /*
- $('.modal-canc').magnificPopup({
- items: {
- src: '#modalCanc'
- },
- type: 'inline',
- preloader: false,
- focus: '#CJ_CODPERD',
- modal: true
-
- }).magnificPopup('open');
- */
- $("#numOrc").val(cNumOrc);
- $("#recOrc").val(cRecOrc);
- $("#dialogCancel").modal('show');
- }
- /*
- dialog.one("mfp-hide", function (e) {
- if (e.target === this) {
- dialog.remove();
- }
- if ($('.modal.in').css('display') == 'block') {
- // do not notify bootstrap about this change!!
- e.stopPropagation();
- }
- });
- */
- function confirmCanc(cNumOrc,cRecOrc) {
- var codPerda = $("#CJ_CODPERD").val();
- var codConc = $("#CJ_CDCONCO").val();
- if(codPerda==""){
- $("#modalCanc").modal('hide');
- bootbox.alert("Informe o motivo da perda!")
- $("#CJ_CODPERD").focus();
- return false;
- }
- if(codPerda.substr(0,1)=="S" && codConc =="" ){
- $("#modalCanc").modal('hide');
- bootbox.alert("Para esse motivo de cancelamento é obrigatório informar o concorrente!")
- $("#CJ_CDCONCO").focus();
- return false;
- }
- $("#modalCanc").modal('hide');
- var dialogCanc = bootbox.dialog({
- message: '<p class="text-center"><i class="fa fa-spin fa-spinner"></i> Cancelando o orçamento. Aguarde...</p>',
- closeButton: false
- });
- //Cancela o orçamento
- $.ajax({
- url: "U_GeraCancela.apw?PR=<%=cLCodLogin%>",
- type: "POST",
- data: 'recorc='+cRecOrc+'&codperda='+codPerda+'&concorrente='+codConc,
- cache: false,
- success:
- function(retorno) {
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retorno);
- $("#modalCanc").modal('hide');
- return;
- }
- if (retorno == "") {
- bootbox.alert('Falha ao cancelar o orçamento. Tente novamente mais tarde.');
- }else{
-
- bootbox.alert("Orçamento cancelado com sucesso!")
- $("#modalCanc").modal('hide');
- }
- }
- });
- }
-
- function fecharCanc(){
- $.magnificPopup.close();
- return false;
- }
- /*
- msg = '<div class="row form-group">'
- //Código de perda
- msg +=' <div class="row form-group">'
- msg +=' <div class="col-lg-1"></div>'
- msg +=' <div class="col-lg-9">'
- msg +=' <label class="control-label">Motivo do Cancelamento</label>'
- msg +=' <div class="input-group">'
- msg +=' <select data-plugin-selectTwo class="form-control populate placeholder mb-md" data-plugin-options='+"'"
- msg +=' { "placeholder": "Selecione...", "allowClear": false }'+"'"+' name="CJ_CODPERD" id="CJ_CODPERD" '
- msg +=' required="" aria-required="true">'
- msg += '<%=cPerda%>'
- msg +=' </select>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' </div>'
- // concorrente
- msg +=' <div class="row form-group">'
- msg +=' <div class="col-lg-1"></div>'
- msg +=' <div class="col-lg-9">'
- msg +=' <label class="control-label">Concorrente</label>'
- msg +=' <div class="input-group">'
- msg +=' <select data-plugin-selectTwo class="form-control populate placeholder mb-md" data-plugin-options='+"'"
- msg +=' { "placeholder": "Selecione...", "allowClear": false }'+"'"+' name="CJ_CDCONCO" id="CJ_CDCONCO" '
- msg +=' required="" aria-required="true">'
- msg +=' <%=cConcorrente%>'
- msg +=' </select>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' </div>'
- msg +='</div>'
- bootbox.dialog({
- title: "Cancelar Orçamento "+cRecOrc,
- message: msg,
- buttons: {
- cancel: {
- label: 'Cancelar'
- },
- sucess: {
- label: 'Confirmar',
- callback: function () {
- codPerda = $("#CJ_CODPERD").val();
- codConc = $("#CJ_CDCONCO").val();
- if(codPerda.substr(0,1)=="S" && codConc =="" ){
- $('.bootbox.modal').modal('hide');
- bootbox.alert("Para esse motivo de cancelamento é obrigatório informar o concorrente!")
- $("#CJ_CDCONCO").focus();
- return false;
- }
- $('.bootbox.modal').modal('hide');
- var dialogCanc = bootbox.dialog({
- message: '<p class="text-center"><i class="fa fa-spin fa-spinner"></i> Efetivando orçamento. Aguarde...</p>',
- closeButton: false
- });
- //Efetiva o orçamento
- $.ajax({
- url: "U_GeraEfetiva.apw?PR=<%=cLCodLogin%>",
- type: "POST",
- data: 'recorc='+cRecOrc,
- cache: false,
- success:
- function(retorno) {
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- dialogEftv.modal('hide');
- $("html").html(retorno);
- return;
- }
- if (retorno == "") {
- dialogEftv.modal('hide');
- bootbox.alert('Falha ao efetivar o orçamento. Tente novamente mais tarde.');
- }else{
- dialogEftv.modal('hide');
-
- bootbox.confirm({
- title: "Efetivação do Orçamento",
- message: retorno,
- buttons: {
- cancel: {
- label: 'Cancelar'
- },
- confirm: {
- label: 'OK'
- }
- },
- callback: function (result) {
- if (result){
- location.href='u_Orcamento.apw?PR=<%=cLCodLogin%>'
- }
- }
- });
- }
- }
- });
- }
- }
- }
- });
- }
- */
- //ViewDanfe
- function ViewDanfe(notaFiscal,tipo){
- $.ajax({
- url: "U_MailNF.apw?PR=<%=cLCodLogin%>",
- type: "POST",
- data: 'email=&doc='+notaFiscal+'&tipo='+tipo,
- cache: false,
- success:
- function(docDanfe) {
- if (docDanfe.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(docDanfe);
- return;
- }
- if (docDanfe == "" || docDanfe.indexOf('Falha') >= 0 ) {
- bootbox.alert('Falha ao gerar o arquivo. Tente novamente mais tarde.');
- }
- if (docDanfe.substr(0,5) == "DANFE") {
- window.open('/anexos/danfe/'+docDanfe,"_blank")
- }
- }
- });
- }
-
- //Impressão do Orçamento
- function PrtOrc(orcto){
- $.ajax({
- url: "U_MailOrc.apw?PR=<%=cLCodLogin%>&opc=print",
- type: "POST",
- data: 'opc=print&doc='+orcto,
- cache: false,
- success:
- function(docOrcto) {
- if (docOrcto.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(docOrcto);
- return;
- }
- if (docOrcto == "" ) {
- bootbox.alert('Falha ao gerar o arquivo. Tente novamente mais tarde.');
- }
- if (docOrcto.substr(0,9) == "orcamento") {
- window.open('/anexos/orcamentos/'+docOrcto,"_blank")
- }
- }
- });
- }
-
-
- function Filtro(){
-
- if( window.location.href.match('estoque.apw') || window.location.href.match('Estoque.apw')){
-
- var cliSel = $("#CLIENTE").val();//Cliente
- var tpCli = $("#TPCLI").val();//Tipo Cliente
- var estFat = $("#EST_FAT").val();//Estado faturamento
- var estEntre = $("#EST_ENTRE").val();//Estado entrega
- var munEntre = $("#MUN_ENTRE").val()//Municipio entrega
- //var grupoSel = $("#GRUP_PROD").val();//Grupo produto
- var _oportun = $("#OPORTUN").val();//Oportunidade
- var btFiltro = document.getElementById("btFiltro");
- var lRetFil = true;
- if(cliSel == '' && (estFat == "" || tpCli == "")) {
- bootbox.alert("Campos Tipo/Estado de faturamento vazios.");
- lRetFil = false;
- btFiltro.value="Consultar";
- $("#CLIENTE").focus();
- return;
-
- }
- if (tpCli == ""){
- bootbox.alert("Campo Tipo Vazio.");
- lRetFil = false;
- btFiltro.value="Consultar";
- return;
- }
- if (estFat == ""){
- bootbox.alert("Campo Estado Faturamento Vazio.");
- $("#EST_FAT").focus();
- btFiltro.value="Consultar";
- lRetFil = false;
- return;
- }
- if (estEntre == ""){
- bootbox.alert("Campo Estado Entrega Vazio.");
- $("#EST_ENTRE").focus();
- btFiltro.value="Consultar";
- lRetFil = false;
- return;
- }
- if (munEntre == ""){
- bootbox.alert("Campo Municipio Entrega Vazio.");
- $("#MUN_ENTRE").focus();
- btFiltro.value="Consultar";
- lRetFil = false;
- return;
- }
- //if (grupoSel == ""){
- // bootbox.alert("Campo Grupo V�zio.");
-
- // lRetFil = false;
- // return;
- // }
- if (_oportun == ""){
- bootbox.alert("Campo Oportunidade Vazio.");
- $("#OPORTUN").focus();
- btFiltro.value="Consultar";
- lRetFil = false;
- return;
- }
- if (lRetFil){
- //$("#GRUPOP").val(grupoSel);
- $("#FILTROP").val('001');
- $("#formGrid").submit();
- }
- } else {
- //Submete formulario
- $("#formGrid").submit();
- }
- }
-
- function GerarBoletos(){
- var noCheckedBox = true;
- var oBtnBol = $("#btBoleto");
- if (document.querySelectorAll("input[type=checkbox]").length>1){
- oBtnBol.attr("disabled","");
- document.querySelectorAll("input[type=checkbox]").forEach(e=> {
- if (e.checked) {
- noCheckedBox = false;
- }
- })
- if (noCheckedBox){
- bootbox.alert("Selecione pelo menos 1 título!");
- oBtnBol.removeAttr("disabled");
- } else {
- document.querySelectorAll("input[type=checkbox]").forEach(e=> {
- if (e.checked) {
- ViewBoleto(e.value);
- e.checked=false;
- }
- })
- bootbox.alert("Aguarde... Os boletos serão gerados em breve!");
- oBtnBol.removeAttr("disabled");
- }
- } else {
- bootbox.alert("Sem títulos para geração de boleto!");
- oBtnBol.removeAttr("disabled");
- }
- }
- /*
- function Filtro(obBtn){
- // this.value= '+"'"+'Aguarde...'+"'"+';this.disabled= '+"'"+'disabled'+"'"+';
- obBtn.disabled = true;
- //Submete formulario
- $("#formGrid").submit();
- } */
-
- function Filtrar(obBtn){
- // this.value= '+"'"+'Aguarde...'+"'"+';this.disabled= '+"'"+'disabled'+"'"+';
- obBtn.disabled = true;
- //Submete formulario
- $("#formGrid").submit();
- console.log("Formulário enviado!");
- }
-
-
-
- /**
- // Função para ver detalhes do limite
- **/
- function detLimite(cCliente){
- var msg = "";
- var total = "";
- var pedlib = "";
- var pedidos = "";
- var titulos = "";
- var saldo = "";
- var vencto = "";
- var risco = "";
- var orcprev = "";
- var orcfirme = "";
- var atraso = "";
- var utilizado = "";
-
- $.ajax({
- url: "U_ConsLmt.apw?PR=<%=cLCodLogin%>",
- data: 'cliente='+cCliente,
- type: "POST",
- async: false,
- success:
- function(retorno) {
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retorno);
- return;
- }
- aRet = retorno.split('|');
- total = aRet[0];
- pedlib = aRet[1];
- titulos = aRet[2];
- saldo = aRet[3];
- vencto = aRet[4];
- risco = aRet[5];
- pedidos = aRet[6];
- orcprev = aRet[7];
- orcfirme = aRet[8];
- atraso = aRet[9];
- utilizado = aRet[10];
- }
- });
-
- msg = '<div class="row form-group">'
- msg +=' <br>'
- //Limite Total
- msg +=' <div class="row form-group">'
- msg +=' <div class="col-lg-1"></div>'
- msg +=' <div class="col-lg-5">'
- msg +=' <label class="control-label">Limite Total</label>'
- msg +=' <div class="input-group">'
- msg +=' <input class="form-control text-right" value="'+total+'" disabled>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' <div class="col-lg-5">'
- msg +=' <label class="control-label">Limite Disponível</label>'
- msg +=' <div class="input-group">'
- msg +=' <input class="form-control text-right" value="'+saldo+'" disabled>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' </div>'
-
- //CREDITO
- msg +=' <div class="row form-group">'
- msg +=' <div class="col-lg-1"></div>'
- msg +=' <div class="col-lg-5">'
- msg +=' <label class="control-label">Limite Utilizado</label>'
- msg +=' <div class="input-group">'
- msg +=' <input class="form-control text-right" value="'+utilizado+'" disabled>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' <div class="col-lg-5">'
- msg +=' <label class="control-label">Saldo em títulos</label>'
- msg +=' <div class="input-group">'
- msg +=' <input class="form-control text-right" value="'+titulos+'" disabled>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' <div class="row form-group">'
- msg +=' <div class="col-lg-1"></div>'
- msg +=' <div class="col-lg-5">'
- msg +=' <label class="control-label">Valor em atraso</label>'
- msg +=' <div class="input-group">'
- msg +=' <input class="form-control text-right" value="'+atraso+'" disabled>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' </div>'
- // msg +=' <div class="col-lg-3">'
- // msg +=' <label class="control-label">Vencimento Limite</label>'
- // msg +=' <div class="input-group">'
- // msg +=' <input class="form-control text-right" value="'+vencto+'" disabled>'
- // msg +=' </div>'
- // msg +=' </div>'
- // msg +=' <div class="col-lg-2">'
- // msg +=' <label class="control-label">Risco</label>'
- // msg +=' <div class="input-group">'
- // msg +=' <input class="form-control text-right" value="'+risco+'" disabled>'
- // msg +=' </div>'
- // msg +=' </div>'
- // msg +=' </div>'
-
- //Pedidos
- // msg +=' <div class="row form-group">'
- // msg +=' <div class="col-lg-1"></div>'
- // msg +=' <div class="col-lg-5">'
- // msg +=' <label class="control-label">Pedidos em Aberto</label>'
- // msg +=' <div class="input-group">'
- // msg +=' <input class="form-control text-right" value="'+pedidos+'" disabled>'
- // msg +=' </div>'
- // msg +=' </div>'
- // msg +=' <div class="col-lg-5">'
- // msg +=' <label class="control-label">Pedidos Liberados</label>'
- // msg +=' <div class="input-group">'
- // msg +=' <input class="form-control text-right" value="'+pedlib+'" disabled>'
- // msg +=' </div>'
- // msg +=' </div>'
- // msg +=' </div>'
-
- //Orçamentos
- // msg +=' <div class="row form-group">'
- // msg +=' <div class="col-lg-1"></div>'
- // msg +=' <div class="col-lg-5">'
- // msg +=' <label class="control-label">Orçamentos Previstos</label>'
- // msg +=' <div class="input-group">'
- // msg +=' <input class="form-control text-right" value="'+orcprev+'" disabled>'
- // msg +=' </div>'
- // msg +=' </div>'
- // msg +=' <div class="col-lg-5">'
- // msg +=' <label class="control-label">Orçamentos Firmes</label>'
- // msg +=' <div class="input-group">'
- // msg +=' <input class="form-control text-right" value="'+orcfirme+'" disabled>'
- // msg +=' </div>'
- // msg +=' </div>'
- // msg +=' </div>'
- // msg +='</div>'
-
-
- if(msg != ""){
- bootbox.dialog({
- title: 'Limite de Crédito',
- message: "<p>"+msg+"</p>",
- backdrop: true,
- buttons: {
- ok: {
- label: "OK"
- }
- }
- });
- }
- }
-
- /**
- // Função para enviar msg ao financeiro
- **/
- function mensagemFin(cRecCli){
- $("#recCliente").val(cRecCli);
- $("#dialogMsgFin").modal('show');
- }
-
- /**
- // Função para envio de e-mail ao financeiro
- **/
- function emailFin(cRecCli){
-
- //aguardar
- var x = [];
- var cAnexos = "";
- var cMensagem = $("#textoMensagem").val();
- var dialogTab = bootbox.dialog({
- message: '<p class="text-center"><i class="fa fa-spin fa-spinner"></i> Enviando e-mail... Aguarde...</p>',
- closeButton: false
- });
- $('#dialogMsgFin').modal('hide');
- $(".dz-filename").each(function() { x.push($(this).text())});
- for (i = 0; i < x.length; i++) {
- cAnexos += x[i]+"|";
- }
- oObjDados = {'cliente': cRecCli, 'mensagem': cMensagem, 'anexos':cAnexos};
-
- $.ajax({
- url: "U_EnvMsgFin.apw?PR=<%=cLCodLogin%>",
- //data: 'cliente='+cRecCli+'&mensagem='+cMensagem+'&anexos='+cAnexos,
- data: oObjDados,
- type: "POST",
- async: false,
- success:
- function(retorno) {
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retorno);
- return;
- } else {
- //remove aguarde
- dialogTab.modal('hide');
- $('.bootbox.modal').modal('hide');
- bootbox.alert("Mensagem enviada com sucesso!");
- //document.location.href = "U_LimiteCredito.apw?PR=<%=cLCodLogin%>" ;
- }
- }
- });
-
- }
-
- /**
- // Função para buscar as filiais que o vendedor tem acesso
- **/
- function getFilVend(){
- var msg = "";
- var cFilVend = "";
- var lRet = false;
-
- $.ajax({
- url: "U_FilVend.apw?PR=<%=cLCodLogin%>",
- type: "POST",
- async: false,
- success:
- function(retorno) {
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retorno);
- return;
- }
- if(retorno != "" && retorno.indexOf("Expires") == -1) {
-
- msg = '<div class="row form-group">'
- msg +=' <br>'
- msg +=' <div class="row form-group">'
- msg +=' <div class="col-lg-1"></div>'
- msg +=' <div class="col-lg-9">'
- msg +=' <label class="control-label">Selecione a filial para geração do orçamento</label>'
- msg +=' <div class="input-group">'
- msg +=' <select data-plugin-selectTwo class="form-control populate placeholder mb-md" data-plugin-options='+"'"
- msg +=' { "placeholder": "Selecione...", "allowClear": false }'+"'"+' name="FILVEND" id="FILVEND" '
- msg +=' required="" aria-required="true">'
- msg += retorno
- msg +=' </select>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' </div>'
- msg +='</div>'
-
-
- if(msg != ""){
- bootbox.dialog({
- title: 'Filial Para Orçamento',
- message: "<p>"+msg+"</p>",
- backdrop: true,
- closeButton: false,
- onEscape: false,
- buttons: {
- cancel: {
- label: "Cancelar"
- },
- sucess: {
- label: "OK",
- callback: function () {
- cFilVend = $("#FILVEND").val();
- $('.bootbox.modal').modal('hide');
-
-
- //Chama função para trocar de filial
- $.ajax({
- url: "U_TrocaFil.apw?PR=<%=cLCodLogin%>",
- data: 'filial='+cFilVend,
- type: "POST",
- async: false,
- success:
- function(retfil) {
- if (retfil.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retfil);
- return;
- }
- if(retfil != "" && retfil.indexOf("Expires") == -1) {
- url_atual = window.location.href;
- if( url_atual.match('orcamento.apw') || url_atual.match('Orcamento.apw')){
- //if(location.pathname.indexOf('U_orcamento')>0){
- location.href='u_AddOrc.apw?PR=<%=cLCodLogin%>'
- } else {
- location.href='u_AddCF.apw?PR=<%=cLCodLogin%>'
- }
- } else {
- bootbox.alert("Falha ao logar na filial "+cFilVend+".");
- }
- }
- });
- }
- }
- },
- });
- }
- } else {
- $('.bootbox.modal').modal('hide');
- bootbox.alert("Falha ao localizar as filiais que o vendedor tem acesso.");
- }
- }
- });
-
-
- }
-
- /**
- // Função para buscar a filial para inclusão da venda agregada
- **/
- function getFilial(){
- var msg = "";
- var cFilVend = "";
- var lRet = false;
-
- $.ajax({
- url: "U_FilVend.apw?PR=<%=cLCodLogin%>",
- type: "POST",
- async: false,
- success:
- function(retorno) {
- if (retorno.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retorno);
- return;
- }
- if(retorno != "" && retorno.indexOf("Expires") == -1) {
-
- msg = '<div class="row form-group">'
- msg +=' <br>'
- msg +=' <div class="row form-group">'
- msg +=' <div class="col-lg-1"></div>'
- msg +=' <div class="col-lg-9">'
- msg +=' <label class="control-label">Selecione a filial para inclusão da venda</label>'
- msg +=' <div class="input-group">'
- msg +=' <select data-plugin-selectTwo class="form-control populate placeholder mb-md" data-plugin-options='+"'"
- msg +=' { "placeholder": "Selecione...", "allowClear": false }'+"'"+' name="FILVEND" id="FILVEND" '
- msg +=' required="" aria-required="true">'
- msg += retorno
- msg +=' </select>'
- msg +=' </div>'
- msg +=' </div>'
- msg +=' </div>'
- msg +='</div>'
-
-
- if(msg != ""){
- bootbox.dialog({
- title: 'Filial Venda Agregada',
- message: "<p>"+msg+"</p>",
- backdrop: true,
- closeButton: false,
- onEscape: false,
- buttons: {
- sucess: {
- label: "OK",
- callback: function () {
- cFilVend = $("#FILVEND").val();
- $('.bootbox.modal').modal('hide');
-
-
- //Chama função para trocar de filial
- $.ajax({
- url: "U_TrocaFil.apw?PR=<%=cLCodLogin%>",
- data: 'filial='+cFilVend,
- type: "POST",
- async: false,
- success:
- function(retfil) {
- if (retfil.indexOf('HTTP-EQUIV') >= 0 ) {
- $("html").html(retfil);
- return;
- }
- if(retfil != "" && retfil.indexOf("Expires") == -1) {
- location.href='u_AgregarVenda.apw?PR=<%=cLCodLogin%>'
- } else {
- bootbox.alert("Falha ao logar na filial "+cFilVend+".");
- }
- }
- });
- }
- }
- },
- });
- }
- } else {
- $('.bootbox.modal').modal('hide');
- bootbox.alert("Falha ao localizar as filiais que o vendedor tem acesso.");
- }
- }
- });
-
-
- }
- function SelectCli() {
- var clienteSelect = document.getElementById("CLIENTE");
- var tipoCliSel = document.getElementById("TPCLI");
- var estCliSel = document.getElementById("EST_FAT");
- var estEntSel = document.getElementById("EST_ENTRE");
- var munCliSel = document.getElementById("MUN_ENTRE");
- //var grupoCliSel = document.getElementById("GRUP");
-
- var selectedOption = clienteSelect.options[clienteSelect.selectedIndex];
- var tipoCliVal = selectedOption.getAttribute("TIPO");
- var estadoCliVal = selectedOption.getAttribute("EST");
- var entregaCliVal = selectedOption.getAttribute("ESTE");
- var munCliVal = selectedOption.getAttribute("MUN");
- //var grupoCliVal = selectedOption.getAttribute("GRUPO");
- tipoCliSel.value = tipoCliVal;
- estCliSel.value = estadoCliVal;
- estEntSel.value = entregaCliVal;
- munCliSel.value = munCliVal;
- //grupoCliSel.value = grupoCliVal;
- $("select[name=TPCLI]").change();
- $("select[name=EST_FAT]").change();
- $("select[name=EST_ENTRE]").change();
- $("select[name=MUN_ENTRE]").change();
- }
- function retMunicipios(cMunE) {
- var cEst = document.getElementById('EST_ENTRE').value;//element.value;
- var cCli = document.getElementById('CLIENTE').value;
- var cMun = cMunE//document.getElementById('MUN_ENTRE').value;
- $.ajax({
- url: "U_RetMun.apw?PR=<%=cLCodLogin%>",
- data: 'cEst='+cEst + '&cCli='+cCli,
- type: "POST",
- async: false,
- success:
- function(municipios) {
- if (municipios.indexOf('<META HTTP-EQUIV') >= 0 ) {
- $("html").html(municipios);
- return;
- }
- if ( municipios == "" ) {
- bootbox.alert('Nenhum Mucicipio Listado!');
- $("#EST_FAT").focus();
- }else{
- $('#MUN_ENTRE').empty();
- $("#MUN_ENTRE").append(municipios);
- $("select[name=MUN_ENTRE]").change();
- }
- }
- });
-
- }
-
- <%=cLJavaScr%>
-
-
- </script>
-
- </body>
- </html>
|