truong-leave-day #116
			
				
			
		
		
		
	| 
						 | 
					@ -111,8 +111,8 @@ const LeaveManagement = () => {
 | 
				
			||||||
  const [date, setDate] = useState({
 | 
					  const [date, setDate] = useState({
 | 
				
			||||||
    year: new Date().getFullYear().toString(),
 | 
					    year: new Date().getFullYear().toString(),
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  const [dataTimeType, setDataTimeType] = useState<DataTimeType[]>([])
 | 
					  // const [dataTimeType, setDataTimeType] = useState<DataTimeType[]>([])
 | 
				
			||||||
  const [dataReason, setDataReason] = useState<DataReason[]>([])
 | 
					  // const [dataReason, setDataReason] = useState<DataReason[]>([])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const now = new Date()
 | 
					  const now = new Date()
 | 
				
			||||||
  const currentMonth = now.getMonth() + 1 // getMonth() trả về 0-11
 | 
					  const currentMonth = now.getMonth() + 1 // getMonth() trả về 0-11
 | 
				
			||||||
| 
						 | 
					@ -137,19 +137,19 @@ const LeaveManagement = () => {
 | 
				
			||||||
    return []
 | 
					    return []
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  useEffect(() => {
 | 
					  // useEffect(() => {
 | 
				
			||||||
    const fetchData = async () => {
 | 
					  //   const fetchData = async () => {
 | 
				
			||||||
      const resultTimeType = await getListMasterByType('TIME_TYPE')
 | 
					  //     const resultTimeType = await getListMasterByType('TIME_TYPE')
 | 
				
			||||||
      setDataTimeType(
 | 
					  //     setDataTimeType(
 | 
				
			||||||
        resultTimeType.filter((item: DataTimeType) => item.c_code !== 'ALL'),
 | 
					  //       resultTimeType.filter((item: DataTimeType) => item.c_code !== 'ALL'),
 | 
				
			||||||
      )
 | 
					  //     )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const resultReason = await getListMasterByType('REASON')
 | 
					  //     const resultReason = await getListMasterByType('REASON')
 | 
				
			||||||
      setDataReason(resultReason)
 | 
					  //     setDataReason(resultReason)
 | 
				
			||||||
    }
 | 
					  //   }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fetchData()
 | 
					  //   fetchData()
 | 
				
			||||||
  }, [])
 | 
					  // }, [])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const getLeaveList = async () => {
 | 
					  const getLeaveList = async () => {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
| 
						 | 
					@ -602,8 +602,8 @@ const LeaveManagement = () => {
 | 
				
			||||||
                  </Table.Td>
 | 
					                  </Table.Td>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                  {monthInYear.map((d, i) => {
 | 
					                  {monthInYear.map((d, i) => {
 | 
				
			||||||
                    const isCurrentMonth =
 | 
					                    // const isCurrentMonth =
 | 
				
			||||||
                      Number(date.year) === currentYear && d.value === currentMonth
 | 
					                    //   Number(date.year) === currentYear && d.value === currentMonth
 | 
				
			||||||
                    let leaveDataByMonth = getDetailLeaveDay(
 | 
					                    let leaveDataByMonth = getDetailLeaveDay(
 | 
				
			||||||
                      user.monthlyLeaveDays,
 | 
					                      user.monthlyLeaveDays,
 | 
				
			||||||
                    )
 | 
					                    )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@ import {
 | 
				
			||||||
  getTicketsOfUser,
 | 
					  getTicketsOfUser,
 | 
				
			||||||
} from '@/api/Admin'
 | 
					} from '@/api/Admin'
 | 
				
			||||||
import { DataTablePagination } from '@/components/DataTable/DataTable'
 | 
					import { DataTablePagination } from '@/components/DataTable/DataTable'
 | 
				
			||||||
import { Xdelete, create } from '@/rtk/helpers/CRUD'
 | 
					import { Xdelete } from '@/rtk/helpers/CRUD'
 | 
				
			||||||
import { get, post } from '@/rtk/helpers/apiService'
 | 
					import { get, post } from '@/rtk/helpers/apiService'
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  Badge,
 | 
					  Badge,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,6 @@ import {
 | 
				
			||||||
  TextInput,
 | 
					  TextInput,
 | 
				
			||||||
  Tooltip,
 | 
					  Tooltip,
 | 
				
			||||||
  Modal,
 | 
					  Modal,
 | 
				
			||||||
  Group,
 | 
					 | 
				
			||||||
} from '@mantine/core'
 | 
					} from '@mantine/core'
 | 
				
			||||||
import { useDisclosure } from '@mantine/hooks'
 | 
					import { useDisclosure } from '@mantine/hooks'
 | 
				
			||||||
import { notifications } from '@mantine/notifications'
 | 
					import { notifications } from '@mantine/notifications'
 | 
				
			||||||
| 
						 | 
					@ -492,9 +491,7 @@ const Timekeeping = () => {
 | 
				
			||||||
        content: classes.deleteModal,
 | 
					        content: classes.deleteModal,
 | 
				
			||||||
      }}
 | 
					      }}
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      <Text className={classes.deleteModalTitle}>
 | 
					      <Text className={classes.deleteModalTitle}>Confirm Delete</Text>
 | 
				
			||||||
        Confirm Delete
 | 
					 | 
				
			||||||
      </Text>
 | 
					 | 
				
			||||||
      <Text className={classes.deleteModalContent}>
 | 
					      <Text className={classes.deleteModalContent}>
 | 
				
			||||||
        Are you sure you want to delete this note?
 | 
					        Are you sure you want to delete this note?
 | 
				
			||||||
      </Text>
 | 
					      </Text>
 | 
				
			||||||
| 
						 | 
					@ -508,10 +505,7 @@ const Timekeeping = () => {
 | 
				
			||||||
        >
 | 
					        >
 | 
				
			||||||
          Cancel
 | 
					          Cancel
 | 
				
			||||||
        </Button>
 | 
					        </Button>
 | 
				
			||||||
        <Button 
 | 
					        <Button className={classes.deleteButton} onClick={handleConfirmDelete}>
 | 
				
			||||||
          className={classes.deleteButton}
 | 
					 | 
				
			||||||
          onClick={handleConfirmDelete}
 | 
					 | 
				
			||||||
        >
 | 
					 | 
				
			||||||
          Delete
 | 
					          Delete
 | 
				
			||||||
        </Button>
 | 
					        </Button>
 | 
				
			||||||
      </Box>
 | 
					      </Box>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue