diff --git a/app/public/mock/v1/tasks/(id).GET.json b/app/public/mock/v1/tasks/(id).GET.json
index 320d663..5dd1e78 100644
--- a/app/public/mock/v1/tasks/(id).GET.json
+++ b/app/public/mock/v1/tasks/(id).GET.json
@@ -7,7 +7,18 @@
"duration": 5400000,
"spent_time": 3000000,
"is_finished": false,
- "dates": [],
+ "timeblocks": [
+ {
+ "id": 43,
+ "start": "2023-01-31 04:02:17",
+ "end": "2023-01-31 08:23:05"
+ },
+ {
+ "id": 52,
+ "start": "2023-09-26 01:01:17",
+ "end": "2024-02-11 08:23:05"
+ }
+ ],
"master_task": {
"id": 1,
"name": "Master task 1",
diff --git a/app/src/plugins/app/_theme/global.sass b/app/src/plugins/app/_theme/global.sass
index 193b9e2..b269b45 100644
--- a/app/src/plugins/app/_theme/global.sass
+++ b/app/src/plugins/app/_theme/global.sass
@@ -34,6 +34,21 @@
height: 24px
width: 24px
+.remove-date
+ border: 1px solid rgba(0, 0, 0, 0.2)
+ border-radius: 50%
+ padding: 13px
+ height: 24px
+ width: 24px
+
+.add-date
+ color: white
+ border-radius: 50%
+ background: #6200EE
+ padding: 13px
+ height: 24px
+ width: 24px
+
th
font-size: 16px !important
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 fb9bf27..c62c19e 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
@@ -277,15 +277,14 @@
{{ task.master_task }} |
- IN
+ {{ getFullNameByEmployeeId(task.employee_id).initials }}
-
- Meno zamestnanca
+ {{ getFullNameByEmployeeId(task.employee_id).fullName }}
|
|
@@ -369,6 +368,23 @@ export default {
console.log(x)
},
+ getFullNameByEmployeeId(employee_id) {
+ let fullName = ''
+ let initials = ''
+ this.employees.forEach(employee => {
+ if (employee.id === employee_id) {
+ fullName = `${employee.name} ${employee.surname}`
+ initials = employee.name.charAt(0) + employee.surname.charAt(0)
+ }
+ })
+ return {
+ fullName,
+ initials
+ }
+
+ },
+
+
async showModal(masterTask, editMode = false) {
this.visible = true
this.masterTask = null
diff --git a/app/src/plugins/tm@modal/task/z-task-modal.vue b/app/src/plugins/tm@modal/task/z-task-modal.vue
index 3ecad71..afe9e91 100644
--- a/app/src/plugins/tm@modal/task/z-task-modal.vue
+++ b/app/src/plugins/tm@modal/task/z-task-modal.vue
@@ -165,9 +165,9 @@
-
+
-
+
+
+
+
+
+
Pridať dátum
+
+
+
+
+
+
+ Potvrdiť
+
+
@@ -355,7 +396,9 @@ export default {
preventInputFocus: false,
masterTasks: [],
masterTaskIdSelect: null,
- employeeIdSelect: null
+ employeeIdSelect: null,
+ showDatePicker: false,
+ selectedNewDate: []
}
},
@@ -377,6 +420,7 @@ export default {
duration: { required },
employee: { required },
},
+ selectedNewDate: { required }
}
},
@@ -431,6 +475,21 @@ export default {
}
},
+ async addNewDate() {
+ if (this.selectedNewDate) {
+ this.task.timeblocks.push({
+ start: this.selectedNewDate[0],
+ end: this.selectedNewDate[1]
+ })
+ this.showDatePicker = false
+ this.selectedNewDate = []
+ }
+ },
+
+ removeDate(index) {
+ this.task.timeblocks.splice(index, 1)
+ },
+
openDeleteTaskModal(task) {
this.$events.emit('show-delete-task-modal', { task })
},