|
|
|
@@ -43,6 +43,7 @@ const FormPanel = ({ formData }) => { |
|
|
|
|
|
|
|
const [actionValue, setActionValue] = React.useState(true); |
|
|
|
|
|
|
|
const [warningTitle, setWarningTitle] = React.useState(""); |
|
|
|
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); |
|
|
|
const [warningText, setWarningText] = React.useState(""); |
|
|
|
|
|
|
|
@@ -72,13 +73,14 @@ const FormPanel = ({ formData }) => { |
|
|
|
vaild: yup.string().max(255, intl.formatMessage({ id: 'requireLoginPassword' })).required(intl.formatMessage({ id: 'requireLoginPassword' })), |
|
|
|
}), |
|
|
|
onSubmit: values => { |
|
|
|
if (isOverTime()&&!isDummyLoggedIn()) { |
|
|
|
if (isOverTime() && !isDummyLoggedIn()) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'MSG.proofOutOfTime' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
} |
|
|
|
let pm = paymentMethod; |
|
|
|
if (!isDummyLoggedIn()){ |
|
|
|
if (!isDummyLoggedIn()) { |
|
|
|
if (pm == "demandNote") { |
|
|
|
pm = isOverDnReviseDeadline() ? "" : pm; |
|
|
|
} else if (pm == "office") { |
|
|
|
@@ -86,12 +88,14 @@ const FormPanel = ({ formData }) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (actionValue == false && isOverReviseDeadline() &&!isDummyLoggedIn()) { |
|
|
|
if (actionValue == false && isOverReviseDeadline() && !isDummyLoggedIn()) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'MSG.overReviseDeadline' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
} |
|
|
|
else if (formData.creditor == false && pm == "") { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'MSG.plzSelectPaymentMethod' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
@@ -99,6 +103,7 @@ const FormPanel = ({ formData }) => { |
|
|
|
|
|
|
|
if (!actionValue) { |
|
|
|
if (!attachments || attachments.length <= 0) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'requireFile' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
@@ -116,6 +121,7 @@ const FormPanel = ({ formData }) => { |
|
|
|
files: attachments ? attachments : [], |
|
|
|
onSuccess: function (responseData) { |
|
|
|
if (responseData.msg) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: responseData.msg })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
@@ -128,11 +134,13 @@ const FormPanel = ({ formData }) => { |
|
|
|
} |
|
|
|
}, |
|
|
|
onFail: function (response) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'actionFail' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
console.log(response); |
|
|
|
}, |
|
|
|
onError: function (error) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'actionFail' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
console.log(error); |
|
|
|
@@ -145,12 +153,14 @@ const FormPanel = ({ formData }) => { |
|
|
|
let file = event.target.files[0]; |
|
|
|
if (file) { |
|
|
|
if (!file.name.toLowerCase().substr(file.name.length - 4).includes(".pdf")) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'requireValidFileWithPdfFormat' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
document.getElementById("uploadFileBtn").value = ""; |
|
|
|
return; |
|
|
|
} |
|
|
|
if (file.size >= (10 * 1024 * 1034)) { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "attention" })) |
|
|
|
setWarningText(intl.formatMessage({ id: 'fileSizeWarning' })); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
return; |
|
|
|
@@ -306,10 +316,9 @@ const FormPanel = ({ formData }) => { |
|
|
|
<table style={tabelStyle}> |
|
|
|
<tr style={tabelStyle}> |
|
|
|
<th style={tabelStyle} width="50" align="left"></th> |
|
|
|
<th style={tabelStyle} width="400" align="left"><FormattedMessage id="paymentMeans" /></th> |
|
|
|
<th style={tabelStyle} width="400" align="left"><FormattedMessage id="paymentMethodMeans" /></th> |
|
|
|
<th style={tabelStyle} width="300" align="left"><FormattedMessage id="paymentMeans" /></th> |
|
|
|
<th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th> |
|
|
|
<th style={tabelStyle} width="300" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> |
|
|
|
<th style={tabelStyle} width="400" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style={tabelStyle}> |
|
|
|
@@ -320,19 +329,27 @@ const FormPanel = ({ formData }) => { |
|
|
|
}} |
|
|
|
/> |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}><FormattedMessage id="payDn" /></td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="atm" /></li> |
|
|
|
<li><FormattedMessage id="pps" /></li> |
|
|
|
<li><FormattedMessage id="eBank" /></li> |
|
|
|
<li><FormattedMessage id="phoneBank" /></li> |
|
|
|
<li><FormattedMessage id="eCheque" /></li> |
|
|
|
<li><FormattedMessage id="fps" /></li> |
|
|
|
<li><FormattedMessage id="hkpo" /></li> |
|
|
|
<li><FormattedMessage id="store" /></li> |
|
|
|
<li><FormattedMessage id="post" /></li> |
|
|
|
</ul> |
|
|
|
<FormattedMessage id="payDn" /> |
|
|
|
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "payDn" })) |
|
|
|
setWarningText( |
|
|
|
<><FormattedMessage id="paymentMethodMeans" /> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="atm" /></li> |
|
|
|
<li><FormattedMessage id="pps" /></li> |
|
|
|
<li><FormattedMessage id="eBank" /></li> |
|
|
|
<li><FormattedMessage id="phoneBank" /></li> |
|
|
|
<li><FormattedMessage id="eCheque" /></li> |
|
|
|
<li><FormattedMessage id="fps" /></li> |
|
|
|
<li><FormattedMessage id="hkpo" /></li> |
|
|
|
<li><FormattedMessage id="store" /></li> |
|
|
|
<li><FormattedMessage id="post" /></li> |
|
|
|
</ul> |
|
|
|
</> |
|
|
|
); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}}><FormattedMessage id="viewDetail" /></a> |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} 5:00 p.m.</td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
@@ -350,12 +367,20 @@ const FormPanel = ({ formData }) => { |
|
|
|
}} |
|
|
|
/> |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}><FormattedMessage id="payNPGO" /></td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="cheque" /></li> |
|
|
|
<li><FormattedMessage id="cash" /></li> |
|
|
|
</ul> |
|
|
|
<FormattedMessage id="payNPGO" /> |
|
|
|
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "payNPGO" })) |
|
|
|
setWarningText( |
|
|
|
<><FormattedMessage id="paymentMethodMeans" /> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="cheque" /></li> |
|
|
|
<li><FormattedMessage id="cash" /></li> |
|
|
|
</ul> |
|
|
|
</> |
|
|
|
); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}}><FormattedMessage id="viewDetail" /></a> |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 12:00 p.m.</td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
@@ -370,10 +395,9 @@ const FormPanel = ({ formData }) => { |
|
|
|
<table style={tabelStyle}> |
|
|
|
<tr style={tabelStyle}> |
|
|
|
<th style={tabelStyle} width="50" align="left"></th> |
|
|
|
<th style={tabelStyle} width="400" align="left"><FormattedMessage id="paymentMeans" /></th> |
|
|
|
<th style={tabelStyle} width="400" align="left"><FormattedMessage id="paymentMethodMeans" /></th> |
|
|
|
<th style={tabelStyle} width="300" align="left"><FormattedMessage id="paymentMeans" /></th> |
|
|
|
<th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th> |
|
|
|
<th style={tabelStyle} width="300" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> |
|
|
|
<th style={tabelStyle} width="400" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style={tabelStyle}> |
|
|
|
@@ -384,13 +408,21 @@ const FormPanel = ({ formData }) => { |
|
|
|
}} |
|
|
|
/> |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}><FormattedMessage id="payOnline" /></td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="fps" /></li> |
|
|
|
<li><FormattedMessage id="card" /></li> |
|
|
|
<li><FormattedMessage id="pps" /></li> |
|
|
|
</ul> |
|
|
|
<FormattedMessage id="payOnline" /> |
|
|
|
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "payOnline" })) |
|
|
|
setWarningText( |
|
|
|
<><FormattedMessage id="paymentMethodMeans" /> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="fps" /></li> |
|
|
|
<li><FormattedMessage id="card" /></li> |
|
|
|
<li><FormattedMessage id="pps" /></li> |
|
|
|
</ul> |
|
|
|
</> |
|
|
|
); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}}><FormattedMessage id="viewDetail" /></a> |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 2:00 p.m.</td> |
|
|
|
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 2:30 p.m.</td> |
|
|
|
@@ -407,20 +439,29 @@ const FormPanel = ({ formData }) => { |
|
|
|
/> |
|
|
|
} |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}><FormattedMessage id="payDn" /></td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="atm" /></li> |
|
|
|
<li><FormattedMessage id="pps" /></li> |
|
|
|
<li><FormattedMessage id="eBank" /></li> |
|
|
|
<li><FormattedMessage id="phoneBank" /></li> |
|
|
|
<li><FormattedMessage id="eCheque" /></li> |
|
|
|
<li><FormattedMessage id="fps" /></li> |
|
|
|
<li><FormattedMessage id="hkpo" /></li> |
|
|
|
<li><FormattedMessage id="store" /></li> |
|
|
|
<li><FormattedMessage id="post" /></li> |
|
|
|
</ul> |
|
|
|
<FormattedMessage id="payDn" /> |
|
|
|
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "payDn" })) |
|
|
|
setWarningText( |
|
|
|
<><FormattedMessage id="paymentMethodMeans" /> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="atm" /></li> |
|
|
|
<li><FormattedMessage id="pps" /></li> |
|
|
|
<li><FormattedMessage id="eBank" /></li> |
|
|
|
<li><FormattedMessage id="phoneBank" /></li> |
|
|
|
<li><FormattedMessage id="eCheque" /></li> |
|
|
|
<li><FormattedMessage id="fps" /></li> |
|
|
|
<li><FormattedMessage id="hkpo" /></li> |
|
|
|
<li><FormattedMessage id="store" /></li> |
|
|
|
<li><FormattedMessage id="post" /></li> |
|
|
|
</ul> |
|
|
|
</> |
|
|
|
); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}}><FormattedMessage id="viewDetail" /></a> |
|
|
|
</td> |
|
|
|
|
|
|
|
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} 5:00 p.m.</td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
<FormattedMessage id="payDnRemark" values={{ |
|
|
|
@@ -442,12 +483,20 @@ const FormPanel = ({ formData }) => { |
|
|
|
/> |
|
|
|
} |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}><FormattedMessage id="payNPGO" /></td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="cheque" /></li> |
|
|
|
<li><FormattedMessage id="cash" /></li> |
|
|
|
</ul> |
|
|
|
<FormattedMessage id="payNPGO" /> |
|
|
|
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { |
|
|
|
setWarningTitle(intl.formatMessage({ id: "payDn" })) |
|
|
|
setWarningText( |
|
|
|
<><FormattedMessage id="paymentMethodMeans" /> |
|
|
|
<ul> |
|
|
|
<li><FormattedMessage id="cheque" /></li> |
|
|
|
<li><FormattedMessage id="cash" /></li> |
|
|
|
</ul> |
|
|
|
</> |
|
|
|
); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}}><FormattedMessage id="viewDetail" /></a> |
|
|
|
</td> |
|
|
|
<td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 12:00 p.m.</td> |
|
|
|
<td style={tabelStyle}> |
|
|
|
@@ -589,7 +638,7 @@ const FormPanel = ({ formData }) => { |
|
|
|
}} |
|
|
|
> |
|
|
|
<DialogTitle> |
|
|
|
<FormattedMessage id="attention" /> |
|
|
|
{warningTitle} |
|
|
|
</DialogTitle> |
|
|
|
<DialogContent style={{ display: 'flex', }}> |
|
|
|
<Typography variant="h3" style={{ padding: '16px' }}>{warningText}</Typography> |
|
|
|
|