diff --git a/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue
index dbd3066..77e5033 100644
--- a/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue
+++ b/app/src/plugins/tm@modal/master-task/z-complete-master-task-modal.vue
@@ -22,7 +22,7 @@ import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
export default {
mixins: [ modalMixin ],
- emits: ['close', 'on-master-task-edited'],
+ emits: ['close', 'master-task-edited'],
data() {
return {
@@ -43,7 +43,8 @@ export default {
const { mastertask } = await this.$axios.put_auth(`v1/mastertasks/${tempMastertask.id}`, tempMastertask)
this.visible = false
- this.$emit('on-master-task-edited', mastertask)
+ this.$emit('master-task-edited', mastertask)
+ this.$events.emit('close-both-modals')
} catch (error) {
this.$toast.error(error)
}
diff --git a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue
index f1ab6c6..42f8503 100644
--- a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue
+++ b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue
@@ -60,7 +60,7 @@
@@ -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() {
diff --git a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue
index 5fb9b78..8c54fa1 100644
--- a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue
+++ b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue
@@ -43,7 +43,7 @@ export default {
delete timesheet.employee_name
return timesheet
})}
- const { subtask } = await this.$axios.put_auth(`v1/subtasks/${tempSubtask.id}`, tempSubtask)
+ const { subtask } = await this.$axios.put_auth(`v1/subtasks/${tempSubtask.id}`, tempSubtask)
this.visible = false
this.$emit('on-subtask-edited', subtask)