mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[tm@store] Added store
This commit is contained in:
1 parent
a1a410c54d
commit
774ca7b607
44 files changed
+989
-720
No files matched your search
+24
-19
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col cols="5">
|
||||
<v-sheet class="pa-2 ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<div class="d-flex align-center">
|
||||
<v-icon icon="mdi-drag-vertical" size="large"></v-icon>
|
||||
<p class="mx-3">Status</p>
|
||||
@@ -9,7 +9,7 @@
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
<v-col cols="7">
|
||||
<v-sheet class="ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<p v-if="masterTask.is_finished" class="status-badge px-4 py-2 rounded-pill">Ukončený</p>
|
||||
<p v-if="!masterTask.is_finished" class="status-badge px-4 py-2 rounded-pill">Neukončený</p>
|
||||
</v-sheet>
|
||||
@@ -17,7 +17,7 @@
|
||||
</v-row>
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col cols="5">
|
||||
<v-sheet class="pa-2 ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<div class="d-flex align-center">
|
||||
<v-icon icon="mdi-calendar-week" size="large"></v-icon>
|
||||
<p class="mx-3">Deadline</p>
|
||||
@@ -25,14 +25,14 @@
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
<v-col cols="7">
|
||||
<v-sheet class="ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<p :class="`${tmUtils.isAfter(masterTask.deadline) ? 'text-black' : 'text-red-darken-4'}`">{{ tmUtils.formatDateTime(masterTask.deadline) }}</p>
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
<v-col cols="5">
|
||||
<v-sheet class="pa-2 ma-2 pt-0">
|
||||
<v-sheet class="pa-2 pt-0">
|
||||
<div class="d-flex align-center">
|
||||
<v-icon icon="mdi-account-multiple-outline" size="large"></v-icon>
|
||||
<p class="mx-3">Tím</p>
|
||||
@@ -53,7 +53,7 @@
|
||||
</v-row>
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col cols="5">
|
||||
<v-sheet class="pa-2 ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<div class="d-flex align-center">
|
||||
<v-icon icon="mdi-clock-time-three-outline" size="large"></v-icon>
|
||||
<p class="mx-3">Naplánovaný čas</p>
|
||||
@@ -61,14 +61,14 @@
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
<v-col cols="7">
|
||||
<v-sheet class="ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<p>{{ masterTask?.duration?.toFixed(2) }} h</p>
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="align-center">
|
||||
<v-col cols="5">
|
||||
<v-sheet class="pa-2 ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<div class="d-flex align-center">
|
||||
<v-icon icon="mdi-timer-outline" size="large"></v-icon>
|
||||
<p class="mx-3">Odpracovaný čas</p>
|
||||
@@ -76,38 +76,43 @@
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
<v-col cols="7">
|
||||
<v-sheet class="ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<p :class="masterTask.time_worked > masterTask.duration ? 'text-red-darken-4' : 'text-black'">{{ masterTask.time_worked?.toFixed(2) }} h</p>
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="align-center border-bottom">
|
||||
<v-col cols="5">
|
||||
<v-sheet class="pa-2 ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<div class="d-flex align-center">
|
||||
<v-icon icon="mdi-clock-time-three-outline" size="large"></v-icon>
|
||||
<p class="mx-3">Zostávajúci čas</p>
|
||||
</div>
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="7">
|
||||
<v-sheet class="ma-2">
|
||||
<v-sheet class="py-3">
|
||||
<p :class="masterTask.time_worked > masterTask.duration ? 'text-red-darken-4' : 'text-black'">{{ (masterTask.duration - masterTask.time_worked)?.toFixed(2) }} h</p>
|
||||
</v-sheet>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<div class="px-5 py-5 border-bottom">
|
||||
<p>Popis zadania</p>
|
||||
<section v-html="masterTask.description" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||
<p class="mt-5">Prílohy</p>
|
||||
<div class="w-100 d-flex align-center">
|
||||
<div v-for="(file, index) in masterTask.files" :key="file.id" class="d-flex align-center flex-wrap" :class="[index === 0 ? 'ml-0' : 'ml-2']">
|
||||
<v-chip class="mt-2">
|
||||
<p @click="downloadFile(index)" class="cursor-pointer">{{ file.name }}</p>
|
||||
<v-icon class="mx-1" icon="mdi-paperclip"></v-icon>
|
||||
</v-chip>
|
||||
|
||||
<template v-if="masterTask.files?.length">
|
||||
<p class="mt-5">Prílohy</p>
|
||||
<div class="w-100 d-flex align-center">
|
||||
<div v-for="(file, index) in masterTask.files" :key="file.id" class="d-flex align-center flex-wrap" :class="[index === 0 ? 'ml-0' : 'ml-2']">
|
||||
<v-chip class="mt-2">
|
||||
<p @click="downloadFile(index)" class="cursor-pointer">{{ file.name }}</p>
|
||||
<v-icon class="mx-1" icon="mdi-paperclip"></v-icon>
|
||||
</v-chip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
export default {
|
||||
computed: {
|
||||
employeesOptions() {
|
||||
const selectedEmployees = [...this.masterTask.employees, ...this.masterTask.team?.employees]
|
||||
.map(employee => employee.id)
|
||||
const selectedEmployees = [...this.masterTask.employees].map(employee => employee.id)
|
||||
|
||||
const employees = this.employees.filter(
|
||||
(employee) => !selectedEmployees.includes(employee.id)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-dialog v-model="visible" max-width="650">
|
||||
<v-dialog v-model="visible" max-width="750">
|
||||
<v-card>
|
||||
<div class="d-flex justify-space-between align-center">
|
||||
<h1>Ste si istý, že chcete zmazať <b>{{ masterTask.name }}</b>?</h1>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-dialog v-model="visible" max-width="650" max-height="90%" height="700px">
|
||||
<v-dialog v-model="visible" max-width="750" max-height="90%" height="700px">
|
||||
<W-loadable :content="masterTask" class="h-100">
|
||||
<v-card v-if="editMode" height="100%" class="d-flex flex-column scrolling">
|
||||
<div class="d-flex justify-space-between align-center modal-header">
|
||||
@@ -18,17 +18,13 @@
|
||||
|
||||
<v-select v-model="this.masterTask.team_id" @focus="onInputFocus" class="modal-input border-select" :class="{ error: v$.masterTask.team_id.$errors.length }" label="Tím" variant="solo" :items="teams" item-value="id" item-title="name"></v-select>
|
||||
|
||||
<v-text-field v-for="(employee, index) in masterTask.employees" :key="employee.id" @focus="onInputFocus" :class="{ error: !masterTask.employees[index].duration }" class="modal-input" :label="`${employee.name} ${employee.surname}`" variant="solo" placeholder="h" v-model="masterTask.employees[index].duration" type="number" min="1" @input="onEmployeeDurationChanged">
|
||||
<p class="employee-select-avatar d-flex justify-center align-center">
|
||||
{{ employee.name.charAt(0) + employee.surname.charAt(0) }}
|
||||
</p>
|
||||
</v-text-field>
|
||||
|
||||
<!-- <v-text-field v-for="(employee, index) in masterTask.team?.employees" :key="employee.id" @focus="onInputFocus" :class="{ error: !masterTask.team.employees[index].duration }" class="modal-input" :label="`${employee.name} ${employee.surname}`" variant="solo" placeholder="h" v-model="masterTask.team.employees[index].duration" type="number" min="1" @input="onEmployeeDurationChanged">
|
||||
<p class="employee-select-avatar d-flex justify-center align-center">
|
||||
{{ employee.name.charAt(0) + employee.surname.charAt(0) }}
|
||||
</p>
|
||||
</v-text-field> -->
|
||||
<template v-if="!masterTask.id">
|
||||
<v-text-field v-for="(employee, index) in masterTask.employees" :key="employee.id" @focus="onInputFocus" :class="{ error: !masterTask.employees[index].duration }" class="modal-input" :label="`${employee.name} ${employee.surname}`" variant="solo" placeholder="h" v-model="masterTask.employees[index].duration" type="number" min="1" @input="onEmployeeDurationChanged">
|
||||
<p class="employee-select-avatar d-flex justify-center align-center">
|
||||
{{ employee.name.charAt(0) + employee.surname.charAt(0) }}
|
||||
</p>
|
||||
</v-text-field>
|
||||
</template>
|
||||
|
||||
<Z-autocomplete label="Vyhľadať zamestnanca" v-if="showAddEmployeeInput" :options="employeesOptions" class="modal-input" @option-selected="onEmployeeSelected" />
|
||||
|
||||
@@ -59,7 +55,8 @@
|
||||
|
||||
<v-card-actions class="d-flex flex-column modal-content">
|
||||
<div class="w-100">
|
||||
<A-task-description :master-task="masterTask" />
|
||||
<A-mastertask-description :master-task="masterTask" />
|
||||
|
||||
<div class="d-flex justify-start align-center mt-8">
|
||||
<v-btn class="button primary" @click="save()">Ukončiť mastertask</v-btn>
|
||||
</div>
|
||||
@@ -92,7 +89,7 @@ import '@vueup/vue-quill/dist/vue-quill.snow.css'
|
||||
|
||||
import SelectsMixin from './_mixins/selects.mixin'
|
||||
import ATasksTable from './_components/a-tasks-table.vue'
|
||||
import ATaskDescription from './_components/a-task-description.vue'
|
||||
import AMastertaskDescription from './_components/a-mastertask-description.vue'
|
||||
|
||||
export default {
|
||||
// MIXINS
|
||||
@@ -104,7 +101,7 @@ export default {
|
||||
mixins: [VuetifyFixFocusMixin, SelectsMixin],
|
||||
|
||||
components: {
|
||||
ATaskDescription,
|
||||
AMastertaskDescription,
|
||||
ATasksTable,
|
||||
Datepicker,
|
||||
ZFilesUpload,
|
||||
@@ -149,7 +146,7 @@ export default {
|
||||
})
|
||||
|
||||
this.$events.on('on-task-edited', (task) => {
|
||||
if (!this.masterTask.subtasks) return
|
||||
if (!this.masterTask?.subtasks) return
|
||||
|
||||
if (this.masterTask.subtasks.find(subtask => subtask.id == task.id)) {
|
||||
this.masterTask.subtasks = this.masterTask.subtasks.map(t => t.id == task.id ? task : t)
|
||||
@@ -172,10 +169,10 @@ export default {
|
||||
this.masterTask = null
|
||||
|
||||
try {
|
||||
this.teams = await this.$axios.get_auth_data('v1/teams')
|
||||
this.projects = await this.$axios.get_auth_data('v1/projects')
|
||||
const employees = await this.$axios.get_auth_data('v1/employees')
|
||||
this.employees = tmUtils.enrichEmployeesByFullName(employees)
|
||||
this.teams = await this.$axios.get_auth_data('v1/teams')
|
||||
this.projects = await this.$axios.get_auth_data('v1/projects')
|
||||
const employees = await this.$axios.get_auth_data('v1/employees')
|
||||
this.employees = tmUtils.enrichEmployeesByFullName(employees)
|
||||
|
||||
if (masterTask?.id) {
|
||||
this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTask.id}`)
|
||||
@@ -185,16 +182,6 @@ export default {
|
||||
this.masterTask.team_id = this.masterTask.team.id
|
||||
this.masterTask.project_id = project.id
|
||||
this.masterTask.project_code = project.code
|
||||
|
||||
// TODO refactor
|
||||
this.masterTask.employees = this.masterTask.employees.map(employee => {
|
||||
const subtask = this.masterTask?.subtasks.find(subtask => subtask.employee_id == employee.id)
|
||||
employee.duration = subtask.duration
|
||||
|
||||
return employee
|
||||
})
|
||||
|
||||
console.log(this.masterTask.employees)
|
||||
} else {
|
||||
this.masterTask = { employees: [], duration: 0 }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user