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