Ticket good printing

This commit is contained in:
2024-06-25 17:58:18 -04:00
parent 52a02c7595
commit 4def44d82e
15 changed files with 963 additions and 429 deletions

View File

@@ -82,6 +82,11 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-accent">Edit</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">
Print
</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
</td>
</tr>

View File

@@ -82,6 +82,12 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-accent ">Edit</button>
</router-link>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">
Print
</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-accent">Delete</button>
</td>
</tr>

View File

@@ -17,9 +17,9 @@
<div class="flex start pb-10 text-2xl">Todays Deliveries </div>
<div class="flex justify-end pb-5">
<button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
<!-- <button @click.prevent="printtTicketAll" class="btn btn-accent btn-sm">
Print All
</button>
</button> -->
</div>
<div class="overflow-x-auto bg-neutral">
@@ -88,10 +88,11 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">Edit</button>
</router-link>
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent btn-sm">
Print
</button>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">
Print
</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
Delete
</button>
@@ -227,52 +228,52 @@ export default defineComponent({
})
},
printtTicketAll() {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/print_today';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
printTicket(delivery_id: number) {
let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
axios({
method: 'options',
url: path,
headers: authHeader(),
}).then((response: any) => {
if (response.data.ok) {
notify({
title: "Success",
text: "Sent to Printer",
type: "success",
});
this.getPage(this.page)
} else {
notify({
title: "Failure",
text: "error printing",
type: "success",
});
}
})
},
// printtTicketAll() {
// let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/print_today';
// axios({
// method: 'get',
// url: path,
// headers: authHeader(),
// }).then((response: any) => {
// if (response.data.ok) {
// notify({
// title: "Success",
// text: "Sent to Printer",
// type: "success",
// });
// this.getPage(this.page)
// } else {
// notify({
// title: "Failure",
// text: "error printing",
// type: "success",
// });
// }
// })
// },
// printTicket(delivery_id: number) {
// let path = import.meta.env.VITE_PRINT_URL + '/command/printticket/' + delivery_id;
// axios({
// method: 'options',
// url: path,
// headers: authHeader(),
// }).then((response: any) => {
// if (response.data.ok) {
// notify({
// title: "Success",
// text: "Sent to Printer",
// type: "success",
// });
// this.getPage(this.page)
// } else {
// notify({
// title: "Failure",
// text: "error printing",
// type: "success",
// });
// }
// })
// },
},
})
</script>

View File

@@ -88,10 +88,11 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">Edit</button>
</router-link>
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent btn-sm">
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">
Print
</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
Delete
</button>

View File

@@ -86,9 +86,15 @@
<router-link :to="{ name: 'deliveryEdit', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">Edit</button>
</router-link>
<button @click.prevent="printTicket(oil['id'])" class="btn btn-accent btn-sm">Print</button>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">Delete</button>
<router-link :to="{ name: 'Ticket', params: { id: oil['id'] } }">
<button class="btn btn-accent btn-sm">
Print
</button>
</router-link>
<button @click.prevent="deleteCall(oil['id'])" class="btn btn-error btn-sm">
Delete
</button>
</td>
</tr>
</tbody>