Commit cd02b769 authored by vinh's avatar vinh

commit

parent 56c9fcbb
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</router-link> </router-link>
</div> </div>
<div class="logout" @click="logout"> <div class="logout" @click="logout">
<i class="bi bi-box-arrow-right icon"> Logout</i> <i class="bi bi-box-arrow-right icon"> </i>Logout
</div> </div>
</div> </div>
</template> </template>
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
} }
.icon { .icon {
color: rgb(150, 150, 150); color: rgb(74, 74, 74);
font-size: 25px; font-size: 25px;
} }
...@@ -152,4 +152,18 @@ export default { ...@@ -152,4 +152,18 @@ export default {
background-color: rgb(247, 108, 105); background-color: rgb(247, 108, 105);
color: #fff; color: #fff;
} }
@media (max-width:425px) {
.logout {
cursor: pointer;
padding-left: 20px;
font-size: 15px;
display: flex;
gap: 15px;
padding: 15px;
min-height: 100px;
align-items: center;
background-color: rgb(247, 108, 105);
}
}
</style> </style>
...@@ -108,20 +108,19 @@ export default defineComponent({ ...@@ -108,20 +108,19 @@ export default defineComponent({
const viewDetail = async (checkinId, bookingId) => { const viewDetail = async (checkinId, bookingId) => {
try { try {
console.log(checkinId, bookingId)
const response = await axios.post('checkin/checkin-detail', { const response = await axios.post('checkin/checkin-detail', {
checkinId: checkinId, checkinId: checkinId,
bookingId: bookingId bookingId: bookingId
}) })
CheckinDetail.value = { CheckinDetail.value = {
'Guest name': response.data.guest_name, 'Guest name': response.data[0].guest_name,
'Guest number': response.data.guest_number, 'Guest number': response.data[0].guest_number,
'Booked time': response.data.created_at, 'Booked time': response.data[0].created_at,
'Employee id': response.data.id, 'Employee id': response.data[1].id,
'Employee name': response.data.name, 'Employee name': response.data[1].name,
'Employee role': response.data.role, 'Employee role': response.data[1].role,
} }
console.log(CheckinDetail.value) console.log(response.data[1])
document.getElementById('detail-modal').style.display = 'block' document.getElementById('detail-modal').style.display = 'block'
} catch (error) { } catch (error) {
console.error(error.response.data) console.error(error.response.data)
...@@ -155,9 +154,21 @@ export default defineComponent({ ...@@ -155,9 +154,21 @@ export default defineComponent({
} }
const exportData = async () => { const exportData = async () => {
try { try {
const response = await axios.get('checkin/export') axios({
console.log(response.data) method: 'GET',
url: 'checkin/export',
responseType: 'blob',
}).then(response => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'data.csv'); // Specify the filename
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
} catch (error) { } catch (error) {
console.error(error.response.data) console.error(error.response.data)
} }
......
...@@ -188,11 +188,11 @@ export default defineComponent({ ...@@ -188,11 +188,11 @@ export default defineComponent({
async mounted() { async mounted() {
this.loaded = false this.loaded = false
try { try {
const bookingThisYear = await axios.get('booking-this-year') const bookingThisYear = await axios.get('dashboard/booking-this-year')
this.LineChartData.datasets[0].data = bookingThisYear.data this.LineChartData.datasets[0].data = bookingThisYear.data
const interestThisYear = await axios.get('interest-this-year') const interestThisYear = await axios.get('dashboard/interest-this-year')
this.BarChartData.datasets[0].data = interestThisYear.data this.BarChartData.datasets[0].data = interestThisYear.data
const IncomeAndSalary = await axios.get('income-this-month') const IncomeAndSalary = await axios.get('dashboard/income-this-month')
this.PieChartData.datasets[0].data = IncomeAndSalary.data this.PieChartData.datasets[0].data = IncomeAndSalary.data
this.loaded = true this.loaded = true
} catch (e) { } catch (e) {
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
const modifyRoom = (id) => { const modifyRoom = (id) => {
//router push to modify room //router push to modify room
router.push('/modify/' + id) router.push('room/modify/' + id)
} }
const handleFileUpload = (event) => { const handleFileUpload = (event) => {
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
} }
const viewRoomDetail = async (id) => { const viewRoomDetail = async (id) => {
let response = await axios.post('room-detail', { let response = await axios.post('room/room-detail', {
id: id id: id
}) })
roomInfo.value = { roomInfo.value = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment