ARE.vue 1.11 KB
Newer Older
Rémy Marronnier's avatar
Rémy Marronnier committed
1
 <template>
Rémy Marronnier's avatar
Rémy Marronnier committed
2
  <v-form @submit.prevent="submitARE" ref="formARE" v-model="validity" :lazy-validation="lazy">
Rémy Marronnier's avatar
Rémy Marronnier committed
3
    Quel est le montant de cette allocation ?
Rémy Marronnier's avatar
Rémy Marronnier committed
4 5 6 7 8 9 10 11 12 13 14
    <v-text-field
      v-model.number="monthly_allocation_value"
      autofocus
      required
      :rules="rules"
      min="0"
      type="number"
      label="Montant par mois"
    ></v-text-field>
    <v-btn @click="back">Revenir</v-btn>
    <v-btn v-bind:disabled="!validity" type="submit">Continuer</v-btn>
Rémy Marronnier's avatar
Rémy Marronnier committed
15
  </v-form>
Rémy Marronnier's avatar
Rémy Marronnier committed
16 17 18 19
</template>
 
 <script>
export default {
Rémy Marronnier's avatar
Rémy Marronnier committed
20
  name: "ARE",
Rémy Marronnier's avatar
Rémy Marronnier committed
21 22 23 24 25 26
  created() {
    this.monthly_allocation_value = this.$store.state.situation.monthly_allocation_value;
  },
  data: () => ({
    monthly_allocation_value: null,
    validity: false,
Rémy Marronnier's avatar
Rémy Marronnier committed
27
    rules: [v => !!v || "doit être renseigné"]
Rémy Marronnier's avatar
Rémy Marronnier committed
28
  }),
Rémy Marronnier's avatar
Rémy Marronnier committed
29
  methods: {
Rémy Marronnier's avatar
Rémy Marronnier committed
30 31 32 33 34 35 36 37 38 39 40
    validate() {
      if (this.$refs.formARE.validate()) {
        this.validity = true;
      }
    },
    back() {
      this.$router.go(-1);
    },
    submitARE() {
      this.validate();
      this.$store.dispatch("submitARE", this.monthly_allocation_value);
Rémy Marronnier's avatar
Rémy Marronnier committed
41 42 43
      this.$router.push("votre-age");
    }
  }
Rémy Marronnier's avatar
Rémy Marronnier committed
44 45 46 47 48
};
</script>
 
 <style>
</style>