From c91a08fc4d900d161e4d66374c93c709e61cf1bf Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 14 Mar 2025 09:39:04 +0700 Subject: [PATCH] fix convertDate command --- .../components/DialogCreateCommandORG.vue | 5 ++-- .../18_command/components/Step/1_Detail.vue | 7 +++++- .../components/Step/Dialog2_Salary.vue | 25 ------------------- .../18_command/components/Step/View0_Live.vue | 2 -- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/src/modules/18_command/components/DialogCreateCommandORG.vue b/src/modules/18_command/components/DialogCreateCommandORG.vue index d78ce9f96..9d655ca9d 100644 --- a/src/modules/18_command/components/DialogCreateCommandORG.vue +++ b/src/modules/18_command/components/DialogCreateCommandORG.vue @@ -28,6 +28,7 @@ const { dialogConfirm, hideLoader, date2Thai, + convertDateToAPI, } = mixin; const modal = defineModel("modal", { required: true }); @@ -145,8 +146,8 @@ function onSubmit() { showLoader(); const body = { commandTypeId: commandType.value, - commandAffectDate: commandAffectDate.value, - commandExcecuteDate: commandExcecuteDate.value, + commandAffectDate: convertDateToAPI(commandAffectDate.value), + commandExcecuteDate: convertDateToAPI(commandExcecuteDate.value), commandYear: commandYear.value, commandNo: commandNo.value, persons: selected.value ? dataMapToSend.value : [], diff --git a/src/modules/18_command/components/Step/1_Detail.vue b/src/modules/18_command/components/Step/1_Detail.vue index 0439c538d..db8f924c9 100644 --- a/src/modules/18_command/components/Step/1_Detail.vue +++ b/src/modules/18_command/components/Step/1_Detail.vue @@ -22,6 +22,7 @@ const { date2Thai, success, dialogConfirm, + convertDateToAPI, } = useCounterMixin(); /** @@ -70,7 +71,11 @@ async function onSubmit() { dialogConfirm($q, async () => { showLoader(); await http - .put(config.API.commandAction(commandId.value, "tab1"), formData) + .put(config.API.commandAction(commandId.value, "tab1"), { + ...formData, + commandAffectDate: convertDateToAPI(formData.commandAffectDate), + commandExcecuteDate: convertDateToAPI(formData.commandExcecuteDate), + }) .then(async () => { await props.fetchDataCommandList(); success($q, "บันทึกข้อมูลสำเร็จ"); diff --git a/src/modules/18_command/components/Step/Dialog2_Salary.vue b/src/modules/18_command/components/Step/Dialog2_Salary.vue index 0329e668d..77a3efceb 100644 --- a/src/modules/18_command/components/Step/Dialog2_Salary.vue +++ b/src/modules/18_command/components/Step/Dialog2_Salary.vue @@ -47,31 +47,6 @@ function checkCommandSysId() { readonly.value = true; } } - -// const chechCommandCode = computed(() => { -// const listCommandCode = [ -// "C-PM-01", -// "C-PM-02", -// "C-PM-03", -// "C-PM-04", -// "C-PM-05", -// "C-PM-07", -// "C-PM-08", -// "C-PM-09", -// "C-PM-21", -// "C-PM-22", -// "C-PM-24", -// "C-PM-29", -// "C-PM-38", -// "C-PM-39", -// ]; -// if (listCommandCode.includes(props.commandCode)) { -// return true; -// } else { -// return false; -// } -// }); - function onSubmit() { dialogConfirm($q, () => { showLoader(); diff --git a/src/modules/18_command/components/Step/View0_Live.vue b/src/modules/18_command/components/Step/View0_Live.vue index ae8aef787..fd5e051f3 100644 --- a/src/modules/18_command/components/Step/View0_Live.vue +++ b/src/modules/18_command/components/Step/View0_Live.vue @@ -238,8 +238,6 @@ function onConfirmOrder() { }) .then(async () => { await router.push(`/command/view/${commandId.value}`); - // fetchData?.(); - // isCheckAuthority.value = true; }) .catch((err) => { messageError($q, err);