%PDF- %PDF-
Direktori : /home/ugotscom/bos_naturals/resources/js/components/ |
Current File : /home/ugotscom/bos_naturals/resources/js/components/tasks.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> {{users.total}}</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">For Sale</div> <div class="h5 mb-0 font-weight-bold text-gray-800"></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">Rent</div> <div class="h5 mb-0 font-weight-bold text-gray-800"></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"></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" style="width:50%">Task</th> <th scope="col">Assigned</th> <th scope="col">Status</th> <th scope="col">due date</th> <th scope="col">Actions</th> </tr> </thead> <tbody> <tr v-for ="user in users.data" :key="user.id"> <th scope="row" class="task">{{user.task}}</th> <td>{{user.name}}</td> <td> <div v-bind:style="{ backgroundColor: user.color }" class="status-style"> {{user.status}} </div> </td> <td>{{user.due_date|fdate}}</td> <td><router-link v-bind:to="'/taskdetail/'+user.id">View</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:{}, staffs:[], clientid:'' } }, 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('tasks/searchquery?q=' + searchQuery) .then(response => { this.isLoading = false; this.users = response.data; }); }, getResults(page = 1) { axios.get('tasks/tasksbyid/'+this.clientid+'?page=' + page) .then(response => { this.users = response.data; }); }, loadtheusers(){ axios.get('/dashboard').then(response =>{ this.staff=response.data; this.clientid=response.data.id; this.loadusers(); }); }, loadusers(){ axios.get('/tasks/tasksbyid/'+this.clientid).then(({data})=> (this.users = data)); }, getPosts: function() { axios.get('/leads').then(function(response){ this.rows = response.data; }.bind(this)); }, getcount(){ axios.get('/leads/totalcount').then(({data})=> (this.counts = data)); } }, created: function(){ this.loadtheusers(), this.getcount() } } </script> <style scoped> .status-style{ text-align: center; color: #fff; } </style>