-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.vue
147 lines (147 loc) · 4.51 KB
/
dashboard.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!-- eslint-disable prettier/prettier -->
<template>
<div>
<v-row no-gutters>
<v-col cols="8" md="3">
<v-text-field
v-model="search"
clearable
solo
flat
label="Search"
prepend-inner-icon="mdi-magnify"
color="primary"
> </v-text-field>
</v-col>
</v-row>
<v-sheet elevation="3" style="border-radius: 5px">
<!-- fixed-tabs -->
<v-tabs
hide-slider
height="100px"
next-icon="mdi-chevron-right-circle"
prev-icon="mdi-chevron-left-circle"
v-model="selectedTab"
>
<v-tab
v-for="(item, id) in all_tabs"
:key="id"
class="tabs"
active-class="active-class"
>
<div>
<div>
<v-chip label color="#F4F4F4" class="ma-2"
><v-icon small :color="item.color"
>mdi-circle</v-icon
></v-chip
>
</div>
<div class="tab-label">
{{ item.label }}
</div>
<div class="tab-count py-2">
{{ item.value }}
</div>
</div>
</v-tab>
</v-tabs>
</v-sheet>
<data-table
:current_tab="tab"
:search="search"
@updateCount="updateCount($event)"
/>
</div>
</template>
<script>
import dataTable from "./datatable.vue";
export default {
name: "dashboard",
components: { dataTable },
data() {
return {
search: "",
total_assigned_to_me: 0,
total_document_collected: 0,
total_service_delivered: 0,
total_service_rejected: 0,
total_applications: 0,
tab: "vendor_assign_complete",
selectedTab: 0,
};
},
watch: {
selectedTab() {
this.tab = this.all_tabs[this.selectedTab].key;
},
},
computed: {
all_tabs() {
return [
{
label: "Assigned to me",
key: "vendor_assign_complete",
value: `${this.total_assigned_to_me}`,
color: "#EFB608",
},
{
label: "Document Collected",
key: "document_pickup_complete",
color: "#ED8020",
value: `${this.total_document_collected}`,
},
{
label: "Service Delivered",
key: "service_delivery_complete",
color: "#219653",
value: `${this.total_service_delivered}`,
},
{
label: "Service Rejected",
key: "failed",
color: "#E22F2F",
value: `${this.total_service_rejected}`,
},
{
label: "All Application",
key: "",
color: "#2F80ED",
value: `${this.total_applications}`,
},
];
},
},
methods: {
updateCount(counts) {
this.total_assigned_to_me = counts.total_assigned_to_me,
this.total_document_collected = counts.total_document_collected,
this.total_service_delivered = counts.total_service_delivered,
this.total_service_rejected = counts.total_service_rejected,
this.total_applications = counts.total_applications
}
},
};
</script>
<style scoped>
.tabs {
width: 200px;
border-left: 1px solid #ececec;
border-right: 1px solid #ececec;
}
.active-class {
background: #eaf2fd;
}
.tab-label {
font-weight: 600;
font-size: 12px;
line-height: 14px;
text-transform: none;
}
.tab-count {
font-weight: 600;
font-size: 25px;
line-height: 42px;
color: #2f80ed;
}
</style>