@@ -9,15 +9,15 @@ export function getStatus(params) { | |||
case "cancelled": | |||
return getStatusTag({ color: "#757373", text: "已取消" }) | |||
case "accepted": | |||
return getStatusTag({ color: "#22a13f", text: "已接受" }) | |||
return getStatusTag({ color: "#22a13f", text: "處理中" }) | |||
case "confirmed": | |||
return getStatusTag({ color: "#22a13f", text: "已確認" }) | |||
return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||
case "paid": | |||
return getStatusTag({ color: "#22a13f", text: "已付費" }) | |||
return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||
case "published": | |||
return getStatusTag({ color: "#f5a83d", text: "已發表" }) | |||
return getStatusTag({ color: "#f5a83d", text: "已發布" }) | |||
case "withdrawn": | |||
return getStatusTag({ color: "#8a8784", text: "已撤銷" }) | |||
return getStatusTag({ color: "#8a8784", text: "已撤回" }) | |||
default: | |||
return getStatusTag({ text: params.row.status }) | |||
} | |||
@@ -32,15 +32,15 @@ export function getStatusByText(status) { | |||
case "cancelled": | |||
return getStatusTag({ color: "#757373", text: "已取消" }) | |||
case "accepted": | |||
return getStatusTag({ color: "#22a13f", text: "已接受" }) | |||
return getStatusTag({ color: "#22a13f", text: "處理中" }) | |||
case "confirmed": | |||
return getStatusTag({ color: "#22a13f", text: "已確認" }) | |||
return getStatusTag({ color: "#22a13f", text: "待付款" }) | |||
case "paid": | |||
return getStatusTag({ color: "#22a13f", text: "已付費" }) | |||
return getStatusTag({ color: "#22a13f", text: "待發布" }) | |||
case "published": | |||
return getStatusTag({ color: "#f5a83d", text: "已發表" }) | |||
return getStatusTag({ color: "#f5a83d", text: "已發布" }) | |||
case "withdrawn": | |||
return getStatusTag({ color: "#8a8784", text: "已撤銷" }) | |||
return getStatusTag({ color: "#8a8784", text: "已撤回" }) | |||
default: | |||
return getStatusTag({ text: params.row.status }) | |||
} | |||
@@ -55,11 +55,33 @@ export function getStatusEng(params) { | |||
case "cancelled": | |||
return getStatusTag({ color: "#757373", text: "Cancelled" }) | |||
case "accepted": | |||
return getStatusTag({ color: "#22a13f", text: "Accepted" }) | |||
return getStatusTag({ color: "#22a13f", text: "Processing" }) | |||
case "confirmed": | |||
return getStatusTag({ color: "#22a13f", text: "Confirmed" }) | |||
return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) | |||
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": | |||
return getStatusTag({ color: "#f5a83d", text: "Published" }) | |||
case "withdrawn": | |||
@@ -40,6 +40,7 @@ const ApplicationDetailCard = ( | |||
// const params = useParams(); | |||
const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); | |||
const [companyName, setCompanyName] = useState({}); | |||
const [verified, setVerified] = useState(null); | |||
const [fileDetail, setfileDetail] = useState({}); | |||
const [onReady,setOnReady] = useState(false); | |||
const {register, | |||
@@ -52,6 +53,7 @@ const ApplicationDetailCard = ( | |||
if (Object.keys(applicationDetailData).length > 0) { | |||
setCurrentApplicationDetailData(applicationDetailData.data); | |||
setCompanyName(applicationDetailData.companyName); | |||
setVerified(applicationDetailData.userData.verifiedBy?true:false) | |||
setfileDetail(applicationDetailData.fileDetail); | |||
} | |||
}, [applicationDetailData]); | |||
@@ -96,61 +98,16 @@ const ApplicationDetailCard = ( | |||
border={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 | |||
// size="large" | |||
variant="contained" | |||
@@ -158,42 +115,93 @@ const ApplicationDetailCard = ( | |||
sx={{ | |||
textTransform: 'capitalize', | |||
alignItems: 'end', | |||
backgroundColor:'#ffa733' | |||
}}> | |||
<CloseIcon/> | |||
<Typography ml={1}> Reject</Typography> | |||
<BorderColorOutlinedIcon/> | |||
<Typography ml={1}> Edit</Typography> | |||
</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"}}> | |||
Application Details | |||
</Typography> | |||
@@ -233,7 +241,7 @@ const ApplicationDetailCard = ( | |||
<Grid item xs={12} md={9} lg={9}> | |||
<FormControl variant="outlined" fullWidth > | |||
{StatusUtils.getStatusByText(currentApplicationDetailData.status)} | |||
{StatusUtils.getStatusByTextEng(currentApplicationDetailData.status)} | |||
</FormControl> | |||
</Grid> | |||
</Grid> | |||
@@ -368,15 +376,15 @@ const ApplicationDetailCard = ( | |||
</Grid> | |||
<Grid container direction="row" justifyContent="space-between" | |||
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 item xs={12} md={12} lg={12}> | |||
<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'}}> | |||
<FormLabel>Manuscript File:</FormLabel> | |||
</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 item xs={12} md={5} lg={5} sx={{display: 'flex', alignItems: 'center'}}> | |||
<FormControl variant="outlined" fullWidth > | |||
@@ -23,7 +23,7 @@ const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingCompo | |||
import ContentPasteSearchIcon from '@mui/icons-material/ContentPasteSearch'; | |||
import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; | |||
import HighlightOff from '@mui/icons-material/HighlightOff'; | |||
import {useNavigate} from "react-router-dom"; | |||
// import {useNavigate} from "react-router-dom"; | |||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | |||
const ClientDetailCard = ( | |||
@@ -36,17 +36,19 @@ const ClientDetailCard = ( | |||
// const params = useParams(); | |||
const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({}); | |||
const [onReady,setOnReady] = useState(false); | |||
const [companyName, setCompanyName] = useState({}); | |||
const [companyName, setCompanyName] = useState({enCompanyName:"",chCompanyName:""}); | |||
const {register, | |||
// getValues | |||
} = useForm() | |||
const navigate = useNavigate() | |||
// const navigate = useNavigate() | |||
useEffect(() => { | |||
//if user data from parent are not null | |||
if (Object.keys(applicationDetailData).length > 0 && applicationDetailData !== undefined) { | |||
setCurrentApplicationDetailData(applicationDetailData.userData); | |||
setCompanyName(applicationDetailData.companyName); | |||
if (!applicationDetailData.companyName1==null){ | |||
setCompanyName(applicationDetailData.companyName); | |||
} | |||
} | |||
}, [applicationDetailData]); | |||
@@ -61,8 +63,8 @@ const ClientDetailCard = ( | |||
const handleViewClick = () => () => { | |||
console.log(currentApplicationDetailData) | |||
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(() => { | |||
@@ -45,10 +45,8 @@ const DashboardDefault = () => { | |||
height: '100%', | |||
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(() => { | |||
if(params.id > 0 ){ | |||
@@ -83,7 +81,7 @@ const DashboardDefault = () => { | |||
</Grid> | |||
<Grid item xs={12} > | |||
<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> | |||
</Grid> | |||
<Grid item xs={12} > | |||