feat: add more field
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s

This commit is contained in:
Methapon2001 2025-03-06 17:33:09 +07:00
parent 5278f4952e
commit 35fd79634a
6 changed files with 133 additions and 39 deletions

View file

@ -181,7 +181,19 @@ watch([() => pageState.currentTab], async () => {
<template #main>
<TableReport
:row="dataReportQuotation"
:row="
dataReportQuotation.map((v) => ({
...v,
name:
v.customerBranch.customer.customerType === 'CORP'
? $i18n.locale === 'eng'
? v.customerBranch.registerNameEN
: v.customerBranch.registerName
: $i18n.locale === 'eng'
? `${v.customerBranch.firstNameEN} ${v.customerBranch.lastNameEN}`
: `${v.customerBranch.firstName} ${v.customerBranch.lastName}`,
}))
"
:columns="colReportQuotation"
>
<template #status="{ item }">
@ -208,7 +220,22 @@ watch([() => pageState.currentTab], async () => {
</div>
</template>
<template #main>
<TableReport :row="dataReportInvoice" :columns="colReport">
<TableReport
:row="
dataReportInvoice.map((v) => ({
...v,
name:
v.customerBranch.customer.customerType === 'CORP'
? $i18n.locale === 'eng'
? v.customerBranch.registerNameEN
: v.customerBranch.registerName
: $i18n.locale === 'eng'
? `${v.customerBranch.firstNameEN} ${v.customerBranch.lastNameEN}`
: `${v.customerBranch.firstName} ${v.customerBranch.lastName}`,
}))
"
:columns="colReport"
>
<template #status="{ item }">
<BadgeComponent
:title="$t(`invoice.status.${item.row.status}`)"
@ -233,7 +260,22 @@ watch([() => pageState.currentTab], async () => {
</div>
</template>
<template #main>
<TableReport :row="dataReportReceipt" :columns="colReport">
<TableReport
:row="
dataReportReceipt.map((v) => ({
...v,
name:
v.customerBranch.customer.customerType === 'CORP'
? $i18n.locale === 'eng'
? v.customerBranch.registerNameEN
: v.customerBranch.registerName
: $i18n.locale === 'eng'
? `${v.customerBranch.firstNameEN} ${v.customerBranch.lastNameEN}`
: `${v.customerBranch.firstName} ${v.customerBranch.lastName}`,
}))
"
:columns="colReport"
>
<template #status="{ item }">
<BadgeComponent
:title="$t(`invoice.status.${item.row.status}`)"
@ -260,7 +302,22 @@ watch([() => pageState.currentTab], async () => {
</div>
</template>
<template #main>
<TableReport :row="dataReportInvoice" :columns="colReport">
<TableReport
:row="
dataReportInvoice.map((v) => ({
...v,
name:
v.customerBranch.customer.customerType === 'CORP'
? $i18n.locale === 'eng'
? v.customerBranch.registerNameEN
: v.customerBranch.registerName
: $i18n.locale === 'eng'
? `${v.customerBranch.firstNameEN} ${v.customerBranch.lastNameEN}`
: `${v.customerBranch.firstName} ${v.customerBranch.lastName}`,
}))
"
:columns="colReport"
>
<template #status="{ item }">
<BadgeComponent
:title="$t(`invoice.status.${item.row.status}`)"
@ -317,7 +374,9 @@ watch([() => pageState.currentTab], async () => {
code: v.code,
name:
v.customer.customerType === 'CORP'
? v.customerName
? $i18n.locale === 'eng'
? v.registerNameEN
: v.registerName
: $i18n.locale === 'eng'
? `${v.firstNameEN} ${v.lastNameEN}`
: `${v.firstName} ${v.lastName}`,

View file

@ -32,7 +32,12 @@ const prop = withDefaults(
style="background-color: hsla(var(--info-bg) / 0.07)"
:props="props"
>
<q-th v-for="col in columns" :key="col.name" :props="props">
<q-th
v-for="col in columns"
style="text-align: center"
:key="col.name"
:props="props"
>
{{ $t(col.label) }}
</q-th>
</q-tr>

View file

@ -41,6 +41,18 @@ export const colReportQuotation = [
label: 'report.document.status',
field: '',
},
{
name: 'customer',
align: 'left',
label: 'report.customerName',
field: 'name',
},
{
name: 'amount',
align: 'left',
label: 'report.value',
field: (data: ReportQuotation) => formatNumberDecimal(data.amount, 2),
},
{
name: 'createAt',
align: 'center',
@ -68,6 +80,18 @@ export const colReport = [
label: 'report.table.status',
field: '',
},
{
name: 'customer',
align: 'left',
label: 'report.customerName',
field: 'name',
},
{
name: 'amount',
align: 'left',
label: 'report.value',
field: (data: Report) => formatNumberDecimal(data.amount, 2),
},
{
name: 'createAt',
align: 'center',