better type system
This commit is contained in:
parent
4104b28f6f
commit
22f368bf22
2 changed files with 7 additions and 10 deletions
|
@ -1,15 +1,8 @@
|
|||
<script>
|
||||
import Customer from '@/types/CustomerType.vue';
|
||||
export default class Contract {
|
||||
no = "";
|
||||
customer = {
|
||||
id: "",
|
||||
acc_no: "",
|
||||
name: "",
|
||||
short_name: "",
|
||||
at_risk: false,
|
||||
address: {
|
||||
}
|
||||
};
|
||||
customer = new Customer();
|
||||
terms = "";
|
||||
products = [];
|
||||
start_date = new Date();
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
</template>
|
||||
<v-row>
|
||||
<v-col cols="4">
|
||||
<v-btn @click="contract.products.push({})" v-if="contract.products.length < 4">+ Add Product</v-btn>
|
||||
<v-btn @click="addProduct()" v-if="contract.products.length < 4">+ Add Product</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
|
@ -93,6 +93,7 @@
|
|||
import axios from 'axios'
|
||||
import DatePicker from '@vuepic/vue-datepicker'
|
||||
import methods from '@/CommonMethods.vue'
|
||||
import Product from '@/types/ProductType.vue'
|
||||
export default {
|
||||
props: {
|
||||
setcontract: {}
|
||||
|
@ -142,6 +143,9 @@ export default {
|
|||
close() {
|
||||
this.$emit('closetab','list')
|
||||
},
|
||||
addProduct() {
|
||||
this.contract.products.push(new Product())
|
||||
},
|
||||
async saveContract(){
|
||||
this.saving = true
|
||||
let url = this.$api_url + "/customers/contracts/" + this.contract.no + "/save"
|
||||
|
|
Loading…
Reference in a new issue