Compare commits
No commits in common. "c5fd049d078be48edb2b790673252bbd095371ac" and "35c7f00ba3aae95930271b66618efa37824abc7e" have entirely different histories.
c5fd049d07
...
35c7f00ba3
4 changed files with 44 additions and 82 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cmc_fe",
|
"name": "cmc_fe",
|
||||||
"version": "0.1.1",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
|
|
|
@ -48,20 +48,12 @@
|
||||||
</template>
|
</template>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-footer >
|
<v-footer >
|
||||||
<v-banner>
|
<sub>{{ site_info.name }} v{{ site_info.version }}</sub>
|
||||||
<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: {
|
||||||
|
@ -87,7 +79,6 @@ export default{
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
appVersion: version,
|
|
||||||
items: [],
|
items: [],
|
||||||
drawer: null,
|
drawer: null,
|
||||||
drawer2: false
|
drawer2: false
|
||||||
|
|
|
@ -8,6 +8,5 @@ export default class Customer {
|
||||||
full_title = "";
|
full_title = "";
|
||||||
at_risk = false;
|
at_risk = false;
|
||||||
address = new CustomerAddress();
|
address = new CustomerAddress();
|
||||||
notes = {}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
|
<h3>Customer List</h3>
|
||||||
|
<v-responsive
|
||||||
|
max-width="500"
|
||||||
|
>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
clearable
|
clearable
|
||||||
label="Search"
|
label="Search"
|
||||||
|
@ -6,12 +10,7 @@
|
||||||
v-model="searchQuery"
|
v-model="searchQuery"
|
||||||
density="compact"
|
density="compact"
|
||||||
append-inner-icon="mdi-magnify"></v-text-field>
|
append-inner-icon="mdi-magnify"></v-text-field>
|
||||||
<v-row>
|
</v-responsive>
|
||||||
<v-col cols="12" sm=12 lg=6>
|
|
||||||
<h3>Customer List</h3>
|
|
||||||
<v-progress-linear color="blue" :active="customers_loading" indeterminate>
|
|
||||||
</v-progress-linear>
|
|
||||||
<v-list>
|
|
||||||
<RecycleScroller
|
<RecycleScroller
|
||||||
class="scroller"
|
class="scroller"
|
||||||
:items="filteredCustomers"
|
:items="filteredCustomers"
|
||||||
|
@ -19,29 +18,13 @@
|
||||||
key-field="acc_no"
|
key-field="acc_no"
|
||||||
v-slot="{ item }"
|
v-slot="{ item }"
|
||||||
>
|
>
|
||||||
<v-list-item @click="getCustomerNotes(item)">
|
<v-row class="customer">
|
||||||
<template v-slot:title>
|
<v-col cols="6">
|
||||||
{{ item.acc_no }} - {{ item.name }}
|
{{ item.acc_no }} - {{ item.name }}
|
||||||
</template>
|
|
||||||
<template v-slot:append>
|
|
||||||
<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-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
<hr />
|
||||||
|
</RecycleScroller>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -53,12 +36,12 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
searchQuery: "",
|
searchQuery: "",
|
||||||
customer_list: [],
|
showSearch: true,
|
||||||
customers_loading: null,
|
open: false,
|
||||||
|
list: [],
|
||||||
limit: 5000,
|
limit: 5000,
|
||||||
listreceived: false,
|
loading: true,
|
||||||
notes_loading: null,
|
listreceived: false
|
||||||
notes: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -69,7 +52,7 @@ export default {
|
||||||
if (!this.listreceived){
|
if (!this.listreceived){
|
||||||
this.getCustomerList()
|
this.getCustomerList()
|
||||||
}
|
}
|
||||||
let clist = this.customer_list.filter(q =>
|
let clist = this.list.filter(q =>
|
||||||
q.name.toLowerCase().includes(query) ||
|
q.name.toLowerCase().includes(query) ||
|
||||||
q.acc_no.includes(query)
|
q.acc_no.includes(query)
|
||||||
)
|
)
|
||||||
|
@ -77,32 +60,18 @@ 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.customers_loading = true
|
this.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.customer_list = resp.data
|
this.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
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +80,10 @@ export default {
|
||||||
.scroller {
|
.scroller {
|
||||||
height: 500px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
.scroller.small {
|
.customer {
|
||||||
height: 200px;
|
height: 32%;
|
||||||
|
padding: 0 12px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue