%PDF- %PDF-
Direktori : /home/ugotscom/kma/resources/js/components/Members/ |
Current File : /home/ugotscom/kma/resources/js/components/Members/tempmemberdetails.vue |
<template> <div class="container-fluid" > <form action="/leads" method="POST" @submit.prevent="updateMember()"> <div class="form-group"> <label for="lead_name">Member Code</label> <input type="text" class="form-control" v-model="memberdetails.member_code" placeholder=""> </div> <div class="form-group"> <label for="lead_name">Name</label> <input type="text" class="form-control" v-model="memberdetails.name"> </div> <div class="form-group"> <label for="lead_name">Designation</label> <input type="text" class="form-control" v-model="memberdetails.designation"> </div> <div class="form-row"> <div class="col"> <div class="form-group"> <label for="lead_name">Company Name</label> <input type="text" class="form-control" v-model="memberdetails.company_name"> </div> </div> <div class="col"> <div class="form-group"> <label for="lead_name">Company Address</label> <input type="text" class="form-control" v-model="memberdetails.company_address"> </div> </div> </div> <div class="form-group"> <label for="lead_name">Home Address</label> <input type="text" class="form-control" v-model="memberdetails.home_address"> </div> <div class="form-group"> <label for="email">Email</label> <input type="text" class="form-control" name="email" v-model="memberdetails.email" placeholder=""> </div> <div class="form-group"> <label for="email">Alternate Email</label> <input type="text" class="form-control" name="email2" v-model="memberdetails.email2" placeholder=""> </div> <div class="form-row"> <div class="col"> <div class="form-group"> <label for="phone">Phone</label> <input type="text" class="form-control" name="phone" v-model="memberdetails.phone" > </div> </div> <div class="col"> <div class="form-group"> <label for="phone">Secondary Phone</label> <input type="text" class="form-control" name="phone" v-model="memberdetails.phone2"> </div> </div> </div> <div class="form-group"> <label for="phone">Proposed By</label> <input type="text" class="form-control" name="phone" v-model="memberdetails.proposed_by" > </div> <div class="form-row"> <div class="col"> <div class="form-group"> <label for="">Member Type</label> <select v-model="memberdetails.member_type" class="form-control"> <option value="1">Individual Members</option> <option value="2">Individual Member-Life Time</option> <option value="3">Individual Member _Senior Citizen </option> <option value="4">Corporate Member</option> <option value="5">Associate Corporate Member </option> <option value="6">AIMA</option> <option value="7">Start Up</option> <option value="8">Student Member</option> </select> </div> </div> <div class="col"> <div class="form-group"> <label for="phone">GST (optional)</label> <input type="text" class="form-control" name="phone" v-model="memberdetails.gst" > </div> </div> </div> <div class="form-group"> <label for="date">Date of Joining</label> <input type="date" class="form-control" name="phone" v-model="memberdetails.doj" > </div> <button type="submit" value="submit" class="btn btn-primary">Submit</button> </form> </div> </template> <script> import addtags from '../addtag.vue' export default { components: { addtags}, data(){ return { id:this.$route.params.id, clientid:1, client_id:'', transaction_id:'', transaction_type:'', amount:'', date:'', task:'', method:'', status:'success', id:this.$route.params.id, users:[], ref:[], ref_name:'', ref_id:'', tasks:{}, activeItem: 'activity', properties:{}, leads:{}, profiles:[], maintenances:[], activities:[], payments:{}, memberdetails:{ member_code:"", name:"", email:"", email2:"", phone:"", phone2:"", designation:"", company_address:"", company_name:"", home_address:"", proposed_by:"", status:2, gst:"" } } }, methods:{ loadusers(){ axios.get('/temporary/memberdetails/'+this.id) .then(response => { this.users = response.data; this.memberdetails.member_code =this.users[0].member_code; this.memberdetails.name =this.users[0].name; this.memberdetails.email =this.users[0].email; this.memberdetails.email2 =this.users[0].email2; this.memberdetails.phone =this.users[0].phone; this.memberdetails.phone2 =this.users[0].phone2; this.memberdetails.designation =this.users[0].designation; this.memberdetails.company_name =this.users[0].company_name; this.memberdetails.company_address =this.users[0].company_address; this.memberdetails.home_address =this.users[0].home_address; this.memberdetails.proposed_by =this.users[0].proposed_by; this.memberdetails.status =this.users[0].status; this.memberdetails.gst =this.users[0].gst; this.ref_id=this.users[0].client_id; this.loadref(); }) }, loadref(){ axios.get('/client/clientdetails/'+this.ref_id) .then(response => { this.ref = response.data; this.ref_name=this.ref[0].name; }) }, updateMember(){ axios.patch('/members/'+this.ref_id,this.memberdetails ) .then(response => { this.$toaster.success('Member Details Approved'), this.$router.push({ path: '/temporarymember'}) }) }, loadtasks(){ axios.get('/tasks/gettasksuserid/'+this.id).then(response => { this.tasks = response.data }) }, loadpayments(){ axios.get('/payments/paymentdetails/'+this.id).then(response=> {this.payments=response.data}) }, loadMaintenances(){ axios.get('/maintenance/maintenancebyclient/'+this.id).then(response => { this.maintenances = response.data }) }, loadactivities(){ axios.get('/activities/'+this.id) .then(response => { this.activities = response.data; }) }, getResults(page = 1) { axios.get('/tasks/taskdetails/'+this.id+'?page=' + page) .then(response => { this.tasks = response.data; }); }, addtask(){ axios .post('/tasks', { client_id: this.client_id, task: this.task, status:this.status }) .then(function (response) { //handle success console.log(response); }); this.$root.$emit('bv::toggle::collapse', 'example-collapse') }, addpayments(){ axios .post('/payments', { date:this.date, client_id: this.id, transaction_id: this.transaction_id, transaction_type:this.transaction_type, amount:this.amount, status:this.status }) .then(function (response) { //handle success this.loadpayments(), console.log(response); }); this.$root.$emit('bv::toggle::collapse', 'add-payment') }, isActive (menuItem) { return this.activeItem === menuItem }, setActive (menuItem) { this.activeItem = menuItem }, getProperties:function(page = 1) { axios.get('/properties/allclientproperties/'+this.id+'?page=' + page) .then(response => { this.properties = response.data; }); }, loadproperties:function(){ axios.get('/properties/allclientproperties/'+this.id).then(({data})=> (this.properties = data)); }, getLeads:function(page = 1) { axios.get('/leads/leaddetailsid/'+this.id+'?page=' + page) .then(response => { this.leads = response.data; }); }, loadLeads:function(){ axios.get('/leads/leaddetailsid/'+this.id).then(({data})=> (this.leads = data)); }, onChange(e) { this.file = e.target.files[0]; }, formSubmit(e) { e.preventDefault(); let existingObj = this; const config = { headers: { 'content-type': 'multipart/form-data' } } let data = new FormData(); data.append('file', this.file); axios.post('/members/imageupload', data, config) .then(function (res) { existingObj.success = res.data.success; }) .catch(function (err) { existingObj.output = err; }); } }, created: function(){ this.loadusers(), this.loadtasks(), this.loadpayments(), this.loadproperties(), this.loadLeads(), this.loadMaintenances(), this.loadactivities() } } </script> <style scoped> .nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: #ffffff; background-color: #0d75dd; border-color: #dee2e6 #dee2e6 #f8fafc; } #tasks ul { padding: 0; margin: 0; list-style: none; } .profile-title{ font-size: 19px; text-align: center; font-weight: bold; padding-top: 12px; } </style>