chore: install prettier
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div :id="docid" v-if="record">
|
||||
<div
|
||||
:id="docid"
|
||||
v-if="record"
|
||||
>
|
||||
<div>
|
||||
<Caption v-bind="{ title: this.data && findFieldName('info')[this.lang] }"></Caption>
|
||||
<div class="columns is-multiline mx-0">
|
||||
@@ -7,7 +10,11 @@
|
||||
<div class="field">
|
||||
<label class="label">Mã khách hàng</label>
|
||||
<div class="control">
|
||||
<span class="hyperlink" @click="$copyToClipboard(record.code)">{{ record.code }}</span>
|
||||
<span
|
||||
class="hyperlink"
|
||||
@click="$copyToClipboard(record.code)"
|
||||
>{{ record.code }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,14 +30,21 @@
|
||||
<div class="field">
|
||||
<label class="label">Điện thoại</label>
|
||||
<div class="control">
|
||||
<span class="hyperlink" @click="openPhone()">{{ record.phone }}</span>
|
||||
<span
|
||||
class="hyperlink"
|
||||
@click="openPhone()"
|
||||
>{{ record.phone }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-3 pb-1 px-0">
|
||||
<div class="field">
|
||||
<label class="label">Email</label>
|
||||
<div class="control" style="word-break: break-all">
|
||||
<div
|
||||
class="control"
|
||||
style="word-break: break-all"
|
||||
>
|
||||
{{ record.email || "/" }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,7 +117,11 @@
|
||||
<div class="field">
|
||||
<label class="label">Người tạo</label>
|
||||
<div class="control">
|
||||
<span class="hyperlink" @click="openUser(record.creator)">{{ record.creator__fullname || "/" }}</span>
|
||||
<span
|
||||
class="hyperlink"
|
||||
@click="openUser(record.creator)"
|
||||
>{{ record.creator__fullname || "/" }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,7 +140,11 @@
|
||||
<div class="field">
|
||||
<label class="label">Người cập nhật</label>
|
||||
<div class="control">
|
||||
<span class="hyperlink" @click="openUser(record.updater)">{{ record.updater__fullname || "/" }}</span>
|
||||
<span
|
||||
class="hyperlink"
|
||||
@click="openUser(record.updater)"
|
||||
>{{ record.updater__fullname || "/" }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -131,7 +153,7 @@
|
||||
<label class="label">Thời gian cập nhật</label>
|
||||
<div class="control">
|
||||
<span>
|
||||
{{ record.update_time ? $dayjs(record.update_time).format("DD/MM/YYYY HH:mm") : '/' }}
|
||||
{{ record.update_time ? $dayjs(record.update_time).format("DD/MM/YYYY HH:mm") : "/" }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,58 +165,137 @@
|
||||
<ImageGallery v-bind="{ row: record, api: 'customerfile', hideopt: true }"></ImageGallery>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<Caption v-bind="{ title: this.isIndividual ? 'Người liên quan' : 'Người đại diện pháp luật' }"></Caption>
|
||||
<Caption
|
||||
v-bind="{
|
||||
title: this.isIndividual ? 'Người liên quan' : 'Người đại diện pháp luật',
|
||||
}"
|
||||
></Caption>
|
||||
<div class="mt-2">
|
||||
<div
|
||||
<div
|
||||
v-if="this.relatedPeople && this.relatedPeople.length > 0"
|
||||
v-for="relatedPerson in this.relatedPeople"
|
||||
class="columns is-0 mb-2"
|
||||
>
|
||||
<span class="column is-2">{{ relatedPerson.people__code }}</span>
|
||||
<span class="column is-4 ">
|
||||
<span class="has-text-primary hyperlink"
|
||||
<span class="column is-4">
|
||||
<span
|
||||
class="has-text-primary hyperlink"
|
||||
@click="openRelatedPerson(relatedPerson.people)"
|
||||
>{{ relatedPerson.people__fullname }}</span>
|
||||
>{{ relatedPerson.people__fullname }}</span
|
||||
>
|
||||
<span> ({{ relatedPerson.relation__name }})</span>
|
||||
</span>
|
||||
<span class="column is-4">{{ relatedPerson.people__phone }}</span>
|
||||
</div>
|
||||
<div v-else class="has-text-grey">
|
||||
Chưa có {{ this.isIndividual ? 'người liên quan' : 'người đại diện pháp luật' }}
|
||||
<div
|
||||
v-else
|
||||
class="has-text-grey"
|
||||
>
|
||||
Chưa có
|
||||
{{ this.isIndividual ? "người liên quan" : "người đại diện pháp luật" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="record.count_product >0" class="mt-3">
|
||||
<Caption class="mb-2" v-bind="{ title: this.data && findFieldName('transaction')[this.lang] }"></Caption>
|
||||
<DataView v-bind="{
|
||||
setting: 'customer-all-transaction',
|
||||
pagename: this.$id(),
|
||||
api: 'customer',
|
||||
params: {
|
||||
filter: { id: this.row.customer || this.row.id },
|
||||
/* copied from 02-connection.js */
|
||||
values:
|
||||
'id,update_time,creator,creator__fullname,country,country__name,country__en,issued_date,issued_place,issued_place__name,code,email,fullname,legal_code,phone,legal_type,legal_type__name,address,contact_address,note,type,type__name,updater,updater__fullname,create_time,update_time',
|
||||
distinct_values: {
|
||||
label: { type: 'Concat', field: ['code', 'fullname', 'phone', 'legal_code'] },
|
||||
order: { type: 'RowNumber' },
|
||||
image_count: { type: 'Count', field: 'id', subquery: { model: 'Customer_File', column: 'ref' } },
|
||||
count_note: { type: 'Count', field: 'id', subquery: { model: 'Customer_Note', column: 'ref' } },
|
||||
count_product: { type: 'Count', field: 'id', subquery: { model: 'Product_Booked', column: 'transaction__customer' } },
|
||||
sum_product: { type: 'Sum', field: 'transaction__sale_price', subquery: { model: 'Product_Booked', column: 'transaction__customer' } },
|
||||
sum_receiver: { type: 'Sum', field: 'transaction__amount_received', subquery: { model: 'Product_Booked', column: 'transaction__customer' } },
|
||||
sum_remain: { type: 'Sum', field: 'transaction__amount_remain', subquery: { model: 'Product_Booked', column: 'transaction__customer' } }
|
||||
<div
|
||||
v-if="record.count_product > 0"
|
||||
class="mt-3"
|
||||
>
|
||||
<Caption
|
||||
class="mb-2"
|
||||
v-bind="{ title: this.data && findFieldName('transaction')[this.lang] }"
|
||||
></Caption>
|
||||
<DataView
|
||||
v-bind="{
|
||||
setting: 'customer-all-transaction',
|
||||
pagename: this.$id(),
|
||||
api: 'customer',
|
||||
params: {
|
||||
filter: { id: this.row.customer || this.row.id },
|
||||
/* copied from 02-connection.js */
|
||||
values:
|
||||
'id,update_time,creator,creator__fullname,country,country__name,country__en,issued_date,issued_place,issued_place__name,code,email,fullname,legal_code,phone,legal_type,legal_type__name,address,contact_address,note,type,type__name,updater,updater__fullname,create_time,update_time',
|
||||
distinct_values: {
|
||||
label: {
|
||||
type: 'Concat',
|
||||
field: ['code', 'fullname', 'phone', 'legal_code'],
|
||||
},
|
||||
order: { type: 'RowNumber' },
|
||||
image_count: {
|
||||
type: 'Count',
|
||||
field: 'id',
|
||||
subquery: { model: 'Customer_File', column: 'ref' },
|
||||
},
|
||||
count_note: {
|
||||
type: 'Count',
|
||||
field: 'id',
|
||||
subquery: { model: 'Customer_Note', column: 'ref' },
|
||||
},
|
||||
count_product: {
|
||||
type: 'Count',
|
||||
field: 'id',
|
||||
subquery: {
|
||||
model: 'Product_Booked',
|
||||
column: 'transaction__customer',
|
||||
},
|
||||
},
|
||||
sum_product: {
|
||||
type: 'Sum',
|
||||
field: 'transaction__sale_price',
|
||||
subquery: {
|
||||
model: 'Product_Booked',
|
||||
column: 'transaction__customer',
|
||||
},
|
||||
},
|
||||
sum_receiver: {
|
||||
type: 'Sum',
|
||||
field: 'transaction__amount_received',
|
||||
subquery: {
|
||||
model: 'Product_Booked',
|
||||
column: 'transaction__customer',
|
||||
},
|
||||
},
|
||||
sum_remain: {
|
||||
type: 'Sum',
|
||||
field: 'transaction__amount_remain',
|
||||
subquery: {
|
||||
model: 'Product_Booked',
|
||||
column: 'transaction__customer',
|
||||
},
|
||||
},
|
||||
},
|
||||
summary: 'annotate',
|
||||
},
|
||||
summary: 'annotate',
|
||||
},
|
||||
}" />
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-4 border-bottom" id="ignore"></div>
|
||||
<div class="buttons mt-2 is-flex is-gap-1" id="ignore">
|
||||
<button v-if="$getEditRights('edit', { code: 'customer', category: 'topmenu' })" class="button is-primary" @click="edit()">Chỉnh sửa</button>
|
||||
<button class="button is-light" @click="$exportpdf(docid, record.code)">In thông tin</button>
|
||||
<div
|
||||
class="mt-4 border-bottom"
|
||||
id="ignore"
|
||||
></div>
|
||||
<div
|
||||
class="buttons mt-2 is-flex is-gap-1"
|
||||
id="ignore"
|
||||
>
|
||||
<button
|
||||
v-if="$getEditRights('edit', { code: 'customer', category: 'topmenu' })"
|
||||
class="button is-primary"
|
||||
@click="edit()"
|
||||
>
|
||||
Chỉnh sửa
|
||||
</button>
|
||||
<button
|
||||
class="button is-light"
|
||||
@click="$exportpdf(docid, record.code)"
|
||||
>
|
||||
In thông tin
|
||||
</button>
|
||||
</div>
|
||||
<Modal @close="showmodal = undefined" v-bind="showmodal" @dataevent="changeInfo" v-if="showmodal"></Modal>
|
||||
<Modal
|
||||
@close="showmodal = undefined"
|
||||
v-bind="showmodal"
|
||||
@dataevent="changeInfo"
|
||||
v-if="showmodal"
|
||||
></Modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -225,15 +326,19 @@ export default {
|
||||
},
|
||||
isIndividual() {
|
||||
return this.record.type === 1;
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.record = await this.$getdata("customer", { id: this.row.customer || this.row.id }, undefined, true);
|
||||
if (this.isIndividual) {
|
||||
this.relatedPeople = await this.$getdata("customerpeople", { customer: this.row.customer || this.row.id });
|
||||
this.relatedPeople = await this.$getdata("customerpeople", {
|
||||
customer: this.row.customer || this.row.id,
|
||||
});
|
||||
} else {
|
||||
const org = await this.$getdata('organization', { customer: this.row.customer || this.row.id }, undefined, true);
|
||||
this.relatedPeople = await this.$getdata("legalrep", { organization: org.id });
|
||||
const org = await this.$getdata("organization", { customer: this.row.customer || this.row.id }, undefined, true);
|
||||
this.relatedPeople = await this.$getdata("legalrep", {
|
||||
organization: org.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -270,10 +375,19 @@ export default {
|
||||
this.record = this.$copy(v);
|
||||
// refetch relatedPeople
|
||||
if (this.isIndividual) {
|
||||
this.relatedPeople = await this.$getdata("customerpeople", { customer: this.row.customer || this.row.id });
|
||||
this.relatedPeople = await this.$getdata("customerpeople", {
|
||||
customer: this.row.customer || this.row.id,
|
||||
});
|
||||
} else {
|
||||
const org = await this.$getdata('organization', { customer: this.row.customer || this.row.id }, undefined, true);
|
||||
this.relatedPeople = await this.$getdata("legalrep", { organization: org.id });
|
||||
const org = await this.$getdata(
|
||||
"organization",
|
||||
{ customer: this.row.customer || this.row.id },
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
this.relatedPeople = await this.$getdata("legalrep", {
|
||||
organization: org.id,
|
||||
});
|
||||
}
|
||||
},
|
||||
openUser(userId) {
|
||||
@@ -287,15 +401,15 @@ export default {
|
||||
};
|
||||
},
|
||||
async openRelatedPerson(peopleId) {
|
||||
const peopleRow = await this.$getdata('people', { id: peopleId }, undefined, true);
|
||||
const peopleRow = await this.$getdata("people", { id: peopleId }, undefined, true);
|
||||
this.showmodal = {
|
||||
component: "people/PeopleView",
|
||||
vbind: { row: peopleRow },
|
||||
title: 'Người liên quan',
|
||||
width: '65%',
|
||||
height: '400px',
|
||||
}
|
||||
}
|
||||
title: "Người liên quan",
|
||||
width: "65%",
|
||||
height: "400px",
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user