mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[mastertask] ukoncovanie, [teams overview] spravne zobrazovanie kapacit jednotlivych zamestnancov
This commit is contained in:
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>
|
||||
@@ -70,7 +70,7 @@
|
||||
<A-mastertask-description :mastertask="mastertask" />
|
||||
|
||||
<div class="d-flex justify-start align-center mt-8">
|
||||
<v-btn class="button primary" @click="toggleIsFinished()">{{ mastertask.is_finished ? 'Otvoriť mastertask' : 'Ukončiť mastertask' }}</v-btn>
|
||||
<v-btn class="button primary" @click="toggleIsFinished(mastertask)">{{ mastertask.is_finished ? 'Otvoriť mastertask' : 'Ukončiť mastertask' }}</v-btn>
|
||||
</div>
|
||||
|
||||
<A-tasks-table :subtasks="mastertask.subtasks" />
|
||||
@@ -264,17 +264,8 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async toggleIsFinished() {
|
||||
this.mastertask.is_finished = this.mastertask.is_finished == 0 ? 1 : 0
|
||||
this.save()
|
||||
// try {
|
||||
// const toggleMastertask = { ...this.mastertask, is_finished: this.mastertask.is_finished ? 0 : 1, duration: this.mastertask.duration }
|
||||
// const { mastertask } = await this.$axios.put_auth(`v1/mastertasks/${toggleMastertask.id}`, toggleMastertask)
|
||||
|
||||
// this.$emit('on-mastertask-edited', mastertask)
|
||||
// } catch (error) {
|
||||
// this.$toast.error(error)
|
||||
// }
|
||||
async toggleIsFinished(mastertask) {
|
||||
this.$events.emit('show-complete-master-task-modal', { mastertask })
|
||||
},
|
||||
|
||||
async save() {
|
||||
|
||||
Reference in new issue
Block a user