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: {
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`;
}
}
}

View File

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

View File

@ -40,7 +40,7 @@
<option value="man">{{ $t('person.gender.man') }}</option>
<option value="neuter">{{ $t('person.gender.neuter') }}</option>
</select>
<label for="gender">{{ $t('person.gender.title') }}</label>
<label>{{ $t('person.gender.title') }}</label>
</div>
<div class="input-group mb-3">
@ -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();
}))
}
}
}

View File

@ -45,9 +45,8 @@
<add-address
:options="this.addAddress.options"
:address-changed-callback="submitAddress"
:context="this.addAddress.context"
>
:address-changed-callback="submitAddress">
</add-address>
</div>
@ -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();
}
},
}