[napajanie modalov na BE]

This commit is contained in:
romankko2 committed 2023-01-26 21:11:53 +01:00
1 parent 26792a85a6
commit 4c8ee66cd6
34 files changed
+494 -396

No files matched your search

@@ -273,6 +273,7 @@
</div>
<v-table class="mt-7 mb-5">
<tbody class="px-5 py-5">
<!-- Kravarik: natiahnut toto z masterTask.tasks -->
<tr v-for="(employee, index) in masterTask.employees" :key="employee.id">
<td class="w-25">{{ masterTask.name }}</td>
<td class="d-flex align-center">
@@ -352,17 +353,6 @@ export default {
}
},
async created() {
try {
this.teams = await this.$axios.get_auth_data('v1/teamsx')
this.employees = await this.$axios.get_auth_data('v1/employees')
// this.masterTask = await this.$axios.get_auth_data(`v1/master-task/${this.masterTaksId}`)
// this.selectedTeam = `${this.masterTask.team.name} - ${this.masterTask.team.id}`)
} catch (error) {
this.$toast.error(error)
}
},
methods: {
// async downloadFile() {
// try {
@@ -375,13 +365,20 @@ export default {
// }
// },
async create(masterTaskId = null, editMode = false) {
async showModal(masterTask, editMode = false) {
this.visible = true
this.masterTask = null
if (masterTaskId) {
await this._load(masterTaskId)
this.editMode = editMode || (!this.masterTask?.id)
try {
this.teams = await this.$axios.get_auth_data('v1/teams')
this.employees = await this.$axios.get_auth_data('v1/employees')
} catch (error) {
this.$toast.error(error)
}
if (masterTask?.id) {
await this._load(masterTask.id)
this.editMode = editMode || !masterTask?.id
} else {
const masterTask = {
project_code: null,
@@ -396,7 +393,7 @@ export default {
setTimeout(() => {
this.masterTask = masterTask
this.editMode = editMode || (!this.masterTask.id)
this.editMode = editMode || !this.masterTask.id
})
}
},
@@ -434,7 +431,7 @@ export default {
async _create() {
try {
await this.$axios.post_auth('v1/master-tasks')
await this.$axios.post_auth('v1/mastertasks')
} catch (error) {
this.$toast.error(error)
}