better customer screen WIP
This commit is contained in:
parent
b78da566d9
commit
c5fd049d07
3 changed files with 81 additions and 43 deletions
|
@ -47,13 +47,21 @@
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-footer >
|
<v-footer>
|
||||||
<sub>{{ site_info.name }} v{{ site_info.version }}</sub>
|
<v-banner>
|
||||||
|
<v-banner-text>
|
||||||
|
<sub>{{ site_info.name }}<br/>
|
||||||
|
BE v{{ site_info.version }}<br/>
|
||||||
|
FE v{{ appVersion }}
|
||||||
|
</sub>
|
||||||
|
</v-banner-text>
|
||||||
|
</v-banner>
|
||||||
</v-footer>
|
</v-footer>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { version } from "@/../package.json"
|
||||||
export default{
|
export default{
|
||||||
name: "MyNav",
|
name: "MyNav",
|
||||||
props: {
|
props: {
|
||||||
|
@ -79,6 +87,7 @@ export default{
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
appVersion: version,
|
||||||
items: [],
|
items: [],
|
||||||
drawer: null,
|
drawer: null,
|
||||||
drawer2: false
|
drawer2: false
|
||||||
|
|
|
@ -8,5 +8,6 @@ export default class Customer {
|
||||||
full_title = "";
|
full_title = "";
|
||||||
at_risk = false;
|
at_risk = false;
|
||||||
address = new CustomerAddress();
|
address = new CustomerAddress();
|
||||||
|
notes = {}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,30 +1,47 @@
|
||||||
<template>
|
<template>
|
||||||
<h3>Customer List</h3>
|
<v-text-field
|
||||||
<v-responsive
|
clearable
|
||||||
max-width="500"
|
label="Search"
|
||||||
>
|
variant="outlined"
|
||||||
<v-text-field
|
v-model="searchQuery"
|
||||||
clearable
|
density="compact"
|
||||||
label="Search"
|
append-inner-icon="mdi-magnify"></v-text-field>
|
||||||
variant="outlined"
|
<v-row>
|
||||||
v-model="searchQuery"
|
<v-col cols="12" sm=12 lg=6>
|
||||||
density="compact"
|
<h3>Customer List</h3>
|
||||||
append-inner-icon="mdi-magnify"></v-text-field>
|
<v-progress-linear color="blue" :active="customers_loading" indeterminate>
|
||||||
</v-responsive>
|
</v-progress-linear>
|
||||||
<RecycleScroller
|
<v-list>
|
||||||
class="scroller"
|
<RecycleScroller
|
||||||
:items="filteredCustomers"
|
class="scroller"
|
||||||
:item-size="50"
|
:items="filteredCustomers"
|
||||||
key-field="acc_no"
|
:item-size="50"
|
||||||
v-slot="{ item }"
|
key-field="acc_no"
|
||||||
>
|
v-slot="{ item }"
|
||||||
<v-row class="customer">
|
>
|
||||||
<v-col cols="6">
|
<v-list-item @click="getCustomerNotes(item)">
|
||||||
{{ item.acc_no }} - {{ item.name }}
|
<template v-slot:title>
|
||||||
</v-col>
|
{{ item.acc_no }} - {{ item.name }}
|
||||||
</v-row>
|
</template>
|
||||||
<hr />
|
<template v-slot:append>
|
||||||
</RecycleScroller>
|
<v-btn color="info">Contracts</v-btn>
|
||||||
|
<v-btn color="warning">Med Feeds</v-btn>
|
||||||
|
</template>
|
||||||
|
</v-list-item>
|
||||||
|
</RecycleScroller>
|
||||||
|
</v-list>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12" sm=12 lg=6>
|
||||||
|
<h3>Notes <v-btn color="warning" size="smaller" variant="text" icon="mdi-plus"></v-btn></h3>
|
||||||
|
<v-progress-linear color="blue" :active="notes_loading" indeterminate>
|
||||||
|
</v-progress-linear>
|
||||||
|
<v-list>
|
||||||
|
<v-list-item v-for="item in notes" :key="item.id">
|
||||||
|
{{ item.text }}
|
||||||
|
</v-list-item>
|
||||||
|
</v-list>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -36,12 +53,12 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
searchQuery: "",
|
searchQuery: "",
|
||||||
showSearch: true,
|
customer_list: [],
|
||||||
open: false,
|
customers_loading: null,
|
||||||
list: [],
|
|
||||||
limit: 5000,
|
limit: 5000,
|
||||||
loading: true,
|
listreceived: false,
|
||||||
listreceived: false
|
notes_loading: null,
|
||||||
|
notes: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -52,7 +69,7 @@ export default {
|
||||||
if (!this.listreceived){
|
if (!this.listreceived){
|
||||||
this.getCustomerList()
|
this.getCustomerList()
|
||||||
}
|
}
|
||||||
let clist = this.list.filter(q =>
|
let clist = this.customer_list.filter(q =>
|
||||||
q.name.toLowerCase().includes(query) ||
|
q.name.toLowerCase().includes(query) ||
|
||||||
q.acc_no.includes(query)
|
q.acc_no.includes(query)
|
||||||
)
|
)
|
||||||
|
@ -60,30 +77,41 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getCustomerNotes(cust){
|
||||||
|
this.notes_loading = true
|
||||||
|
let url = this.$api_url + "/customers/" + cust + "/notes"
|
||||||
|
axios.get(url)
|
||||||
|
.then(resp => {
|
||||||
|
this.notes = resp.data
|
||||||
|
})
|
||||||
|
.catch(error => (console.log(error)))
|
||||||
|
.finally(() => {
|
||||||
|
this.notes_loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
async getCustomerList() {
|
async getCustomerList() {
|
||||||
this.loading = true
|
this.customers_loading = true
|
||||||
let url = this.$api_url + "/customers/list"
|
let url = this.$api_url + "/customers/list"
|
||||||
axios
|
axios
|
||||||
.get(url,{
|
.get(url,{
|
||||||
params: { limit: this.limit, query: this.searchQuery }})
|
params: { limit: this.limit, query: this.searchQuery }})
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
this.list = resp.data
|
this.customer_list = resp.data
|
||||||
this.listreceived = true
|
this.listreceived = true
|
||||||
this.loading = false
|
|
||||||
})
|
})
|
||||||
.catch(error => (console.log(error)))
|
.catch(error => (console.log(error)))
|
||||||
|
.finally(() => {
|
||||||
|
this.customers_loading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.scroller {
|
.scroller {
|
||||||
height: 500px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
.customer {
|
.scroller.small {
|
||||||
height: 32%;
|
height: 200px;
|
||||||
padding: 0 12px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue