|
|
@@ -6,19 +6,20 @@ import { |
|
|
|
Button, |
|
|
|
Dialog, DialogTitle, DialogContent, DialogActions |
|
|
|
} from '@mui/material'; |
|
|
|
import {FiDataGrid} from "components/FiDataGrid"; |
|
|
|
import { FiDataGrid } from "components/FiDataGrid"; |
|
|
|
import * as DateUtils from "utils/DateUtils" |
|
|
|
import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils"; |
|
|
|
import {useNavigate} from "react-router-dom"; |
|
|
|
import { useNavigate } from "react-router-dom"; |
|
|
|
// ==============================|| EVENT TABLE ||============================== // |
|
|
|
|
|
|
|
export default function SubmittedTab({ rows }) { |
|
|
|
const [selectedRowItems, setSelectedRowItems] = React.useState([]); |
|
|
|
const [isPopUp, setIsPopUp] = React.useState(false); |
|
|
|
//const [amount, setAmount] = React.useState(0); |
|
|
|
const navigate = useNavigate() |
|
|
|
|
|
|
|
const handleDetailClick = (params) => () => { |
|
|
|
navigate('/publicNotice/'+ params.id); |
|
|
|
navigate('/publicNotice/' + params.id); |
|
|
|
}; |
|
|
|
|
|
|
|
const columns = [ |
|
|
@@ -93,6 +94,7 @@ export default function SubmittedTab({ rows }) { |
|
|
|
|
|
|
|
const getWindowContent = () => { |
|
|
|
var content = []; |
|
|
|
let totalAmount = 0; |
|
|
|
const datas = rows?.filter((row) => |
|
|
|
selectedRowItems.includes(row.id) |
|
|
|
); |
|
|
@@ -102,12 +104,30 @@ export default function SubmittedTab({ rows }) { |
|
|
|
備註: {datas[i].remarks} |
|
|
|
<br /><br /> |
|
|
|
</>); |
|
|
|
|
|
|
|
totalAmount += datas[i].fee; |
|
|
|
} |
|
|
|
content.push(<> |
|
|
|
總計金額: {totalAmount} <br /><br /> |
|
|
|
</>); |
|
|
|
//setAmount(totalAmount); |
|
|
|
return content; |
|
|
|
} |
|
|
|
|
|
|
|
function handleRowDoubleClick(params) { |
|
|
|
navigate('/publicNotice/'+ params.id); |
|
|
|
navigate('/publicNotice/' + params.id); |
|
|
|
} |
|
|
|
|
|
|
|
function doPayment() { |
|
|
|
setIsPopUp(false); |
|
|
|
let totalAmount = 0; |
|
|
|
const datas = rows?.filter((row) => |
|
|
|
selectedRowItems.includes(row.id) |
|
|
|
); |
|
|
|
for (var i = 0; i < datas?.length; i++) { |
|
|
|
totalAmount += datas[i].fee; |
|
|
|
} |
|
|
|
navigate('/payment', { state: { amount: totalAmount } }); |
|
|
|
} |
|
|
|
|
|
|
|
return ( |
|
|
@@ -142,7 +162,7 @@ export default function SubmittedTab({ rows }) { |
|
|
|
</DialogContent> |
|
|
|
<DialogActions> |
|
|
|
<Button onClick={() => setIsPopUp(false)}>Close</Button> |
|
|
|
<Button onClick={() => setIsPopUp(false)}>確認</Button> |
|
|
|
<Button onClick={() => doPayment()}>確認</Button> |
|
|
|
</DialogActions> |
|
|
|
</Dialog> |
|
|
|
</div> |
|
|
|