diff --git a/app/src/plugins/app/_config/App.vue b/app/src/plugins/app/_config/App.vue
index 3f7d31e..ced0bf6 100644
--- a/app/src/plugins/app/_config/App.vue
+++ b/app/src/plugins/app/_config/App.vue
@@ -16,7 +16,8 @@
-
+
+
\ No newline at end of file
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 d23dbee..7033095 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
@@ -12,17 +12,33 @@
-
+
+
+
-
+
+
-
+
+
+
-
+
- {{ employee.name.charAt(0) + employee.surname.charAt(0) }}
+ {{ employee?.name.charAt(0) + employee?.surname.charAt(0) }}
+
+
+
+
+
+
+ {{ employee?.name.charAt(0) + employee?.surname.charAt(0) }}
+
+
@@ -30,7 +46,7 @@
- Pridať zamestnanca
+ Pridať zamestnanca
@@ -114,6 +130,7 @@ export default {
data() {
return {
+ deadline: null,
editMode: false,
visible: false,
errorUtils,
@@ -153,15 +170,21 @@ export default {
return {
mastertask: {
project_id: { required },
- team_id: { required },
+ employees: { required },
name: { required },
description: { required },
- deadline: { required }
+ deadline: { required },
+ _deadline_time: { required }
}
}
},
mounted() {
+ this.$events.on('memberDeleted', (filteredMembers) => {
+ console.log()
+ //this.mastertask.employees = filteredMembers
+ }),
+
this.$events.on('on-mastertask-deleted', (mastertask) => {
if (mastertask?.id == this.mastertask?.id) this.closeModal()
})
@@ -189,11 +212,30 @@ export default {
},
methods: {
+ removeMemberAlert(member) {
+ const team = this.mastertask.team
+ this.$events.emit('show-delete-team-member-modal', { member, team })
+ },
+
+ editDatepicker(type) {
+ const calendarElement = document.getElementsByClassName('dp__instance_calendar')[0]
+ const switchBtn = calendarElement.lastChild.querySelectorAll('.dp__button')[0]
+ if (!calendarElement) return
+ if (type == 'date') {
+ calendarElement.lastChild.remove()
+ } else if (type == 'time') {
+ switchBtn.click()
+ //calendarElement.lastChild.remove()
+ }
+ },
+
async showModal({mastertask, editMode = false}) {
this.editMode = null
this.visible = true
this.mastertask = null
- this.$nextTick(() => this.v$.$reset())
+ this.$nextTick(() => {
+ this.v$.$reset()
+ })
try {
if (mastertask?.id) {
@@ -206,7 +248,7 @@ export default {
// this.mastertask.project_code = project.code
} else {
- this.mastertask = { employees: [], duration: 0 }
+ this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' }
}
this.editMode = editMode || !this.mastertask.id
@@ -226,6 +268,8 @@ export default {
if (this.$refs['description'])
this.mastertask.description = this.$refs['description'].getHTML()
+ this._mergeDeadlineTimeDate()
+
try {
this.mastertask.deadline = moment(this.mastertask.deadline).format('YYYY-MM-DD HH:MM:SS')
@@ -253,6 +297,15 @@ export default {
addTask() {
this.$events.emit('show-subtask-modal', { subtask: null, editMode: false, mastertask: this.mastertask })
+ },
+
+ _mergeDeadlineTimeDate() {
+ const date = new Date(this.mastertask.deadline);
+ const timeParts = this.mastertask._deadline_time.split(':');
+ date.setHours(parseInt(timeParts[0]));
+ date.setMinutes(parseInt(timeParts[1]));
+
+ this.mastertask.deadline = date
}
},
@@ -260,6 +313,14 @@ export default {
editMode() {
this.$nextTick(() => {
this.$refs['description']?.setHTML(this.mastertask.description || '')
+
+ if (!this.mastertask) return
+
+ const date = new Date(this.mastertask.deadline)
+ const hours = date.getHours()
+ const minutes = date.getMinutes()
+
+ this.mastertask._deadline_time = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
})
}
}
@@ -267,6 +328,15 @@ export default {