%PDF- %PDF-
Direktori : /home/ugotscom/bos_naturals/resources/js/components/ |
Current File : /home/ugotscom/bos_naturals/resources/js/components/propertyserviceleads copy.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">Property Marketing Leads</div> <div class="h5 mb-0 font-weight-bold text-gray-800"> <p>{{totalcount['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">Pending Visits</div> <div class="h5 mb-0 font-weight-bold text-gray-800">{{totalcount['pendingsitevisit']}}</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">Pending Addition</div> <div class="h5 mb-0 font-weight-bold text-gray-800">{{totalcount['pending']}}</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">Crossed Due Date</div> <div class="h5 mb-0 font-weight-bold text-gray-800">{{totalcount['due']}}</div> </div> </div> </div> </div> <select v-model="dataFilter" v-on:click="changeItem()"> <option value="0">All</option> <option value="1">Open Leads</option> <option value="2">Site Visit Assigned</option> <option value="3">Add Property</option> <option value="4">Pending Verification</option> <option value="5">Completed</option> <option value="7">Rejected</option> <option value="8">Closed</option> </select> <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">Additional Info</th> <th scope="col">Status</th> <th scope="col">Location</th> <th scope="col">Days Old</th> </tr> </thead> <tbody> <tr v-for ="user in users.data" :key="user.leadid"> <th scope="row">{{user.enquiry_id}}</th> <td>{{user.name}}</td> <td>{{user.property_fors}}</td> <td>{{user.property_for_type}}</td> <td>{{user.additional_info}}</td> <td> <div v-bind:style="{ backgroundColor: user.color }" class="status-style"> {{user.status_name}} </div> </td> <td>{{user.location}}</td> <td>{{user.created_at|diffdate}}</td> <td><router-link v-bind:to="'/viewpropertyservicelead/'+user.enquiry_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 { mounted() { console.log('Component mounted.') }, data(){ return { users:{}, searchQuery:'', isTyping: false, isLoading: false, counts:{}, totalcount:[], dataFilter:0, } }, 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('propertyservice/searchquery?q=' + searchQuery) .then(response => { this.isLoading = false; this.users = response.data; }); }, getResults(page = 1) { axios.get('propertyservice?page=' + page) .then(response => { this.users = response.data; }); }, loadusers(){ axios.get('/propertyservice').then(({data})=> (this.users = data)); }, loadtotalcount(){ axios.get('/propertyservice/totalcount') .then(response => { this.totalcount = response.data; }); }, getPosts: function() { axios.get('/propertyservice').then(function(response){ this.rows = response.data; }.bind(this)); }, getcount(){ axios.get('/propertyservice').then(({data})=> (this.counts = data)); }, changeItem(){ axios.get('/propertyservice/leads/'+this.dataFilter).then(({data})=> (this.users = data)); }, }, created: function(){ this.loadusers(), this.loadtotalcount(), this.counta() }, } </script> <style scoped> .status-style{ text-align: center; color: #fff; } </style>