Update Hospital Portal
This commit is contained in:
@@ -252,7 +252,6 @@ const allowedStatusesForCSLMS = ['waiting_pharmacy', 'order_prepared', 'ready',
|
|||||||
|
|
||||||
const [openDialogStatus, setOpenDialogStatus] = useState(false);
|
const [openDialogStatus, setOpenDialogStatus] = useState(false);
|
||||||
// const [dialogIDRow, setDialogIDRow] = useState<number | null>(null);
|
// const [dialogIDRow, setDialogIDRow] = useState<number | null>(null);
|
||||||
console.log(dialogIDRow);
|
|
||||||
const [dialogIDRowDriver, setDialogIDRowDriver] = useState<number | null>(null);
|
const [dialogIDRowDriver, setDialogIDRowDriver] = useState<number | null>(null);
|
||||||
const [txtStatusDriver, setTxtStatusDriver] = useState('');
|
const [txtStatusDriver, setTxtStatusDriver] = useState('');
|
||||||
const [txtIDDriver, setTxtIDDriver] = useState('');
|
const [txtIDDriver, setTxtIDDriver] = useState('');
|
||||||
@@ -272,7 +271,7 @@ console.log(dialogIDRow);
|
|||||||
const handleClickKonfirmasi = (row: any) => {
|
const handleClickKonfirmasi = (row: any) => {
|
||||||
setTxtStatusDriver('');
|
setTxtStatusDriver('');
|
||||||
setTxtIDDriver('');
|
setTxtIDDriver('');
|
||||||
if(row.sStatus === 'ready' || row.sStatus === 'failed')
|
if(row.sStatus === 'order_prepared' || row.sStatus === 'ready' || row.sStatus === 'failed')
|
||||||
{
|
{
|
||||||
//close
|
//close
|
||||||
setDialogIDRow(row.id === dialogIDRow ? null : row.id);
|
setDialogIDRow(row.id === dialogIDRow ? null : row.id);
|
||||||
@@ -314,6 +313,8 @@ console.log(dialogIDRow);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const putPrescriptionOrders = (row: any) => {
|
const putPrescriptionOrders = (row: any) => {
|
||||||
|
//close
|
||||||
|
setDialogIDRow(row.id === dialogIDRow ? null : row.id);
|
||||||
setIsDisabled(true); // Disable button after clicking
|
setIsDisabled(true); // Disable button after clicking
|
||||||
const updateData = {
|
const updateData = {
|
||||||
sStatus: row.sStatus
|
sStatus: row.sStatus
|
||||||
@@ -322,7 +323,6 @@ console.log(dialogIDRow);
|
|||||||
.put(`/put-prescription-orders/${row.nID_orders}`, updateData)
|
.put(`/put-prescription-orders/${row.nID_orders}`, updateData)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
enqueueSnackbar(response?.data?.meta?.message, { variant: 'success' });
|
enqueueSnackbar(response?.data?.meta?.message, { variant: 'success' });
|
||||||
setDialogIDRow(row.id === dialogIDRow ? null : row.id);
|
|
||||||
setIsDisabled(false); // Re-enable the button after success
|
setIsDisabled(false); // Re-enable the button after success
|
||||||
|
|
||||||
// Call reloadData to refresh the table
|
// Call reloadData to refresh the table
|
||||||
|
|||||||
@@ -392,8 +392,8 @@ export default function TableList() {
|
|||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
style={{ width: 'auto' }}
|
style={{ width: 'auto', padding: '0px 4px'}}
|
||||||
onClick={() => setDialogIDRow(obj.id === dialogIDRow ? null : obj.id)}
|
onClick={() => setDialogIDRow(obj.id)}
|
||||||
>
|
>
|
||||||
{obj.button_accept}
|
{obj.button_accept}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user