PSTW_CentralizeSystem/Areas/MMS/Views/Marine/TarBallForm.cshtml
2025-04-09 16:36:48 +08:00

140 lines
4.7 KiB
Plaintext

@{
ViewData["Title"] = "Tarball Report";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<title>Tarball Report</title>
<style>
.container {
width: 1200px; /* Approximate width for A4 aspect ratio */
margin: 20px auto;
padding: 20px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
div {
padding-top: 10px;
padding-bottom: 10px;
}
h4 {
padding-top: 15px;
padding-bottom: 5px;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #ccc;
padding: 10px;
}
.tbhead {
text-align: center;
}
</style>
</head>
<body>
<div id="app" class="container">
<div>
<h4>Month</h4>
<select v-model="selectedMonth" style="width: 100%; padding: 5px;">
<option value="default" selected disabled>Filter by Month</option>
<option v-for="month in months" :value="month">{{ month }}</option>
</select>
<h4>Year</h4>
<select v-model="selectedYear" style="width: 100%; padding: 5px;">
<option value="default" selected disabled>Filter by Year</option>
<option v-for="year in years" :value="year">{{ year }}</option>
</select>
</div>
<div class="datatable">
<table>
<thead>
<tr>
<th>No.</th>
<th>Date</th>
<th>Station</th>
<th>Approval Status</th>
<th>PDF</th>
</tr>
</thead>
<tbody>
<tr v-for="data in numberedData" :key="data.no">
<td>{{ data.no }}</td>
<td>{{ data.date }}</td>
<td>{{ data.station }}</td>
<td>
<button class="btn btn-success">Approve</button>
<button class="btn btn-danger">Reject</button>
</td>
<td>
<a href="/MMS/Marine/ViewPDF" class="btn btn-primary" target="_blank">View PDF</a>
<a href="/MMS/Marine/GenerateReport" class="btn btn-primary">Download PDF</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
@section Scripts{
<script>
new Vue({
el: '#app',
data: {
selectedMonth: '',
selectedYear: '',
months: [
'January', 'February', 'March', 'April', 'May',
'June', 'July', 'August', 'September',
'October', 'November', 'December'
],
mockData: [
{ date: '2023-01-15', station: 'Station A' },
{ date: '2024-02-20', station: 'Station B' },
{ date: '2023-03-10', station: 'Station C' },
{ date: '2025-04-05', station: 'Station A' },
{ date: '2023-05-18', station: 'Station B' },
{ date: '2024-06-11', station: 'Station C' },
{ date: '2025-07-23', station: 'Station A' },
{ date: '2023-08-09', station: 'Station B' },
{ date: '2024-09-25', station: 'Station C' },
{ date: '2025-10-14', station: 'Station A' }
]
},
computed: {
years() {
const allYears = this.mockData.map(data => new Date(data.date).getFullYear());
const minYear = Math.min(...allYears);
const maxYear = Math.max(...allYears);
return Array.from({ length: maxYear - minYear + 1 }, (_, i) => (minYear + i).toString());
},
//increment for 'no.' column
numberedData() {
return this.mockData.map((data, index) => ({
no: index + 1,
...data
}));
}
}
});
</script>
}