mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
[subtask, masterTask] delete requests
This commit is contained in:
1 parent
17ed7616ee
commit
72d709cd13
4 files changed
+44
-29
No files matched your search
@@ -12,19 +12,22 @@
|
||||
</div>
|
||||
|
||||
<v-card-actions class="d-flex flex-column modal-content">
|
||||
<v-text-field
|
||||
v-model="masterTask.project_code"
|
||||
<v-select
|
||||
v-model="masterTask.project_id"
|
||||
@focus="onInputFocus"
|
||||
class="modal-input"
|
||||
class="modal-input border-select"
|
||||
label="Kód projektu"
|
||||
variant="solo"
|
||||
:class="{ error: v$.masterTask.project_code.$errors.length }"
|
||||
:items="projects"
|
||||
item-value="id"
|
||||
item-title="code"
|
||||
:class="{ error: v$.masterTask.project_id.$errors.length }"
|
||||
:hint="
|
||||
v$.masterTask.project_code.$errors
|
||||
? errorUtils.parseErrors(v$.masterTask.project_code.$errors)
|
||||
v$.masterTask.project_id.$errors
|
||||
? errorUtils.parseErrors(v$.masterTask.project_id.$errors)
|
||||
: null
|
||||
"
|
||||
></v-text-field>
|
||||
></v-select>
|
||||
|
||||
<v-text-field
|
||||
v-model="masterTask.name"
|
||||
@@ -285,7 +288,7 @@
|
||||
<div class="d-flex justify-start">
|
||||
<img class="pencil-icon" :src="require('@/plugins/tm@dashboard/_components/_img/checkmark.svg')" alt="checkmark-icon" :style="{opacity: 0.3}">
|
||||
<img class="pencil-icon ml-2" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon" :style="{opacity: 0.3}">
|
||||
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" :style="{opacity: 0.3}">
|
||||
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" @click.stop="openDeleteTaskModal(task)">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -336,6 +339,7 @@ export default {
|
||||
errorUtils,
|
||||
v$: useVuelidate(),
|
||||
teams: null,
|
||||
projects: null,
|
||||
employees: null,
|
||||
employeeSelect: null,
|
||||
teamSelect: '',
|
||||
@@ -348,9 +352,11 @@ export default {
|
||||
validations() {
|
||||
return {
|
||||
masterTask: {
|
||||
project_code: { required },
|
||||
project_id: { required },
|
||||
name: { required },
|
||||
team: { required },
|
||||
// duration: { required },
|
||||
// description: { required },
|
||||
deadline: { required },
|
||||
employees: { atLeastOne }
|
||||
},
|
||||
@@ -364,10 +370,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
itemSelected(x) {
|
||||
console.log(x)
|
||||
},
|
||||
|
||||
getFullNameByEmployeeId(employee_id) {
|
||||
let fullName = ''
|
||||
let initials = ''
|
||||
@@ -394,6 +396,7 @@ export default {
|
||||
try {
|
||||
this.teams = await this.$axios.get_auth_data('v1/teams')
|
||||
const employees = await this.$axios.get_auth_data('v1/employees')
|
||||
this.projects = await this.$axios.get_auth_data('v1/projects')
|
||||
this.employees = tmUtils.enrichEmployeesByFullName(employees)
|
||||
|
||||
if (masterTask?.id) {
|
||||
@@ -414,15 +417,23 @@ export default {
|
||||
return
|
||||
|
||||
try {
|
||||
this.masterTask.duration = 5
|
||||
this.masterTask.description = 'popis'
|
||||
this.masterTask.employees = this.masterTask.employees.map(employee => {
|
||||
employee.duration = 5
|
||||
return employee
|
||||
})
|
||||
this.masterTask.deadline = moment(this.masterTask.deadline).format("YYYY-MM-DD HH:MM:SS")
|
||||
|
||||
if (this.masterTask.id)
|
||||
await this.$axios.put_auth(`v1/mastertasks/${this.masterTask.id}`, this.masterTask)
|
||||
|
||||
else
|
||||
await this.$axios.post_auth('v1/mastertasks', this.masterTask)
|
||||
await this.$axios.post_auth_data('v1/mastertasks', this.masterTask)
|
||||
|
||||
this.closeModal()
|
||||
} catch (error) {
|
||||
this.$toast(error)
|
||||
this.$toast.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -435,6 +446,10 @@ export default {
|
||||
this.$events.emit('show-delete-master-task-modal', { masterTask })
|
||||
},
|
||||
|
||||
openDeleteTaskModal(task) {
|
||||
this.$events.emit('show-delete-task-modal', { task })
|
||||
},
|
||||
|
||||
employeeSelected(selectedOption) {
|
||||
const employee = this.employees.find((empl) => empl.id == selectedOption.key)
|
||||
this.masterTask.employees.push(employee)
|
||||
|
||||
Reference in new issue
Block a user