111 lines
2.3 KiB
TypeScript
111 lines
2.3 KiB
TypeScript
import { QTableProps } from 'quasar';
|
|
import { Invoice } from 'src/stores/payment/types';
|
|
import { formatNumberDecimal } from 'src/stores/utils';
|
|
import { dateFormatJS } from 'src/utils/datetime';
|
|
|
|
export const columns = [
|
|
{
|
|
name: '#order',
|
|
align: 'center',
|
|
label: 'general.order',
|
|
field: (v: Invoice & { _index: number }) => v._index + 1,
|
|
},
|
|
|
|
{
|
|
name: 'invoiceCode',
|
|
align: 'center',
|
|
label: 'requestList.invoiceCode',
|
|
field: 'code',
|
|
},
|
|
|
|
{
|
|
name: 'workSheetName',
|
|
align: 'center',
|
|
label: 'invoice.workSheetName',
|
|
field: (v: Invoice) => v.quotation.workName,
|
|
},
|
|
|
|
{
|
|
name: 'customer',
|
|
align: 'center',
|
|
label: 'general.customer',
|
|
field: (v: Invoice) => v.quotation.customerBranch.registerName,
|
|
},
|
|
|
|
{
|
|
name: 'issueDate',
|
|
align: 'center',
|
|
label: 'taskOrder.issueDate',
|
|
field: (v: Invoice) => dateFormatJS({ date: v.createdAt }),
|
|
},
|
|
|
|
{
|
|
name: 'paymentDueDate',
|
|
align: 'center',
|
|
label: 'invoice.paymentDueDate',
|
|
field: (v: Invoice) => dateFormatJS({ date: v.quotation.dueDate }),
|
|
},
|
|
|
|
{
|
|
name: 'value',
|
|
align: 'center',
|
|
label: 'preview.value',
|
|
field: (v: Invoice) => formatNumberDecimal(v.amount, 2),
|
|
},
|
|
{
|
|
name: '#status',
|
|
align: 'center',
|
|
label: 'general.status',
|
|
field: (_) => '#status',
|
|
},
|
|
{
|
|
name: '#action',
|
|
align: 'center',
|
|
label: '',
|
|
field: (_) => '#action',
|
|
},
|
|
] as const satisfies QTableProps['columns'];
|
|
|
|
export const docColumn = [
|
|
{
|
|
name: 'order',
|
|
align: 'center',
|
|
label: 'general.order',
|
|
field: 'no',
|
|
},
|
|
{
|
|
name: 'document',
|
|
align: 'left',
|
|
label: 'general.document',
|
|
field: 'document',
|
|
},
|
|
{
|
|
name: 'attachment',
|
|
align: 'left',
|
|
label: 'requestList.attachment',
|
|
field: 'attachment',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
align: 'center',
|
|
label: 'general.amount',
|
|
field: 'amount',
|
|
},
|
|
{
|
|
name: 'documentInSystem',
|
|
align: 'center',
|
|
label: 'requestList.documentInSystem',
|
|
field: 'documentInSystem',
|
|
},
|
|
{
|
|
name: 'status',
|
|
align: 'center',
|
|
label: 'general.status',
|
|
field: 'status',
|
|
},
|
|
] as const satisfies QTableProps['columns'];
|
|
|
|
export const hslaColors: Record<string, string> = {
|
|
PaymentWait: '--orange-5-hsl',
|
|
PaymentSuccess: '--green-8-hsl',
|
|
};
|