diff --git a/src/pages/05_quotation/form.ts b/src/pages/05_quotation/form.ts index 86d7bd65..11dfe0ff 100644 --- a/src/pages/05_quotation/form.ts +++ b/src/pages/05_quotation/form.ts @@ -69,6 +69,13 @@ export const useQuotationForm = defineStore('form-quotation', () => { if (!data) return; // NOTE: Error should be handled globally by axios instance resetFormData = Object.assign(data, { + productServiceList: data.productServiceList.map((v) => ({ + ...v, + worker: undefined, + workerIndex: v.worker.map((a) => + data.worker.findIndex((b) => b.employeeId === a.id), + ), + })), dueDate: new Date(data.dueDate), payBillDate: data.payBillDate ? new Date(data.payBillDate) : undefined, worker: data.worker.map((v) => diff --git a/src/stores/quotations/types.ts b/src/stores/quotations/types.ts index d5b948c8..9000bc4b 100644 --- a/src/stores/quotations/types.ts +++ b/src/stores/quotations/types.ts @@ -208,6 +208,7 @@ export type QuotationFull = { work: WorkRelation | null; serviceId: string | null; service: ServiceRelation | null; + worker: EmployeeRelation[]; }[]; id: string;