This commit is contained in:
Viet An
2026-05-25 15:23:12 +07:00
parent 5f2a98977b
commit 6685a43360
48 changed files with 732 additions and 2901 deletions

View File

@@ -326,15 +326,22 @@ export default {
},
},
async created() {
this.record = await this.$getdata("customer", { id: this.row.customer || this.row.id }, undefined, true);
this.record = await this.$getdata("customer", { first: true, filter: { id: this.row.customer || this.row.id } });
if (this.isIndividual) {
this.relatedPeople = await this.$getdata("customerpeople", {
customer: this.row.customer || this.row.id,
filter: {
customer: this.row.customer || this.row.id,
},
});
} else {
const org = await this.$getdata("organization", { customer: this.row.customer || this.row.id }, undefined, true);
const org = await this.$getdata("organization", {
first: true,
filter: { customer: this.row.customer || this.row.id },
});
this.relatedPeople = await this.$getdata("legalrep", {
organization: org.id,
filter: {
organization: org.id,
},
});
}
},
@@ -373,17 +380,19 @@ export default {
// refetch relatedPeople
if (this.isIndividual) {
this.relatedPeople = await this.$getdata("customerpeople", {
customer: this.row.customer || this.row.id,
filter: {
customer: this.row.customer || this.row.id,
},
});
} else {
const org = await this.$getdata(
"organization",
{ customer: this.row.customer || this.row.id },
undefined,
true,
);
const org = await this.$getdata("organization", {
first: true,
filter: { customer: this.row.customer || this.row.id },
});
this.relatedPeople = await this.$getdata("legalrep", {
organization: org.id,
filter: {
organization: org.id,
},
});
}
},
@@ -398,7 +407,10 @@ export default {
};
},
async openRelatedPerson(peopleId) {
const peopleRow = await this.$getdata("people", { id: peopleId }, undefined, true);
const peopleRow = await this.$getdata("people", {
first: true,
filter: { id: peopleId },
});
this.showmodal = {
component: "people/PeopleView",
vbind: { row: peopleRow },