mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
fixy
This commit is contained in:
1 parent
1024f73ab5
commit
4e8fa39e34
8 files changed
+79
-13
No files matched your search
@@ -9,9 +9,14 @@
|
||||
</p>
|
||||
<p class="ml-2">{{ task._employeeFullName }}</p>
|
||||
</td>
|
||||
<td>
|
||||
<p class="text-light-green" v-if="task.is_finished">Ukončený</p>
|
||||
<p v-if="!task.is_finished">Neukončený</p>
|
||||
</td>
|
||||
<td class="task-action">
|
||||
<div class="d-flex justify-start">
|
||||
<img class="pencil-icon" :src="require('@/plugins/tm@dashboard/_components/_img/checkmark.svg')" alt="checkmark-icon" :style="{opacity: 0.3}">
|
||||
<img v-if="task.is_finished" class="pencil-icon is-finished" :src="require('@/plugins/tm@dashboard/_components/_img/checkmark.svg')" alt="checkmark-icon" @click.stop="clickCompleteTask(task)">
|
||||
<img v-if="!task.is_finished" class="pencil-icon" :src="require('@/plugins/tm@dashboard/_components/_img/checkmark.svg')" alt="checkmark-icon" @click.stop="clickCompleteTask(task)">
|
||||
<img class="pencil-icon ml-2" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon" @click.stop="openEditTaskModal(task)">
|
||||
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" @click.stop="openDeleteTaskModal(task)">
|
||||
</div>
|
||||
@@ -56,6 +61,24 @@ export default {
|
||||
|
||||
openEditTaskModal(task) {
|
||||
this.$events.emit('show-task-modal', { task, editMode: false })
|
||||
},
|
||||
|
||||
async clickCompleteTask(task) {
|
||||
if (!task.is_finished) {
|
||||
this.openCompleteTaskModal(task)
|
||||
} else {
|
||||
task.is_finished = !task.is_finished
|
||||
try {
|
||||
await this.$axios.patch_auth(`v1/subtasks/${task.id}`, task)
|
||||
this.$emit('reopenTask', task)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
openCompleteTaskModal(task) {
|
||||
this.$events.emit('show-complete-task-modal', { task })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user