| @@ -8,7 +8,7 @@ import { | |||||
| Stack, | Stack, | ||||
| Dialog, DialogTitle, DialogContent, DialogActions, InputAdornment, | Dialog, DialogTitle, DialogContent, DialogActions, InputAdornment, | ||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import {delBugMode} from "auth/utils"; | |||||
| import { delBugMode } from "auth/utils"; | |||||
| const MainCard = Loadable(lazy(() => import('components/MainCard'))); | const MainCard = Loadable(lazy(() => import('components/MainCard'))); | ||||
| import { useForm } from "react-hook-form"; | import { useForm } from "react-hook-form"; | ||||
| import { | import { | ||||
| @@ -94,17 +94,17 @@ const ApplicationDetailCard = ( | |||||
| setStatus("notAccepted") | setStatus("notAccepted") | ||||
| }; | }; | ||||
| const setCompleteDisable=()=>{ | |||||
| if(delBugMode) return false; | |||||
| const setCompleteDisable = () => { | |||||
| if (delBugMode) return false; | |||||
| return (new Date()).getTime() < DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate).getTime(); | return (new Date()).getTime() < DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate).getTime(); | ||||
| } | } | ||||
| const complatedClick = () => () => { | const complatedClick = () => () => { | ||||
| let issueDate = DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate); | let issueDate = DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate); | ||||
| let current = new Date(); | let current = new Date(); | ||||
| if(delBugMode){ | |||||
| if (delBugMode) { | |||||
| setStatus("complete") | setStatus("complete") | ||||
| }else if(current.getTime() >= issueDate.getTime()){ | |||||
| } else if (current.getTime() >= issueDate.getTime()) { | |||||
| setStatus("complete") | setStatus("complete") | ||||
| } | } | ||||
| }; | }; | ||||
| @@ -113,7 +113,7 @@ const ApplicationDetailCard = ( | |||||
| setStatus("withdraw") | setStatus("withdraw") | ||||
| }; | }; | ||||
| const doPublish =()=>()=>{ | |||||
| const doPublish = () => () => { | |||||
| setStatus("publish") | setStatus("publish") | ||||
| } | } | ||||
| @@ -231,24 +231,22 @@ const ApplicationDetailCard = ( | |||||
| <DoneIcon /> | <DoneIcon /> | ||||
| <Typography ml={1} variant="h5">Publish</Typography> | <Typography ml={1} variant="h5">Publish</Typography> | ||||
| </Button> | </Button> | ||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={withdrawnClick()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||||
| </Button> | |||||
| </> | </> | ||||
| : | : | ||||
| (currentApplicationDetailData.status == "paid" && currentApplicationDetailData.creditor == 0) ? | |||||
| (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 0) ? | |||||
| <> | <> | ||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={complatedClick()} | |||||
| disabled={setCompleteDisable()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#52b202' | |||||
| }}> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Publish</Typography> | |||||
| </Button> | |||||
| <Button | <Button | ||||
| // size="large" | // size="large" | ||||
| variant="contained" | variant="contained" | ||||
| @@ -261,7 +259,40 @@ const ApplicationDetailCard = ( | |||||
| <CloseIcon /> | <CloseIcon /> | ||||
| <Typography ml={1} variant="h5">Withdraw</Typography> | <Typography ml={1} variant="h5">Withdraw</Typography> | ||||
| </Button> | </Button> | ||||
| </> : null | |||||
| </> | |||||
| : | |||||
| ( | |||||
| (currentApplicationDetailData.status == "paid" && currentApplicationDetailData.creditor == 0) ? | |||||
| <> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={complatedClick()} | |||||
| disabled={setCompleteDisable()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#52b202' | |||||
| }}> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Publish</Typography> | |||||
| </Button> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={withdrawnClick()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||||
| </Button> | |||||
| </> : null | |||||
| ) | |||||
| } | } | ||||
| </Stack> | </Stack> | ||||
| </Grid> | </Grid> | ||||