prefil date and time [blocker]

This commit is contained in:
romankko2 committed 2023-06-09 16:47:01 +02:00
1 parent 2d7f29e9f4
commit 19a321baa8
6 files changed
+47 -24

No files matched your search

+2 -2
View File
@@ -52,8 +52,8 @@ export default {
},
mounted() {
this.$events.on('show-menu-modal', () => {
this.$refs['z-show-menu-modal'].showModal()
this.$events.on('show-menu-modal', (data) => {
this.$refs['z-show-menu-modal'].showModal(data)
})
this.$events.on('show-delete-team-modal', ({team}) => {
+6 -8
View File
@@ -261,15 +261,13 @@ export default {
const dateTo = new Date(dateFrom)
dateTo.setHours(dateFrom.getHours() + 1)
const splitDate = split.date
const time = moment(dateFrom).format('HH:mm')
const date = moment(dateFrom).format('DD.MM.yyyy')
const time = moment(splitDate).format('hh:mm')
const date = moment(splitDate).format('YYYY-MM-DD') // dd.MM.yyyy
console.log(time)
console.log(date)
this.$events.emit('show-menu-modal', {})
this.$events.emit('show-menu-modal', {
time: time,
date: date
})
setTimeout(() => {
this.$events.emit('add-timeblock', {
+1 -1
View File
@@ -157,7 +157,7 @@ export default {
},
onDragStart(e) {
if (this.event.type == 'blocker' || this.event.type == 'non-working-hours') return
if (this.event.type == 'blocker' || this.event.type == 'non-working-hours') return //|| this.event._timeblock_is_finished || this.event.subtask?.is_finished
this.event.draggingStatic = false
this.dnd && this.dnd.eventDragStart(e, this.event);
},
@@ -108,7 +108,12 @@ export default {
//fixnut validacie employee_id
this.blocker = blocker
} else {
this.blocker = { start: null }
this.blocker = {start: null }
if (blocker.starts_at_time && blocker.datepicker) {
this.datepicker = blocker.datepicker
this.starts_at_time = blocker.starts_at_time
}
}
} catch (error) {
this.$toast.error(error)
@@ -2,15 +2,17 @@
<v-dialog v-model="visible" max-width="750">
<v-card>
<div class="d-flex justify-space-between align-center">
<h1>
Vytvoriť
</h1>
<h1>Vytvoriť</h1>
<v-icon @click.stop="closeModal()" icon="mdi-close" size="large"></v-icon>
</div>
<v-card-actions class="mt-10 d-flex justify-start align-center">
<v-btn class="button primary half outline" @click.stop="createTask()">TASK</v-btn>
<v-btn class="button primary half outline" @click.stop="createBlocker()">BLOCKER</v-btn>
<v-btn class="button primary half outline" @click.stop="createTask()"
>TASK</v-btn
>
<v-btn class="button primary half outline" @click.stop="createBlocker()"
>BLOCKER</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
@@ -18,16 +20,19 @@
<script>
export default {
emits: ['update'],
emits: ['update', 'data'],
props: ['data'],
data() {
return {
visible: false
visible: false,
localData: null,
}
},
methods: {
async showModal() {
async showModal(data) {
this.localData = data
this.visible = true
},
@@ -36,12 +41,22 @@ export default {
},
createTask() {
this.$events.emit('show-subtask-modal', {})
this.$events.emit('show-subtask-modal', {
subtask: {
deadline: this.localData.date,
_deadline_time: this.localData.time,
},
})
},
createBlocker() {
this.$events.emit('show-blocker-modal', {})
}
}
this.$events.emit('show-blocker-modal', {
blocker: {
starts_at_time: this.localData.time,
datepicker: this.localData.date,
},
})
},
},
}
</script>
@@ -197,6 +197,11 @@ export default {
this.subtask = this._enrichTask(data)
} else {
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
} catch (error) {