mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
Merge branch 'main' of bitbucket.org:studiotem/jandl-taskmanager-app
This commit is contained in:
commit
6b4784788d
25 files changed
+129
-23
No files matched your search
@@ -65,6 +65,7 @@ transition-group.vuecal__cell(
|
|||||||
import Event from './event.vue'
|
import Event from './event.vue'
|
||||||
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
inject: ['vuecal', 'utils', 'modules', 'view', 'domEvents'],
|
inject: ['vuecal', 'utils', 'modules', 'view', 'domEvents'],
|
||||||
@@ -262,11 +263,11 @@ export default {
|
|||||||
dateTo.setHours(dateFrom.getHours() + 1)
|
dateTo.setHours(dateFrom.getHours() + 1)
|
||||||
|
|
||||||
const time = moment(dateFrom).format('HH:mm')
|
const time = moment(dateFrom).format('HH:mm')
|
||||||
const date = moment(dateFrom).format('DD.MM.yyyy')
|
|
||||||
|
|
||||||
this.$events.emit('show-menu-modal', {
|
this.$events.emit('show-menu-modal', {
|
||||||
time: time,
|
time: time,
|
||||||
date: date
|
date: tmUtils.formatDateTimeForBackend(dateFrom),
|
||||||
|
employee: this.user.id
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -309,6 +310,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters("auth", ["user"]),
|
||||||
// Drag & drop module.
|
// Drag & drop module.
|
||||||
dnd () {
|
dnd () {
|
||||||
return this.modules.dnd
|
return this.modules.dnd
|
||||||
|
|||||||
@@ -430,10 +430,9 @@ export default {
|
|||||||
.vuecal__event
|
.vuecal__event
|
||||||
border-radius: 16px
|
border-radius: 16px
|
||||||
// padding: 20px 10px
|
// padding: 20px 10px
|
||||||
min-height: 200px !important
|
min-height: 70px !important
|
||||||
text-align: left
|
text-align: left
|
||||||
background: rgba(248, 248, 248, 1)
|
background: rgba(248, 248, 248, 1)
|
||||||
min-height: 40px
|
|
||||||
transition: min-height .4s, height .4s, box-shadow .4s, width .4s, left .4s
|
transition: min-height .4s, height .4s, box-shadow .4s, width .4s, left .4s
|
||||||
|
|
||||||
.custom-event-body
|
.custom-event-body
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<v-row class="px-10 py-8 subheader">
|
<v-row class="px-10 py-8 subheader">
|
||||||
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="filter.projectId" class="subheader-input" :items="[...projectsOptions]" item-title="code" item-value="id" label="Projekt" variant="outlined" @update:search="projectCodeSearch = $event" />
|
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="filter.projectId" class="subheader-input" :items="[...projectsOptions]" item-title="code" item-value="id" label="Projekt" variant="outlined" @update:search="projectCodeSearch = $event" />
|
||||||
|
|
||||||
<v-select v-model="filter.teamId" class="subheader-input" :items="[null, ...teams]" label="Tím" variant="outlined" item-title="name" item-value="id" />
|
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="filter.teamId" class="subheader-input" :items="[...teams]" item-title="name" item-value="id" label="Tím" variant="outlined" />
|
||||||
|
|
||||||
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="filter.employeeId" class="subheader-input" :items="[...enrichedEmployees]" item-title="_fullName" item-value="id" label="Zamestnanec" variant="outlined" />
|
<v-autocomplete :custom-filter="customFilter" :match-any="true" v-model="filter.employeeId" class="subheader-input" :items="[...enrichedEmployees]" item-title="_fullName" item-value="id" label="Zamestnanec" variant="outlined" />
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div ref="page">
|
<div ref="page">
|
||||||
<A-project-filter v-if="$store.getters['tm/isInitialized']" @filterChanged="onFilterChanged" />
|
<A-project-filter v-if="$store.getters['tm/isInitialized']" @filterChanged="onFilterChanged" />
|
||||||
|
|
||||||
<W-loadable :content="filteredProjects" emptyMessage="Nenašli sa žiadne vyhovujúce projekty">
|
<W-loadable class="non-projects" :content="filteredProjects" emptyMessage="Nenašli sa žiadne vyhovujúce projekty">
|
||||||
<A-project-calendar :events="filteredProjects" :month="filter.month" @open-detail="openMasterTaskModal" />
|
<A-project-calendar :events="filteredProjects" :month="filter.month" @open-detail="openMasterTaskModal" />
|
||||||
</W-loadable>
|
</W-loadable>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,3 +91,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.non-projects
|
||||||
|
height: 27rem !important
|
||||||
|
</style>
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row class="px-10 py-8 subheader">
|
<v-row class="px-10 py-8 subheader">
|
||||||
<v-select
|
<v-autocomplete
|
||||||
v-model="selectedTeam"
|
:custom-filter="customFilter"
|
||||||
|
:match-any="true" v-model="selectedTeam"
|
||||||
class="subheader-input"
|
class="subheader-input"
|
||||||
:items="teams"
|
:items="teams"
|
||||||
item-title="name"
|
item-title="name"
|
||||||
item-value="id"
|
item-value="id"
|
||||||
label="Tím"
|
label="Tím"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
></v-select>
|
/>
|
||||||
<div class="d-flex date-wrapper">
|
<div class="d-flex date-wrapper">
|
||||||
<v-btn class="subheader-icon-button prev" variant="outlined" @click="prevDay()"><img :src="require('@/plugins/app/_img/icons/icon-prev.svg')" alt=""></v-btn>
|
<v-btn class="subheader-icon-button prev" variant="outlined" @click="prevDay()"><img :src="require('@/plugins/app/_img/icons/icon-prev.svg')" alt=""></v-btn>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@@ -32,9 +33,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addDays, subDays } from 'date-fns'
|
import { addDays, subDays } from 'date-fns'
|
||||||
|
import AutocompleteMixin from '@/plugins/tm@_mixins/autocomplete.mixin'
|
||||||
|
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [AutocompleteMixin],
|
||||||
emits: ['filter-changed'],
|
emits: ['filter-changed'],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
export default {
|
||||||
|
mounted() {
|
||||||
|
window.addEventListener('keydown', this.handleKeyDown)
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
handleKeyDown(event) {
|
||||||
|
if (event.keyCode === 27) this.closeModal()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -44,9 +44,10 @@ import VuetifyFixFocusMixin from "@/plugins/tm@modal/_mixins/vuetify-fix-focus"
|
|||||||
import { mapGetters } from "vuex"
|
import { mapGetters } from "vuex"
|
||||||
import moment from "moment"
|
import moment from "moment"
|
||||||
import AutocompleteMixin from '@/plugins/tm@_mixins/autocomplete.mixin'
|
import AutocompleteMixin from '@/plugins/tm@_mixins/autocomplete.mixin'
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [VuetifyFixFocusMixin, AutocompleteMixin],
|
mixins: [VuetifyFixFocusMixin, AutocompleteMixin, modalMixin],
|
||||||
|
|
||||||
emits: ["close"],
|
emits: ["close"],
|
||||||
|
|
||||||
@@ -63,7 +64,8 @@ export default {
|
|||||||
blocker: null,
|
blocker: null,
|
||||||
datepicker: null,
|
datepicker: null,
|
||||||
starts_at_time: null,
|
starts_at_time: null,
|
||||||
ends_at_time: null
|
ends_at_time: null,
|
||||||
|
employee: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -109,11 +111,12 @@ export default {
|
|||||||
//fixnut validacie employee_id
|
//fixnut validacie employee_id
|
||||||
this.blocker = blocker
|
this.blocker = blocker
|
||||||
} else {
|
} else {
|
||||||
this.blocker = {start: null }
|
this.blocker = {start: null, employee_id: this.user.id }
|
||||||
|
|
||||||
if (blocker.starts_at_time && blocker.datepicker) {
|
if (blocker.starts_at_time && blocker.datepicker && blocker.employee_id) {
|
||||||
this.datepicker = blocker.datepicker
|
this.datepicker = blocker.datepicker
|
||||||
this.starts_at_time = blocker.starts_at_time
|
this.starts_at_time = blocker.starts_at_time
|
||||||
|
this.blocker.employee_id = blocker.employee_id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -136,6 +139,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.$events.emit("on-blocker-edited", this.blocker)
|
this.$events.emit("on-blocker-edited", this.blocker)
|
||||||
|
this.$events.emit("blocker-created")
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error)
|
this.$toast.error(error)
|
||||||
|
|||||||
@@ -20,7 +20,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
emits: ['on-blocker-deleted'],
|
emits: ['on-blocker-deleted'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -73,8 +73,11 @@ export default {
|
|||||||
'mastertask.team_id'(value) {
|
'mastertask.team_id'(value) {
|
||||||
if (!value) return
|
if (!value) return
|
||||||
|
|
||||||
this.mastertask.team = this.teams.find(team => team.id == value)
|
const team = this.teams.find(team => team.id == value)
|
||||||
this.mastertask.employees = this.mastertask.team.employees
|
if (!team) return
|
||||||
|
|
||||||
|
this.mastertask.team = JSON.parse(JSON.stringify(team))
|
||||||
|
this.mastertask.employees = [...this.mastertask.team.employees]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
emits: ['on-mastertask-deleted'],
|
emits: ['on-mastertask-deleted'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -28,8 +28,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ import VuetifyFixFocusMixin from '@/plugins/tm@modal/_mixins/vuetify-fix-focus'
|
|||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { QuillEditor } from '@vueup/vue-quill'
|
import { QuillEditor } from '@vueup/vue-quill'
|
||||||
// import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
// import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
import '@vueup/vue-quill/dist/vue-quill.snow.css'
|
import '@vueup/vue-quill/dist/vue-quill.snow.css'
|
||||||
|
|
||||||
@@ -112,7 +113,7 @@ export default {
|
|||||||
// watch: mastertask.team_id
|
// watch: mastertask.team_id
|
||||||
|
|
||||||
emits: ['master-task-edited', 'close'],
|
emits: ['master-task-edited', 'close'],
|
||||||
mixins: [VuetifyFixFocusMixin, SelectsMixin, AutocompleteMixin],
|
mixins: [VuetifyFixFocusMixin, SelectsMixin, AutocompleteMixin, modalMixin],
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
AMastertaskDescription,
|
AMastertaskDescription,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
|
<v-card-actions class="mt-10 d-flex justify-start align-center mobile-view">
|
||||||
<v-btn class="button primary half outline" @click.stop="createTask()"
|
<v-btn class="button primary half outline" @click.stop="createTask()"
|
||||||
>TASK</v-btn
|
>SUB TASK</v-btn
|
||||||
>
|
>
|
||||||
<v-btn class="button primary half outline" @click.stop="createBlocker()"
|
<v-btn class="button primary half outline" @click.stop="createBlocker()"
|
||||||
>BLOCKER</v-btn
|
>BLOCKER</v-btn
|
||||||
@@ -19,9 +19,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
emits: ['update', 'data'],
|
emits: ['update', 'data'],
|
||||||
props: ['data'],
|
props: ['data'],
|
||||||
|
mixins: [ modalMixin ],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -30,6 +33,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.$events.on('blocker-created', () => {
|
||||||
|
this.closeModal()
|
||||||
|
})
|
||||||
|
|
||||||
|
this.$events.on('task-created', () => {
|
||||||
|
this.closeModal()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async showModal(data) {
|
async showModal(data) {
|
||||||
this.localData = data
|
this.localData = data
|
||||||
@@ -44,8 +57,11 @@ export default {
|
|||||||
this.$events.emit('show-subtask-modal', {
|
this.$events.emit('show-subtask-modal', {
|
||||||
subtask: {
|
subtask: {
|
||||||
deadline: this.localData.date,
|
deadline: this.localData.date,
|
||||||
_deadline_time: this.localData.time,
|
_deadline_time: this.localData.time
|
||||||
},
|
},
|
||||||
|
onTaskCreated: () => {
|
||||||
|
this.closeModal()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -54,7 +70,11 @@ export default {
|
|||||||
blocker: {
|
blocker: {
|
||||||
starts_at_time: this.localData.time,
|
starts_at_time: this.localData.time,
|
||||||
datepicker: this.localData.date,
|
datepicker: this.localData.date,
|
||||||
|
employee_id: this.localData.employee
|
||||||
},
|
},
|
||||||
|
onBlockerCreated: () => {
|
||||||
|
this.closeModal()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,11 @@
|
|||||||
{{ employee.name.charAt(0) + employee.surname.charAt(0) }}
|
{{ employee.name.charAt(0) + employee.surname.charAt(0) }}
|
||||||
</p>
|
</p>
|
||||||
<p class="ml-2" v-html="`${employee.name} ${employee.surname}`" />
|
<p class="ml-2" v-html="`${employee.name} ${employee.surname}`" />
|
||||||
|
<!-- <v-tooltip text="Vymazať priradeného zamestnanca" location="top">
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<v-icon v-bind="props" class="ml-2 cursor-pointer" icon="mdi-close" />
|
||||||
|
</template>
|
||||||
|
</v-tooltip> -->
|
||||||
</v-sheet>
|
</v-sheet>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<v-col cols="7">
|
<v-col cols="7">
|
||||||
<v-sheet class="py-3">
|
<v-sheet class="py-3">
|
||||||
<p>{{ hours }} h</p>
|
<p>{{ (hours).toFixed(2) }} h</p>
|
||||||
</v-sheet>
|
</v-sheet>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|||||||
@@ -57,8 +57,10 @@ import useVuelidate from '@vuelidate/core'
|
|||||||
import { required, numeric, minValue } from '@vuelidate/validators'
|
import { required, numeric, minValue } from '@vuelidate/validators'
|
||||||
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
props: {
|
props: {
|
||||||
hours: {
|
hours: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
|||||||
@@ -51,8 +51,10 @@ import useVuelidate from '@vuelidate/core'
|
|||||||
import { required } from '@vuelidate/validators'
|
import { required } from '@vuelidate/validators'
|
||||||
import Datepicker from '@vuepic/vue-datepicker'
|
import Datepicker from '@vuepic/vue-datepicker'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
emits: ['update-subtask'],
|
emits: ['update-subtask'],
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="d-flex justify-space-between align-center">
|
<div class="d-flex justify-space-between align-center">
|
||||||
<h1>Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z mastertasku <b>{{ subtask?.master_task?.name || subtask.master_task }}</b>?</h1>
|
<h1>Ste si istý, že chcete {{ subtask.is_finished ? 'znovu otvoriť' : 'dokončiť' }} task, z mastertasku <b>{{ subtask?.master_task?.name || subtask.master_task }}</b>?</h1>
|
||||||
<v-icon
|
<v-icon
|
||||||
@click.stop="visible = false"
|
@click.stop="closeModal()"
|
||||||
icon="mdi-close"
|
icon="mdi-close"
|
||||||
size="large"
|
size="large"
|
||||||
></v-icon>
|
></v-icon>
|
||||||
@@ -18,7 +18,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
emits: ['close', 'on-subtask-edited'],
|
emits: ['close', 'on-subtask-edited'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -47,6 +50,10 @@ export default {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error)
|
this.$toast.error(error)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
closeModal() {
|
||||||
|
this.visible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
emits: ['on-subtask-deleted'],
|
emits: ['on-subtask-deleted'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -18,8 +18,10 @@
|
|||||||
import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
|
import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
|
||||||
import useVuelidate from '@vuelidate/core'
|
import useVuelidate from '@vuelidate/core'
|
||||||
import { required, numeric, minValue } from '@vuelidate/validators'
|
import { required, numeric, minValue } from '@vuelidate/validators'
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
emits: ['close', 'on-subtask-edited'],
|
emits: ['close', 'on-subtask-edited'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -120,10 +120,11 @@ import AutocompleteMixin from '@/plugins/tm@_mixins/autocomplete.mixin'
|
|||||||
|
|
||||||
import ZTaskReadonlyInfo from "./_components/z-task-readonly-info.vue"
|
import ZTaskReadonlyInfo from "./_components/z-task-readonly-info.vue"
|
||||||
import { mapGetters } from "vuex"
|
import { mapGetters } from "vuex"
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
emits: ["close", "refresh"],
|
emits: ["close", "refresh"],
|
||||||
mixins: [VuetifyFixFocusMixin, SelectsMixin, AutocompleteMixin],
|
mixins: [VuetifyFixFocusMixin, SelectsMixin, AutocompleteMixin, modalMixin],
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
ZTaskReadonlyInfo,
|
ZTaskReadonlyInfo,
|
||||||
@@ -209,6 +210,11 @@ export default {
|
|||||||
this.subtask = this._enrichTask(data)
|
this.subtask = this._enrichTask(data)
|
||||||
} else {
|
} else {
|
||||||
this.subtask = { master_task: mastertask, employees: [{}], _deadline_time: '17:00' }
|
this.subtask = { master_task: mastertask, employees: [{}], _deadline_time: '17:00' }
|
||||||
|
|
||||||
|
if (subtask?.deadline && subtask._deadline_time) {
|
||||||
|
this.subtask.deadline = subtask.deadline
|
||||||
|
this.subtask._deadline_time = subtask._deadline_time
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.editMode = editMode || !this.subtask.id
|
this.editMode = editMode || !this.subtask.id
|
||||||
@@ -257,6 +263,7 @@ export default {
|
|||||||
this.$store.commit('tm/update_subtask', subtask)
|
this.$store.commit('tm/update_subtask', subtask)
|
||||||
this.$events.emit("on-subtask-edited", this.subtask)
|
this.$events.emit("on-subtask-edited", this.subtask)
|
||||||
})
|
})
|
||||||
|
this.$events.emit("task-created")
|
||||||
}
|
}
|
||||||
|
|
||||||
this.closeModal()
|
this.closeModal()
|
||||||
@@ -368,6 +375,7 @@ export default {
|
|||||||
'subtask.master_task_id'(value) {
|
'subtask.master_task_id'(value) {
|
||||||
if (!value) return
|
if (!value) return
|
||||||
this.subtask._master_task = this.mastertasks.find((mastertask) => mastertask.id == this.subtask.master_task_id)
|
this.subtask._master_task = this.mastertasks.find((mastertask) => mastertask.id == this.subtask.master_task_id)
|
||||||
|
this.subtask.project_code = this.subtask._master_task?.project_code || null
|
||||||
},
|
},
|
||||||
|
|
||||||
editMode() {
|
editMode() {
|
||||||
|
|||||||
@@ -17,7 +17,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [ modalMixin ],
|
||||||
emits: ['update'],
|
emits: ['update'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -43,11 +43,12 @@ import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
|
|||||||
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
import tmUtils from '@/plugins/tm@_utils/tm.utils'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import AutocompleteMixin from '@/plugins/tm@_mixins/autocomplete.mixin'
|
import AutocompleteMixin from '@/plugins/tm@_mixins/autocomplete.mixin'
|
||||||
|
import modalMixin from '@/plugins/tm@modal/_mixins/modal.mixin'
|
||||||
|
|
||||||
const atLeastOne = (value) => value.length
|
const atLeastOne = (value) => value.length
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [AutocompleteMixin],
|
mixins: [AutocompleteMixin, modalMixin],
|
||||||
emits: ['close', 'update'],
|
emits: ['close', 'update'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<td>{{ subtask.project_code }}</td>
|
<td>{{ subtask.project_code }}</td>
|
||||||
<td>{{ subtask.title ?? subtask.master_task?.name ?? subtask.master_task }}</td>
|
<td>{{ subtask.title ?? subtask.master_task?.name ?? subtask.master_task }}</td>
|
||||||
<td>{{ subtask.duration }} h</td>
|
<td>{{ subtask.duration }} h</td>
|
||||||
<td>{{ subtask.duration - subtask.spent_time }} h</td>
|
<td>{{ (subtask.duration - subtask.spent_time).toFixed(2) }} h</td>
|
||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start">
|
<div class="d-flex justify-start">
|
||||||
<img class="pencil-icon" :src="require('@/plugins/app/_img/icons/eye.svg')" alt="pencil-icon" @click.stop="editTask(subtask, false)">
|
<img class="pencil-icon" :src="require('@/plugins/app/_img/icons/eye.svg')" alt="pencil-icon" @click.stop="editTask(subtask, false)">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="text-left">Kód projektu</th>
|
<th class="text-left">Kód projektu</th>
|
||||||
<th class="text-left">Názov</th>
|
<th class="text-left">Názov</th>
|
||||||
|
<th class="text-left">Deadline</th>
|
||||||
<th class="text-left">Trvanie</th>
|
<th class="text-left">Trvanie</th>
|
||||||
<th class="text-left">Akcia</th>
|
<th class="text-left">Akcia</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
|
|
||||||
<td>{{ subtask.project_code }}</td>
|
<td>{{ subtask.project_code }}</td>
|
||||||
<td>{{ subtask.title ?? subtask.master_task?.name ?? subtask.master_task }}</td>
|
<td>{{ subtask.title ?? subtask.master_task?.name ?? subtask.master_task }}</td>
|
||||||
|
<td>{{ getDeadline(subtask) }}</td>
|
||||||
<td>{{ subtask.spent_time }} h</td>
|
<td>{{ subtask.spent_time }} h</td>
|
||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start">
|
<div class="d-flex justify-start">
|
||||||
@@ -28,6 +30,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import moment from 'moment'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
subtasks: {
|
subtasks: {
|
||||||
@@ -36,6 +41,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapGetters('tm', ['mastertasks'])
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
editTask(subtask, editMode) {
|
editTask(subtask, editMode) {
|
||||||
this.$events.emit('show-subtask-modal', {subtask, editMode})
|
this.$events.emit('show-subtask-modal', {subtask, editMode})
|
||||||
@@ -43,6 +52,13 @@ export default {
|
|||||||
|
|
||||||
deleteTask(subtask) {
|
deleteTask(subtask) {
|
||||||
this.$events.emit('show-delete-task-modal', {subtask})
|
this.$events.emit('show-delete-task-modal', {subtask})
|
||||||
|
},
|
||||||
|
|
||||||
|
getDeadline(subtask) {
|
||||||
|
if(subtask.deadline) return moment(subtask.deadline).format('DD.MM.yyyy')
|
||||||
|
else if(!this.mastertasks) return ''
|
||||||
|
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
|
||||||
|
return moment(masterTask).format('DD.MM.yyyy') ? moment(masterTask.deadline).format('DD.MM.yyyy') : ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user