danielbrito1987

WindowDialog.js

Jul 27th, 2021
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import { bindActionCreators } from 'redux'
  4. import { panelWindow } from '../actions'
  5.  
  6. import { formatDate, formatNumber } from 'devextreme/localization';
  7. import translate from '../language/index'
  8. import { FREE, BUSY } from '../containers/StatusTypes'
  9.  
  10. import { Popup as PopupForm, ToolbarItem, Position } from 'devextreme-react/popup';
  11. import { AsyncRule, Form as FormPopup, Item, Label, RequiredRule, SimpleItem, StringLengthRule, Tab, TabbedItem, TabPanelOptions } from 'devextreme-react/form';
  12. import { ScrollView, Button, Box, DropDownBox } from 'devextreme-react';
  13.  
  14.  
  15. import DataGrid, { Column, Export, ColumnChooser, ColumnFixing, Selection, Editing, FilterRow, HeaderFilter, SearchPanel, GroupPanel, Sorting, Pager, Paging, Popup, Summary, TotalItem, Lookup, Grouping, Form, Scrolling, GroupItem } from 'devextreme-react/data-grid';
  16. import { Tooltip } from 'devextreme-react/tooltip';
  17.  
  18. import Magnifier from "react-magnifier";
  19. import { isPlate, imageToDataUri } from '../funcs'
  20. import Carousel from './Carousel';
  21.  
  22. import * as consts from './../constants'
  23. import { sendRequest } from '../api/api';
  24. import CustomStore from 'devextreme/data/custom_store';
  25.  
  26. import FileUploader from 'devextreme-react/file-uploader';
  27. import { apiLoad, saveChange } from './../actions'
  28. import notify from 'devextreme/ui/notify';
  29. import { v4 as uuidv4 } from 'uuid'
  30.  
  31. import jsPDF from 'jspdf';
  32. import 'jspdf-autotable';
  33. import { exportDataGrid as exportDataGridToPdf } from 'devextreme/pdf_exporter';
  34. import { toBase64, isCPF, isCNPJ } from '../funcs'
  35.  
  36. import ActiveCell from '../components/ActiveCell';
  37. import YesCell from '../components/YesCell';
  38. import axios from 'axios';
  39.  
  40. const mapStateToProps = store => ({
  41.   modal: store.overlay.modal,
  42.   windows: store.panel.windows,
  43. });
  44.  
  45. let up = 0;
  46.  
  47. const mapDispatchToProps = dispatch =>
  48.   bindActionCreators({ panelWindow, apiLoad, saveChange }, dispatch);
  49.  
  50. class WindowDialog extends React.Component {
  51.   constructor(props) {
  52.     super(props);
  53.     this.timeUpdate = 0;
  54.     this.cancel;
  55.     this._isMounted = false;
  56.     this.dataGridMovimentsRef = React.createRef();
  57.     this.dataGridTarifacaoRef = React.createRef();
  58.     this.dataGridHistoricoRef = React.createRef();
  59.     this.dataGridRef = React.createRef();
  60.     this.gridDocumentsContainer = React.createRef();
  61.     this.fpGuest = React.createRef();
  62.     this.txtQtdHospedes = React.createRef();
  63.  
  64.     let date = new Date();
  65.     date.setHours(date.getHours() - 3);
  66.     this.state = {
  67.       events: [],
  68.       frmSimulate: {},
  69.       simulateInfo: null,
  70.       dataSource: new CustomStore({
  71.         key: 'pessoa_id',
  72.         load: () => sendRequest('/pessoas/0'),
  73.                 insert: (values) => function(){},
  74.         update: (key, values) => function(){}
  75.       }),
  76.       editRowKey: undefined,
  77.             isPhysical: true,
  78.       frmGuest: {},
  79.             contacts: [],
  80.             documents: [],
  81.             addresses: [],
  82.             expanded: true,
  83.             expandedAddress: true,
  84.             expandedContact: true,
  85.             expandedDocument: true,
  86.             contactsDeletedSource: [],
  87.       expand: this.props.expand,
  88.       animation: '',
  89.       animationClose: '',
  90.       error: { field: null, message: null },
  91.       qtd_hospedes: 2,
  92.       camera: null,
  93.       imagens: [],
  94.       isCam: true,
  95.       checkin_em: date.toISOString().substr(0, 19),
  96.       checkout: new Date(),
  97.       awake: new Date(),
  98.       tipo_tarifacao: 0,
  99.       tabIndex: this.props.tabIndex ? this.props.tabIndex : (this.props.status == FREE ? 0 : 7),
  100.       transportes: [],
  101.       hospedes: [],
  102.       servicos: [],
  103.       produtos: [],
  104.       movements: [],
  105.       tarifacoes: [],
  106.       dsTarifacao: [],
  107.       vendas: [],
  108.       frmChekin: { checkin_em: new Date() },
  109.       frmMovimentacao: {},
  110.       fdPaymentMethod: {},
  111.       fdDiscount: {},
  112.       paymentMethodVisible: false,
  113.       discountVisible: false,
  114.       totalServicos: 0,
  115.       totalConsumo: 0,
  116.       totalAdiantamento: 0,
  117.       totalAcrescimos: 0,
  118.       totalDescontos: 0,
  119.       valorReceber: 0,
  120.       valorTroco: 0
  121.     }
  122.  
  123.     this.openModal = this.openModal.bind(this);
  124.     this.closeModal = this.closeModal.bind(this);
  125.     this.changeTab = this.changeTab.bind(this);
  126.     this.update = this.update.bind(this);
  127.     this.addGuest = this.addGuest.bind(this);
  128.     this.delGuest = this.delGuest.bind(this);
  129.     this.onToolbarPreparing = this.onToolbarPreparing.bind(this);
  130.  
  131.     this.onSaving = this.onSaving.bind(this);
  132.     this.onEditingStartGuest = this.onEditingStartGuest.bind(this);
  133.  
  134.     this.onToolbarPreparingAddress = this.onToolbarPreparingAddress.bind(this);
  135.     this.onToolbarPreparingContact = this.onToolbarPreparingContact.bind(this);
  136.     this.onToolbarPreparingDocument = this.onToolbarPreparingDocument.bind(this);
  137.     this.onToolbarPreparingBill = this.onToolbarPreparingBill.bind(this);
  138.  
  139.     this.getUhData = this.getUhData.bind(this);
  140.     this.getGuests = this.getGuests.bind(this);
  141.     this.checkin = this.checkin.bind(this);
  142.  
  143.     this.minimizeBtnOp = {
  144.       icon: 'dx-icon dx-icon-minus',
  145.       stylingMode: 'text',
  146.       onClick: this.openModal
  147.     }
  148.  
  149.     this.billingBtnOp = {
  150.       text: translate('Billing'),
  151.       icon: 'fas fa-dollar-sign',
  152.       onClick: () => this.changeTab(1)
  153.     }
  154.  
  155.     this.paymentsBtnOp = {
  156.       text: translate('PaymentsAndDiscounts'),
  157.       icon: 'fas fa-coins',
  158.       onClick: () => this.changeTab(2)
  159.     }
  160.  
  161.     this.checkInBtnOp = {
  162.       text: this.props.status == FREE ? translate('CheckIn') : translate('CheckOut'),
  163.       icon: 'fa fa-sign-in-alt',
  164.       type: 'success',
  165.       onClick: this.checkin.bind(this)
  166.     }
  167.  
  168.     this.paymentMethodButtonOptions = {
  169.       icon: 'check',
  170.       text: translate('Confirm'),
  171.       onClick: this.makePaymentMethod.bind(this)
  172.     };
  173.     this.discountButtonOptions = {
  174.       icon: 'check',
  175.       text: translate('Confirm'),
  176.       onClick: this.makeDiscount.bind(this)
  177.     };
  178.   }
  179.  
  180.     onSaving(e)
  181.     {
  182.         if(!this.fpGuest.current.instance.validate().isValid)
  183.         {
  184.             e.cancel = true;
  185.             return;
  186.         }
  187.  
  188.         // valida cpf e cnpj
  189.         if(this.state.frmGuest.tipo == 0 )
  190.         {
  191.             if(!isCPF(this.state.frmGuest.cpf_cnpj))
  192.             {
  193.                 notify({ message: translate('INF_60'), position: 'top center'}, 'warning', 3000);
  194.                 e.cancel = true;
  195.                 return;
  196.             }
  197.         }
  198.         else if(this.state.frmGuest.tipo == 1 )
  199.         {
  200.             if(!isCNPJ(this.state.frmGuest.cpf_cnpj))
  201.             {
  202.                 notify({ message: translate('INF_61'), position: 'top center'}, 'warning', 3000);
  203.                 e.cancel = true;
  204.                 return;
  205.             }
  206.         }
  207.  
  208.         if(this.state.editRowKey)
  209.         {
  210.             e.cancel = true;
  211.  
  212.             e.promise = saveChange(this.props.dispatch, '/pessoas/2', {
  213.                 type: 'update',
  214.                 data: Object.assign({contacts: this.state.contacts, addresses: this.state.addresses, documents: this.state.documents, contatos_removidos: this.state.contactsDeletedSource}, this.state.frmGuest)
  215.             });
  216.            
  217.             let _this = this;
  218.             e.promise.then(function(e)
  219.             {
  220.                 if(_this._isMounted && e)
  221.                 {
  222.                     _this.setState({editRowKey: undefined, contactsDeletedSource: [], contacts: [], addresses: [], frmGuest: {}});
  223.                     _this.dataGridRef.current.instance.refresh();
  224.                     _this.dataGridRef.current.instance.cancelEditData();
  225.                 }
  226.             });
  227.             return;
  228.         }
  229.         else
  230.         {
  231.             e.promise = sendRequest(`/pessoas/2`, 'POST', {
  232.                 values: Object.assign({contacts: this.state.contacts, addresses: this.state.addresses, documents: this.state.documents}, this.state.frmGuest)
  233.             });
  234.            
  235.             let _this = this;
  236.             e.cancel = true;
  237.             e.promise.then(function(e)
  238.             {
  239.                 if(_this._isMounted && e)
  240.                 {
  241.                     _this.setState({editRowKey: undefined, contactsDeletedSource: [], contacts: [], addresses: [], documents: [], frmGuest: {}});
  242.                     _this.dataGridRef.current.instance.refresh();
  243.                     _this.dataGridRef.current.instance.cancelEditData();
  244.                 }
  245.             });
  246.             return;
  247.         }
  248.     };
  249.  
  250.   delGuest(_index) {
  251.     let hospedes = this.state.hospedes;
  252.  
  253.     hospedes.splice(_index, 1);
  254.  
  255.     if (this._isMounted) {
  256.       this.setState({ hospedes: hospedes, tipo_hospede: hospedes.length > 0 ? hospedes[0].tipo_hospede : 0, nome_hospede: hospedes.length > 0 ? hospedes[0].nome_hospede : '', cpf_cnpj_hospede: hospedes.length > 0 ? hospedes[0].cpf_cnpj_hospede : '' });
  257.       up++;
  258.     }
  259.   }
  260.  
  261.   addGuest(hospede) {
  262.     let hospedes = this.state.hospedes;
  263.  
  264.     hospedes.push(hospede);
  265.  
  266.     if (this._isMounted) {
  267.       this.setState({ hospedes: hospedes, tipo_hospede: hospedes.length > 0 ? hospedes[0].tipo_hospede : 0, nome_hospede: hospedes.length > 0 ? hospedes[0].nome_hospede : '', cpf_cnpj_hospede: hospedes.length > 0 ? hospedes[0].cpf_cnpj_hospede : '' });
  268.       up++;
  269.     }
  270.   }
  271.  
  272.   async componentDidMount() {
  273.     this._isMounted = true;
  274.     window.addEventListener('resize', this.update);
  275.     document.addEventListener("keydown", this.onKeyDown, false);
  276.  
  277.     let _this = this;
  278.     setTimeout(() => {
  279.       _this.loadCamera();
  280.     }, 300);
  281.  
  282.     if(_this.props.status == BUSY) {
  283.       //await _this.getGuests();
  284.       await _this.getUhData();
  285.     }
  286.  
  287.     const promise0 = sendRequest('/formas-pagamento-ativas');
  288.     promise0.then(function (res) {
  289.       if(_this._isMounted)
  290.       {
  291.         _this.setState({ srcFormasPagamento: res });
  292.       }
  293.     });
  294.  
  295.     const promise1 = sendRequest('/parceiros/regras');
  296.     promise1.then(function (res) {
  297.       if(_this._isMounted)
  298.       {
  299.         _this.setState({ srcDescontoParceiros: res });
  300.       }  
  301.     });
  302.  
  303.     const promise2 = sendRequest('/tabelas-precos-ativas');
  304.     promise2.then(function (res) {
  305.       let lista = [];
  306.  
  307.       if(_this._isMounted)
  308.       {
  309.         res.forEach((data, index) => {
  310.           let diaSemana = new Date();
  311.  
  312.           if(diaSemana.getDay() == data.dia_semana && data.categoria_id == _this.props.windows[0].categoria_id) {
  313.             lista.push(data);
  314.           }
  315.         })
  316.  
  317.         _this.setState({ tarifacoes: lista });
  318.       }
  319.     });
  320.  
  321.     const promise3 = sendRequest('/produtos-servicos');
  322.     promise3.then(function (res) {
  323.       if(_this._isMounted)
  324.       {
  325.         _this.setState({ srcProdutosservicos: res });
  326.       }  
  327.     });
  328.  
  329.     const promise4 = sendRequest('/grupo-produtos-ativos');
  330.         promise4.then(function(res){
  331.             if(_this._isMounted)
  332.             {
  333.                 _this.setState({groupsSource: res});
  334.             }
  335.         });
  336.        
  337.         const promise5 = sendRequest('/unidades-medida');
  338.         promise5.then(function(res){
  339.             if(_this._isMounted)
  340.             {
  341.                 _this.setState({measuresSource: res});
  342.             }
  343.         });
  344.   }
  345.  
  346.   async getUhData() {
  347.     let _this = this;
  348.  
  349.     const res = await sendRequest('/vendas/getByUhId/' + _this.props.windows[0].uh_id);
  350.  
  351.     let form = _this.state.frmChekin;
  352.     form['checkin_em'] = new Date(res[0].checkin_em);
  353.     form['qtd_hospedes'] = res[0].hospedes;
  354.  
  355.     _this.setState({
  356.       vendas: res,
  357.       checkin_em: new Date(res[0].checkin_em),
  358.       frmChekin: form
  359.     });
  360.   }
  361.  
  362.   getGuests() {
  363.     const promise = sendRequest('/pessoas/getGuests/' + this.props.windows[0].uh_id);
  364.  
  365.     promise.then((res) => {
  366.       this.setState({
  367.         dataSource: res
  368.       });
  369.     });
  370.   }
  371.  
  372.   onKeyDown(e) {
  373.     if(e.altKey) {
  374.       switch(e.keyCode) {
  375.         case 49: this.changeTab(0);
  376.                  break;
  377.         case 50: this.changeTab(1);
  378.                  break;
  379.         case 51: this.changeTab(2);
  380.                  break;
  381.         case 52: this.changeTab(3);
  382.                  break;
  383.         case 53: this.changeTab(4);
  384.                  break;
  385.         case 54: this.changeTab(5);
  386.                  break;
  387.         case 55: this.changeTab(6);
  388.                  break;
  389.       }
  390.     } else if(e.keyCode == 27) {
  391.       this.closeModal();
  392.     }    
  393.   }
  394.  
  395.   componentWillUnmount() {
  396.     this._isMounted = false;
  397.     clearInterval(this.timeUpdate);
  398.     if (this.cancel) this.cancel();
  399.   }
  400.  
  401.     validateForm(e){
  402.         e.component.validate();
  403.     }
  404.  
  405.     onEditingStartGuest(e) {
  406.         let _this = this;
  407.         const promise1 = sendRequest('/pessoas/' + e.key + '/0');
  408.        
  409.         promise1.then(function(res){
  410.             if(_this._isMounted)
  411.             {
  412.                 _this.setState({
  413.                     editRowKey: e.key,
  414.                     fpGuest: res.pessoa,
  415.                     contacts: res.contacts,
  416.                     addresses: res.addresses,
  417.                     documents: res.documents
  418.                 });
  419.             }
  420.         });
  421.     }
  422.  
  423.   renderState(data) {
  424.     return <span>{data.descricao}</span>;
  425.   }
  426.  
  427.   openModal() {
  428.     if (!this.state.expand && this.props.modal) {
  429.       return;
  430.     }
  431.  
  432.     if (this._isMounted) {
  433.       this.setState({ expand: !this.state.expand, animationClose: (!this.state.expand) ? '' : ' zoomOutDown2 ' });
  434.  
  435.       let wd = this.props.windows;
  436.       for (var i = 0; i < wd.length; i++) {
  437.         if (this.props.uh_codigo == wd[i].uh_codigo) {
  438.           wd[i].expand = !wd[i].expand;
  439.           wd[i].tabIndex = this.state.tabIndex;
  440.         }
  441.       }
  442.  
  443.       this.props.panelWindow(wd);
  444.  
  445.       let _this = this;
  446.       setTimeout(function () {
  447.         _this.setState({ animationClose: '', frmMovimentacao: { qtd_hospedes: frmChekin.qtd_hospedes } });
  448.       }, 1000);
  449.     }
  450.   }
  451.  
  452.   closeModal() {
  453.     if (this._isMounted) {
  454.       let wd = this.props.windows, wnd = [];
  455.       for (var i = 0; i < wd.length; i++) {
  456.         if (this.props.uh_codigo != wd[i].uh_codigo) {
  457.           wnd.push(wd[i]);
  458.         }
  459.       }
  460.  
  461.       this.props.panelWindow(wnd);
  462.     }
  463.   }
  464.  
  465.   async changeTab(_idx) {
  466.     if (this._isMounted) {
  467.       var wd = this.props.windows;
  468.       for (var i = 0; i < wd.length; i++) {
  469.         if (this.props.uh_codigo == wd[i].uh_codigo) {
  470.           wd[i].title = _idx;
  471.         }
  472.       }
  473.       this.props.panelWindow(wd);
  474.       var _this = this;
  475.  
  476.       setTimeout(function () {
  477.         if (_this._isMounted) {
  478.           _this.setState({ tabIndex: _idx });
  479.         }
  480.       }, 100);
  481.     }
  482.   }
  483.  
  484.   onToolbarPreparing(e) {
  485.     e.toolbarOptions.items.unshift({
  486.       location: 'after',
  487.       widget: 'dxButton',
  488.       options: {
  489.                 icon:'exportpdf',
  490.         hint: translate('INF_65'),
  491.         onClick: this.exportGrid
  492.       }
  493.     },
  494.         {
  495.       location: 'after',
  496.       widget: 'dxButton',
  497.       options: {
  498.                 icon: 'arrowup',
  499.         hint: translate('CollapseAll'),
  500.         onClick: this.collapseAllClick
  501.       }
  502.     });
  503.     }
  504.  
  505.   checkin() {
  506.     let data = {
  507.       checkin_em: formatDate(new Date(this.state.frmChekin.checkin_em), 'Y-m-d\TH:m:s'),
  508.       qtd_hospedes: this.state.frmChekin.qtd_hospedes,
  509.       uh_codigo: this.props.uh_codigo,
  510.       // observacoes: this.state.frmChekin.observacoes,
  511.       // transportes: this.state.transportes,
  512.       // hospedes: this.state.dataSource,
  513.       // produtos: this.state.produtos,
  514.       // servicos: this.state.produtos,
  515.       // imagens: this.state.imagens
  516.     };
  517.  
  518.     const promise = sendRequest('/vendas/checkin', 'POST', data);
  519.     promise.then((res) => {
  520.       if (res.result) {
  521.         notify({ message: 'Check-In realizado com sucesso!', position: 'top center'}, 'success', 3000);
  522.       }
  523.     })
  524.     .catch((error) => {
  525.       console.log(error);
  526.       notify({ message: 'Erro ao realizar o check-in!', position: 'top center'}, 'error', 3000);
  527.     })
  528.   }
  529.  
  530.   render() {
  531.     const { isPhysical, srcFormasPagamento, payments, srcDescontoParceiros, srcProdutosservicos, groupsSource, measuresSource, productServicesValues, frmChekin, dataSourceMoviments, fdDiscount, fdPaymentMethod, transportes, tarifacoes, dsTarifacao, dataSource, editRowKey, isDropZoneActive, textVisible, frmGuest, frmSimulate, contacts, addresses, documents, checkout, awake, simulateInfo, vendas } = this.state;
  532.  
  533.     let tabName = '';
  534.     let tabIndex = this.state.tabIndex;
  535.  
  536.     switch (tabIndex) {
  537.       default:
  538.       case 0:
  539.         {
  540.           tabName = this.props.status == FREE ? translate('CheckIn') : translate('CheckOut');
  541.         } break;
  542.       case 1:
  543.         {
  544.           tabName = translate('Billing');
  545.         } break;
  546.       case 2:
  547.         {
  548.           tabName = this.state.expand ? translate('FinancialMovement') : translate('Movement');
  549.         } break;
  550.       case 3:
  551.         {
  552.           tabName = translate('ProductsAndServices');
  553.         } break;
  554.       case 4:
  555.         {
  556.           tabName = translate('Guests');
  557.         } break;
  558.       case 5:
  559.         {
  560.           tabName = translate('ModeTransport');
  561.         } break;
  562.       case 6:
  563.         {
  564.           tabName = this.state.expand ? translate('CustomerHistory') : translate('History');
  565.         } break;
  566.       case 7:
  567.         {
  568.           tabName = translate('CheckOut');
  569.         } break;
  570.     }
  571.  
  572.     return (
  573.       <React.Fragment>
  574.         <PopupForm
  575.           visible={this.state.expand}
  576.           onHiding={this.closeModal}
  577.           dragEnabled={true}
  578.           closeOnOutsideClick={false}
  579.           showTitle={true}
  580.           title={this.props.uh_codigo + ' - ' + tabName}
  581.           width='90%'
  582.           height='80%'
  583.         >
  584.           <ToolbarItem
  585.             widget="dxButton"
  586.             location="after"
  587.             options={this.minimizeBtnOp}
  588.           />
  589.  
  590.           <ToolbarItem
  591.             toolbar="bottom"
  592.             location="after">
  593.               <div style={{padding: 4, width: "100%", fontSize: 16}} className="rect demo-dark">
  594.                 <strong>{translate('ValueReceivable')}: {formatNumber(Number(this.state.valorReceber), consts.fmtCurrency)}</strong>
  595.               </div>
  596.           </ToolbarItem>
  597.  
  598.           <ToolbarItem
  599.             widget="dxButton"
  600.             toolbar="bottom"
  601.             location="after"
  602.             options={this.checkInBtnOp}
  603.           />
  604.  
  605.           <ScrollView width='100%' height='100%'>
  606.             <FormPopup labelLocation="top" formData={frmChekin}>
  607.               <TabbedItem itemType="tabbed">
  608.  
  609.                 <TabPanelOptions selectedIndex={this.state.tabIndex} onTitleClick={(e) => this.changeTab(e.itemIndex)} />
  610.                                
  611.                 <Tab hint={translate('Guests')} icon="fas fa-suitcase-rolling">
  612.                   <DataGrid
  613.                     id="gridContainer"
  614.                     ref={this.dataGridRef}
  615.                     dataSource={dataSource}
  616.                     repaintChangesOnly={true}
  617.                     allowColumnReordering={true}
  618.                     allowColumnResizing={true}
  619.                     showBorders={true}
  620.                     onSaving={this.onSaving}
  621.                     onEditingStart={this.onEditingStartGuest}
  622.                     onToolbarPreparing={this.onToolbarPreparing}
  623.                     columnHidingEnabled={true}>
  624.  
  625.                     <Grouping autoExpandAll={this.state.expanded} />
  626.                     <Selection mode="multiple" />
  627.                     <Editing
  628.                       mode="popup"
  629.                       refreshMode="reshape"
  630.                       allowUpdating={true}
  631.                       allowAdding={true}
  632.                       allowDeleting={false}
  633.                       useIcons={true}>
  634.  
  635.                       <Popup title={translate('Guests')} showTitle={true} width="90%"/>
  636.                       <FormPopup labelLocation="top">
  637.                         <TabbedItem colCount={2} colSpan={2} itemType="tabbed">
  638.                           <Tab title={translate('Guest')}>
  639.                             <FormPopup labelLocation="top" ref={this.fpGuest} colCount={2} colSpan={2} formData={frmGuest}>
  640.                               <SimpleItem dataField="ativo" helpText={translate('INF_38')} editorType="dxCheckBox">
  641.                                 <Label text={translate('Situation')}/>
  642.                               </SimpleItem>
  643.                               <SimpleItem dataField="tipo" editorType="dxLookup" allowEditing={false} editorOptions={{dataSource: consts.typePerson,  onValueChanged: this.typePersonChange, displayExpr: "name", valueExpr: "id", searchEnabled: false, showCancelButton: false, closeOnOutsideClick: true}} isRequired={true}>
  644.                                 <Label text={translate('Person')}/>
  645.                               </SimpleItem>
  646.                               <SimpleItem dataField="nome" visible={isPhysical} isRequired={true}>
  647.                                 <StringLengthRule max={30} message={translate('ERROR_32')+" (30)"} />
  648.                                 <Label text={translate('Name')}/>
  649.                               </SimpleItem>
  650.                               <SimpleItem dataField="sobrenome" visible={isPhysical} isRequired={true}>
  651.                                 <StringLengthRule max={70} message={translate('ERROR_32')+" (70)"} />
  652.                                 <Label text={translate('LastName')}/>
  653.                               </SimpleItem>
  654.                               <SimpleItem dataField="razao_social" visible={!isPhysical} isRequired={true}>
  655.                                 <StringLengthRule max={50} message={translate('ERROR_32')+" (50)"} />
  656.                                 <Label text={translate('SocialReason')}/>
  657.                               </SimpleItem>
  658.                               <SimpleItem dataField="nome_fantasia" visible={!isPhysical} isRequired={true}>
  659.                                 <StringLengthRule max={50} message={translate('ERROR_32')+" (50)"} />
  660.                                 <Label text={translate('FantasyName')}/>
  661.                               </SimpleItem>
  662.                               <SimpleItem dataField="cpf_cnpj" dataType='dxTextBox' editorOptions={{ mask: frmGuest.tipo == 0 ? "000.000.000-00" : "00.000.000/0000-00", maskInvalidMessage: isPhysical ? translate('INF_60') : translate('INF_61')}}>
  663.                                 <Label text={frmGuest.tipo == 0 ? translate('CPF_2') : translate('CNPJ_2')} isRequired={true}/>
  664.                                 <AsyncRule message={translate('ERROR_45')} validationCallback={this.asyncCpfCnpjValidation} />
  665.                               </SimpleItem>
  666.                               <SimpleItem dataField="genero" editorType="dxLookup" editorOptions={{dataSource: consts.typeGenre, displayExpr: "name", valueExpr: "id", searchEnabled: false, showCancelButton: false, closeOnOutsideClick: true}} visible={isPhysical}>
  667.                                 <Label text={translate('Genre')}/>
  668.                               </SimpleItem>
  669.                               <SimpleItem dataField="data_nasc" editorType="dxDateBox" visible={frmGuest.tipo == 0} editorOptions={consts.opDate}>
  670.                                 <Label text={translate('DateOfBirth')}/>
  671.                               </SimpleItem>
  672.                               <SimpleItem dataField="estado_civil" editorType="dxLookup" editorOptions={{dataSource: consts.maritalStatus, displayExpr: 'name', valueExpr: 'id', showClearButton: true, closeOnOutsideClick: true}} visible={isPhysical}>
  673.                                 <Label text={translate('MaritalStatus')}/>
  674.                               </SimpleItem>
  675.                               <SimpleItem dataField="nacionalidade" visible={frmGuest.tipo == 0}>
  676.                                 <StringLengthRule max={50} message={translate('ERROR_32')+" (50)"} />
  677.                                 <Label text={translate('Nationality')}/>
  678.                               </SimpleItem>
  679.                               <SimpleItem colSpan={2} dataField="observacao" editorType="dxTextArea">
  680.                                 <Label text={translate('Notes')}/>
  681.                               </SimpleItem>
  682.                             </FormPopup>
  683.                           </Tab>
  684.                           <Tab title={translate('Addresses')}>
  685.                             <div className="pb-3 dx-field-item-help-text">{translate('INF_5')}</div>
  686.                             <DataGrid
  687.                               id="gridAddressesContainer"
  688.                               dataSource={addresses}
  689.                               repaintChangesOnly={true}
  690.                               allowColumnReordering={true}
  691.                               allowColumnResizing={true}
  692.                               showBorders={true}
  693.                               onToolbarPreparing={this.onToolbarPreparingAddress}
  694.                               columnHidingEnabled={true}>
  695.            
  696.                               <Grouping autoExpandAll={this.state.expandedAddress} />
  697.                               <Selection mode="multiple" />
  698.                               <Editing
  699.                                 mode="popup"
  700.                                 allowUpdating={true}
  701.                                 allowAdding={true}
  702.                                 allowDeleting={false}
  703.                                 useIcons={true}>
  704.  
  705.                                 <Popup title={translate('Address')} showTitle={true} width="90%" height="400px"/>
  706.  
  707.                                 <Form labelLocation="top">
  708.                                   <Item itemType="group" colCount={2} colSpan={2}>
  709.                                     <Item dataField="principal" />
  710.                                     <Item dataField="ativo" />
  711.                                     <Item dataField="endereco" isRequired={true}/>
  712.                                     <Item dataField="estado" isRequired={true}/>
  713.                                     <Item dataField="cidade" isRequired={true}/>
  714.                                     <Item dataField="bairro" isRequired={true}/>
  715.                                     <Item dataField="numero" />
  716.                                     <Item dataField="cep" isRequired={true}/>
  717.                                     <Item dataField="complemento" />
  718.                                   </Item>
  719.                                 </Form>
  720.  
  721.                               </Editing>
  722.  
  723.                               <Paging defaultPageSize={20} />
  724.                               <Pager showPageSizeSelector={true} allowedPageSizes={[10, 20, 30, 40, 50, 100]} showInfo={true} />
  725.                               <Sorting mode="multiple" />
  726.                               <ColumnChooser enabled={true} />
  727.                               <ColumnFixing enabled={true} />
  728.                               <FilterRow visible={true} applyFilter="auto" />
  729.                               <HeaderFilter visible={false} />
  730.                               <SearchPanel visible={true} />
  731.                               <GroupPanel visible={true} />
  732.            
  733.                               <Export enabled={true} allowExportSelectedData={true} fileName={translate('Addresses')} />
  734.            
  735.                               <Column
  736.                                 dataField="endereco"
  737.                                 caption={translate('Address')}
  738.                                 dataType="string">
  739.                                 <StringLengthRule max={100} message={translate('ERROR_32')+" (100)"} />
  740.                               </Column>
  741.            
  742.                               <Column
  743.                                 dataField="estado"
  744.                                 caption={translate('State')}
  745.                                 width={80}>
  746.                                 <Lookup dataSource={consts.sourceStates} displayExpr='name' valueExpr='id'/>
  747.                               </Column>
  748.                              
  749.                               <Column
  750.                                 dataField="cidade"
  751.                                 caption={translate('City')}
  752.                                 dataType="string">
  753.                                 <StringLengthRule max={50} message={translate('ERROR_32')+" (50)"} />
  754.                               </Column>
  755.                              
  756.                               <Column
  757.                                 dataField="bairro"
  758.                                 caption={translate('Neighborhood')}
  759.                                 dataType="string">
  760.                                 <StringLengthRule max={30} message={translate('ERROR_32')+" (30)"} />
  761.                               </Column>
  762.                              
  763.                               <Column
  764.                                 dataField="numero"
  765.                                 caption={translate('Number')}
  766.                                 dataType="string"
  767.                                 width={80}>
  768.                                 <StringLengthRule max={8} message={translate('ERROR_32')+" (8)"} />
  769.                               </Column>
  770.            
  771.                               <Column
  772.                                 dataField="cep"
  773.                                 caption={translate('ZipCode')}
  774.                                 dataType='dxTextBox'
  775.                                 editorOptions={{ mask: "00.000-000", maskInvalidMessage: translate('INF_62')}}
  776.                                 width={80}/>
  777.            
  778.                               <Column
  779.                                 dataField="complemento"
  780.                                 caption={translate('Complement')}  
  781.                                 visible={false}
  782.                                 width={140}>
  783.                                 <StringLengthRule max={100} message={translate('ERROR_32')+" (100)"} />
  784.                               </Column>
  785.            
  786.                               <Column
  787.                                 dataField="principal"
  788.                                 caption={translate('Main')}
  789.                                 dataType="boolean"
  790.                                 cellRender={YesCell}
  791.                                 allowHeaderFiltering={false}
  792.                                 width={80}
  793.                                 falseText={translate('No')}
  794.                                 trueText={translate('Yes')}
  795.                                 alignment="center"
  796.                               />
  797.  
  798.                               <Column
  799.                                 dataField="ativo"
  800.                                 caption={translate('Situation')}
  801.                                 dataType="boolean"
  802.                                 cellRender={ActiveCell}
  803.                                 allowHeaderFiltering={false}
  804.                                 width={80}
  805.                                 falseText={translate('Inactive')}
  806.                                 trueText={translate('Active')}
  807.                                 alignment="center"
  808.                               />
  809.            
  810.                               <Summary>
  811.                                 <GroupItem
  812.                                   column="endereco"
  813.                                   summaryType="count"
  814.                                   displayFormat={"{0}"}
  815.                                   alignByColumn={true}
  816.                                   showInGroupFooter={true}/>
  817.                                 <GroupItem
  818.                                   column="endereco"
  819.                                   summaryType="count"
  820.                                   displayFormat={"{0}"}
  821.                                   alignByColumn={true} />
  822.                                 <TotalItem
  823.                                   column="endereco"
  824.                                   summaryType="count"
  825.                                   displayFormat={"{0}"}/>
  826.                               </Summary>
  827.                             </DataGrid>
  828.                           </Tab>
  829.                           <Tab title={translate('FormsContact')}>
  830.                             <DataGrid
  831.                               id="gridContactsContainer"
  832.                               dataSource={contacts}
  833.                               repaintChangesOnly={true}
  834.                               allowColumnReordering={true}
  835.                               allowColumnResizing={true}
  836.                               showBorders={true}
  837.                               onRowRemoved={this.onRowRemovedContact}
  838.                               onToolbarPreparing={this.onToolbarPreparingContact}
  839.                               columnHidingEnabled={true}>
  840.            
  841.                               <Grouping autoExpandAll={this.state.expandedContact} />
  842.                               <Selection mode="multiple" />
  843.                               <Editing
  844.                                 mode="popup"
  845.                                 allowUpdating={true}
  846.                                 allowAdding={true}
  847.                                 allowDeleting={true}
  848.                                 useIcons={true}>
  849.  
  850.                                 <Popup title={translate('Contact')} showTitle={true} width="90%" height="300px"/>
  851.                               </Editing>
  852.  
  853.                               <Paging defaultPageSize={20} />
  854.                               <Pager showPageSizeSelector={true} allowedPageSizes={[10, 20, 30, 40, 50, 100]} showInfo={true} />
  855.                               <Sorting mode="multiple" />
  856.                               <ColumnChooser enabled={true} />
  857.                               <ColumnFixing enabled={true} />
  858.                               <FilterRow visible={true} applyFilter="auto" />
  859.                               <HeaderFilter visible={false} />
  860.                               <SearchPanel visible={true} />
  861.                               <GroupPanel visible={true} />
  862.            
  863.                               <Export enabled={true} allowExportSelectedData={true} fileName={translate('Contacts')} />
  864.            
  865.                               <Column
  866.                                 dataField="tipo"
  867.                                 caption={translate('Type')}
  868.                                 width={160}>
  869.                                   <RequiredRule/>
  870.                                   <Lookup dataSource={consts.typeContact}/>
  871.                               </Column>
  872.  
  873.                               <Column
  874.                                 dataField="descricao"
  875.                                 caption={translate('Contact')}
  876.                                 dataType="string">
  877.                                 <RequiredRule/>
  878.                                 <StringLengthRule max={120} message={translate('ERROR_32')+" (120)"} />
  879.                               </Column>
  880.  
  881.                               <Column
  882.                                 dataField="observacao"
  883.                                 caption={translate('Note')}
  884.                                 dataType="string">
  885.                                 <StringLengthRule max={100} message={translate('ERROR_32')+" (120)"} />
  886.                               </Column>
  887.            
  888.                               <Summary>                                        
  889.                                 <GroupItem
  890.                                   column="descricao"
  891.                                   summaryType="count"
  892.                                   displayFormat={"{0}"}
  893.                                   alignByColumn={true}
  894.                                   showInGroupFooter={true}/>
  895.                                 <GroupItem
  896.                                   column="descricao"
  897.                                   summaryType="count"
  898.                                   displayFormat={"{0}"}
  899.                                   alignByColumn={true} />
  900.                                 <TotalItem
  901.                                   column="descricao"
  902.                                   summaryType="count"
  903.                                   displayFormat={"{0}"}/>
  904.                               </Summary>
  905.                             </DataGrid>
  906.                           </Tab>
  907.                           <Tab title={translate('Documents')}>
  908.                             <DataGrid
  909.                               ref={this.gridDocumentsContainer}
  910.                               id="gridDocumentsContainer"
  911.                               dataSource={documents}
  912.                               repaintChangesOnly={true}
  913.                               allowColumnReordering={true}
  914.                               allowColumnResizing={true}
  915.                               showBorders={true}
  916.                               onSaving={this.onSavingDocuments}
  917.                               onEditingStart={this.onEditingStartDocuments}
  918.                               onEditCanceled={this.onEditCanceledDocuments}
  919.                               onToolbarPreparing={this.onToolbarPreparingDocument}
  920.                               columnHidingEnabled={true}>
  921.            
  922.                               <Grouping autoExpandAll={this.state.expandedDocument} />
  923.                               <Selection mode="multiple" />
  924.                               <Editing
  925.                                 mode="popup"
  926.                                 allowUpdating={true}
  927.                                 allowAdding={true}
  928.                                 allowDeleting={false}
  929.                                 useIcons={true}>
  930.  
  931.                                 <Popup title={translate('Document')} showTitle={true} width="90%" />
  932.                                
  933.                                 <Form labelLocation="top">
  934.                                   <Item itemType="group" colCount={2} colSpan={2}>
  935.                                     <Item dataField="ativo" />
  936.                                     <Item dataField="principal" />
  937.                                     <Item dataField="tipo" />
  938.                                     <Item dataField="numero" />
  939.                                     <Item dataField="expedido_em" />
  940.                                     <Item dataField="expedidor" />
  941.                                     <Item dataField="estado" />
  942.                                     <Item dataField="nome" helpText={translate('INF_43')}/>
  943.                                     <Item dataField="observacao" colSpan={2} />
  944.                                     <Item dataField="imagens" itemType="group" colSpan={2} caption={translate('AttachDocument')}>
  945.                                       <div id="dropzone-external" className={`flex-box ${isDropZoneActive ? 'dx-theme-accent-as-border-color dropzone-active' : 'dx-theme-border-color'}`}>
  946.                                         <div className="d-flex justify-content-between">
  947.                                           {this.renderImgs()}
  948.                                         </div>
  949.                                         {textVisible &&
  950.                                         <div id="dropzone-text" className="flex-box">
  951.                                           <span>{translate('INF_56')}</span>
  952.                                           <span>{translate('ERROR_18')+' 1MB'}</span>
  953.                                         </div>}
  954.                                       </div>
  955.                                         {textVisible ? null : <Button
  956.                                                                   width={120}
  957.                                                                   text={translate('Clean')}
  958.                                                                   type="danger"
  959.                                                                   stylingMode="outlined"
  960.                                                                   onClick={this.clearImages}
  961.                                                                 />}
  962.                                         {this.renderSavedImgs()}
  963.                                       <FileUploader
  964.                                         dialogTrigger="#dropzone-external"
  965.                                         dropZone="#dropzone-external"
  966.                                         multiple={true}
  967.                                         chunkSize={200000}
  968.                                         maxFileSize={1048576}
  969.                                         visible={false}
  970.                                         accept="image/png,image/jpg,image/jpeg"
  971.                                         allowedFileExtensions={['.jpg', '.jpeg', '.png']}
  972.                                         uploadMode='useButtons'
  973.                                         onDropZoneEnter={this.onDropZoneEnter}
  974.                                         onDropZoneLeave={this.onDropZoneLeave}
  975.                                         onValueChanged={this.setImage} />
  976.                                     </Item>
  977.                                   </Item>
  978.                                 </Form>
  979.                               </Editing>
  980.  
  981.                               <Paging defaultPageSize={20} />
  982.                               <Pager showPageSizeSelector={true} allowedPageSizes={[10, 20, 30, 40, 50, 100]} showInfo={true} />
  983.                               <Sorting mode="multiple" />
  984.                               <ColumnChooser enabled={true} />
  985.                               <ColumnFixing enabled={true} />
  986.                               <FilterRow visible={true} applyFilter="auto" />
  987.                               <HeaderFilter visible={false} />
  988.                               <SearchPanel visible={true} />
  989.                               <GroupPanel visible={true} />
  990.            
  991.                               <Export enabled={true} allowExportSelectedData={true} fileName={translate('Documents')} />
  992.            
  993.                               <Column
  994.                                 dataField="tipo"
  995.                                 caption={translate('Type')}
  996.                                 width={80}>
  997.                                   <RequiredRule/>
  998.                                   <Lookup dataSource={consts.typeDocument} displayExpr='name' valueExpr='id'/>
  999.                               </Column>
  1000.  
  1001.                               <Column
  1002.                                 dataField="numero"
  1003.                                 caption={translate('DocumentNo')}
  1004.                                 dataType="string">
  1005.                                 <RequiredRule/>
  1006.                                 <StringLengthRule max={20} message={translate('ERROR_32')+" (20)"} />
  1007.                               </Column>
  1008.  
  1009.                               <Column
  1010.                                 dataField="expedido_em"
  1011.                                 caption={translate('IssuedOn')}
  1012.                                 dataType="date"
  1013.                                 editorOptions={consts.opDate}
  1014.                                 format='shortDate'
  1015.                                 visible={false} >
  1016.                               </Column>
  1017.  
  1018.                               <Column
  1019.                                 dataField="expedidor"
  1020.                                 caption={translate('IssuingAgency')}
  1021.                                 dataType="string"
  1022.                                 visible={false} >
  1023.                                 <RequiredRule/>
  1024.                                 <StringLengthRule max={60} message={translate('ERROR_32')+" (60)"} />
  1025.                               </Column>
  1026.            
  1027.                               <Column
  1028.                                 dataField="estado"
  1029.                                 caption={translate('State')}
  1030.                                 width={80}>
  1031.                                   <RequiredRule/>
  1032.                                   <Lookup dataSource={consts.sourceStates} displayExpr='name' valueExpr='id'/>
  1033.                               </Column>
  1034.  
  1035.                               <Column
  1036.                                 dataField="nome"
  1037.                                 caption={translate('DocumentName')}
  1038.                                 dataType="string"
  1039.                                 visible={false} >
  1040.                                 <StringLengthRule max={60} message={translate('ERROR_32')+" (60)"} />
  1041.                               </Column>
  1042.  
  1043.                               <Column
  1044.                                 dataField="observacao"
  1045.                                 caption={translate('Note')}
  1046.                                 dataType="string"
  1047.                                 visible={false} >
  1048.                                 <StringLengthRule max={150} message={translate('ERROR_32')+" (150)"} />
  1049.                               </Column>
  1050.  
  1051.                               <Column
  1052.                                 dataField="principal"
  1053.                                 caption={translate('Main')}
  1054.                                 dataType="boolean"
  1055.                                 cellRender={YesCell}
  1056.                                 allowHeaderFiltering={false}
  1057.                                 width={80}
  1058.                                 falseText={translate('No')}
  1059.                                 trueText={translate('Yes')}
  1060.                                 alignment="center"
  1061.                               />
  1062.  
  1063.                               <Column
  1064.                                 dataField="ativo"
  1065.                                 caption={translate('Situation')}
  1066.                                 dataType="boolean"
  1067.                                 cellRender={ActiveCell}
  1068.                                 allowHeaderFiltering={false}
  1069.                                 width={80}
  1070.                                 falseText={translate('Inactive')}
  1071.                                 trueText={translate('Active')}
  1072.                                 alignment="center"
  1073.                               />
  1074.  
  1075.                               <Column
  1076.                                 dataField="criado_em"
  1077.                                 caption={translate('CreatedAt')}
  1078.                                 dataType="datetime"
  1079.                                 editorOptions={consts.opDatetime}
  1080.                                 format="shortDateShortTime"
  1081.                                 visible={false}
  1082.                                 width={140}
  1083.                               />
  1084.  
  1085.                               <Column
  1086.                                 dataField="editado_em"
  1087.                                 caption={translate('UpdatedAt')}  
  1088.                                 dataType="datetime"
  1089.                                 editorOptions={consts.opDatetime}
  1090.                                 format="shortDateShortTime"
  1091.                                 visible={false}
  1092.                                 width={140}
  1093.                               />
  1094.            
  1095.                               <Summary>
  1096.                                 <GroupItem
  1097.                                   column="tipo"
  1098.                                   summaryType="count"
  1099.                                   displayFormat={"{0}"}
  1100.                                   alignByColumn={true}
  1101.                                   showInGroupFooter={true}/>
  1102.                                 <GroupItem
  1103.                                   column="tipo"
  1104.                                   summaryType="count"
  1105.                                   displayFormat={"{0}"}
  1106.                                   alignByColumn={true} />
  1107.                                 <TotalItem
  1108.                                   column="tipo"
  1109.                                   summaryType="count"
  1110.                                   displayFormat={"{0}"}/>
  1111.                               </Summary>
  1112.                             </DataGrid>
  1113.                           </Tab>
  1114.                         </TabbedItem>
  1115.                       </FormPopup>
  1116.                     </Editing>
  1117.                     <Paging defaultPageSize={20} />
  1118.                     <Pager showPageSizeSelector={true} allowedPageSizes={[10, 20, 30, 40, 50, 100]} showInfo={true} />
  1119.                     <Sorting mode="multiple" />
  1120.                     <ColumnChooser enabled={true} />
  1121.                     <ColumnFixing enabled={true} />
  1122.                     <FilterRow visible={true}   applyFilter="auto" />
  1123.                     <HeaderFilter visible={false} />
  1124.                     <SearchPanel visible={true} />
  1125.                     <GroupPanel visible={true} />
  1126.  
  1127.                     <Export enabled={true} allowExportSelectedData={true} fileName={document.title}/>
  1128.  
  1129.                     <Column
  1130.                       dataField="nome_padrao"
  1131.                       caption={translate('Nome')}
  1132.                       dataType="string"  
  1133.                       allowHeaderFiltering={false}>
  1134.                       <RequiredRule/>
  1135.                     </Column>
  1136.  
  1137.                     <Column
  1138.                       dataField="tipo"
  1139.                       caption={translate('Person')}
  1140.                       width={100}>
  1141.                       <Lookup dataSource={consts.typePerson} displayExpr="name" valueExpr="id"/>
  1142.                       <RequiredRule/>
  1143.                     </Column>
  1144.  
  1145.                     <Column
  1146.                       dataField="cpf_cnpj"
  1147.                       caption={translate('CPFCNPJ')}
  1148.                       width={140}
  1149.                       alignment="center"
  1150.                       allowEditing={!editRowKey}>
  1151.                       <RequiredRule/>
  1152.                     </Column>
  1153.  
  1154.                     <Column
  1155.                       dataField="data_nasc"
  1156.                       caption={translate('DateOfBirth')}
  1157.                       dataType="date"
  1158.                       editorOptions={consts.opDate}
  1159.                       format='shortDate'
  1160.                       visible={false}
  1161.                       width={80}
  1162.                     />
  1163.  
  1164.                     <Column
  1165.                       dataField="idade"
  1166.                       caption={translate('Age')}
  1167.                       visible={false}
  1168.                       alignment="center"
  1169.                       width={80}
  1170.                     />
  1171.  
  1172.                     <Column
  1173.                       dataField="genero"
  1174.                       caption={translate('Genre')}
  1175.                       visible={false}
  1176.                       width={80}>
  1177.                       <Lookup dataSource={consts.typeGenre} displayExpr="name" valueExpr="id"/>
  1178.                     </Column>
  1179.  
  1180.                     <Column
  1181.                       dataField="estado_civil"
  1182.                       caption={translate('MaritalStatus')}
  1183.                       visible={false}
  1184.                       width={80}>
  1185.                       <Lookup dataSource={consts.maritalStatus} displayExpr="name" valueExpr="id" />
  1186.                     </Column>
  1187.  
  1188.                     <Column
  1189.                       dataField="ativo"
  1190.                       caption={translate('Situation')}
  1191.                       dataType="boolean"
  1192.                       cellRender={ActiveCell}
  1193.                       allowHeaderFiltering={false}
  1194.                       width={80}
  1195.                       falseText={translate('Inactive')}
  1196.                       trueText={translate('Active')}
  1197.                       alignment="center"
  1198.                     />
  1199.  
  1200.                     <Column
  1201.                       dataField="criado_em"
  1202.                       caption={translate('CreatedAt')}
  1203.                       dataType="datetime"
  1204.                       editorOptions={consts.opDatetime}
  1205.                       format="shortDateShortTime"
  1206.                       visible={false}
  1207.                       width={140}
  1208.                     />
  1209.  
  1210.                     <Column
  1211.                       dataField="editado_em"
  1212.                       caption={translate('UpdatedAt')}  
  1213.                       dataType="datetime"
  1214.                       editorOptions={consts.opDatetime}
  1215.                       format="shortDateShortTime"
  1216.                       visible={false}
  1217.                       width={140}
  1218.                     />
  1219.  
  1220.                     <Summary>
  1221.                       <GroupItem
  1222.                         column="nome_padrao"
  1223.                         summaryType="count"
  1224.                         displayFormat={"{0}"}
  1225.                         alignByColumn={true}
  1226.                         showInGroupFooter={true}/>
  1227.                       <GroupItem
  1228.                         column="nome_padrao"
  1229.                         summaryType="count"
  1230.                         displayFormat={"{0}"}
  1231.                         alignByColumn={true} />
  1232.                       <TotalItem
  1233.                         column="nome_padrao"
  1234.                         summaryType="count"
  1235.                         displayFormat={"{0}"}/>
  1236.                     </Summary>
  1237.                   </DataGrid>    
  1238.                
  1239.                 </Tab>
  1240.               </TabbedItem>
  1241.             </FormPopup>
  1242.           </ScrollView>
  1243.         </PopupForm>
  1244.       </React.Fragment>
  1245.     );
  1246.   }
  1247. }
  1248.  
  1249. export default connect(mapStateToProps, mapDispatchToProps)(WindowDialog);
Add Comment
Please, Sign In to add comment