瀏覽代碼

fix bug

master
Anna Ho 1 年之前
父節點
當前提交
bbbafe15c4
共有 1 個文件被更改,包括 60 次插入53 次删除
  1. +60
    -53
      src/pages/Proof/Reply_Public/ProofForm.js

+ 60
- 53
src/pages/Proof/Reply_Public/ProofForm.js 查看文件

@@ -26,7 +26,7 @@ import { notifyActionSuccess } from 'utils/CommonFunction';
import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
import { ThemeProvider } from "@emotion/react";
import { FormattedMessage, useIntl } from "react-intl";
import {isDummyLoggedIn} from "utils/Utils"
import { isDummyLoggedIn } from "utils/Utils"

const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable')));
//import * as ProofStatus from "utils/statusUtils/ProofStatus";
@@ -59,7 +59,7 @@ const FormPanel = ({ formData }) => {
React.useEffect(() => {
if (formData) {
setData(formData);
if (isDummyLoggedIn()){
if (isDummyLoggedIn()) {
set_paymentMethod("demandNote")
}
}
@@ -83,7 +83,7 @@ const FormPanel = ({ formData }) => {
setIsWarningPopUp(true);
return;
}
else if ( formData.creditor==false && paymentMethod=="") {
else if (formData.creditor == false && paymentMethod == "") {
setWarningText(intl.formatMessage({ id: 'MSG.plzSelectPaymentMethod' }));
setIsWarningPopUp(true);
return;
@@ -108,12 +108,12 @@ const FormPanel = ({ formData }) => {
files: attachments ? attachments : [],
onSuccess: function (responseData) {
if (responseData.msg) {
setWarningText(intl.formatMessage({ id: responseData.msg}));
setWarningText(intl.formatMessage({ id: responseData.msg }));
setIsWarningPopUp(true);
return;
}
if (responseData.id == params.id) {
notifyActionSuccess(intl.formatMessage({id: "submitted"}))
notifyActionSuccess(intl.formatMessage({ id: "submitted" }))
navigate("/proof/pay/" + params.id);
} else {
navigate("/proof/search");
@@ -292,8 +292,8 @@ const FormPanel = ({ formData }) => {


{
actionValue && formData.creditor==false ?
isDummyLoggedIn()?
actionValue && formData.creditor == false ?
isDummyLoggedIn() ?
<Grid item xs={12} sx={{ mb: 1, }}>
<table style={tabelStyle}>
<tr style={tabelStyle}>
@@ -357,7 +357,7 @@ const FormPanel = ({ formData }) => {
</td>
</tr>
</table>
</Grid>:
</Grid> :
<Grid item xs={12} sx={{ mb: 1, }}>
<table style={tabelStyle}>
<tr style={tabelStyle}>
@@ -453,52 +453,59 @@ const FormPanel = ({ formData }) => {
</Grid>

:
isOverReviseDeadline() ?
<Grid item xs={12} md={12} textAlign="left">
<Typography variant="h5" style={{ color: "red" }}>
<FormattedMessage id="MSG.overReviseDeadline" />
</Typography>
</Grid>
:
<>
<Grid item xs={12} md={12} textAlign="left">
<Typography variant="h5">
<FormattedMessage id="requiredUploadFix" />:
</Typography>
</Grid>

<Grid item xs={12} md={12} textAlign="left">
<input
id="uploadFileBtn"
name="file"
type="file"
accept=".pdf"
style={{ display: 'none' }}
disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)}
onChange={(event) => {
readFile(event)
}}
/>
<label htmlFor="uploadFileBtn">
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Button
color="save"
component="span"
variant="contained"
aria-label={intl.formatMessage({ id: 'upload' })}
actionValue?
<></>
:
<>
{
isOverReviseDeadline() ?
<Grid item xs={12} md={12} textAlign="left">
<Typography variant="h5" style={{ color: "red" }}>
<FormattedMessage id="MSG.overReviseDeadline" />
</Typography>
</Grid>
:
<>
<Grid item xs={12} md={12} textAlign="left">
<Typography variant="h5">
<FormattedMessage id="requiredUploadFix" />:
</Typography>
</Grid>

<Grid item xs={12} md={12} textAlign="left">
<input
id="uploadFileBtn"
name="file"
type="file"
accept=".pdf"
style={{ display: 'none' }}
disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)}
>
<FormattedMessage id="upload" />
</Button>
</ThemeProvider>
</label>
</Grid>


<Grid item xs={12} sm={12} md={12} lg={12} textAlign="left" sx={{ width: '95%', maxWidth: { xs: '70vw', sm: '72vw', md: '75vw', lg: '80vw' } }} >
<UploadFileTable key="uploadTable" recordList={attachments} setRecordList={setAttachments} />
</Grid>
</>
onChange={(event) => {
readFile(event)
}}
/>
<label htmlFor="uploadFileBtn">
<ThemeProvider theme={PNSPS_BUTTON_THEME}>
<Button
color="save"
component="span"
variant="contained"
aria-label={intl.formatMessage({ id: 'upload' })}
disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)}
>
<FormattedMessage id="upload" />
</Button>
</ThemeProvider>
</label>
</Grid>


<Grid item xs={12} sm={12} md={12} lg={12} textAlign="left" sx={{ width: '95%', maxWidth: { xs: '70vw', sm: '72vw', md: '75vw', lg: '80vw' } }} >
<UploadFileTable key="uploadTable" recordList={attachments} setRecordList={setAttachments} />
</Grid>
</>
}
</>
}

<Grid item xs={12} sm={12} md={12} lg={12}>


Loading…
取消
儲存