[mastertask] ukoncovanie, [teams overview] spravne zobrazovanie kapacit jednotlivych zamestnancov

This commit is contained in:
romankko2 committed 2023-08-20 20:40:04 +02:00
1 parent 04d91c93ff
commit 721b29a3ef
5 files changed
+67 -16

No files matched your search

@@ -0,0 +1,53 @@
<template>
<v-dialog v-model="visible" max-width="750" persistent>
<v-card>
<div class="d-flex justify-space-between align-center">
<h1>Ste si istý, že chcete {{ mastertask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} <b>{{ mastertask?.name }}</b>?</h1>
<v-icon
@click.stop="visible = false"
icon="mdi-close"
size="large"
></v-icon>
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
<v-btn class="button primary half" variant="flat" @click="complete()">ÁNO</v-btn>
<v-btn class="button primary half outline" @click.stop="visible = false">ZRUŠIŤ</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
export default {
mixins: [ modalMixin ],
emits: ['close', 'on-master-task-edited'],
data() {
return {
visible: false,
mastertask: null
}
},
methods: {
async showModal({ mastertask }) {
this.mastertask = mastertask
this.visible = true
},
async complete() {
try {
const tempMastertask = {...this.mastertask, is_finished: this.mastertask.is_finished ? 0 : 1, duration: this.mastertask.duration }
const { mastertask } = await this.$axios.put_auth(`v1/mastertasks/${tempMastertask.id}`, tempMastertask)
this.visible = false
this.$emit('on-master-task-edited', mastertask)
} catch (error) {
this.$toast.error(error)
}
}
}
}
</script>