diff --git a/src/views/Delegate/Schedule.vue b/src/views/Delegate/Schedule.vue index f50dcdb..b5c91b1 100644 --- a/src/views/Delegate/Schedule.vue +++ b/src/views/Delegate/Schedule.vue @@ -199,6 +199,7 @@ @@ -281,7 +282,7 @@ @click="saveWhen()" text color="success" - :disabled="when.day.length < 4 || when.to === null || when.from === null || when.to.length !== 5 || when.from.length !== 5"> + :disabled="(mode == 'add' ? when.day.length === 0 : when.day.length < 4) || when.to === null || when.from === null || when.to.length !== 5 || when.from.length !== 5"> Valider @@ -477,7 +478,9 @@ export default { if (!Array.isArray(i.when)) { i.when = [] } - i.when.push(this.when) + this.when.day.forEach((d) => { + i.when.push({ ...this.when, day: d, _id: Date.now().toString() }) + }) } // sort all days i.when = i.when.sort((a, b) => this.days.indexOf(a.day) >= this.days.indexOf(b.day) ? 1 : -1)