New order button
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vite App</title>
|
||||
<title>Mleczarnia Kuzma</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -2,10 +2,18 @@
|
||||
import { ref } from 'vue'
|
||||
import { useSiteControlStore } from '@/stores/siteControl.store'
|
||||
import { router } from '@/router/router'
|
||||
import { useOrdersStore } from '@/stores/orders.store'
|
||||
import { useContractorsStore } from '@/stores/contractors.store'
|
||||
import { useCategoriesStore } from '@/stores/categories.store'
|
||||
import { storeToRefs } from 'pinia'
|
||||
|
||||
const activator = ref(false);
|
||||
|
||||
const siteControlStore = useSiteControlStore();
|
||||
const ordersStore = useOrdersStore();
|
||||
const contractorsStore = useContractorsStore();
|
||||
const categoriesStore = useCategoriesStore();
|
||||
|
||||
|
||||
function makeBurger() {
|
||||
activator.value = !activator.value
|
||||
@@ -29,6 +37,19 @@ function clickOrders() {
|
||||
function routeLogin() {
|
||||
router.push("/login");
|
||||
}
|
||||
|
||||
function newOrder() {
|
||||
const {order, uuid, deliveryDate, orderDate } = storeToRefs(ordersStore);
|
||||
const { contractor } = storeToRefs(contractorsStore);
|
||||
contractor.value = undefined;
|
||||
order.value = undefined;
|
||||
uuid.value = undefined;
|
||||
deliveryDate.value = undefined;
|
||||
orderDate.value = undefined;
|
||||
categoriesStore.fetchCategories();
|
||||
siteControlStore.switchToFrom();
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -59,6 +80,9 @@ function routeLogin() {
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-item">
|
||||
<div class="buttons">
|
||||
<button class="button is-info" @click="newOrder">
|
||||
Nowe Zamówienie
|
||||
</button>
|
||||
<button class="button is-light" @click="routeLogin">
|
||||
Log in
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user