@@ -9,15 +9,15 @@ export function getStatus(params) { | |||||
case "cancelled": | case "cancelled": | ||||
return getStatusTag({ color: "#757373", text: "已取消" }) | return getStatusTag({ color: "#757373", text: "已取消" }) | ||||
case "accepted": | case "accepted": | ||||
return getStatusTag({ color: "#22a13f", text: "已接受" }) | |||||
return getStatusTag({ color: "#22a13f", text: "處理中" }) | |||||
case "confirmed": | case "confirmed": | ||||
return getStatusTag({ color: "#22a13f", text: "已確認" }) | |||||
return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||||
case "paid": | case "paid": | ||||
return getStatusTag({ color: "#22a13f", text: "已付費" }) | |||||
return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||||
case "published": | case "published": | ||||
return getStatusTag({ color: "#f5a83d", text: "已發表" }) | |||||
return getStatusTag({ color: "#f5a83d", text: "已發布" }) | |||||
case "withdrawn": | case "withdrawn": | ||||
return getStatusTag({ color: "#8a8784", text: "已撤銷" }) | |||||
return getStatusTag({ color: "#8a8784", text: "已撤回" }) | |||||
default: | default: | ||||
return getStatusTag({ text: params.row.status }) | return getStatusTag({ text: params.row.status }) | ||||
} | } | ||||
@@ -32,15 +32,15 @@ export function getStatusByText(status) { | |||||
case "cancelled": | case "cancelled": | ||||
return getStatusTag({ color: "#757373", text: "已取消" }) | return getStatusTag({ color: "#757373", text: "已取消" }) | ||||
case "accepted": | case "accepted": | ||||
return getStatusTag({ color: "#22a13f", text: "已接受" }) | |||||
return getStatusTag({ color: "#22a13f", text: "處理中" }) | |||||
case "confirmed": | case "confirmed": | ||||
return getStatusTag({ color: "#22a13f", text: "已確認" }) | |||||
return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||||
case "paid": | case "paid": | ||||
return getStatusTag({ color: "#22a13f", text: "已付費" }) | |||||
return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||||
case "published": | case "published": | ||||
return getStatusTag({ color: "#f5a83d", text: "已發表" }) | |||||
return getStatusTag({ color: "#f5a83d", text: "已發布" }) | |||||
case "withdrawn": | case "withdrawn": | ||||
return getStatusTag({ color: "#8a8784", text: "已撤銷" }) | |||||
return getStatusTag({ color: "#8a8784", text: "已撤回" }) | |||||
default: | default: | ||||
return getStatusTag({ text: params.row.status }) | return getStatusTag({ text: params.row.status }) | ||||
} | } | ||||
@@ -55,11 +55,33 @@ export function getStatusEng(params) { | |||||
case "cancelled": | case "cancelled": | ||||
return getStatusTag({ color: "#757373", text: "Cancelled" }) | return getStatusTag({ color: "#757373", text: "Cancelled" }) | ||||
case "accepted": | case "accepted": | ||||
return getStatusTag({ color: "#22a13f", text: "Accepted" }) | |||||
return getStatusTag({ color: "#22a13f", text: "Processing" }) | |||||
case "confirmed": | case "confirmed": | ||||
return getStatusTag({ color: "#22a13f", text: "Confirmed" }) | |||||
return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) | |||||
case "paid": | case "paid": | ||||
return getStatusTag({ color: "#22a13f", text: "Paid" }) | |||||
return getStatusTag({ color: "#22a13f", text: "To be published" }) | |||||
case "published": | |||||
return getStatusTag({ color: "#f5a83d", text: "Published" }) | |||||
case "withdrawn": | |||||
return getStatusTag({ color: "#8a8784", text: "Withdrawn" }) | |||||
default: | |||||
return getStatusTag({ text: params.row.status }) | |||||
} | |||||
} | |||||
export function getStatusByTextEng(status) { | |||||
switch (status) { | |||||
case "submitted": | |||||
return getStatusTag({ color: "#f5a83d", text: "Submitted" }) | |||||
case "rejected": | |||||
return getStatusTag({ color: "#d9372b", text: "Rejected" }) | |||||
case "cancelled": | |||||
return getStatusTag({ color: "#757373", text: "Cancelled" }) | |||||
case "accepted": | |||||
return getStatusTag({ color: "#22a13f", text: "Processing" }) | |||||
case "confirmed": | |||||
return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) | |||||
case "paid": | |||||
return getStatusTag({ color: "#22a13f", text: "To Be Published" }) | |||||
case "published": | case "published": | ||||
return getStatusTag({ color: "#f5a83d", text: "Published" }) | return getStatusTag({ color: "#f5a83d", text: "Published" }) | ||||
case "withdrawn": | case "withdrawn": | ||||
@@ -40,6 +40,7 @@ const ApplicationDetailCard = ( | |||||
// const params = useParams(); | // const params = useParams(); | ||||
const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); | const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); | ||||
const [companyName, setCompanyName] = useState({}); | const [companyName, setCompanyName] = useState({}); | ||||
const [verified, setVerified] = useState(null); | |||||
const [fileDetail, setfileDetail] = useState({}); | const [fileDetail, setfileDetail] = useState({}); | ||||
const [onReady,setOnReady] = useState(false); | const [onReady,setOnReady] = useState(false); | ||||
const {register, | const {register, | ||||
@@ -52,6 +53,7 @@ const ApplicationDetailCard = ( | |||||
if (Object.keys(applicationDetailData).length > 0) { | if (Object.keys(applicationDetailData).length > 0) { | ||||
setCurrentApplicationDetailData(applicationDetailData.data); | setCurrentApplicationDetailData(applicationDetailData.data); | ||||
setCompanyName(applicationDetailData.companyName); | setCompanyName(applicationDetailData.companyName); | ||||
setVerified(applicationDetailData.userData.verifiedBy?true:false) | |||||
setfileDetail(applicationDetailData.fileDetail); | setfileDetail(applicationDetailData.fileDetail); | ||||
} | } | ||||
}, [applicationDetailData]); | }, [applicationDetailData]); | ||||
@@ -96,61 +98,16 @@ const ApplicationDetailCard = ( | |||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
> | > | ||||
<Grid container spacing={4} direction="row"> | |||||
<Grid item xs={4} > | |||||
<Stack | |||||
direction="row" | |||||
justifyContent="space-between" | |||||
alignItems="center" | |||||
spacing={2} | |||||
mb={2} | |||||
> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
}}> | |||||
<BorderColorOutlinedIcon/> | |||||
<Typography ml={1}> Edit</Typography> | |||||
</Button> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<EditNoteIcon/> | |||||
<Typography ml={1}> Create Proof</Typography> | |||||
</Button> | |||||
</Stack> | |||||
</Grid> | |||||
<Grid item xs={8} > | |||||
<Stack | |||||
direction="row" | |||||
justifyContent="space-between" | |||||
alignItems="center" | |||||
spacing={2} | |||||
mb={2} | |||||
> | |||||
{currentApplicationDetailData.status =="submitted"? | |||||
<> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
backgroundColor:'#52b202' | |||||
}}> | |||||
<DoneIcon/> | |||||
<Typography ml={1}> Accept</Typography> | |||||
</Button> | |||||
{verified? | |||||
<Grid container spacing={4} direction="row"> | |||||
<Grid item xs={4} > | |||||
<Stack | |||||
direction="row" | |||||
justifyContent="space-between" | |||||
alignItems="center" | |||||
spacing={2} | |||||
mb={2} | |||||
> | |||||
<Button | <Button | ||||
// size="large" | // size="large" | ||||
variant="contained" | variant="contained" | ||||
@@ -158,42 +115,93 @@ const ApplicationDetailCard = ( | |||||
sx={{ | sx={{ | ||||
textTransform: 'capitalize', | textTransform: 'capitalize', | ||||
alignItems: 'end', | alignItems: 'end', | ||||
backgroundColor:'#ffa733' | |||||
}}> | }}> | ||||
<CloseIcon/> | |||||
<Typography ml={1}> Reject</Typography> | |||||
<BorderColorOutlinedIcon/> | |||||
<Typography ml={1}> Edit</Typography> | |||||
</Button> | </Button> | ||||
</>: | |||||
<> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
backgroundColor:'#52b202' | |||||
}}> | |||||
<DoneIcon/> | |||||
<Typography ml={1}> Complete</Typography> | |||||
</Button> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
backgroundColor:'#ffa733' | |||||
}}> | |||||
<CloseIcon/> | |||||
<Typography ml={1}> Withdraw</Typography> | |||||
</Button> | |||||
</> | |||||
} | |||||
</Stack> | |||||
</Grid> | |||||
</Grid> | |||||
{currentApplicationDetailData.status =="accepted"? | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<EditNoteIcon/> | |||||
<Typography ml={1}> Create Proof</Typography> | |||||
</Button>: | |||||
null | |||||
} | |||||
</Stack> | |||||
</Grid> | |||||
<Grid item xs={8} > | |||||
<Stack | |||||
direction="row" | |||||
justifyContent="space-between" | |||||
alignItems="center" | |||||
spacing={2} | |||||
mb={2} | |||||
> | |||||
{currentApplicationDetailData.status =="submitted"? | |||||
<> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
backgroundColor:'#52b202' | |||||
}}> | |||||
<DoneIcon/> | |||||
<Typography ml={1}> Accept</Typography> | |||||
</Button> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
backgroundColor:'#ffa733' | |||||
}}> | |||||
<CloseIcon/> | |||||
<Typography ml={1}> Reject</Typography> | |||||
</Button> | |||||
</>: | |||||
currentApplicationDetailData.status =="paid"? | |||||
<> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
backgroundColor:'#52b202' | |||||
}}> | |||||
<DoneIcon/> | |||||
<Typography ml={1}> Complete</Typography> | |||||
</Button> | |||||
<Button | |||||
// size="large" | |||||
variant="contained" | |||||
// onClick={handleNewUserClick} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
backgroundColor:'#ffa733' | |||||
}}> | |||||
<CloseIcon/> | |||||
<Typography ml={1}> Withdraw</Typography> | |||||
</Button> | |||||
</>:null | |||||
} | |||||
</Stack> | |||||
</Grid> | |||||
</Grid>:null | |||||
} | |||||
<Typography variant="h5" sx={{mb: 2, borderBottom: "1px solid black"}}> | <Typography variant="h5" sx={{mb: 2, borderBottom: "1px solid black"}}> | ||||
Application Details | Application Details | ||||
</Typography> | </Typography> | ||||
@@ -233,7 +241,7 @@ const ApplicationDetailCard = ( | |||||
<Grid item xs={12} md={9} lg={9}> | <Grid item xs={12} md={9} lg={9}> | ||||
<FormControl variant="outlined" fullWidth > | <FormControl variant="outlined" fullWidth > | ||||
{StatusUtils.getStatusByText(currentApplicationDetailData.status)} | |||||
{StatusUtils.getStatusByTextEng(currentApplicationDetailData.status)} | |||||
</FormControl> | </FormControl> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -368,15 +376,15 @@ const ApplicationDetailCard = ( | |||||
</Grid> | </Grid> | ||||
<Grid container direction="row" justifyContent="space-between" | <Grid container direction="row" justifyContent="space-between" | ||||
alignItems="center"> | alignItems="center"> | ||||
<Grid item xs={12} md={12} lg={12} mt={1}> | |||||
<Grid item xs={12} md={6} lg={6} mt={1}> | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
<Grid container direction="row"> | <Grid container direction="row"> | ||||
<Grid item xs={12} md={2} lg={2} | |||||
<Grid item xs={12} md={3} lg={3} | |||||
sx={{display: 'flex', alignItems: 'center'}}> | sx={{display: 'flex', alignItems: 'center'}}> | ||||
<FormLabel>Manuscript File:</FormLabel> | <FormLabel>Manuscript File:</FormLabel> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={6} lg={6} sx={{display: 'flex', alignItems: 'center'}}> | |||||
<Grid item xs={12} md={9} lg={9} sx={{display: 'flex', alignItems: 'center'}}> | |||||
<Grid container direction="row" justifyContent="flex-start"> | <Grid container direction="row" justifyContent="flex-start"> | ||||
<Grid item xs={12} md={5} lg={5} sx={{display: 'flex', alignItems: 'center'}}> | <Grid item xs={12} md={5} lg={5} sx={{display: 'flex', alignItems: 'center'}}> | ||||
<FormControl variant="outlined" fullWidth > | <FormControl variant="outlined" fullWidth > | ||||
@@ -23,7 +23,7 @@ const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingCompo | |||||
import ContentPasteSearchIcon from '@mui/icons-material/ContentPasteSearch'; | import ContentPasteSearchIcon from '@mui/icons-material/ContentPasteSearch'; | ||||
import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; | import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; | ||||
import HighlightOff from '@mui/icons-material/HighlightOff'; | import HighlightOff from '@mui/icons-material/HighlightOff'; | ||||
import {useNavigate} from "react-router-dom"; | |||||
// import {useNavigate} from "react-router-dom"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const ClientDetailCard = ( | const ClientDetailCard = ( | ||||
@@ -36,17 +36,19 @@ const ClientDetailCard = ( | |||||
// const params = useParams(); | // const params = useParams(); | ||||
const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); | const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); | ||||
const [onReady,setOnReady] = useState(false); | const [onReady,setOnReady] = useState(false); | ||||
const [companyName, setCompanyName] = useState({}); | |||||
const [companyName, setCompanyName] = useState({enCompanyName:"",chCompanyName:""}); | |||||
const {register, | const {register, | ||||
// getValues | // getValues | ||||
} = useForm() | } = useForm() | ||||
const navigate = useNavigate() | |||||
// const navigate = useNavigate() | |||||
useEffect(() => { | useEffect(() => { | ||||
//if user data from parent are not null | //if user data from parent are not null | ||||
if (Object.keys(applicationDetailData).length > 0 && applicationDetailData !== undefined) { | if (Object.keys(applicationDetailData).length > 0 && applicationDetailData !== undefined) { | ||||
setCurrentApplicationDetailData(applicationDetailData.userData); | setCurrentApplicationDetailData(applicationDetailData.userData); | ||||
setCompanyName(applicationDetailData.companyName); | |||||
if (!applicationDetailData.companyName1==null){ | |||||
setCompanyName(applicationDetailData.companyName); | |||||
} | |||||
} | } | ||||
}, [applicationDetailData]); | }, [applicationDetailData]); | ||||
@@ -61,8 +63,8 @@ const ClientDetailCard = ( | |||||
const handleViewClick = () => () => { | const handleViewClick = () => () => { | ||||
console.log(currentApplicationDetailData) | console.log(currentApplicationDetailData) | ||||
currentApplicationDetailData.type == "ORG"? | currentApplicationDetailData.type == "ORG"? | ||||
navigate('/orgUser/'+ currentApplicationDetailData.id): | |||||
navigate('/indUser/'+ currentApplicationDetailData.id); | |||||
window.open('/orgUser/'+ currentApplicationDetailData.id, "_blank", "noreferrer"): | |||||
window.open('/indUser/'+ currentApplicationDetailData.id, "_blank", "noreferrer"); | |||||
}; | }; | ||||
// useEffect(() => { | // useEffect(() => { | ||||
@@ -45,10 +45,8 @@ const DashboardDefault = () => { | |||||
height: '100%', | height: '100%', | ||||
backgroundSize:'cover' | backgroundSize:'cover' | ||||
} | } | ||||
// const appNo = "G2023-343" | |||||
// const gazetteIssue = "2023 Vol 027" | |||||
// const issueNo = "No. 36" | |||||
// const issueDate = "A001" | |||||
const title = groupNo!=""?("Application / "+appNo+", "+gazetteIssue+", "+groupNo+" , "+groupTitle):("Application / "+appNo+", "+gazetteIssue) | |||||
useEffect(() => { | useEffect(() => { | ||||
if(params.id > 0 ){ | if(params.id > 0 ){ | ||||
@@ -83,7 +81,7 @@ const DashboardDefault = () => { | |||||
</Grid> | </Grid> | ||||
<Grid item xs={12} > | <Grid item xs={12} > | ||||
<Stack direction="row" height='20px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='20px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={4} mt={3} variant="h4">Application / {appNo}, {gazetteIssue}, {groupNo} , {groupTitle}</Typography> | |||||
<Typography ml={4} mt={3} variant="h4">{title}</Typography> | |||||
</Stack> | </Stack> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} > | <Grid item xs={12} > | ||||