1(this.webpackJsonpsbsupervisor=this.webpackJsonpsbsupervisor||[]).push([[12],{718:function(e,a,t){"use strict";t.r(a);var r=t(748),n=t(12),o=t.n(n),i=t(19),c=t(3),s=t(36),l=t(37),u=t(39),d=t(38),p=t(1),m=t.n(p),f=t(232),b=t(96),v=t(86),O=t(22),g=t(13),k=t(16),h=t(99),j=function(e){var a=e.tipo,t=e.onClick,r=e.style,n=e.className;return"xlsx"===a?m.a.createElement("svg",{version:"1.0",xmlns:"http://www.w3.org/2000/svg",width:"1.6em",height:"1.6em",viewBox:"0 0 351.000000 301.000000",preserveAspectRatio:"xMidYMid meet",onClick:t,style:Object(c.a)({cursor:"pointer",marginRight:"10px"},r),className:n},m.a.createElement("g",{transform:"translate(0.000000,301.000000) scale(0.100000,-0.100000)",fill:"var(--cor-filtro-azul-consulta)",stroke:"none"},m.a.createElement("path",{d:"M890 2851 c-448 -87 -832 -161 -852 -165 l-38 -7 0 -1174 c0 -646 4 -1175 8 -1175 5 0 394 -74 866 -165 471 -91 859 -165 861 -165 3 0 5 677 5 1505 0 1427 -1 1505 -17 1504 -10 0 -385 -72 -833 -158z m-130 -955 c49 -101 94 -202 101 -225 7 -22 15 -41 19 -41 4 0 13 19 19 43 7 23 57 124 110 224 l96 183 138 0 138 0 -12 -22 c-7
1-13 -84 -141 -171 -286 l-160 -262 118 -193 c65 -105 146 -238 181 -294 l63 -103 -149 0 -149 0 -107 202 c-58 111 -109 215 -112 230 -8 39 -19 35 -36 -14 -8 -24 -60 -126 -115 -228 l-100 -185 -146 -3 c-80 -1 -146 0 -146 4 0 4 81 134 180 289 99 155 180 286 180 290 0 3 -73 131 -161 283 -89 152 -163 280 -166 285 -2 4 64 7 147 7 l151 0 89 -184z"}),m.a.createElement("path",{d:"M1840 2485 l0 -175 175 0 175 0 0 -110 0 -110 -175 0 -175 0 0 -120 0 -120 175 0 175 0 0 -110 0 -110 -175 0 -175 0 0 -120 0 -120 175 0 175 0 0 -115 0 -115 -175 0 -175 0 0 -120 0 -120 175 0 175 0 0 -110 0 -110 -175 0 -175 0 0 -175 0 -175 552 0 552 0 28 27 28 27 0 233 0 233 -193 145 -194 145 -152 0 -152 0 1 117 c1 88 -2 128 -14 155 -20 47 -20 89 0 136 12 28 16 66 14 160 l-1 122 155 0 156 0 190 142 190 143 0 238 0 238 -25 24 -24 25 -556 0 -555 0 0 -175z m920 -285 l0 -110 -225 0 -225 0 0 110 0 110 225 0 225 0 0 -110z m0 -1390 l0 -110 -225 0 -225 0 0 110 0 110 225 0 225 0 0 -110z"}),m.a.createElement("path",{d:"M2859 1947 c-316 -237 -489 -373 -497 -391 -17 -37 -15 -83 4 -114 9 -15 231 -188 495 -385 515 -387 518 -388 587 -353 17 9 35 24 40 34 5 9 12 351 15 762 l5 744 -33 33 c-28 28 -40 33 -82 33 -50 0 -50 0 -534 -363z"}))):"pdf"===a?m.a.createElement("svg",{version:"1.0",xmlns:"http://www.w3.org/2000/svg",width:"1.6em",height:"1.6em",viewBox:"0 0 512 512",preserveAspectRatio:"xMidYMid meet",onClick:t,style:Object(c.a)({cursor:"pointer"},r),className:n},m.a.createElement("path",{fill:"var(--cor-filtro-azul-consulta)",d:"M369.9 97.1L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34.8zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm250.2-143.7c-12.2-12-47-8.7-64.4-6.5-17.2-10.5-28.7-25-36.8-46.3 3.9-16.1 10.1-40.6 5.4-56-4.2-29.4-42.3-26.5-52.9-24.8-22.2 4.3-28.5 23.2-23.1 39.3 3.1 9.8 16 18.7 13.9 27.3-4.9 24.9 30 11.6 36.8 17.7 15.1 13.8 16.8 36.7 16.2 47.7-3.4 42.5 35.1 24.3 42.6 18.2 12.6 8.6 20.8 4.3 29.5 1.2 13.5-4.8 23.8-14.4 29.1-27.2 2.1-5.1 3.5-10.6 3.5-16.4.1-14.3-11.5-26-24.2-30.4z"})):null},C=function(e){var a=e.xlsx,t=e.pdf,r=e.dados,n=e.definirOnclick,o=e.style,i=e.className;return m.a.createElement("div",{style:Object(c.a)(Object(c.a)({},{position:"absolute",right:"20px",margin:"-2px",zIndex:1}),o),className:i},(null===a||void 0===a?void 0:a.ativo)&&m.a.createElement(j,{tipo:"xlsx",onClick:function(e){return n({onClick:a.onClick,params:a.params,dados:r,e:e})}}),(null===t||void 0===t?void 0:t.ativo)&&m.a.createElement(j,{tipo:"pdf",onClick:function(e){return n({onClick:t.onClick,params:t.params,dados:r,e:e})}}))};C.defaultProps={definirOnclick:function(){},xlsx:{ativo:!1,onClick:"gerarXlsx"},style:{position:"absolute",right:"20px",margin:"-2px",zIndex:1,cursor:"pointer"},dados:{}};var x=C,E=t(25),S=t(72),M=t.n(S),w=t(87),P=t(17),_=function(e){Object(u.a)(t,e);var a=Object(d.a)(t);function t(e){var r;return Object(s.a)(this,t),(r=a.call(this,e)).toggleModalSecundario=function(){r.setState((function(e){return{ativarModalSecundario:!e.ativarModalSecundario}}))},r.reinicializarTabela=function(){r.tabelaRef.current.fireFetchData()},r.colunaDeAcoes=function(e,a,t){return m.a.createElement(p.Fragment,null,"0"===e.status_aprovacao_receita&&m.a.createElement(p.Fragment,null,m.a.createElement(P.d,{color:"#3CB371",onClick:function(){return r.props.modalConfirm({mensagem:"Deseja Aprovar esta solicita\xe7\xe3o?",titulo:"Confirma\xe7\xe3o",callback:function(){return r.definirOnclick({dados:Object(c.a)(Object(c.a)({},e),{},{status_aprovacao_receita:1,status:"APROVADA",indice:t}),onClick:"aprovacao-receita"})}})},className:"menuIcons pull-right"}),m.a.createElement(P.C,{color:"#dc3545",onClick:function(){return r.props.modalConfirm({mensagem:"Deseja Reprovar esta solicita\xe7\xe3o?",titulo:"Confirma\xe7\xe3o",callback:function(){return r.promptBeforeCall({dados:Object(c.a)(Object(c.a)({},e),{},{status_aprovacao_receita:2,status:"REPROVADA",indice:t}),onClick:"aprovacao-receita"})}})},className:"menuIcons pull-right"})),"1"==e.status_aprovacao_receita&&m.a.createElement(P.e,{color:"#3CB371",size:"1.5rem"}),"2"==e.status_aprovacao_receita&&m.a.createElement(P.D,{color:"#dc3545",size:"1.5rem"}))},r.gerarColunas=function(){var e=r.state.estrutura.tabela.campos?r.state.estrutura.tabela.campos.slice():[],a=e.map((function(a){switch(r.state.estrutura.tipoRelatorio){case"abrir-arquivo":a.Cell=function(e){var t=e.original,n=e.index;switch(a.name){case"status_aprovacao_receita":return r.colunaDeAcoes(t,a,n);case"link_receita":return t.link_receita?m.a.createElement(P.m,{size:"1.5rem",onClick:function(){return r.requestAbrirArquivo(r.state.estrutura.tabela.url,"GET",t)}}):null;
1case"arquivo_receita":return t.arquivo_receita?m.a.createElement(P.o,{size:"1.5rem",onClick:function(){return r.requestAbrirArquivo(r.state.estrutura.tabela.url,"GET",t)}}):null;default:return m.a.createElement(h.a,{dados:t,elemento:a,definirOnclick:function(){return r.requestAbrirArquivo(r.state.estrutura.tabela.url,"GET",t)}})}};break;case"transferir-meta-venda":a.Cell=function(e){var t=e.original;return"transferir"===a.name?m.a.createElement(p.Fragment,null,m.a.createElement(P.x,{onClick:function(){return Number(t.disponivel)>0&&r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:Object(c.a)(Object(c.a)({},t),{},{modal:"transferir"})}))},className:"menuIcons pull-right"}),m.a.createElement(P.B,{onClick:function(){return Number(t.disponivel)>0&&r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:Object(c.a)(Object(c.a)({},t),{},{modal:"transferirM"})}))},className:"menuIcons pull-right"}),m.a.createElement(P.b,{onClick:function(){return Number(t.haslog)>0&&r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:Object(c.a)(Object(c.a)({},t),{},{modal:"logs"})}))},className:"menuIcons pull-right"})):m.a.createElement(h.a,{dados:t,elemento:a,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}})};break;case"lista-cliente-por-funcionario":a.Cell=function(e){var t=e.original;return"icon"===a.name?m.a.createElement(h.c,{dados:t,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}}):m.a.createElement(h.a,{dados:t,elemento:a,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}})},e[0].Footer=function(e){var a=e.data;return m.a.createElement("div",{className:"rt-footer-total"},m.a.createElement("strong",null,"Total de Clientes: ",a[0]?a[0]._original.total_de_dados:0))};break;case"rota-prevista-realizada":a.Cell=function(e){var t=e.original;return"icon"===a.name?m.a.createElement(h.d,{dados:t,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}}):m.a.createElement(h.a,{dados:t,elemento:a,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}})};break;case"lista-cliente-nao-atendidos":e[0].Footer=function(e){var a=e.data;return m.a.createElement("div",{className:"rt-footer-total"},m.a.createElement("strong",null,"Total de Clientes: ",a[0]?a[0]._original.total_de_dados:0))};break;case"horario-funcionario":a.Cell=function(e){var t=e.original;return m.a.createElement(h.b,{dados:t,elemento:a,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}})};break;case"pedidos-recusados":a.Cell=function(e){var t=e.original,n=e.index;return"conferido"===a.name?m.a.createElement("div",{className:"d-flex justify-content-center"},m.a.createElement("input",{type:"checkbox",style:{width:"20px",height:"20px",cursor:"pointer"},checked:t.conferido,onChange:function(){return r.definirOnclick({onClick:"toggle-conferido",dados:Object(c.a)(Object(c.a)({},t),{},{indice:n})})}})):m.a.createElement(h.a,{dados:t,elemento:a,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}})};break;default:a.Cell=function(e){var t=e.original;return m.a.createElement(h.a,{dados:t,elemento:a,definirOnclick:function(){return r.definirOnclick(Object(c.a)(Object(c.a)({},a),{},{dados:t}))}})}}return a})),t=r.state.estrutura.exportar||{},n=t.xlsx,o=t.pdf,i={xlsx:n?Object(c.a)(Object(c.a)({},n),{},{onClick:"gerarXlsx"}):null,pdf:o?Object(c.a)(Object(c.a)({},o),{},{onClick:"gerarPDF"}):null,definirOnclick:r.definirOnclick,dados:Object(c.a)({},r.paramsConsulta)};return a[a.length-1].Footer=m.a.createElement("div",{className:"rt-footer-total"},m.a.createElement(x,Object.assign({className:"rt-footer-total"},i))),a},r.buscarModalSecundario=function(e){r.setState({loader:!0},Object(i.a)(o.a.mark((function a(){var t;return o.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(g.a)({method:r.state.estrutura.metodoRequisicao,url:r.state.estrutura.requisicaoURL,params:e});case 3:(t=a.sent).data.modal.tipoRelatorio===r.state.estrutura.tipoRelatorio?(r.paramsConsulta=e,r.setState({estrutura:t.data.modal,loader:!1},r.reinicializarTabela)):r.setState({estruturaModalSecundario:t.data,loader:!1,ativarModalSecundario:!0}),a.next=10;break;case 7:a.prev=7,a.t0=a.catch(0),r.props.ativar("receber","erro");case 10:case"end":return a.stop()}}),a,null,[[0,7]])}))))},r.gerarTdProps=function(){switch(r.state.estrutura.tipoRelatorio){case"cliente-titulos":return function(e,a,t,r){return{style:JSON.parse(a.original.vencido_style)}
1};case"itens-pedido":return function(e,a,t,r){return a?{className:a.original.rowClassName}:{}};default:return}},r.requestAbrirArquivo=function(e,a,t){r.setState({loader:!0},(function(){Object(g.a)({method:a,url:e,params:t}).then((function(e){var a,t=e.data;window.open(null!==(a=t.arquivo.url)&&void 0!==a?a:"#",t.arquivo.title),r.setState({loader:!1})})).catch((function(e){console.log(e),r.setState({loader:!1}),r.props.ativar("receber","erro")}))}))},r.promptBeforeCall=function(e){var a,t=e.onClick,n=e.dados;do{a=prompt("Informe o motivo da reprova\xe7\xe3o")}while(null==a||""==a);r.definirOnclick({onClick:t,dados:Object(c.a)(Object(c.a)({},n),{},{motivo:a})})},r.definirOnclick=function(){var e=Object(i.a)(o.a.mark((function e(a){var t,n,i,s,l,u,d,p;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=a.onClick,n=a.params,i=a.dados,s=a.e,e.t0=t,e.next="buscarModalSecundario"===e.t0?4:"aprovacao-receita"===e.t0?7:"gerarXlsx"===e.t0?23:"gerarPDF"===e.t0?40:"toggle-conferido"===e.t0?57:74;break;case 4:return n=Object(c.a)(Object(c.a)({},r.paramsConsulta),M()(i,n)),r.buscarModalSecundario(n),e.abrupt("break",75);case 7:return e.prev=7,r.setState({loader:!0}),e.next=11,Object(g.a)({method:"POST",url:"/gerenciamento/appplus/aprovacao-receita",data:i});case 11:l=e.sent,1==l.data.status?(r.state.estrutura.tabela.dados[i.indice]=i,r.props.ativar("editar","sucesso")):r.props.ativar("editar","erro"),e.next=19;break;case 16:e.prev=16,e.t1=e.catch(7),r.props.ativar("editar","erro");case 19:return e.prev=19,r.setState({loader:!1}),e.finish(19);case 22:return e.abrupt("break",75);case 23:return e.prev=23,s.stopPropagation(),r.props.ativar("exportar","iniciar"),r.setState({loader:!0}),n=Object(c.a)(Object(c.a)({requisicaoURL:r.state.estrutura.requisicaoURL},r.paramsConsulta),M()(i,n)),e.next=30,k.w(n,r.state.estrutura.exportar.url);case 30:r.props.ativar("exportar","sucesso"),e.next=36;break;case 33:e.prev=33,e.t2=e.catch(23),r.props.ativar("exportar","erro");case 36:return e.prev=36,r.setState({loader:!1}),e.finish(36);case 39:return e.abrupt("break",75);case 40:return e.prev=40,s.stopPropagation(),r.props.ativar("exportar","iniciar"),r.setState({loader:!0}),n=Object(c.a)(Object(c.a)({requisicaoURL:r.state.estrutura.requisicaoURL},r.paramsConsulta),M()(i,n)),e.next=47,k.v(n,r.state.estrutura.exportar.url);case 47:r.props.ativar("exportar","sucesso"),e.next=53;break;case 50:e.prev=50,e.t3=e.catch(40),r.props.ativar("exportar","erro");case 53:return e.prev=53,r.setState({loader:!1}),e.finish(53);case 56:return e.abrupt("break",75);case 57:return e.prev=57,r.setState({loader:!0}),u=!i.conferido,e.next=62,Object(g.a)({method:"POST",url:"/consultas/sbvendas/pedidos_recusados/toggle-conferido-pedido-recusado",data:{recusado_id:i.recusado_id,conferido:u}});case 62:d=e.sent,1===d.data.status?((p=Object(c.a)({},r.state.estrutura)).tabela.dados[i.indice].conferido=u,r.setState({estrutura:p}),r.props.ativar("editar","sucesso")):r.props.ativar("editar","erro"),e.next=70;break;case 67:e.prev=67,e.t4=e.catch(57),r.props.ativar("editar","erro");case 70:return e.prev=70,r.setState({loader:!1}),e.finish(70);case 73:case 74:return e.abrupt("break",75);case 75:case"end":return e.stop()}}),e,null,[[7,16,19,22],[23,33,36,39],[40,50,53,56],[57,67,70,73]])})));return function(a){return e.apply(this,arguments)}}(),r.paramsConsulta=r.props.paramsConsulta,r.tabelaRef=m.a.createRef(),r.state={ativarModalSecundario:void 0,estruturaModalSecundario:void 0,estrutura:r.props.estrutura.modal,quantidadePorPagina:r.props.estrutura.modal.tabela?r.props.estrutura.modal.tabela.quantidadePorPagina:void 0},r}return Object(l.a)(t,[{key:"render",value:function(){var e=this,a=this.state.estrutura,t=a.header,r=a.tabela,n=a.filtro;return m.a.createElement(p.Fragment,null,m.a.createElement(f.a,{noGutters:!0},m.a.createElement(O.F,Object.assign({toggle:this.props.toggle},t)),m.a.createElement(O.D,Object.assign({gerarConsulta:this.buscarModalSecundario,estrutura:this.props.subFuncionalidade.estrutura,params:this.paramsConsulta},n)),m.a.createElement(b.a,{sm:12,className:"conteudo-modal-secundario"},m.a.createElement(O.hb,{async:r.async,filtrar:r.filtrar,params:this.paramsConsulta,buscarValoresPaginacao:function(a){return e.props.buscarValoresPaginacao(e.props.indiceSubModal,r.url,a,r.metodo)},dados:r.async?this.props.subFuncionalidade.dados:r.dados,colunas:this.gerarC
1olunas(),quantidadeDePaginas:this.props.subFuncionalidade.quantidadeDePaginas,quantidadePorPagina:r.quantidadePorPagina,loader:this.props.subFuncionalidade.tabelaLoader,getTrProps:this.gerarTdProps(),style:{margin:"0px",height:null,border:"none",minHeight:"200px"},tabelaRef:this.tabelaRef})),this.state.loader&&m.a.createElement(O.Q,{overlay:!0})),m.a.createElement(w.a,{boolModal:this.state.ativarModalSecundario,toggle:this.toggleModalSecundario,estrutura:this.state.estruturaModalSecundario}))}}]),t}(p.PureComponent),q=Object(v.a)(_);a.default=Object(E.b)((function(e){var a=e.subFuncionalidades,t=a.funcionalidadeAtiva,n=a.indiceSubModal,o=a.paramsConsulta;return{subFuncionalidade:Object(r.a)(a,["funcionalidadeAtiva","indiceSubModal","paramsConsulta"])[t][n],funcionalidadeAtiva:t,indiceSubModal:n,paramsConsulta:o}}),(function(e,a){return{ativar:function(a,t){return e(k.c(a,t))},desativar:function(){return e(k.o())},modalConfirm:function(a){var t=a.mensagem,r=a.titulo,n=a.callback;return e(k.e({mensagem:t,titulo:r,callback:n}))},buscarValoresPaginacao:function(a,t,r,n){return e(k.n(void 0,a,t,r,n))}}}))(q)},748:function(e,a,t){"use strict";function r(e,a){if(null==e)return{};var t,r,n=function(e,a){if(null==e)return{};var t,r,n={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],a.indexOf(t)>=0||(n[t]=e[t]);return n}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],a.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}t.d(a,"a",(function(){return r}))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.