jws-frontend/src/pages/09_task-order/constants.ts
Thanaphon Frappet 550ed55de0
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s
refactor: show all product and add column status and edit format remark
2025-04-17 15:02:22 +07:00

329 lines
6.2 KiB
TypeScript

import { QTableProps } from 'quasar';
import { TaskStatus } from 'src/stores/task-order/types';
export const taskStatusOpts = [
{
status: TaskStatus.Pending,
name: 'taskOrder.status.Pending',
},
{
status: TaskStatus.InProgress,
name: 'taskOrder.status.InProgress',
},
{
status: TaskStatus.Success,
name: 'taskOrder.status.Success',
},
{
status: TaskStatus.Failed,
name: 'taskOrder.status.Failed',
},
{
status: TaskStatus.Redo,
name: 'taskOrder.status.Redo',
},
{
status: TaskStatus.Validate,
name: 'taskOrder.status.Validate',
},
{
status: TaskStatus.Complete,
name: 'taskOrder.status.Complete',
},
{
status: TaskStatus.Restart,
name: 'taskOrder.status.Restart',
},
];
export const pageTabs = [
{ label: 'title', value: 'Pending' },
{ label: 'inProgress', value: 'InProgress' },
{ label: 'goodReceipt', value: 'Complete' },
];
export const pageTabsReceive = [
{ label: 'taskInCart', value: 'Pending' },
{ label: 'receiveTask', value: 'Accept' },
{ label: 'sentTask', value: 'Submit' },
];
export enum Status {
taskOrder = 'taskOrder',
receiveTaskOrder = 'receiveTaskOrder',
sendTaskOrder = 'sendTaskOrder',
payment = 'payment',
goodReceipt = 'goodReceipt',
}
export const taskStatusReceiveToggle = [
{
value: TaskStatus.Pending,
icon: 'mdi-file-move-outline',
color: 'warning',
},
{
value: TaskStatus.Success,
icon: 'mdi-file-check-outline',
color: 'positive',
},
{
value: TaskStatus.Failed,
icon: 'mdi-file-remove-outline',
color: 'negative',
},
];
export const taskStatusOrderToggle = [
{
value: TaskStatus.InProgress,
icon: 'mdi-file-move-outline',
color: 'warning',
},
{
value: TaskStatus.Complete,
icon: 'mdi-file-check-outline',
color: 'positive',
},
{
value: TaskStatus.Redo,
icon: 'mdi-file-remove-outline',
color: 'negative',
},
{
value: TaskStatus.Restart,
icon: 'mdi-file-remove-outline',
color: 'negative',
},
];
export const column = [
{
name: 'order',
align: 'center',
label: 'general.order',
field: 'no',
},
{
name: 'taskName',
align: 'center',
label: 'taskOrder.title',
field: 'taskName',
},
{
name: 'issueBranch',
align: 'center',
label: 'taskOrder.issueBranch',
field: 'issueBranch',
},
{
name: 'institution',
align: 'center',
label: 'general.agencies',
field: 'institution',
},
{
name: 'createdAt',
align: 'center',
label: 'taskOrder.issueDate',
field: 'createdAt',
},
{
name: 'createdBy',
align: 'center',
label: 'taskOrder.madeBy',
field: 'createdBy',
},
{
name: 'contactTel',
align: 'center',
label: 'general.telephone',
field: 'contactTel',
},
{
name: 'contactName',
align: 'left',
label: 'taskOrder.contactName',
field: 'contactName',
},
{
name: 'taskStatus',
align: 'center',
label: 'general.status',
field: 'taskStatus',
},
] as const satisfies QTableProps['columns'];
export const employeeColumn = [
{
name: 'order',
align: 'center',
label: 'general.order',
field: 'no',
},
{
name: 'code',
align: 'center',
label: 'requestList.requestListCode',
field: 'code',
},
{
name: 'quotationCode',
align: 'center',
label: 'requestList.quotationCode',
field: 'quotationCode',
},
{
name: 'fullName',
align: 'center',
label: 'quotation.employeeName',
field: 'fullName',
},
{
name: 'dateOfBirth',
align: 'center',
label: 'general.age',
field: 'dateOfBirth',
},
{
name: 'nationality',
align: 'center',
label: 'general.nationality',
field: 'nationality',
},
{
name: 'dueDate',
align: 'center',
label: 'quotation.documentExpireDate',
field: 'dueDate',
},
{
name: 'day',
align: 'center',
label: 'general.numberOfDay',
field: 'day',
},
] as const satisfies QTableProps['columns'];
export const productColumn = [
{
name: 'order',
align: 'center',
label: 'general.order',
field: 'no',
},
{
name: 'code',
align: 'center',
label: 'productService.product.code',
field: 'code',
},
{
name: 'productList',
align: 'center',
label: 'taskOrder.productList',
field: 'productList',
},
{
name: 'status',
align: 'center',
label: 'general.status',
field: 'status',
},
{
name: 'amountOfEmployee',
align: 'center',
label: 'taskOrder.amountOfEmployee',
field: 'amountOfEmployee',
},
{
name: 'pricePerUnit',
align: 'center',
label: 'quotation.pricePerUnit',
field: 'pricePerUnit',
},
{
name: 'discount',
align: 'center',
label: 'general.discount',
field: 'discount',
},
{
name: 'priceBeforeVat',
align: 'center',
label: 'quotation.priceBeforeVat',
field: 'priceBeforeVat',
},
{
name: 'vat',
align: 'center',
label: 'general.vat',
field: 'vat',
},
{
name: 'totalPriceBaht',
align: 'center',
label: 'quotation.totalPriceBaht',
field: 'totalPriceBaht',
},
] as const satisfies QTableProps['columns'];
export const receiveProductColumn = [
{
name: 'order',
align: 'center',
label: 'general.order',
field: 'order',
},
{
name: 'requestListCode',
align: 'center',
label: 'requestList.requestListCode',
field: 'requestListCode',
},
{
name: 'flow',
align: 'center',
label: 'flow.step',
field: 'flow',
},
{
name: 'quotation',
align: 'center',
label: 'quotation.employeeName',
field: 'quotation',
},
{
name: 'age',
align: 'center',
label: 'general.age',
field: 'age',
},
{
name: 'nationality',
align: 'center',
label: 'general.nationality',
field: 'nationality',
},
{
name: 'documentExpireDate',
align: 'center',
label: 'quotation.documentExpireDate',
field: 'documentExpireDate',
},
{
name: 'numberOfDay',
align: 'center',
label: 'general.numberOfDay',
field: 'numberOfDay',
},
{
name: 'quotationCode',
align: 'center',
label: 'requestList.quotationCode',
field: 'quotationCode',
},
] as const satisfies QTableProps['columns'];