mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Projects] Added filters
This commit is contained in:
1 parent
919b2eebbe
commit
302286bff8
29 files changed
+508
-350
No files matched your search
@@ -10,13 +10,13 @@
|
||||
<v-card-actions class="d-flex flex-column modal-content">
|
||||
<v-text-field v-model="task.project_code" label="Kód projektu" :value="task.project_code" @focus="onInputFocus" class="modal-input" variant="solo" disabled></v-text-field>
|
||||
|
||||
<Z-autocomplete label="Master task" :options="mastertasks.map((masterTask) => ({ key: masterTask.id, value: masterTask.name }))" :validations="v$.task.master_task.id" :clear-on-submit="false" :value="task?.master_task?.name" :class="{ error: v$.task.master_task.id.$errors.length }" class="modal-input" @option-selected="onMasterTaskSelected" />
|
||||
<Z-autocomplete label="Master task" :options="mastertasks.map((mastertask) => ({ key: mastertask.id, value: mastertask.name }))" :validations="v$.task.master_task.id" :clear-on-submit="false" :value="task?.master_task?.name" :class="{ error: v$.task.master_task.id.$errors.length }" class="modal-input" @option-selected="onMasterTaskSelected" />
|
||||
|
||||
<v-select v-model="task.employee_id" ref="employee-select" @focus="onInputFocus" class="modal-input border-select" label="Priradený" :class="{ error: v$.task.employee_id.$errors.length }" variant="solo" :items="filteredEmployees" item-value="id" item-title="_fullName"></v-select>
|
||||
|
||||
<v-text-field v-model="task.duration" @focus="onInputFocus" class="modal-input" variant="solo" type="number" label="Časový odhad" :class="{ error: v$.task.duration.$errors.length }" :hint="v$.task.duration.$errors ? errorUtils.parseErrors(v$.task.duration.$errors) : null" append-inner-icon="mdi-clock-outline"></v-text-field>
|
||||
|
||||
<div class="w-100 modal-input" :class="{ error: v$.task.description.$errors.length }">
|
||||
<div class="w-100 modal-input">
|
||||
<QuillEditor ref="description" v-model="task.description" placeholder="Popis" theme="snow" class="rich-text-editor" @input="task.description = $event.srcElement.innerHTML" />
|
||||
</div>
|
||||
|
||||
@@ -92,7 +92,7 @@ export default {
|
||||
errorUtils,
|
||||
v$: useVuelidate(),
|
||||
preventInputFocus: false,
|
||||
masterTaskIdSelect: null,
|
||||
mastertaskIdSelect: null,
|
||||
showDatePicker: false,
|
||||
selectedNewDate: []
|
||||
}
|
||||
@@ -115,7 +115,6 @@ export default {
|
||||
validations() {
|
||||
return {
|
||||
task: {
|
||||
description: { required },
|
||||
master_task: {
|
||||
id: { required }
|
||||
},
|
||||
@@ -140,7 +139,7 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
async showModal(task, editMode = false, masterTask = {}) {
|
||||
async showModal(task, editMode = false, mastertask = {}) {
|
||||
this.task = null
|
||||
this.visible = true
|
||||
this.$nextTick(() => this.v$.$reset())
|
||||
@@ -150,8 +149,8 @@ export default {
|
||||
const subtask = await this.$axios.get_auth_data(`v1/subtasks/${task.id}`)
|
||||
this.task = this._enrichTask(subtask)
|
||||
} else {
|
||||
this.task = { master_task: masterTask, timeblocks: [{start: tmUtils.formatDateTimeForBackend(moment()), end: tmUtils.formatDateTimeForBackend(moment())}] }
|
||||
this.masterTaskIdSelect = masterTask.id
|
||||
this.task = { master_task: mastertask, timeblocks: [{start: tmUtils.formatDateTimeForBackend(moment()), end: tmUtils.formatDateTimeForBackend(moment())}] }
|
||||
this.mastertaskIdSelect = mastertask.id
|
||||
}
|
||||
|
||||
this.editMode = editMode || !this.task.id
|
||||
@@ -224,26 +223,29 @@ export default {
|
||||
},
|
||||
|
||||
_enrichTask(task) {
|
||||
task.master_task = this.mastertasks.find((masterTask) => masterTask.id == task.master_task_id)
|
||||
task.master_task = this.mastertasks.find((mastertask) => mastertask.id == task.master_task_id)
|
||||
task.employee = this.enrichedEmployees.find((employee) => employee.id == task.employee_id)
|
||||
task._created_by = this.enrichedEmployees.find((employee) => employee.id == task.created_by)
|
||||
this.masterTaskIdSelect = task.master_task?.id
|
||||
this.mastertaskIdSelect = task.master_task?.id
|
||||
|
||||
return task
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
masterTaskIdSelect(value) {
|
||||
mastertaskIdSelect(value) {
|
||||
if (!value || !this.task) return
|
||||
|
||||
this.task.master_task = this.mastertasks.find((masterTask) => masterTask.id == value)
|
||||
this.task.master_task = this.mastertasks.find((mastertask) => mastertask.id == value)
|
||||
this.task.project_code = this.task.master_task.project_code
|
||||
},
|
||||
|
||||
"task.employee_id"(value) {
|
||||
"task.employee_id"(value, oldValue) {
|
||||
if (!value) return
|
||||
|
||||
if (value && oldValue)
|
||||
this.task.timeblocks = []
|
||||
|
||||
this.task.employee = this.enrichedEmployees.find((employee) => employee.id == value)
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user