contracts and med feeds by acc_no
This commit is contained in:
parent
623b107f65
commit
a46eebe5d3
5 changed files with 41 additions and 14 deletions
|
@ -27,8 +27,9 @@ export default {
|
|||
methods: {
|
||||
saveComment() {
|
||||
this.saving = true
|
||||
let url = this.$api_url + "/customers/" + this.customer.acc_no + "/comments"
|
||||
let url = this.$api_url + "/customers/comments"
|
||||
axios.put(url, {
|
||||
acc_no: this.customer.acc_no,
|
||||
comment: this.comment
|
||||
})
|
||||
.then(resp => {
|
||||
|
|
|
@ -39,11 +39,21 @@ const routes = [
|
|||
name: 'contractlist',
|
||||
component: ContractList
|
||||
},
|
||||
{
|
||||
path: '/customers/contracts/list/:id',
|
||||
name: 'contractlistid',
|
||||
component: ContractList
|
||||
},
|
||||
{
|
||||
path: '/customers/medicated-feeds/list',
|
||||
name: 'medfeedslist',
|
||||
component: MedFeedsList
|
||||
},
|
||||
{
|
||||
path: '/customers/medicated-feeds/list/:id',
|
||||
name: 'medfeedslistid',
|
||||
component: MedFeedsList
|
||||
},
|
||||
{
|
||||
path: '/customers/complaints/list',
|
||||
name: 'complaintslist',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<h3>Contracts</h3>
|
||||
<h3>Contracts {{ $route.params.id }}</h3>
|
||||
<v-tabs v-model="tab" class="my-2">
|
||||
<v-tab value="list">List</v-tab>
|
||||
<v-tab value="edit" v-if="edit">Edit</v-tab>
|
||||
|
@ -199,11 +199,13 @@ export default {
|
|||
async getContractsList() {
|
||||
this.loading = true
|
||||
let url = this.$api_url + "/customers/contracts/list"
|
||||
console.log("Getting Contracts list...")
|
||||
let acc_no = this.$route.params.id || ""
|
||||
console.log("Getting Contracts list..." + acc_no)
|
||||
axios.get(url, {
|
||||
params: {
|
||||
limit: this.limit,
|
||||
query: this.searchQuery
|
||||
query: this.searchQuery,
|
||||
acc_no: acc_no
|
||||
}
|
||||
})
|
||||
.then(resp => {
|
||||
|
|
|
@ -19,16 +19,18 @@
|
|||
key-field="acc_no"
|
||||
v-slot="{ item }"
|
||||
>
|
||||
<v-list-item @click="getCustomerComments(item)">
|
||||
<v-list-item >
|
||||
<template v-slot:title >
|
||||
<v-card @click="getCustomerComments(item)">
|
||||
{{ item.acc_no }} - {{ item.name }}:
|
||||
<span class="text-caption">{{ item.address.line_1 }}, {{ item.address.line_2 }}, <br/>
|
||||
{{ item.address.city }}, {{ item.address.county}}, {{ item.address.postcode }},
|
||||
</span>
|
||||
</v-card>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<v-btn color="info">Contracts</v-btn>
|
||||
<v-btn color="warning">Med Feeds</v-btn>
|
||||
<v-btn @click.prevent="goToContracts(item)" color="info">Contracts</v-btn>
|
||||
<v-btn @click.prevent="goToMedFeeds(item)" color="warning">Med Feeds</v-btn>
|
||||
</template>
|
||||
</v-list-item>
|
||||
</RecycleScroller>
|
||||
|
@ -97,6 +99,12 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
goToContracts(c){
|
||||
this.$router.push('/customers/contracts/list/' + c.acc_no)
|
||||
},
|
||||
goToMedFeeds(c){
|
||||
this.$router.push('/customers/medicated-feeds/list/' + c.acc_no)
|
||||
},
|
||||
showAddNote() {
|
||||
this.dialog[0] = true
|
||||
},
|
||||
|
@ -109,8 +117,12 @@ export default {
|
|||
getCustomerComments(cust){
|
||||
this.selected_cust = cust
|
||||
this.comments_loading = true
|
||||
let url = this.$api_url + "/customers/" + cust.acc_no + "/comments"
|
||||
axios.get(url)
|
||||
let url = this.$api_url + "/customers/comments"
|
||||
axios.get(url,{
|
||||
params: {
|
||||
acc_no: cust.acc_no
|
||||
}
|
||||
})
|
||||
.then(resp => {
|
||||
this.comments = resp.data
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<h3>Medicated Feeds</h3>
|
||||
<h3>Medicated Feeds {{ $route.params.id }}</h3>
|
||||
<v-tabs v-model="tab">
|
||||
<v-tab value="list" >List</v-tab>
|
||||
<v-tab value="edit" v-if="edit">Edit</v-tab>
|
||||
|
@ -127,11 +127,13 @@ export default {
|
|||
async getMedFeedsList(){
|
||||
this.loading = true
|
||||
let url = this.$api_url + "/customers/medicated-feeds/list"
|
||||
console.log("Getting Medicated Feeds list...")
|
||||
let acc_no = this.$route.params.id || ""
|
||||
console.log("Getting Medicated Feeds list..." + acc_no)
|
||||
axios.get(url,{
|
||||
params: {
|
||||
limit: this.limit,
|
||||
query: this.searchQuery
|
||||
query: this.searchQuery,
|
||||
acc_no: acc_no
|
||||
}
|
||||
}).then(resp => {
|
||||
this.list = resp.data
|
||||
|
|
Loading…
Reference in a new issue