<template>
    <form @submit.prevent="submit">
<div class="form-group row">
    <div class="col-md-12">
        <label for=""> Surname</label>
         <input type="hidden" name="customer_id" id="customer_id" v-model="fields.customer_id" class="form-control" >
        <input type="text" name="surname" id="surname" v-model="fields.surname" class="form-control" placeholder="Enter Surname...">
        <div v-if="errors && errors.surname" class="text-danger">{{ errors.surname[0] }}</div>
    </div>
    <div class="col-md-12">
        <label for="">Other Name(s)</label>
        <input type="text" name="othername" id="othername" v-model="fields.othername" class="form-control" placeholder="Enter Other Name(s)...">
        <div v-if="errors && errors.othername" class="text-danger">{{ errors.othername[0] }}</div>
    </div>
     <div class="col-md-12">
        <label for=""> Username</label>
        <input type="text" name="username" id="username" v-model="fields.username" class="form-control" placeholder="Enter uSername...">
        <div v-if="errors && errors.username" class="text-danger">{{ errors.username[0] }}</div>
    </div>
    
    <div class="col-md-12">
        <label for=""> Contact</label>
        <input type="text" name="contact" id="contact" v-model="fields.contact" class="form-control" placeholder="Enter contact e.g 700111222"> 
        <div v-if="errors && errors.contact" class="text-danger">{{ errors.contact[0] }}</div>                                                       
    </div>

    <div class="col-md-12">
        <label for=""> Email</label>
        <input type="text" name="email" id="email" v-model="fields.email" class="form-control" placeholder="Enter email...">      
        <div v-if="errors && errors.email" class="text-danger">{{ errors.email[0] }}</div>                                                  
    </div>
   </div>
   <div class="form-group row">
    <div class="col-md-12">
        <button type="submit" class="btn btn-success btn-round">Save</button>
        <button type="reset" class="btn btn-danger btn-round">Clear</button>
    </div>
    </div>
    </form>
</template>

<script>
import FormMixin from './FormMixin';

export default {
  mixins: [ FormMixin ],
  props: ['cust_id'],
 
  data() {
    return {
      'action': '/bmp/users/addUser',
      'text': 'User added succesfully',
      'redirect': '',
      fields:{
        customer_id:this.cust_id
      }
    }
  },
  mounted(){
    this.fields.customer_id=this.cust_id;
  }
}

</script>