mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fixes
This commit is contained in:
@@ -77,14 +77,11 @@ export default {
|
||||
return this.$refs.castPerson.$data.person;
|
||||
case 'thirdparty':
|
||||
let data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
data.name = data.text;
|
||||
/*
|
||||
if (data.address !== undefined && data.address !== null) {
|
||||
data.address = { id: data.address.address_id }
|
||||
} else {
|
||||
data.address = null;
|
||||
}
|
||||
*/
|
||||
|
||||
return data;
|
||||
default:
|
||||
|
@@ -219,31 +219,17 @@ export default {
|
||||
|
||||
case 'thirdparty':
|
||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
/* never executed ? */
|
||||
break;
|
||||
|
||||
default:
|
||||
if (typeof this.type === 'undefined') { // action=create or addContact
|
||||
console.log('will rewrite data');
|
||||
if (this.action === 'addContact') {
|
||||
type = 'thirdparty'
|
||||
data = this.$refs.castThirdparty.$data.thirdparty;
|
||||
data = {
|
||||
"type": "thirdparty",
|
||||
"kind": "child",
|
||||
"name": data.text,
|
||||
"isChild": true,
|
||||
"parent": {"type": "thirdparty", "id": this.parent.id},
|
||||
"comment": data.comment,
|
||||
"telephone": data.phonenumber,
|
||||
"email": data.email,
|
||||
"address": this.parent.address
|
||||
}
|
||||
if ("civility" in data) {
|
||||
Object.assign(data, {"civility": {"id": data.civility}} )
|
||||
}
|
||||
if ("profession" in data) {
|
||||
Object.assign(data, {"profession": {"id": data.profession}} )
|
||||
}
|
||||
|
||||
console.log('data original', data);
|
||||
data.parent = {type: "thirdparty", id: this.parent.id};
|
||||
} else {
|
||||
type = this.$refs.castNew.radioType;
|
||||
data = this.$refs.castNew.castDataByType();
|
||||
@@ -253,7 +239,8 @@ export default {
|
||||
throw 'error with object type';
|
||||
}
|
||||
}
|
||||
console.log('type', type, 'data', data)
|
||||
console.log('type', type);
|
||||
console.log('data', data);
|
||||
// pass datas to parent
|
||||
this.$emit('saveFormOnTheFly', { type: type, data: data });
|
||||
},
|
||||
|
Reference in New Issue
Block a user