%PDF- %PDF-
Direktori : /home/ugotscom/bos_naturals/resources/js/components/MIS/ |
Current File : /home/ugotscom/bos_naturals/resources/js/components/MIS/companywise.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 Companies</div> <div class="h5 mb-0 font-weight-bold text-gray-800"> <p>{{tasks['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">Active</div> <div class="h5 mb-0 font-weight-bold text-gray-800">{{tasks['active']}}</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">{{tasks['inactive']}}</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">{{tasks['addedthismonth']}}</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 Company"> <table class="table table-bordered"> <thead> <tr> <th scope="col" class="sml">Client ID</th> <th scope="col">Client Name</th> <th scope="col">Total PQR</th> <th scope="col">Total SDR</th> <th scope="col">Total OC</th> <th scope="col">Actions</th> </tr> </thead> <tbody> <tr v-for ="user in users.data" :key="user.id"> <th scope="row">{{user.client_id}}</th> <td>{{user.name}}</td> <td>{{user.totalpqr}}</td> <td></td> <td>NA </td> <td><router-link v-bind:to="'/viewcompany/'+user.user_id">View</router-link> </td> </tr> </tbody> </table> <pagination :data="users" :limit="10" @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('/mis/companywisemissearchquery?q=' + searchQuery) .then(response => { this.isLoading = false; this.users = response.data; }); }, getResults:function(page = 1) { axios.get('companies?page=' + page) .then(response => { this.users = response.data; }); }, loadusers:function(){ axios.get('/mis/companywisemis').then(({data})=> (this.users = 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>