otf: prepare with debug (wip)

This commit is contained in:
Mathieu Jaumotte 2021-09-29 11:37:53 +02:00
parent 0fe248320d
commit 3824a380ff
4 changed files with 28 additions and 16 deletions

View File

@ -134,6 +134,8 @@ export default {
}, },
methods: { methods: {
openModal() { openModal() {
console.log('## OPEN ON THE FLY MODAL');
console.log('## type:', this.type, ', action:', this.action);
this.modal.showModal = true; this.modal.showModal = true;
this.$nextTick(function() { this.$nextTick(function() {
//this.$refs.search.focus(); //this.$refs.search.focus();
@ -173,11 +175,11 @@ export default {
this.modal.showModal = false; this.modal.showModal = false;
}, },
goToLocation(id, type){ goToLocation(id, type) {
if(type == 'person'){ if (type == 'person') {
window.location = `../../person/${id}/general` window.location = `../../person/${id}/general`;
} else if(type == 'thirdparty') { } else if (type == 'thirdparty') {
window.location = `../../thirdparty/thirdparty/${id}/show` window.location = `../../thirdparty/thirdparty/${id}/show`;
} }
} }
} }

View File

@ -56,6 +56,7 @@ export default {
radioType: { radioType: {
set(type) { set(type) {
this.type = type; this.type = type;
console.log('## type:', type, ', action:', this.action);
}, },
get() { get() {
return this.type; return this.type;

View File

@ -40,7 +40,7 @@
<option value="man">{{ $t('person.gender.man') }}</option> <option value="man">{{ $t('person.gender.man') }}</option>
<option value="neuter">{{ $t('person.gender.neuter') }}</option> <option value="neuter">{{ $t('person.gender.neuter') }}</option>
</select> </select>
<label for="gender">{{ $t('person.gender.title') }}</label> <label>{{ $t('person.gender.title') }}</label>
</div> </div>
<div class="input-group mb-3"> <div class="input-group mb-3">
@ -159,9 +159,17 @@ export default {
getPerson(this.id) getPerson(this.id)
.then(person => new Promise((resolve, reject) => { .then(person => new Promise((resolve, reject) => {
this.person = person; this.person = person;
//console.log('get person', this.person); console.log('get person', this.person);
resolve(); resolve();
})); }));
},
postData() {
postPerson(this.person)
.then(person => new Promise((resolve, reject) => {
this.person = person;
console.log('post person', this.person);
resolve();
}))
} }
} }
} }

View File

@ -45,9 +45,8 @@
<add-address <add-address
:options="this.addAddress.options" :options="this.addAddress.options"
:address-changed-callback="submitAddress"
:context="this.addAddress.context" :context="this.addAddress.context"
> :address-changed-callback="submitAddress">
</add-address> </add-address>
</div> </div>
@ -92,25 +91,27 @@ export default {
} }
}, },
methods: { methods: {
loadThirdparty(){ loadData(){
getThirdparty(this.id).then(thirdparty => new Promise((resolve, reject) => { getThirdparty(this.id).then(thirdparty => new Promise((resolve, reject) => {
this.thirdparty = thirdparty; this.thirdparty = thirdparty;
console.log('get thirdparty', thirdparty);
resolve(); resolve();
})); }));
}, },
submitAddress(payload) {
console.log(payload);
},
postData() { postData() {
postThirdparty(this.thirdparty).then(thirdparty => new Promise((resolve, reject) => { postThirdparty(this.thirdparty).then(thirdparty => new Promise((resolve, reject) => {
this.thirdparty = thirdparty; this.thirdparty = thirdparty;
console.log('post thirdparty', thirdparty);
resolve(); resolve();
})) }))
},
submitAddress(payload) {
console.log('submitAddress', payload);
} }
}, },
mounted() { mounted() {
if (this.action !== 'create'){ if (this.action !== 'create') {
this.loadThirdparty(); this.loadData();
} }
}, },
} }