|
|
@@ -175,7 +175,7 @@
|
|
|
<DefaultInput
|
|
|
v-model="form.payer"
|
|
|
class="col-6"
|
|
|
- label="Pagador"
|
|
|
+ label="Responsável Financeiro"
|
|
|
:error="!!validationErrors.payer_name"
|
|
|
:error-message="validationErrors.payer_name"
|
|
|
/>
|
|
|
@@ -219,6 +219,17 @@
|
|
|
concluir.
|
|
|
</q-banner>
|
|
|
|
|
|
+ <div class="row q-mb-md justify-end">
|
|
|
+ <q-btn
|
|
|
+ outline
|
|
|
+ color="primary"
|
|
|
+ icon="content_copy"
|
|
|
+ label="Copiar Dados do Aluno"
|
|
|
+ size="sm"
|
|
|
+ @click="copyStudentDataToResponsible"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="row q-col-gutter-sm">
|
|
|
<DefaultInput
|
|
|
v-model="responsibleForm.name"
|
|
|
@@ -1001,12 +1012,61 @@ watch(responsibleSelectedCity, (city) => {
|
|
|
city?.value ?? null;
|
|
|
});
|
|
|
|
|
|
+const copyStudentDataToResponsible = () => {
|
|
|
+ responsibleForm.value.name = form.value.name;
|
|
|
+ responsibleForm.value.cpf = form.value.cpf;
|
|
|
+ responsibleForm.value.birth_date = form.value.birthdate;
|
|
|
+ responsibleForm.value.gender = form.value.gender;
|
|
|
+ responsibleForm.value.email = form.value.email;
|
|
|
+ responsibleForm.value.phone = form.value.phone;
|
|
|
+ responsibleForm.value.postal_code = form.value.cep;
|
|
|
+ responsibleForm.value.street = form.value.address;
|
|
|
+ responsibleForm.value.address_number = form.value.address_number;
|
|
|
+ responsibleForm.value.neighborhood = form.value.neighborhood;
|
|
|
+ responsibleForm.value.complement = form.value.complement;
|
|
|
+
|
|
|
+ responsibleSelectedState.value = selectedState.value;
|
|
|
+ responsibleSelectedCity.value = selectedCity.value;
|
|
|
+
|
|
|
+ // The watchers below will sync the actual IDs in the form
|
|
|
+};
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => form.value.name,
|
|
|
+ (newName) => {
|
|
|
+ if (!isStudentUnderage.value) {
|
|
|
+ form.value.payer = newName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => responsibleForm.value.name,
|
|
|
+ (newName) => {
|
|
|
+ if (isStudentUnderage.value) {
|
|
|
+ form.value.payer = newName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => form.value.payer,
|
|
|
+ (newPayer) => {
|
|
|
+ if (isStudentUnderage.value) {
|
|
|
+ responsibleForm.value.name = newPayer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
+
|
|
|
watch(isStudentUnderage, (underage) => {
|
|
|
- if (
|
|
|
- !underage &&
|
|
|
- activeTab.value === "responsible"
|
|
|
- ) {
|
|
|
- activeTab.value = "student";
|
|
|
+ if (underage) {
|
|
|
+ form.value.payer = responsibleForm.value.name;
|
|
|
+ } else {
|
|
|
+ form.value.payer = form.value.name;
|
|
|
+
|
|
|
+ if (activeTab.value === "responsible") {
|
|
|
+ activeTab.value = "student";
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|