|
|
|
@ -1,10 +1,5 @@
|
|
|
|
|
<template>
|
|
|
|
|
<basic-modal
|
|
|
|
|
width="520"
|
|
|
|
|
transition="slide-x-transition"
|
|
|
|
|
tag="form"
|
|
|
|
|
@submit="addSeries"
|
|
|
|
|
>
|
|
|
|
|
<basic-modal width="520" transition="slide-x-transition" tag="form" @submit="addSeries">
|
|
|
|
|
<template #header>
|
|
|
|
|
<div class="close__modal">
|
|
|
|
|
<v-icon class="WMi-cancel-1" large @click="$_closeModal()"></v-icon>
|
|
|
|
@ -35,7 +30,8 @@
|
|
|
|
|
><v-text-field
|
|
|
|
|
dark
|
|
|
|
|
label="how many times in a week?"
|
|
|
|
|
class="no-error-msg mt-0 pt-0"
|
|
|
|
|
class="mt-0 pt-0"
|
|
|
|
|
:rules="[rules.required, rules.min]"
|
|
|
|
|
v-model="form.repeat"
|
|
|
|
|
></v-text-field>
|
|
|
|
|
</v-col>
|
|
|
|
@ -52,9 +48,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<v-spacer></v-spacer>
|
|
|
|
|
<div
|
|
|
|
|
class="d-flex justify-space-between align-items-center w-100 pb-10"
|
|
|
|
|
>
|
|
|
|
|
<div class="d-flex justify-space-between align-items-center w-100 pb-10">
|
|
|
|
|
<RectangleButton
|
|
|
|
|
class="btn__modal--cancel pl-0"
|
|
|
|
|
text="cancel"
|
|
|
|
@ -78,6 +72,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import { mapActions } from "vuex";
|
|
|
|
|
import SectionTitle from "../../Global/Section/SectionTitle.vue";
|
|
|
|
|
import toast from "@/utils/toast";
|
|
|
|
|
export default {
|
|
|
|
|
name: "modal_add_series",
|
|
|
|
|
components: { SectionTitle },
|
|
|
|
@ -86,10 +81,15 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data: () => ({
|
|
|
|
|
form: {},
|
|
|
|
|
rules: {
|
|
|
|
|
required: (value) => !!value || "Required.",
|
|
|
|
|
min: (v) => v <= 7 || "The value of this field must be less than 7",
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
methods: {
|
|
|
|
|
...mapActions("programSeries", ["addSeriesToProgram"]),
|
|
|
|
|
async addSeries() {
|
|
|
|
|
if (this.form.repeat <= 7) {
|
|
|
|
|
let response = await this.addSeriesToProgram({
|
|
|
|
|
data: this.form,
|
|
|
|
|
courseId: Number(this.programId),
|
|
|
|
@ -97,6 +97,9 @@ export default {
|
|
|
|
|
if (response) {
|
|
|
|
|
this.$_closeModal();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
toast.error("The information entered is incorrect", "Error");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|