|
|
@@ -24,6 +24,9 @@ import { notifyActionSuccess } from 'utils/CommonFunction'; |
|
|
|
import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; |
|
|
|
import {ThemeProvider} from "@emotion/react"; |
|
|
|
import {FormattedMessage, useIntl} from "react-intl"; |
|
|
|
import Loadable from 'components/Loadable'; |
|
|
|
import { lazy } from 'react'; |
|
|
|
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); |
|
|
|
|
|
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
|
|
|
|
@@ -36,6 +39,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections }) => { |
|
|
|
|
|
|
|
const [val, setVal] = React.useState({}); |
|
|
|
const [reloadPage, setReloadPage] = React.useState(false); |
|
|
|
const [isSubmitting, setSubmitting] = React.useState(false); |
|
|
|
|
|
|
|
const [issueId, setIssueId] = React.useState(loadedData.issueId); |
|
|
|
const navigate = useNavigate(); |
|
|
@@ -114,6 +118,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections }) => { |
|
|
|
}); |
|
|
|
|
|
|
|
const apply = (values)=>{ |
|
|
|
setSubmitting(true) |
|
|
|
HttpUtils.postWithFiles({ |
|
|
|
url: UrlUtils.POST_PUBLIC_NOTICE_APPLY, |
|
|
|
params: { |
|
|
@@ -140,6 +145,7 @@ const PublicNoticeApplyForm = ({ loadedData, _selections }) => { |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
} |
|
|
|
setSubmitting(false) |
|
|
|
notifyActionSuccess(intl.formatMessage({id: 'submissionSuccess'}) + '!') |
|
|
|
navigate("/publicNotice"); |
|
|
|
// location.reload(); |
|
|
@@ -190,152 +196,159 @@ const PublicNoticeApplyForm = ({ loadedData, _selections }) => { |
|
|
|
{/* <Grid item xs={12}> |
|
|
|
<Typography variant="pnspsFormParagraphBold">申請公共啟事</Typography> |
|
|
|
</Grid> */} |
|
|
|
<Grid item xs={12} md={12} width={{ md: "60%", xs: "90%" }}> |
|
|
|
<Box xs={12} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> |
|
|
|
<form onSubmit={formik.handleSubmit}> |
|
|
|
<Grid container spacing={1} sx={{ minHeight: '80vh' }} direction="row" justifyContent="flex-start" alignItems="center"> |
|
|
|
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> |
|
|
|
{FieldUtils.getTextField({ |
|
|
|
label: intl.formatMessage({id: 'contactPerson'}) + ":", |
|
|
|
valueName: "contactPerson", |
|
|
|
form: formik, |
|
|
|
disabled: true |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={12}> |
|
|
|
{FieldUtils.getPhoneField({ |
|
|
|
label: intl.formatMessage({id: 'userContactNumber'}) + ":", |
|
|
|
disabled: true, |
|
|
|
valueName: { |
|
|
|
code: "tel_countryCode", |
|
|
|
num: "phoneNumber", |
|
|
|
}, |
|
|
|
form: formik |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={12}> |
|
|
|
{FieldUtils.getPhoneField({ |
|
|
|
label: intl.formatMessage({id: 'contactFaxNumber'}) + ":", |
|
|
|
disabled: true, |
|
|
|
valueName: { |
|
|
|
code: "fax_countryCode", |
|
|
|
num: "faxNumber", |
|
|
|
}, |
|
|
|
form: formik |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} lg={12}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<Typography variant="pnspsFormParagraphBold"> |
|
|
|
<FormattedMessage id="targetVol" />: |
|
|
|
</Typography> |
|
|
|
{ |
|
|
|
isSubmitting ? |
|
|
|
<Grid item xs={12} md={12} width={{ md: "60%", xs: "90%" }}> |
|
|
|
<LoadingComponent /> |
|
|
|
</Grid> |
|
|
|
: |
|
|
|
<Grid item xs={12} md={12} width={{ md: "60%", xs: "90%" }}> |
|
|
|
<Box xs={12} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> |
|
|
|
<form onSubmit={formik.handleSubmit}> |
|
|
|
<Grid container spacing={1} sx={{ minHeight: '80vh' }} direction="row" justifyContent="flex-start" alignItems="center"> |
|
|
|
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> |
|
|
|
{FieldUtils.getTextField({ |
|
|
|
label: intl.formatMessage({id: 'contactPerson'}) + ":", |
|
|
|
valueName: "contactPerson", |
|
|
|
form: formik, |
|
|
|
disabled: true |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={9} lg={6}> |
|
|
|
<RadioGroup |
|
|
|
aria-labelledby="radio-buttons-group-label" |
|
|
|
id="issueId" |
|
|
|
name="issueId" |
|
|
|
defaultValue={issueId} |
|
|
|
onChange={(event) => { |
|
|
|
setIssueId(event.target.value); |
|
|
|
}} |
|
|
|
> |
|
|
|
{ |
|
|
|
selections |
|
|
|
} |
|
|
|
</RadioGroup> |
|
|
|
<Grid item xs={12} md={12}> |
|
|
|
{FieldUtils.getPhoneField({ |
|
|
|
label: intl.formatMessage({id: 'userContactNumber'}) + ":", |
|
|
|
disabled: true, |
|
|
|
valueName: { |
|
|
|
code: "tel_countryCode", |
|
|
|
num: "phoneNumber", |
|
|
|
}, |
|
|
|
form: formik |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={12} lg={12}> |
|
|
|
<Grid container direction="row" justifyContent="flex-start" alignItems="center"> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<Typography variant="pnspsFormParagraphBold"> |
|
|
|
<FormattedMessage id="draftFile"/> ({intl.formatMessage({id: 'fileSizeWarning'})}): |
|
|
|
</Typography> |
|
|
|
<Grid item xs={12} md={12}> |
|
|
|
{FieldUtils.getPhoneField({ |
|
|
|
label: intl.formatMessage({id: 'contactFaxNumber'}) + ":", |
|
|
|
disabled: true, |
|
|
|
valueName: { |
|
|
|
code: "fax_countryCode", |
|
|
|
num: "faxNumber", |
|
|
|
}, |
|
|
|
form: formik |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={6} lg={6} sx={{ wordBreak: 'break-word' }}> |
|
|
|
<input |
|
|
|
id="uploadFileBtn" |
|
|
|
name="file" |
|
|
|
type="file" |
|
|
|
accept=".doc,.docx,.xls,.xlsx" |
|
|
|
style={{ display: 'none' }} |
|
|
|
onChange={(event) => { |
|
|
|
readFile(event) |
|
|
|
}} |
|
|
|
/> |
|
|
|
{attachment.name} |
|
|
|
<Grid item xs={12} lg={12}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<Typography variant="pnspsFormParagraphBold"> |
|
|
|
<FormattedMessage id="targetVol" />: |
|
|
|
</Typography> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={9} lg={6}> |
|
|
|
<RadioGroup |
|
|
|
aria-labelledby="radio-buttons-group-label" |
|
|
|
id="issueId" |
|
|
|
name="issueId" |
|
|
|
defaultValue={issueId} |
|
|
|
onChange={(event) => { |
|
|
|
setIssueId(event.target.value); |
|
|
|
}} |
|
|
|
> |
|
|
|
{ |
|
|
|
selections |
|
|
|
} |
|
|
|
</RadioGroup> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
{/* <Grid item xs={12} md={3} lg={3}> |
|
|
|
<label htmlFor="uploadFileBtn"> |
|
|
|
<Button |
|
|
|
aria-label={intl.formatMessage({id: 'uploadFileBtn'})} |
|
|
|
component="span" |
|
|
|
variant="outlined" |
|
|
|
size="large" |
|
|
|
>{attachment ? intl.formatMessage({id: 'uploadFileBtn'}) : intl.formatMessage({id: 'reUpload'})}</Button> |
|
|
|
</label> |
|
|
|
</Grid> */} |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={12} lg={12}> |
|
|
|
<Grid container direction="row" justifyContent="flex-start" alignItems="center"> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<Grid item xs={12} md={12} lg={12}> |
|
|
|
<Grid container direction="row" justifyContent="flex-start" alignItems="center"> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
<Typography variant="pnspsFormParagraphBold"> |
|
|
|
<FormattedMessage id="draftFile"/> ({intl.formatMessage({id: 'fileSizeWarning'})}): |
|
|
|
</Typography> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={6} lg={6} sx={{ wordBreak: 'break-word' }}> |
|
|
|
<input |
|
|
|
id="uploadFileBtn" |
|
|
|
name="file" |
|
|
|
type="file" |
|
|
|
accept=".doc,.docx,.xls,.xlsx" |
|
|
|
style={{ display: 'none' }} |
|
|
|
onChange={(event) => { |
|
|
|
readFile(event) |
|
|
|
}} |
|
|
|
/> |
|
|
|
{attachment.name} |
|
|
|
</Grid> |
|
|
|
{/* <Grid item xs={12} md={3} lg={3}> |
|
|
|
<label htmlFor="uploadFileBtn"> |
|
|
|
<Button |
|
|
|
aria-label={intl.formatMessage({id: 'uploadFileBtn'})} |
|
|
|
component="span" |
|
|
|
variant="outlined" |
|
|
|
size="large" |
|
|
|
>{attachment ? intl.formatMessage({id: 'uploadFileBtn'}) : intl.formatMessage({id: 'reUpload'})}</Button> |
|
|
|
</label> |
|
|
|
</Grid> */} |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={6} lg={6} > |
|
|
|
<label htmlFor="uploadFileBtn"> |
|
|
|
<Button |
|
|
|
aria-label={intl.formatMessage({id: 'uploadFileBtn'})} |
|
|
|
component="span" |
|
|
|
variant="outlined" |
|
|
|
size="large" |
|
|
|
>{attachment ? intl.formatMessage({id: 'uploadFileBtn'}) : intl.formatMessage({id: 'reUpload'})}</Button> |
|
|
|
</label> |
|
|
|
<Grid item xs={12} md={12} lg={12}> |
|
|
|
<Grid container direction="row" justifyContent="flex-start" alignItems="center"> |
|
|
|
<Grid item xs={12} md={3} lg={3} |
|
|
|
sx={{ display: 'flex', alignItems: 'center' }}> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={6} lg={6} > |
|
|
|
<label htmlFor="uploadFileBtn"> |
|
|
|
<Button |
|
|
|
aria-label={intl.formatMessage({id: 'uploadFileBtn'})} |
|
|
|
component="span" |
|
|
|
variant="outlined" |
|
|
|
size="large" |
|
|
|
>{attachment ? intl.formatMessage({id: 'uploadFileBtn'}) : intl.formatMessage({id: 'reUpload'})}</Button> |
|
|
|
</label> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={3} lg={3}> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12} md={3} lg={3}> |
|
|
|
{isORGLoggedIn()? |
|
|
|
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> |
|
|
|
{FieldUtils.getTextField({ |
|
|
|
label: intl.formatMessage({id: 'careOf'}) + ":", |
|
|
|
valueName: "careOf", |
|
|
|
form: formik, |
|
|
|
// disabled: true |
|
|
|
})} |
|
|
|
</Grid>:null |
|
|
|
} |
|
|
|
<Grid item xs={12} md={12} lg={12}> |
|
|
|
{FieldUtils.getTextArea({ |
|
|
|
label: intl.formatMessage({id: 'extraMark'}) + ":", |
|
|
|
valueName: "remarks", |
|
|
|
form: formik, |
|
|
|
inputProps: { maxLength: 255 } |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12}> |
|
|
|
<center> |
|
|
|
<ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> |
|
|
|
<Button |
|
|
|
aria-label={intl.formatMessage({id: 'applyPublicNotice'})} |
|
|
|
variant="contained" |
|
|
|
type="submit" |
|
|
|
> |
|
|
|
<FormattedMessage id="applyPublicNotice"/> |
|
|
|
</Button> |
|
|
|
</ThemeProvider> |
|
|
|
</center> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
{isORGLoggedIn()? |
|
|
|
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> |
|
|
|
{FieldUtils.getTextField({ |
|
|
|
label: intl.formatMessage({id: 'careOf'}) + ":", |
|
|
|
valueName: "careOf", |
|
|
|
form: formik, |
|
|
|
// disabled: true |
|
|
|
})} |
|
|
|
</Grid>:null |
|
|
|
} |
|
|
|
<Grid item xs={12} md={12} lg={12}> |
|
|
|
{FieldUtils.getTextArea({ |
|
|
|
label: intl.formatMessage({id: 'extraMark'}) + ":", |
|
|
|
valueName: "remarks", |
|
|
|
form: formik, |
|
|
|
inputProps: { maxLength: 255 } |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|
<Grid item xs={12}> |
|
|
|
<center> |
|
|
|
<ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> |
|
|
|
<Button |
|
|
|
aria-label={intl.formatMessage({id: 'applyPublicNotice'})} |
|
|
|
variant="contained" |
|
|
|
type="submit" |
|
|
|
> |
|
|
|
<FormattedMessage id="applyPublicNotice"/> |
|
|
|
</Button> |
|
|
|
</ThemeProvider> |
|
|
|
</center> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</form> |
|
|
|
</Box> |
|
|
|
</Grid> |
|
|
|
</form> |
|
|
|
</Box> |
|
|
|
</Grid> |
|
|
|
} |
|
|
|
<div> |
|
|
|
<Dialog |
|
|
|
open={isWarningPopUp} |
|
|
|