Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]購入報告ページの鉄名修正 #655

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions view/next-project/src/pages/purchasereports/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ export default function PurchaseReports(props: Props) {
const [selectedYear, setSelectedYear] = useState<string>(currentYear);

const filteredPurchaseReportViews = useMemo(() => {
return purchaseReportViews.filter((purchaseReportViewItem) => {
return purchaseReportViewItem.purchaseOrder.createdAt?.includes(selectedYear);
});
if (purchaseReportViews.length > 0) {
return purchaseReportViews.filter((purchaseReportViewItem: PurchaseReportView) => {
return purchaseReportViewItem.purchaseOrder.createdAt?.includes(selectedYear);
});
} else {
return [];
}
}, [purchaseReportViews, selectedYear]);

const TotalFee = useCallback((purchaseReport: PurchaseReport, purchaseItems: PurchaseItem[]) => {
Expand Down Expand Up @@ -213,34 +217,34 @@ export default function PurchaseReports(props: Props) {
<table className='mb-5 w-max table-auto border-collapse md:w-full md:table-fixed'>
<thead>
<tr className='border border-x-white-0 border-b-primary-1 border-t-white-0 py-3'>
<th className='w-fit pb-2'>
<div className='text-center text-sm text-black-600'>財務局長チェック</div>
<th className='w-1/20 pb-2'>
<div className='text-center text-sm text-black-600'></div>
</th>
<th className='w-1/12 pb-2'>
<th className='w-2/20 pb-2'>
<div className='text-center text-sm text-black-600'>ID</div>
</th>
<th className='w-1/12 border-b-primary-1 pb-2'>
<th className='w-2/20 border-b-primary-1 pb-2'>
<div className='text-center text-sm text-black-600'>購入した局</div>
</th>
<th className='w-1/12 border-b-primary-1 pb-2'>
<th className='w-2/20 border-b-primary-1 pb-2'>
<div className='text-center text-sm text-black-600'>報告日</div>
</th>
<th className='w-1/12 border-b-primary-1 pb-2'>
<th className='w-2/20 border-b-primary-1 pb-2'>
<div className='text-center text-sm text-black-600'>期限日</div>
</th>
<th className='w-2/12 border-b-primary-1 pb-2'>
<th className='w-3/20 border-b-primary-1 pb-2'>
<div className='text-center text-sm text-black-600'>購入物品 (個数)</div>
</th>
<th className='w-1/12 border-b-primary-1 pb-2'>
<th className='w-2/20 border-b-primary-1 pb-2'>
<div className='text-center text-sm text-black-600'>合計金額</div>
</th>
<th className='w-1/12 border-b-primary-1 pb-2'>
<th className='w-2/20 border-b-primary-1 pb-2'>
<div className='text-center text-sm text-black-600'>備考</div>
</th>
<th className='w-1/12 border-b-primary-1 pb-2'>
<th className='w-2/20 border-b-primary-1 pb-2'>
<div className='text-center text-sm text-black-600'>購入者</div>
</th>
<th className='w-1/12 border-b-primary-1 pb-2'></th>
<th className='w-2/20 border-b-primary-1 pb-2'></th>
</tr>
</thead>
<tbody className='border border-x-white-0 border-b-primary-1 border-t-white-0'>
Expand Down