%PDF- %PDF-
Direktori : /home/ugotscom/kma/resources/js/components/Members/ |
Current File : /home/ugotscom/kma/resources/js/components/Members/tempmembers.vue |
<template> <div class="container-fluid"> <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">Total Members</div> <div class="h5 mb-0 font-weight-bold text-gray-800"> <p>2800</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">Active</div> <div class="h5 mb-0 font-weight-bold text-gray-800">2658</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">Inactive</div> <div class="h5 mb-0 font-weight-bold text-gray-800">142</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">Added This month</div> <div class="h5 mb-0 font-weight-bold text-gray-800">15</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="Search Client"> <table class="table styled-table"> <thead> <tr> <th scope="col">Member Code</th> <th scope="col">Name</th> <th scope="col">Designation</th> <th scope="col">Company</th> <th scope="col">email</th> <th scope="col">phone</th> <th scope="col">Secondary Phone</th> <th scope="col">Member Type</th> <th scope="col">Status</th> <th scope="col">Due</th> <th scope="col">Actions</th> </tr> </thead> <tbody> <tr v-for ="user in users.data" :key="user.id"> <th scope="row">{{user.member_code }}</th> <td>{{user.name}}</td> <td>{{user.designation}}</td> <td>{{user.company_name}}</td> <td>{{user.email}}</td> <td>{{user.phone}}</td> <td>{{user.phone2}}</td> <td>{{user.member_type_code}}</td> <td>{{user.status}}</td> <td>{{user.due}}</td> <td><router-link v-bind:to="'/viewtempmember/'+user.id">View</router-link> </td> </tr> </tbody> </table> <pagination :data="users" @pagination-change-page="getResults"></pagination> </div> </div> </div> </template> <script> export default { data(){ return { users:{}, tasks:[], searchQuery:'', isTyping: false, isLoading: false, status:'', cc:'', } }, watch: { searchQuery: _.debounce(function() { this.isTyping = false; }, 500), isTyping: function(value) { if (!value) { this.searchUser(this.searchQuery); } } }, methods:{ searchUser: function(searchQuery) { this.isLoading = true; axios.get('members/searchquery?q=' + searchQuery) .then(response => { this.isLoading = false; this.users = response.data; }); }, getResults:function(page = 1) { axios.get('members?page=' + page) .then(response => { this.users = response.data; }); }, loadusers:function(){ axios.get('/temporary') .then(response => { this.users = response.data }) }, loadtotalcount(){ axios.get('/client/totalcount') .then(response => { this.tasks = response.data }) }, getPosts:function () { axios.get('/client').then(function(response){ this.rows = response.data; }.bind(this)); }, }, computed:{ computedProducts: function () { if(this.status==""){ return this.users.data; } return this.users.data.filter((item) => { return (this.status.length === 0 || this.status.includes(item.profile))&& (this.cc.length === 0 || this.cc.includes(item.cc)) }) } }, created: function(){ this.loadusers(), this.loadtotalcount(), Echo.join(`chat`) .here((users) => { // }) .joining((user) => { console.log(user.name); }) .leaving((user) => { console.log(user.name); }) .error((error) => { console.error(error); }); }, } </script> <style scoped> .sml{ width: 10%; } </style>