Quellcode durchsuchen

dn revoke paid

CR003
Anna Ho vor 1 Jahr
Ursprung
Commit
c2e1d3a305
3 geänderte Dateien mit 85 neuen und 6 gelöschten Zeilen
  1. +66
    -4
      src/pages/DemandNote/Search/DataGrid.js
  2. +18
    -2
      src/pages/Proof/Payment/Pay_Office.js
  3. +1
    -0
      src/utils/ApiPathConst.js

+ 66
- 4
src/pages/DemandNote/Search/DataGrid.js Datei anzeigen

@@ -19,7 +19,8 @@ import {
DEMAND_NOTE_SEND,
DEMAND_NOTE_ATTACH,
DEMAND_NOTE_MARK_PAID,
DEMAND_NOTE_LIST_ALL
DEMAND_NOTE_LIST_ALL,
DEMAND_NOTE_REVOKE_PAID
} from "utils/ApiPathConst";
import * as HttpUtils from "utils/HttpUtils";
import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
@@ -30,6 +31,7 @@ import { isGrantedAny } from "auth/utils";
export default function SearchDemandNote({ searchCriteria, applySearch }) {

const [isConfirmPopUp, setConfirmPopUp] = useState(false);
const [isRevokePopUp, setRevokePopUp] = useState(false);
const [isSendPopUp, setSendPopUp] = useState(false);
const [isErrorPopUp, setIsErrorPopUp] = useState(false);
const [selectonWarning, setSelectonWarning] = useState(false);
@@ -109,7 +111,8 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) {
dnIdList: idList
},
onSuccess: () => {
if (reloadFun) reloadFun();
searchCriteria.reload = new Date();
set_searchCriteria(searchCriteria);
}
});

@@ -134,12 +137,38 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) {
files: [file],
onSuccess() {
setWait(false);
if (reloadFun) reloadFun();
searchCriteria.reload = new Date();
set_searchCriteria(searchCriteria);
},
});
document.getElementById("uploadFileBtn").value = "";
}

const revokePaid = () => {
setRevokePopUp(false);
let idList = [];
const datas = rows?.filter((row) =>
selectedRowItems.includes(row.id)
);
if (datas?.length < 1) {
setSelectonWarning(true);
return;
}
for (var i = 0; i < datas?.length; i++) {
idList.push(datas[i].id);
}
HttpUtils.post({
url: DEMAND_NOTE_REVOKE_PAID,
params: {
dnIdList: idList
},
onSuccess: () => {
searchCriteria.reload = new Date();
set_searchCriteria(searchCriteria);
}
});
}

const markPaid = () => {
setConfirmPopUp(false);
let idList = [];
@@ -159,7 +188,8 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) {
dnIdList: idList
},
onSuccess: () => {
if (reloadFun) reloadFun();
searchCriteria.reload = new Date();
set_searchCriteria(searchCriteria);
}
});
}
@@ -334,6 +364,16 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) {
Mark as Paid
</Button>
</Grid>

<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}>
<Button
variant="contained"
onClick={() => setRevokePopUp(true)}
>
Revoke as To be Paid
</Button>
</Grid>

</ThemeProvider>
</Grid>
: <></>
@@ -422,6 +462,28 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) {
</DialogActions>
</Dialog>
</div>
<div>
<Dialog
open={isRevokePopUp}
onClose={() => setRevokePopUp(false)}
PaperProps={{
sx: {
minWidth: '40vw',
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
}
}}
>
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure to revoke DN as To Be Paid?</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setRevokePopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
<Button onClick={() => revokePaid()}><Typography variant="h5">Confirm</Typography></Button>
</DialogActions>
</Dialog>
</div>
<div>
<Dialog
open={isSendPopUp}


+ 18
- 2
src/pages/Proof/Payment/Pay_Office.js Datei anzeigen

@@ -68,11 +68,27 @@ const Index = ({ record }) => {
},
)
}} />
<br />
<br />
<div dangerouslySetInnerHTML={{
__html: intl.formatMessage(
{
id: 'proofPaymentBody_office3'
}
)
}} />
<br />
<div dangerouslySetInnerHTML={{
__html: intl.formatMessage(
{
id: 'proofPaymentBody_office4'
}
)
}} />
<br />
<div dangerouslySetInnerHTML={{
__html: intl.formatMessage(
{
id: 'proofPaymentBody_office5'
},
{
paymentDeadline: DateUtils.dateStr(record?.closingDate),
@@ -83,7 +99,7 @@ const Index = ({ record }) => {
<div dangerouslySetInnerHTML={{
__html: intl.formatMessage(
{
id: 'proofPaymentBody_office4'
id: 'proofPaymentBody_office6'
}
)
}} />


+ 1
- 0
src/utils/ApiPathConst.js Datei anzeigen

@@ -185,6 +185,7 @@ export const DEMAND_NOTE_LIST_ALL = apiPath+'/demandNote/listAll';//GET gld
export const DEMAND_NOTE_LOAD = apiPath+'/demandNote/load';//GET
export const DEMAND_NOTE_SEND = apiPath+'/demandNote/send-dn';//POST
export const DEMAND_NOTE_MARK_PAID = apiPath+'/demandNote/mark-as-paid';//POST
export const DEMAND_NOTE_REVOKE_PAID = apiPath+'/demandNote/revoke-paid';//POST
export const DEMAND_NOTE_ATTACH = apiPath+'/demandNote/attach';//POST
export const DEMAND_NOTE_EXPORT = apiPath+'/demandNote/export';//POST



Laden…
Abbrechen
Speichern