|
|
|
@@ -9,11 +9,13 @@ import { |
|
|
|
TableRow, |
|
|
|
Typography, |
|
|
|
} from "@mui/material"; |
|
|
|
import { PaymentPlan, getPaymentPlans } from "api/season-ticket-contract"; |
|
|
|
import { useSeasonTicketContractContext } from "contexts/dashboard/SeasonTicketContractContext"; |
|
|
|
import useAPICall from "hooks/useAPICall"; |
|
|
|
import useDashboard from "hooks/useDashBoard"; |
|
|
|
import useNavigateCustom from "hooks/useNavigateCustom"; |
|
|
|
import { PageID, TabID } from "pages"; |
|
|
|
import { useEffect } from "react"; |
|
|
|
import { useEffect, useState } from "react"; |
|
|
|
import { useParams } from "react-router-dom"; |
|
|
|
import { getPath } from "routes/path"; |
|
|
|
|
|
|
|
@@ -34,6 +36,18 @@ export default function ContractDetail() { |
|
|
|
|
|
|
|
const { navigate, navigateWhenChanged } = useNavigateCustom(); |
|
|
|
|
|
|
|
const [paymentPlans, setPaymentPlans] = useState<PaymentPlan[]>([]); |
|
|
|
|
|
|
|
const { callAPI: callGetPaymentPlans } = useAPICall({ |
|
|
|
apiMethod: getPaymentPlans, |
|
|
|
backDrop: true, |
|
|
|
onSuccess: ({ data }) => {}, |
|
|
|
onFailed: () => { |
|
|
|
select(null); |
|
|
|
moveToList(); |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
const moveToList = () => { |
|
|
|
navigateWhenChanged(getPath(PageID.DASHBOARD_SEASON_TICKET_CONTRACT_LIST)); |
|
|
|
}; |
|
|
|
@@ -50,6 +64,11 @@ export default function ContractDetail() { |
|
|
|
}); |
|
|
|
if (target) { |
|
|
|
select(target); |
|
|
|
|
|
|
|
callGetPaymentPlans({ |
|
|
|
season_ticket_contract_record_no: |
|
|
|
target.season_ticekt_contract_record_no ?? "", |
|
|
|
}); |
|
|
|
} else { |
|
|
|
select(null); |
|
|
|
moveToList(); |
|
|
|
@@ -92,21 +111,22 @@ export default function ContractDetail() { |
|
|
|
<Typography variant="h5">お支払い状況</Typography> |
|
|
|
<Table> |
|
|
|
<TableBody> |
|
|
|
<TableRow> |
|
|
|
<TableCell>2023/09</TableCell> |
|
|
|
<TableCell>未請求</TableCell> |
|
|
|
</TableRow> |
|
|
|
<TableRow> |
|
|
|
<TableCell>2023/08</TableCell> |
|
|
|
<TableCell>支払済み</TableCell> |
|
|
|
</TableRow> |
|
|
|
<TableRow> |
|
|
|
<TableCell>2023/07</TableCell> |
|
|
|
<TableCell>支払済み</TableCell> |
|
|
|
</TableRow> |
|
|
|
{paymentPlans.map((ele, index) => { |
|
|
|
return ( |
|
|
|
<TableRow key={index}> |
|
|
|
<TableCell>{ele.payment_plan_date}</TableCell> |
|
|
|
<TableCell>{ele.payment_method}</TableCell> |
|
|
|
<TableCell>{ele.payment_status}</TableCell> |
|
|
|
</TableRow> |
|
|
|
); |
|
|
|
})} |
|
|
|
{paymentPlans.length === 0 && ( |
|
|
|
<TableRow> |
|
|
|
<TableCell>データなし</TableCell> |
|
|
|
</TableRow> |
|
|
|
)} |
|
|
|
</TableBody> |
|
|
|
</Table> |
|
|
|
<Button>更に表示</Button> |
|
|
|
</Paper> |
|
|
|
<Paper sx={{ p: 2 }}> |
|
|
|
<Typography variant="h5">各種申請</Typography> |
|
|
|
|