From 03e99c0f0c948be6eb0d5c12fc5ec84977a5a2ef Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 23 Jan 2025 14:54:09 +0700 Subject: [PATCH] refactor: add remark --- .../09_task-order/document_view/MainPage.vue | 21 ++++++++++++++++++- src/pages/09_task-order/form.ts | 7 ++----- .../09_task-order/order_view/MainPage.vue | 1 + src/stores/task-order/index.ts | 6 +++++- src/stores/task-order/types.ts | 2 ++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/pages/09_task-order/document_view/MainPage.vue b/src/pages/09_task-order/document_view/MainPage.vue index 9e041b11..12eec3fb 100644 --- a/src/pages/09_task-order/document_view/MainPage.vue +++ b/src/pages/09_task-order/document_view/MainPage.vue @@ -23,6 +23,7 @@ import { import { useRoute } from 'vue-router'; import { useTaskOrderStore } from 'src/stores/task-order'; import { RequestWork } from 'src/stores/request-list'; +import { convertTemplate } from 'src/utils/string-template'; const route = useRoute(); const taskOrder = useTaskOrderStore(); @@ -414,7 +415,25 @@ function print() { }" /> -
+ + {{ $t('general.remark') }} + + +
+
+
diff --git a/src/stores/task-order/index.ts b/src/stores/task-order/index.ts index b3bc8db4..c4aeb682 100644 --- a/src/stores/task-order/index.ts +++ b/src/stores/task-order/index.ts @@ -104,6 +104,10 @@ export const useTaskOrderStore = defineStore('taskorder-store', () => { async function editTaskOrder(body: TaskOrderPayload) { const res = await api.put(`/task-order/${body.id}`, { + taskProduct: body.taskProduct?.map((v) => ({ + productId: v.productId, + discount: v.discount, + })), taskList: body.taskList.map((v) => ({ step: v.step, requestWorkId: v.requestWorkId, @@ -113,7 +117,7 @@ export const useTaskOrderStore = defineStore('taskorder-store', () => { contactName: body.contactName, taskStatus: body.taskStatus, taskName: body.taskName, - taskProduct: body.taskProduct, + remark: body.remark, }); if (res.status < 400) { diff --git a/src/stores/task-order/types.ts b/src/stores/task-order/types.ts index 12abe09f..e3ca337f 100644 --- a/src/stores/task-order/types.ts +++ b/src/stores/task-order/types.ts @@ -56,6 +56,7 @@ export interface TaskOrder { code: string; id: string; userTask: UserTask[]; + remark?: string; } export interface UserTask { @@ -176,6 +177,7 @@ export interface TaskOrderPayload { registeredBranchId?: string; id?: string; code?: string; + remark?: string; } export interface ProductService {