|
@@ -19,7 +19,8 @@ import { |
|
|
DEMAND_NOTE_SEND, |
|
|
DEMAND_NOTE_SEND, |
|
|
DEMAND_NOTE_ATTACH, |
|
|
DEMAND_NOTE_ATTACH, |
|
|
DEMAND_NOTE_MARK_PAID, |
|
|
DEMAND_NOTE_MARK_PAID, |
|
|
DEMAND_NOTE_LIST_ALL |
|
|
|
|
|
|
|
|
DEMAND_NOTE_LIST_ALL, |
|
|
|
|
|
DEMAND_NOTE_REVOKE_PAID |
|
|
} from "utils/ApiPathConst"; |
|
|
} from "utils/ApiPathConst"; |
|
|
import * as HttpUtils from "utils/HttpUtils"; |
|
|
import * as HttpUtils from "utils/HttpUtils"; |
|
|
import { PNSPS_BUTTON_THEME } from "themes/buttonConst"; |
|
|
import { PNSPS_BUTTON_THEME } from "themes/buttonConst"; |
|
@@ -30,6 +31,7 @@ import { isGrantedAny } from "auth/utils"; |
|
|
export default function SearchDemandNote({ searchCriteria, applySearch }) { |
|
|
export default function SearchDemandNote({ searchCriteria, applySearch }) { |
|
|
|
|
|
|
|
|
const [isConfirmPopUp, setConfirmPopUp] = useState(false); |
|
|
const [isConfirmPopUp, setConfirmPopUp] = useState(false); |
|
|
|
|
|
const [isRevokePopUp, setRevokePopUp] = useState(false); |
|
|
const [isSendPopUp, setSendPopUp] = useState(false); |
|
|
const [isSendPopUp, setSendPopUp] = useState(false); |
|
|
const [isErrorPopUp, setIsErrorPopUp] = useState(false); |
|
|
const [isErrorPopUp, setIsErrorPopUp] = useState(false); |
|
|
const [selectonWarning, setSelectonWarning] = useState(false); |
|
|
const [selectonWarning, setSelectonWarning] = useState(false); |
|
@@ -109,7 +111,8 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) { |
|
|
dnIdList: idList |
|
|
dnIdList: idList |
|
|
}, |
|
|
}, |
|
|
onSuccess: () => { |
|
|
onSuccess: () => { |
|
|
if (reloadFun) reloadFun(); |
|
|
|
|
|
|
|
|
searchCriteria.reload = new Date(); |
|
|
|
|
|
set_searchCriteria(searchCriteria); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@@ -134,12 +137,38 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) { |
|
|
files: [file], |
|
|
files: [file], |
|
|
onSuccess() { |
|
|
onSuccess() { |
|
|
setWait(false); |
|
|
setWait(false); |
|
|
if (reloadFun) reloadFun(); |
|
|
|
|
|
|
|
|
searchCriteria.reload = new Date(); |
|
|
|
|
|
set_searchCriteria(searchCriteria); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
document.getElementById("uploadFileBtn").value = ""; |
|
|
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 = () => { |
|
|
const markPaid = () => { |
|
|
setConfirmPopUp(false); |
|
|
setConfirmPopUp(false); |
|
|
let idList = []; |
|
|
let idList = []; |
|
@@ -159,7 +188,8 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) { |
|
|
dnIdList: idList |
|
|
dnIdList: idList |
|
|
}, |
|
|
}, |
|
|
onSuccess: () => { |
|
|
onSuccess: () => { |
|
|
if (reloadFun) reloadFun(); |
|
|
|
|
|
|
|
|
searchCriteria.reload = new Date(); |
|
|
|
|
|
set_searchCriteria(searchCriteria); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@@ -334,6 +364,16 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) { |
|
|
Mark as Paid |
|
|
Mark as Paid |
|
|
</Button> |
|
|
</Button> |
|
|
</Grid> |
|
|
</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> |
|
|
</ThemeProvider> |
|
|
</Grid> |
|
|
</Grid> |
|
|
: <></> |
|
|
: <></> |
|
@@ -422,6 +462,28 @@ export default function SearchDemandNote({ searchCriteria, applySearch }) { |
|
|
</DialogActions> |
|
|
</DialogActions> |
|
|
</Dialog> |
|
|
</Dialog> |
|
|
</div> |
|
|
</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> |
|
|
<div> |
|
|
<Dialog |
|
|
<Dialog |
|
|
open={isSendPopUp} |
|
|
open={isSendPopUp} |
|
|