[mastertask] complete mastertask

This commit is contained in:
romankko2 committed 2023-09-07 20:38:15 +02:00
1 parent d44f9e4358
commit 1cfdf1b044
3 files changed
+20 -6

No files matched your search

@@ -60,7 +60,7 @@
<div class="d-flex justify-space-between align-center modal-header border-bottom pb-4">
<h1>{{ mastertask.name }}</h1>
<div class="d-flex justify-start">
<img class="icon" :src="require('@/plugins/app/_img/icons/pencil.svg')" alt="pencil-icon" @click.stop="editMode = !editMode" />
<img v-if="!mastertask.is_finished" class="icon" :src="require('@/plugins/app/_img/icons/pencil.svg')" alt="pencil-icon" @click.stop="editMode = !editMode" />
<img class="icon trash" :src="require('@/plugins/app/_img/icons/bin.svg')" alt="trash-icon" @click.stop="openDeleteMasterTaskModal(mastertask)" />
</div>
</div>
@@ -184,6 +184,8 @@ export default {
},
mounted() {
this.$events.on('close-both-modals', this.closeBothModals)
this.$events.on('master-task:team-member-deleted', ({ teamId, memberId }) => {
if (this.mastertask.team_id != teamId)
return
@@ -216,9 +218,15 @@ export default {
this.$events.off('on-subtask-deleted')
this.$events.off('on-subtask-edited')
this.$events.off('master-task:team-member-deleted')
this.$events.off('close-both-modals', this.closeBothModals)
},
methods: {
closeBothModals() {
this.$emit('close')
this.visible = false
},
removeEmployee({ id }) {
// const isEmployeeInTeam = this.mastertask.team?.employees.find(employee => employee.id == id)
@@ -253,6 +261,11 @@ export default {
this.mastertask.project_id = project?.id || null
this.mastertask.team_id = this.mastertask.team?.id || null
// this.mastertask.subtasks.forEach(({ employee_id, duration}) => {
// const employee = this.mastertask.employees.find(({ id }) => id == employee_id)
// employee.duration = duration
// })
// this.mastertask.project_code = project.code
} else {
this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' }
@@ -264,8 +277,8 @@ export default {
}
},
async toggleIsFinished(mastertask) {
this.$events.emit('show-complete-master-task-modal', { mastertask })
toggleIsFinished() {
this.$events.emit('show-complete-master-task-modal', { mastertask: this.mastertask })
},
async save() {