coloured live orders and rearranged customer list

This commit is contained in:
Paul Wilde 2023-03-24 10:56:50 +00:00
parent 7b61ccf99b
commit 2c5457673c
3 changed files with 30 additions and 20 deletions

View file

@ -1,5 +1,5 @@
<template> <template>
<h3>Comments <v-btn v-if="customer != null" color="warning" size="smaller" variant="text" icon="mdi-plus" @click="showAddNote"></v-btn></h3> <h3>Comments <v-btn v-if="customer.id != ''" color="warning" size="smaller" variant="text" icon="mdi-plus" @click="showAddNote" :loading="comments_loading"></v-btn></h3>
<v-progress-linear color="yellow" :active="comments_loading" indeterminate> <v-progress-linear color="yellow" :active="comments_loading" indeterminate>
</v-progress-linear> </v-progress-linear>
<v-list> <v-list>

View file

@ -1,11 +1,13 @@
<template> <template>
<h3>{{ doc_types[doc_status] }} Orders - {{ customer.acc_no }} {{ customer.name }}</h3> <h3>{{ doc_types[doc_status] }} Orders - {{ customer.acc_no }} {{ customer.name }}
<v-btn v-if="customer.id != ''" size="smaller" icon="mdi-refresh" variant="text" color="green" @click="getCustomerRecentOrders" :loading="orders_loading"></v-btn>
</h3>
<v-progress-linear color="blue" :active="orders_loading" indeterminate> <v-progress-linear color="blue" :active="orders_loading" indeterminate>
</v-progress-linear> </v-progress-linear>
<v-container> <v-container>
<v-row> <v-row>
<v-col cols=12 v-for="item in sortedOrders" :key="item.doc_no"> <v-col cols=12 v-for="item in sortedOrders" :key="item.doc_no">
<v-card> <v-card :class="{ 'bg-green-lighten-5' : item.doc_status == 'Live' }">
<v-row> <v-row>
<v-col cols=4> <v-col cols=4>
<v-card-title> <v-card-title>
@ -14,6 +16,7 @@
<v-card-subtitle> <v-card-subtitle>
{{ formatDate(item.doc_date,"DD/MM/YYYY") }} {{ formatDate(item.doc_date,"DD/MM/YYYY") }}
<v-icon v-if="item.doc_status == 'Completed'" icon="mdi-check"></v-icon> <v-icon v-if="item.doc_status == 'Completed'" icon="mdi-check"></v-icon>
<v-icon v-if="item.doc_status == 'Live'" icon="mdi-play"></v-icon>
{{ item.doc_status }} {{ item.doc_status }}
</v-card-subtitle> </v-card-subtitle>
<v-card-text> <v-card-text>
@ -58,10 +61,17 @@ export default {
return { return {
orders_loading: false, orders_loading: false,
orders: [], orders: [],
doc_types: ["Live","","Completed"] doc_types: ["Live","","Completed"],
} }
}, },
computed: { computed: {
prog_col(){
if (this.doc_status == 2){
return "green"
} else {
return "blue"
}
},
sortedOrders() { sortedOrders() {
let sorted = this.orders let sorted = this.orders
sorted.sort((a, b) => { sorted.sort((a, b) => {

View file

@ -43,11 +43,11 @@
</v-list-item> </v-list-item>
</RecycleScroller> </RecycleScroller>
</v-list> </v-list>
<CustomerComments :customer="selected_cust"></CustomerComments> <RecentOrders :customer="selected_cust" doc_status="0"></RecentOrders>
</v-col> </v-col>
<v-col cols="12" sm=12 lg=6> <v-col cols="12" sm=12 lg=6>
<CustomerComments :customer="selected_cust"></CustomerComments>
<RecentOrders :customer="selected_cust" doc_status="2"></RecentOrders> <RecentOrders :customer="selected_cust" doc_status="2"></RecentOrders>
<RecentOrders :customer="selected_cust" doc_status="0"></RecentOrders>
</v-col> </v-col>
</v-row> </v-row>
</template> </template>