Adição completa de componentes de para agendamento ao finalizar o atendimento

pull/1/head
adriano 2022-02-27 18:04:31 -03:00
parent c65fcfe66c
commit 2668eaaf3d
4 changed files with 43 additions and 30 deletions

View File

@ -5,8 +5,8 @@
"dependencies": { "dependencies": {
"@date-io/date-fns": "^1.3.13", "@date-io/date-fns": "^1.3.13",
"@emotion/react": "^11.7.1", "@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0", "@emotion/styled": "^11.6.0",
"@material-ui/core": "^4.11.0", "@material-ui/core": "^4.12.1",
"@material-ui/icons": "^4.9.1", "@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56", "@material-ui/lab": "^4.0.0-alpha.56",
"@material-ui/pickers": "^3.3.10", "@material-ui/pickers": "^3.3.10",

View File

@ -63,6 +63,7 @@ const Modal = (props) => {
const [timerPicker, setTimerPicker] = useState(new Date()) const [timerPicker, setTimerPicker] = useState(new Date())
const [textArea1, setTextArea1] = useState() const [textArea1, setTextArea1] = useState()
const [textArea2, setTextArea2] = useState() const [textArea2, setTextArea2] = useState()
const [textFieldCpfCnpj, setTextField] = useState()
const [data] = useState([ const [data] = useState([
{'id': 1, 'name': 'STATUS1'}, {'id': 1, 'name': 'STATUS1'},
@ -79,6 +80,15 @@ const Modal = (props) => {
setOpen(false); setOpen(false);
}; };
const handleChatEnd = (event, reason) => {
if (reason && reason === "backdropClick")
return;
setOpen(false);
};
const descriptionElementRef = useRef(null); const descriptionElementRef = useRef(null);
useEffect(() => { useEffect(() => {
if (open) { if (open) {
@ -120,6 +130,12 @@ const textArea2Value = (data) => {
setTextArea2(data) setTextArea2(data)
} }
const handleTextFieldChange = (event) => {
console.log('CPF/CNPJ: ',(event.target.value));
setTextField(event.target.value);
};
return ( return (
@ -154,26 +170,7 @@ const textArea2Value = (data) => {
height: 430, height: 430,
// backgroundColor: 'primary.dark', // backgroundColor: 'primary.dark',
// '&:hover': {backgroundColor: 'primary.main', opacity: [0.9, 0.8, 0.7],}, // '&:hover': {backgroundColor: 'primary.main', opacity: [0.9, 0.8, 0.7],},
}}> }}>
{/* <Box sx={{
display: 'grid',
}}>
<Item>
<SelectField
func={textFieldSelect}
header={'Status de atendimento'}
currencies={data.map((obj)=>{return {'value': obj.id, 'label': obj.name}})}
/>
</Item>
</Box> */}
<Box sx={{ <Box sx={{
display: 'grid', display: 'grid',
@ -193,7 +190,15 @@ const textArea2Value = (data) => {
maxWidth: '100%', maxWidth: '100%',
}} }}
> >
<TextField fullWidth label="CPF/CNPJ" id="fullWidth" size="small" margin="dense"/> <TextField
fullWidth
label="CPF/CNPJ"
id="fullWidth"
size="small"
margin="dense"
onChange={handleTextFieldChange}
/>
</Box> </Box>
</Item> </Item>
@ -215,13 +220,13 @@ const textArea2Value = (data) => {
</Box> </Box>
{/* <Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)' }}> <Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)' }}>
<Item><TextArea1 func={textArea1Value} hint={'Lembrete'}/> </Item> <Item><TextArea1 func={textArea1Value} hint={'Lembrete'}/> </Item>
<Item><TextArea2 func={textArea2Value} hint={'Mensagem para cliente'}/></Item> <Item><TextArea2 func={textArea2Value} hint={'Mensagem para cliente'}/></Item>
</Box> */} </Box>
</Item> </Item>
@ -231,9 +236,9 @@ const textArea2Value = (data) => {
<DialogActions> <DialogActions>
<div style={{marginRight:'50px'}}> <div style={{marginRight:'50px'}}>
<div>footer</div> <Button onClick={handleClose}>Cancelar</Button>
</div> </div>
<Button onClick={handleClose}>Ok</Button> <Button onClick={handleChatEnd}>Ok</Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>

View File

@ -1,13 +1,19 @@
import * as React from 'react'; import React, { useState, useEffect } from "react";
import TextareaAutosize from '@mui/material/TextareaAutosize'; import TextareaAutosize from '@mui/material/TextareaAutosize';
const MinHeightTextarea = (props) => { const MinHeightTextarea = (props) => {
const [value, setValue] = React.useState(''); const [value, setValue] = useState('');
props.func(value); // props.func(value);
useEffect(()=>{
props.func(value);
}, [value])
const handleChange = (event) => { const handleChange = (event) => {
setValue(event.target.value); setValue(event.target.value);

View File

@ -88,6 +88,8 @@ const Ticket = () => {
const delayDebounceFn = setTimeout(() => { const delayDebounceFn = setTimeout(() => {
const fetchTicket = async () => { const fetchTicket = async () => {
try { try {
const { data } = await api.get("/tickets/" + ticketId); const { data } = await api.get("/tickets/" + ticketId);
setContact(data.contact); setContact(data.contact);