From 3824a380ff389484689d629ae6635a67331fb052 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 29 Sep 2021 11:37:53 +0200 Subject: [PATCH] otf: prepare with debug (wip) --- .../public/vuejs/_components/OnTheFly.vue | 12 +++++++----- .../vuejs/_components/OnTheFly/Create.vue | 1 + .../vuejs/_components/OnTheFly/Person.vue | 12 ++++++++++-- .../vuejs/_components/OnTheFly/ThirdParty.vue | 19 ++++++++++--------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue index 9e5efd86c..43cd0c686 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue @@ -134,6 +134,8 @@ export default { }, methods: { openModal() { + console.log('## OPEN ON THE FLY MODAL'); + console.log('## type:', this.type, ', action:', this.action); this.modal.showModal = true; this.$nextTick(function() { //this.$refs.search.focus(); @@ -173,11 +175,11 @@ export default { this.modal.showModal = false; }, - goToLocation(id, type){ - if(type == 'person'){ - window.location = `../../person/${id}/general` - } else if(type == 'thirdparty') { - window.location = `../../thirdparty/thirdparty/${id}/show` + goToLocation(id, type) { + if (type == 'person') { + window.location = `../../person/${id}/general`; + } else if (type == 'thirdparty') { + window.location = `../../thirdparty/thirdparty/${id}/show`; } } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly/Create.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly/Create.vue index 7644043fd..c5d949c4e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly/Create.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly/Create.vue @@ -56,6 +56,7 @@ export default { radioType: { set(type) { this.type = type; + console.log('## type:', type, ', action:', this.action); }, get() { return this.type; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue index 5261b2c81..bf559fd41 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue @@ -40,7 +40,7 @@ - +
@@ -159,9 +159,17 @@ export default { getPerson(this.id) .then(person => new Promise((resolve, reject) => { this.person = person; - //console.log('get person', this.person); + console.log('get person', this.person); resolve(); })); + }, + postData() { + postPerson(this.person) + .then(person => new Promise((resolve, reject) => { + this.person = person; + console.log('post person', this.person); + resolve(); + })) } } } diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 1f1df7e5f..7fc8fd827 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -45,9 +45,8 @@ + :address-changed-callback="submitAddress">
@@ -72,7 +71,7 @@ export default { }, addAddress: { context: { - + }, options: { //button: { @@ -92,25 +91,27 @@ export default { } }, methods: { - loadThirdparty(){ + loadData(){ getThirdparty(this.id).then(thirdparty => new Promise((resolve, reject) => { this.thirdparty = thirdparty; + console.log('get thirdparty', thirdparty); resolve(); })); }, - submitAddress(payload) { - console.log(payload); - }, postData() { postThirdparty(this.thirdparty).then(thirdparty => new Promise((resolve, reject) => { this.thirdparty = thirdparty; + console.log('post thirdparty', thirdparty); resolve(); })) + }, + submitAddress(payload) { + console.log('submitAddress', payload); } }, mounted() { - if (this.action !== 'create'){ - this.loadThirdparty(); + if (this.action !== 'create') { + this.loadData(); } }, }