mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
bugfix onthefly thirdparty edit form
phonenumber was interchanged with telephone. Editing phonenumber was therefore not possible
This commit is contained in:
parent
265c8b776b
commit
b65dacca72
@ -21,42 +21,42 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else-if="action === 'edit' || action === 'create'">
|
<div v-else-if="action === 'edit' || action === 'create'">
|
||||||
|
|
||||||
<div class="form-floating mb-3" v-if="thirdparty.kind !== 'child'">
|
<div class="form-floating mb-3" v-if="thirdparty.kind !== 'child'">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input mt-0" type="radio" v-model="kind" value="company" id="tpartyKindInstitution">
|
<input class="form-check-input mt-0" type="radio" v-model="kind" value="company" id="tpartyKindInstitution">
|
||||||
<label for="tpartyKindInstitution" class="required">
|
<label for="tpartyKindInstitution" class="required">
|
||||||
<badge-entity
|
<badge-entity
|
||||||
:entity="{ type: 'thirdparty', kind: 'company' }"
|
:entity="{ type: 'thirdparty', kind: 'company' }"
|
||||||
:options="{ displayLong: true }">
|
:options="{ displayLong: true }">
|
||||||
</badge-entity>
|
</badge-entity>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input mt-0" type="radio" v-model="kind" value="contact" id="tpartyKindContact">
|
<input class="form-check-input mt-0" type="radio" v-model="kind" value="contact" id="tpartyKindContact">
|
||||||
<label for="tpartyKindContact" class="required">
|
<label for="tpartyKindContact" class="required">
|
||||||
<badge-entity
|
<badge-entity
|
||||||
:entity="{ type: 'thirdparty', kind: 'contact' }"
|
:entity="{ type: 'thirdparty', kind: 'contact' }"
|
||||||
:options="{ displayLong: true }">
|
:options="{ displayLong: true }">
|
||||||
</badge-entity>
|
</badge-entity>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<p>Contact de :</p>
|
<p>Contact de :</p>
|
||||||
<third-party-render-box :thirdparty="thirdparty.parent"
|
<third-party-render-box :thirdparty="thirdparty.parent"
|
||||||
:options="{
|
:options="{
|
||||||
addInfo: true,
|
addInfo: true,
|
||||||
addEntity: false,
|
addEntity: false,
|
||||||
addAltNames: true,
|
addAltNames: true,
|
||||||
addId: false,
|
addId: false,
|
||||||
addLink: false,
|
addLink: false,
|
||||||
addAge: false,
|
addAge: false,
|
||||||
hLevel: 4,
|
hLevel: 4,
|
||||||
addCenter: false,
|
addCenter: false,
|
||||||
addNoData: true,
|
addNoData: true,
|
||||||
isMultiline: false
|
isMultiline: false
|
||||||
}"></third-party-render-box>
|
}"></third-party-render-box>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<input class="form-control form-control-lg" id="name" v-model="thirdparty.text" v-bind:placeholder="$t('thirdparty.name')" />
|
<input class="form-control form-control-lg" id="name" v-model="thirdparty.text" v-bind:placeholder="$t('thirdparty.name')" />
|
||||||
<label for="name">{{ $t('thirdparty.name') }}</label>
|
<label for="name">{{ $t('thirdparty.name') }}</label>
|
||||||
@ -69,16 +69,16 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template
|
<template
|
||||||
v-if="thirdparty.kind !== 'child'">
|
v-if="thirdparty.kind !== 'child'">
|
||||||
<add-address
|
<add-address
|
||||||
key="thirdparty"
|
key="thirdparty"
|
||||||
:context="context"
|
:context="context"
|
||||||
:options="addAddress.options"
|
:options="addAddress.options"
|
||||||
:address-changed-callback="submitAddress"
|
:address-changed-callback="submitAddress"
|
||||||
ref="addAddress">
|
ref="addAddress">
|
||||||
</add-address>
|
</add-address>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-text" id="email"><i class="fa fa-fw fa-envelope"></i></span>
|
<span class="input-group-text" id="email"><i class="fa fa-fw fa-envelope"></i></span>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span>
|
<span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span>
|
||||||
<input class="form-control form-control-lg"
|
<input class="form-control form-control-lg"
|
||||||
v-model="thirdparty.telephone"
|
v-model="thirdparty.phonenumber"
|
||||||
v-bind:placeholder="$t('thirdparty.phonenumber')"
|
v-bind:placeholder="$t('thirdparty.phonenumber')"
|
||||||
v-bind:aria-label="$t('thirdparty.phonenumber')"
|
v-bind:aria-label="$t('thirdparty.phonenumber')"
|
||||||
aria-describedby="phonenumber" />
|
aria-describedby="phonenumber" />
|
||||||
@ -134,27 +134,27 @@ export default {
|
|||||||
size: 'btn-sm'
|
size: 'btn-sm'
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
create: 'add_an_address_title',
|
create: 'add_an_address_title',
|
||||||
edit: 'edit_address'
|
edit: 'edit_address'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
kind: {
|
kind: {
|
||||||
get() {
|
get() {
|
||||||
// note: there are also default to 'institution' set in the "mounted" method
|
// note: there are also default to 'institution' set in the "mounted" method
|
||||||
if (this.$data.thirdparty.kind !== undefined) {
|
if (this.$data.thirdparty.kind !== undefined) {
|
||||||
return this.$data.thirdparty.kind;
|
return this.$data.thirdparty.kind;
|
||||||
} else {
|
} else {
|
||||||
return 'company';
|
return 'company';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
set(v) {
|
set(v) {
|
||||||
this.$data.thirdparty.kind = v;
|
this.$data.thirdparty.kind = v;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
context() {
|
context() {
|
||||||
let context = {
|
let context = {
|
||||||
target: {
|
target: {
|
||||||
@ -165,10 +165,10 @@ export default {
|
|||||||
addressId: null
|
addressId: null
|
||||||
};
|
};
|
||||||
if ( !(this.thirdparty.address === undefined || this.thirdparty.address === null)
|
if ( !(this.thirdparty.address === undefined || this.thirdparty.address === null)
|
||||||
&& this.thirdparty.address.address_id !== null
|
&& this.thirdparty.address.address_id !== null
|
||||||
) { // to complete
|
) { // to complete
|
||||||
context.addressId = this.thirdparty.address.address_id;
|
context.addressId = this.thirdparty.address.address_id;
|
||||||
context.edit = true;
|
context.edit = true;
|
||||||
}
|
}
|
||||||
console.log('context', context);
|
console.log('context', context);
|
||||||
//this.context = context; <--
|
//this.context = context; <--
|
||||||
@ -182,10 +182,10 @@ export default {
|
|||||||
this.thirdparty.kind = thirdparty.kind;
|
this.thirdparty.kind = thirdparty.kind;
|
||||||
//console.log('get thirdparty', thirdparty);
|
//console.log('get thirdparty', thirdparty);
|
||||||
if (this.action !== 'show') {
|
if (this.action !== 'show') {
|
||||||
if (thirdparty.address !== null) {
|
if (thirdparty.address !== null) {
|
||||||
// bof! we force getInitialAddress because addressId not available when mounted
|
// bof! we force getInitialAddress because addressId not available when mounted
|
||||||
this.$refs.addAddress.getInitialAddress(thirdparty.address.address_id);
|
this.$refs.addAddress.getInitialAddress(thirdparty.address.address_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
}));
|
}));
|
||||||
@ -193,11 +193,11 @@ export default {
|
|||||||
submitAddress(payload) {
|
submitAddress(payload) {
|
||||||
console.log('submitAddress', payload);
|
console.log('submitAddress', payload);
|
||||||
if (typeof payload.addressId !== 'undefined') { // <--
|
if (typeof payload.addressId !== 'undefined') { // <--
|
||||||
this.context.edit = true;
|
this.context.edit = true;
|
||||||
this.context.addressId = payload.addressId; // bof! use legacy and not legacy in payload
|
this.context.addressId = payload.addressId; // bof! use legacy and not legacy in payload
|
||||||
this.thirdparty.address = payload.address; // <--
|
this.thirdparty.address = payload.address; // <--
|
||||||
console.log('switch address to edit mode', this.context);
|
console.log('switch address to edit mode', this.context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addQuery(query) {
|
addQuery(query) {
|
||||||
this.thirdparty.text = query;
|
this.thirdparty.text = query;
|
||||||
@ -208,7 +208,7 @@ export default {
|
|||||||
if (this.action !== 'create') {
|
if (this.action !== 'create') {
|
||||||
this.loadData();
|
this.loadData();
|
||||||
} else {
|
} else {
|
||||||
this.thirdparty.kind = 'company';
|
this.thirdparty.kind = 'company';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user