-
-
+
+
- Default Address
+ Default Address
+
+
\ No newline at end of file
diff --git a/resources/assets/vue/components/address/forms/AddressFormComponent.vue b/resources/assets/vue/components/address/forms/AddressFormComponent.vue
index 809165a1..00dd0b2f 100644
--- a/resources/assets/vue/components/address/forms/AddressFormComponent.vue
+++ b/resources/assets/vue/components/address/forms/AddressFormComponent.vue
@@ -39,7 +39,7 @@
-
+
@@ -59,17 +59,31 @@
type: Number,
default: 1
},
+ addressData: {
+ type: Object,
+ default: {},
+ required:false
+ },
},
watch: {
'id': function() {
this.parameters.company_id = this.id;
+ },
+ 'addressData': function() {
+ this.parameters = {
+ company_id: this.id,
+ street_one: this.addressData.street_one,
+ street_two: this.addressData.street_two,
+ district_id: this.addressData.district.id,
+ post_code: this.addressData.post_code,
+ }
}
},
data() {
return {
parameters : {
company_id: this.id,
- street_one: '',
+ street_one: '',
street_two: '',
district_id: '',
post_code: '',
@@ -87,11 +101,19 @@
},
methods:{
submitForm(){
- this.submit((this.route('api.address.create')), 'post', 'bookingDetailSection', true, true)
+ if(this.type==3){
+ this.submit((this.route('api.address.update',this.addressData.id)), 'put', 'bookingDetailSection', true, true)
+ }else {
+ this.submit((this.route('api.address.create')), 'post', 'bookingDetailSection', true, true)
+ }
},
successHandler(response){
- this.type !== 2 ? this.$emit('updateDefaultAddress', response.payload.data) : this.$emit('createdAddress', response.payload.data);
- this.resetForm();
+ if(this.type==3){
+ console.log('updated??');
+ }else {
+ this.type !== 2 ? this.$emit('updateDefaultAddress', response.payload.data) : this.$emit('createdAddress', response.payload.data);
+ this.resetForm();
+ }
}
}
}
diff --git a/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue b/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue
index 34aba5a5..05d3c522 100644
--- a/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue
+++ b/resources/assets/vue/components/companies/elements/CompanyDetailsComponent.vue
@@ -1,9 +1,6 @@
-
-
{{this.company_details.name ? this.company_details.name : ""}}
-
@@ -24,6 +21,26 @@
+
+
+
+
+
{{ this.company_details.identification.document_type === 'IDENTITY_CARD' ? 'IC' : 'SSM Registration' }} Document
+
+
+
+
+
diff --git a/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue b/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue
index 9409f821..f3876772 100644
--- a/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue
+++ b/resources/assets/vue/components/companies/sections/CustomerProfileSectionComponent.vue
@@ -139,12 +139,19 @@
@@ -157,7 +164,11 @@
@@ -211,7 +222,10 @@
created_before: '',
created_after: '',
status: ''
- }
+ },
+ address_id:0,
+ address:{},
+ displayAddressForm:false,
}
},
computed: {
@@ -228,12 +242,24 @@
})
}
},
+ mounted(){
+ this.$root.$on('deleteAddressConfirm', (id) => {
+ this.address_id=id;
+ $("#deleteAddressModal").closest('.modal').modal('show');
+ });
+ this.$root.$on('updateAddressForm', (address) => {
+ console.log(">>>> "+address);
+ console.log(">>>> "+address.street_one);
+ this.address=address;
+ this.displayAddressForm = true;
+ });
+ },
watch: {
pendingQueue(inComplete){
if(inComplete){
this.fetchCompany();
}
- }
+ },
},
created(){
this.$store.dispatch('updateListQueue', {'name': this.section});