framework for edit med feeds
This commit is contained in:
parent
0f1b107904
commit
4104b28f6f
9 changed files with 142 additions and 8 deletions
19
src/types/CustomerAddressType.vue
Normal file
19
src/types/CustomerAddressType.vue
Normal file
|
@ -0,0 +1,19 @@
|
|||
<script>
|
||||
export default class CustomerAddress {
|
||||
id = "";
|
||||
description = "";
|
||||
contract = "";
|
||||
postal_name = "";
|
||||
line_1 = "";
|
||||
line_2 = "";
|
||||
line_3 = "";
|
||||
line_4 = "";
|
||||
city = "";
|
||||
county = "";
|
||||
postcode = "";
|
||||
country = "";
|
||||
email = "";
|
||||
faxno = "";
|
||||
telephone = "";
|
||||
}
|
||||
</script>
|
12
src/types/CustomerType.vue
Normal file
12
src/types/CustomerType.vue
Normal file
|
@ -0,0 +1,12 @@
|
|||
<script>
|
||||
import CustomerAddress from '@/types/CustomerAddressType.vue'
|
||||
export default class Customer {
|
||||
id = "";
|
||||
acc_no = "";
|
||||
name = "";
|
||||
short_name = "";
|
||||
full_title = "";
|
||||
at_risk = false;
|
||||
address = new CustomerAddress();
|
||||
}
|
||||
</script>
|
23
src/types/MedFeedType.vue
Normal file
23
src/types/MedFeedType.vue
Normal file
|
@ -0,0 +1,23 @@
|
|||
<script>
|
||||
import Medication from '@/types/MedicationType.vue'
|
||||
import Customer from '@/types/CustomerType.vue'
|
||||
import CustomerAddress from '@/types/CustomerAddressType.vue'
|
||||
import Product from '@/types/ProductType.vue'
|
||||
import Vet from '@/types/VetType.vue'
|
||||
export default class MedicatedFeed {
|
||||
id = 0;
|
||||
med_feed_id = 0;
|
||||
medication = new Medication();
|
||||
customer = new Customer();
|
||||
product = new Product();
|
||||
tonnage = 0;
|
||||
vet = new Vet();
|
||||
date_required = "";
|
||||
delivery_address = new CustomerAddress();
|
||||
alt_adds = [];
|
||||
repeat = false;
|
||||
repeat_message = "";
|
||||
current = true;
|
||||
isNew = true;
|
||||
}
|
||||
</script>
|
9
src/types/MedicationType.vue
Normal file
9
src/types/MedicationType.vue
Normal file
|
@ -0,0 +1,9 @@
|
|||
<script>
|
||||
export default class Medication {
|
||||
id = 0;
|
||||
name = "";
|
||||
info = [];
|
||||
med_code = "";
|
||||
inclusion_rate = "";
|
||||
}
|
||||
</script>
|
7
src/types/ProductType.vue
Normal file
7
src/types/ProductType.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script>
|
||||
export default class Product {
|
||||
code = "";
|
||||
name = "";
|
||||
price = "";
|
||||
}
|
||||
</script>
|
7
src/types/VetType.vue
Normal file
7
src/types/VetType.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<script>
|
||||
export default class Vet {
|
||||
id = 0;
|
||||
practice = "";
|
||||
contacts = [];
|
||||
}
|
||||
</script>
|
|
@ -1,6 +1,5 @@
|
|||
<template>
|
||||
<v-card :title="title" :subtitle="'Contract : ' + contract.no">
|
||||
{{ contract }}
|
||||
<v-card-text>
|
||||
<v-container>
|
||||
<v-row>
|
||||
|
|
|
@ -1,3 +1,55 @@
|
|||
<template>
|
||||
Not Implemented, yet :-)
|
||||
<v-card :title="title">
|
||||
<v-card-subtitle>
|
||||
Medicated Feed :
|
||||
<template v-if="mf.isNew">New</template>
|
||||
<template v-else>{{ mf.id }}</template>
|
||||
</v-card-subtitle>
|
||||
<v-card-text>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
{{ mf }}
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn v-if="!mf.isNew" color="red-darken-1"
|
||||
variant="text"
|
||||
@click="saveMedFeed(mf)">Save</v-btn>
|
||||
<v-btn v-if="mf.isNew" color="red-darken-1"
|
||||
variant="text"
|
||||
@click="saveMedFeed(mf)">Add</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue-darken-1"
|
||||
variant="text"
|
||||
@click="close">Close</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
set_mf: {}
|
||||
},
|
||||
watch: {
|
||||
set_mf(newval) {
|
||||
this.mf = newval
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mf: this.set_mf,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('closetab','list')
|
||||
},
|
||||
saveMedFeed(medfeed) {
|
||||
console.log(medfeed)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
append-inner-icon="mdi-magnify"></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-btn v-if="site_info.features.addmedfeed" color="warning" @click="editMedFeed({})">+ Add</v-btn>
|
||||
<v-btn v-if="site_info.features.addmedfeed" color="warning" @click="editMedFeed()">+ Add</v-btn>
|
||||
<v-row>
|
||||
<v-col cols="8" xs="12" sm="12" md="8">
|
||||
<v-progress-linear indeterminate color="blue" :active="loading"></v-progress-linear>
|
||||
|
@ -30,7 +30,7 @@
|
|||
>
|
||||
<v-row class="item" :class="{ at_risk : item.customer.at_risk }">
|
||||
<v-col cols="4">
|
||||
Medicated Feed : {{ item.id }},
|
||||
Medicated Feed : {{ item.id }}<br/>
|
||||
{{ item.customer.acc_no }} - {{ item.customer.name }}
|
||||
</v-col>
|
||||
<v-col>
|
||||
|
@ -57,8 +57,8 @@
|
|||
</v-card>
|
||||
</v-container>
|
||||
</v-overlay>
|
||||
</v-btn>
|
||||
<v-btn v-if="site_info.editmedfeed" >Edit</v-btn>
|
||||
</v-btn><br/>
|
||||
<v-btn v-if="site_info.features.editmedfeed" color="warning" @click="editMedFeed(item)">Edit</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</RecycleScroller>
|
||||
|
@ -66,7 +66,7 @@
|
|||
</v-row>
|
||||
</v-window-item>
|
||||
<v-window-item value="edit">
|
||||
<MedFeedsEdit />
|
||||
<MedFeedsEdit :set_mf="selected_mf" @closetab="tab = 'list'" @medfeedupdate="medfeedUpdated" />
|
||||
</v-window-item>
|
||||
<v-window-item value="scriptreq">
|
||||
<ScriptReq :mf="selected_mf" :user="user_info"></ScriptReq>
|
||||
|
@ -82,6 +82,7 @@ import MedFeedsEdit from './MedFeedsEdit.vue'
|
|||
import ScriptReq from './MedFeedsScriptReq.vue'
|
||||
import OrderForm from './MedFeedsOrderForm.vue'
|
||||
import methods from '@/CommonMethods.vue'
|
||||
import MedFeedType from '@/types/MedFeedType.vue';
|
||||
export default {
|
||||
props: {
|
||||
site_info: {},
|
||||
|
@ -162,9 +163,14 @@ export default {
|
|||
})
|
||||
},
|
||||
async editMedFeed(mf) {
|
||||
console.log(mf)
|
||||
if ( mf != undefined ) {
|
||||
this.selected_mf = mf
|
||||
} else {
|
||||
this.selected_mf = new MedFeedType()
|
||||
}
|
||||
this.edit = true
|
||||
this.tab = "edit"
|
||||
this.selected_mf = mf
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue