mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
OnTheFly modal, Person Sub-component: create/edit form, show
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
<on-the-fly-person
|
||||
v-bind:id="id"
|
||||
v-bind:type="type"
|
||||
v-bind:action="action">
|
||||
v-bind:action="action"
|
||||
ref="castPerson">
|
||||
</on-the-fly-person>
|
||||
</template>
|
||||
|
||||
@@ -28,13 +29,15 @@
|
||||
<on-the-fly-thirdparty
|
||||
v-bind:id="id"
|
||||
v-bind:type="type"
|
||||
v-bind:action="action">
|
||||
v-bind:action="action"
|
||||
ref="castThirdparty">
|
||||
</on-the-fly-thirdparty>
|
||||
</template>
|
||||
|
||||
<template v-slot:body v-else>
|
||||
<on-the-fly-create
|
||||
v-bind:action="action">
|
||||
v-bind:action="action"
|
||||
ref="castNew">
|
||||
</on-the-fly-create>
|
||||
</template>
|
||||
|
||||
@@ -44,7 +47,10 @@
|
||||
class="sc-button bt-update"> <!-- @click.prevent="$emit('..', ..)" -->
|
||||
</button>
|
||||
<button v-else
|
||||
class="sc-button bt-save"> <!-- @click.prevent="$emit('..', ..)" -->
|
||||
class="sc-button bt-save"
|
||||
@click="saveAction"
|
||||
> <!--
|
||||
-->
|
||||
{{ $t('action.save')}}
|
||||
</button>
|
||||
</template>
|
||||
@@ -55,8 +61,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import OnTheFlyPerson from './OnTheFly/Person.vue';
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
||||
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
|
||||
import OnTheFlyThirdparty from './OnTheFly/ThirdParty.vue';
|
||||
import OnTheFlyCreate from './OnTheFly/Create.vue';
|
||||
|
||||
@@ -123,6 +129,16 @@ export default {
|
||||
changeActionTo(action) {
|
||||
// [BUG] clic first on show item button; in modal clic edit button; close modal; clic again on show item button
|
||||
this.$data.action = action;
|
||||
},
|
||||
saveAction() {
|
||||
console.log('saveAction');
|
||||
if (this.type === 'person') {
|
||||
this.$refs.castPerson.postData();
|
||||
} else if (this.type === 'thirdparty') {
|
||||
this.$refs.castThirdparty.postData();
|
||||
} else {
|
||||
this.$refs.castNew.castByType();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user