refactor: quotation table width & clear warning

This commit is contained in:
puriphatt 2024-11-08 10:55:58 +07:00
parent e48f2a66ee
commit 28b48e6c6f
2 changed files with 91 additions and 95 deletions

View file

@ -55,6 +55,7 @@ defineEmits<{
flat flat
hide-pagination hide-pagination
card-container-class="q-col-gutter-sm" card-container-class="q-col-gutter-sm"
class="full-width"
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr <q-tr
@ -62,7 +63,7 @@ defineEmits<{
:props="props" :props="props"
> >
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
{{ $t(col.label) }} {{ col.label && $t(col.label) }}
</q-th> </q-th>
</q-tr> </q-tr>
</template> </template>
@ -106,7 +107,7 @@ defineEmits<{
<q-td v-if="visibleColumns.includes('status')"> <q-td v-if="visibleColumns.includes('status')">
<BadgeComponent <BadgeComponent
:title-i18n="$t(quotationStatus(props.row.quotationStatus))" :title="$t(quotationStatus(props.row.quotationStatus))"
/> />
</q-td> </q-td>
@ -120,7 +121,7 @@ defineEmits<{
</span> </span>
</q-td> </q-td>
<q-td> <q-td class="text-right">
<q-btn <q-btn
:id="`btn-eye-${props.row.firstName}`" :id="`btn-eye-${props.row.firstName}`"
icon="mdi-eye-outline" icon="mdi-eye-outline"
@ -132,6 +133,8 @@ defineEmits<{
/> />
<KebabAction <KebabAction
:idName="`btn-kebab-${props.row.firstName}`"
status="'ACTIVE'"
hide-toggle hide-toggle
@view="$emit('view', props.row)" @view="$emit('view', props.row)"
@edit="$emit('edit', props.row)" @edit="$emit('edit', props.row)"

View file

@ -271,7 +271,6 @@ onMounted(async () => {
async function fetchQuotationList() { async function fetchQuotationList() {
{ {
console.log(pageState.currentTab);
const ret = await quotationStore.getQuotationList({ const ret = await quotationStore.getQuotationList({
page: quotationPage.value, page: quotationPage.value,
pageSize: quotationPageSize.value, pageSize: quotationPageSize.value,
@ -473,7 +472,7 @@ async function storeDataLocal(id: string) {
:options=" :options="
fieldSelectedOption.map((v) => ({ fieldSelectedOption.map((v) => ({
...v, ...v,
label: $t(v.label), label: v.label && $t(v.label),
})) }))
" "
:display-value="$t('general.displayField')" :display-value="$t('general.displayField')"
@ -591,10 +590,8 @@ async function storeDataLocal(id: string) {
/> />
</article> </article>
<article v-else class="col surface-2 full-width scroll"> <article v-else class="col surface-2 full-width scroll">
<div class="row"> <div class="q-pa-md">
<div style="overflow-x: auto" class="q-pa-md">
<TableQuotation <TableQuotation
style="max-width: 100%"
:columns="columnQuotation" :columns="columnQuotation"
:rows="quotationData" :rows="quotationData"
:visible-columns="pageState.fieldSelected" :visible-columns="pageState.fieldSelected"
@ -639,9 +636,7 @@ async function storeDataLocal(id: string) {
}); });
})() })()
" "
:status=" :status="$t(`quotation.status.${item.row.quotationStatus}`)"
$t(`quotation.status.${item.row.quotationStatus}`)
"
:worker-count="item.row._count.worker" :worker-count="item.row._count.worker"
:worker-max="item.row.workerMax || item.row._count.worker" :worker-max="item.row.workerMax || item.row._count.worker"
:customer-name=" :customer-name="
@ -665,8 +660,7 @@ async function storeDataLocal(id: string) {
statusDialog: 'info', statusDialog: 'info',
quotationId: item.row.id, quotationId: item.row.id,
branchId: branchId:
item.row.customerBranch.customer item.row.customerBranch.customer.registeredBranchId,
.registeredBranchId,
}); });
} }
" "
@ -686,7 +680,6 @@ async function storeDataLocal(id: string) {
</template> </template>
</TableQuotation> </TableQuotation>
</div> </div>
</div>
</article> </article>
<!-- SEC: footer content --> <!-- SEC: footer content -->