| @@ -8,7 +8,7 @@ import { | |||
| Stack, | |||
| Dialog, DialogTitle, DialogContent, DialogActions, InputAdornment, | |||
| } from '@mui/material'; | |||
| import {delBugMode} from "auth/utils"; | |||
| import { delBugMode } from "auth/utils"; | |||
| const MainCard = Loadable(lazy(() => import('components/MainCard'))); | |||
| import { useForm } from "react-hook-form"; | |||
| import { | |||
| @@ -94,17 +94,17 @@ const ApplicationDetailCard = ( | |||
| setStatus("notAccepted") | |||
| }; | |||
| const setCompleteDisable=()=>{ | |||
| if(delBugMode) return false; | |||
| const setCompleteDisable = () => { | |||
| if (delBugMode) return false; | |||
| return (new Date()).getTime() < DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate).getTime(); | |||
| } | |||
| const complatedClick = () => () => { | |||
| let issueDate = DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate); | |||
| let current = new Date(); | |||
| if(delBugMode){ | |||
| if (delBugMode) { | |||
| setStatus("complete") | |||
| }else if(current.getTime() >= issueDate.getTime()){ | |||
| } else if (current.getTime() >= issueDate.getTime()) { | |||
| setStatus("complete") | |||
| } | |||
| }; | |||
| @@ -113,7 +113,7 @@ const ApplicationDetailCard = ( | |||
| setStatus("withdraw") | |||
| }; | |||
| const doPublish =()=>()=>{ | |||
| const doPublish = () => () => { | |||
| setStatus("publish") | |||
| } | |||
| @@ -231,24 +231,22 @@ const ApplicationDetailCard = ( | |||
| <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> | |||
| </> | |||
| : | |||
| (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 | |||
| // size="large" | |||
| variant="contained" | |||
| @@ -261,7 +259,40 @@ const ApplicationDetailCard = ( | |||
| <CloseIcon /> | |||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||
| </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> | |||
| </Grid> | |||