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