%PDF- %PDF-
Direktori : /home/ugotscom/3vfm3/resources/js/components/ |
Current File : /home/ugotscom/3vfm3/resources/js/components/leads3.vue |
<template> <div class="container"> <div class="row"> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Property Leads</div> <div class="h5 mb-0 font-weight-bold text-gray-800"> <p>{{counts.length}}</p></div> <router-link @click="say()">click me</router-link> </div> </div> </div> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">This Month</div> <div class="h5 mb-0 font-weight-bold text-gray-800">220</div> </div> </div> </div> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Maintenance Leads</div> <div class="h5 mb-0 font-weight-bold text-gray-800">12</div> </div> </div> </div> <div class="col"> <div class="card border-left-primary shadow h-100 py-2"> <div class="card-body"> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">This Month</div> <div class="h5 mb-0 font-weight-bold text-gray-800">220</div> </div> </div> </div> </div> <div class="row justify-content-center"> <div class="col-md-12"> <input type="text" class="form-control" @input="isTyping = true" v-model="searchQuery" placeholder="Type your keyword"> <table class="table table-bordered"> <thead> <tr> <th scope="col">Id</th> <th scope="col">Client Name</th> <th scope="col">Property For</th> <th scope="col">Property Type</th> <th scope="col">Budget</th> <th scope="col">Location</th> <th scope="col">status</th> <th scope="col">Days Old</th> </tr> </thead> <tbody> <tr v-for ="user in users.data" :key="user.id"> <th scope="row">{{user.id}}</th> <td>{{user.name}}</td> <td>{{user.property_fors}}</td> <td>{{user.property_for_type}}</td> <td>{{user.budget_min}}-{{user.budget_max}}</td> <td> <div v-bind:style="{ backgroundColor: user.color }" class="status-style"> {{user.status}} </div> </td> <td>{{user.location}}</td> <td>status</td> <td><router-link ></router-link></td> <td><router-link v-bind:to="'/viewlead/'+user.package_id">View{{user.package_id}}</router-link></td> </tr> </tbody> </table> <pagination :data="users" @pagination-change-page="getResults"></pagination> </div> </div> </div> </template> <script> export default { mounted() { console.log('Component mounted.') }, data(){ return { users:{}, searchQuery:'', isTyping: false, isLoading: false, counts:{} } }, watch: { searchQuery: _.debounce(function() { this.isTyping = false; }, 1000), isTyping: function(value) { if (!value) { this.searchUser(this.searchQuery); } } }, methods:{ searchUser: function(searchQuery) { this.isLoading = true; axios.get('leads/searchquery?q=' + searchQuery) .then(response => { this.isLoading = false; this.users = response.data; }); }, getResults(page = 1) { axios.get('leads?page=' + page) .then(response => { this.users = response.data; }); }, loadusers(){ axios.get('/leads').then(({data})=> (this.users = data)); }, getPosts: function() { axios.get('/leads').then(function(response){ this.rows = response.data; }.bind(this)); }, getcount(){ axios.get('/leads').then(({data})=> (this.counts = data)); } }, created: function(){ this.loadusers(), this.counta() }, } </script> <style scoped> .status-style{ text-align: center; color: #fff; } </style>