refactor: show all product and add column status and edit format remark
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 7s

This commit is contained in:
Thanaphon Frappet 2025-04-17 15:02:22 +07:00
parent 145784ee40
commit 550ed55de0
7 changed files with 92 additions and 16 deletions

View file

@ -1,5 +1,7 @@
import { RequestWork } from 'src/stores/request-list';
import { TaskStatus } from 'src/stores/task-order/types';
import { formatNumberDecimal } from 'src/stores/utils';
import { i18n } from 'src/boot/i18n';
const templates = {
'quotation-labor': {
@ -46,7 +48,12 @@ const templates = {
converter: (context?: {
items?: {
product: RequestWork['productService']['product'];
list: RequestWork[];
list: (RequestWork & {
taskStatus?: TaskStatus;
failedComment?: string;
failedType?: string;
codeRequest?: string;
})[];
}[];
itemsDiscount?: {
productId: string;
@ -67,8 +74,9 @@ const templates = {
const branch = v.request.quotation.customerBranch;
return (
`${i + 1}. ` +
` ${v.request.code}_${branch.customer.customerType === 'PERS' ? `นายจ้าง ${branch.namePrefix}. ${branch.firstNameEN} ${branch.lastNameEN} `.toUpperCase() : branch.registerName}_` +
`${employee.namePrefix}. ${employee.firstNameEN} ${employee.lastNameEN} `.toUpperCase() +
`(${branch.customer.customerType === 'PERS' ? `นายจ้าง ${branch.namePrefix}. ${branch.firstNameEN} ${branch.lastNameEN} `.toUpperCase() : branch.registerName})`
`${!!v.failedType && v.failedType !== 'other' ? `${i18n.global.t(`taskOrder.${v.failedType}`)}` : !!v.failedComment ? v.failedComment : ''}`
);
});
return [