From 409292b6996c125b28ca96380c9c1b4eadd501b6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 23 May 2025 11:34:22 +0700 Subject: [PATCH] =?UTF-8?q?fix=20=20rules=20=E0=B9=80=E0=B8=87=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/edit/components/DialogForm.vue | 24 ++++++++++--------- .../views/edit/components/FormPosition.vue | 1 - .../views/edit/components/Table.vue | 4 ++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/modules/04_registryPerson/views/edit/components/DialogForm.vue b/src/modules/04_registryPerson/views/edit/components/DialogForm.vue index e2efa0648..6e352bc59 100644 --- a/src/modules/04_registryPerson/views/edit/components/DialogForm.vue +++ b/src/modules/04_registryPerson/views/edit/components/DialogForm.vue @@ -268,7 +268,7 @@ async function updateSelectType(val: string, status: boolean = false) { })); formData.positionLevel = !status ? "" : formData.positionLevel; - } + } // else { // store.posLevelData = []; // // formData.positionLevel = ""; @@ -369,16 +369,18 @@ function onSubmit() { type: empType.value?.toLocaleUpperCase(), commandDateAffect: convertDateToAPI(formData.commandDateAffect), commandDateSign: convertDateToAPI(formData.commandDateSign), - amount: Number(String(formData.amount)?.replace(/,/g, "")), - amountSpecial: Number( - String(formData.amountSpecial)?.replace(/,/g, "") - ), - positionSalaryAmount: Number( - String(formData.positionSalaryAmount)?.replace(/,/g, "") - ), - mouthSalaryAmount: Number( - String(formData.mouthSalaryAmount)?.replace(/,/g, "") - ), + amount: formData.amount + ? Number(String(formData.amount)?.replace(/,/g, "")) + : null, + amountSpecial: formData.amountSpecial + ? Number(String(formData.amountSpecial)?.replace(/,/g, "")) + : null, + positionSalaryAmount: formData.positionSalaryAmount + ? Number(String(formData.positionSalaryAmount)?.replace(/,/g, "")) + : null, + mouthSalaryAmount: formData.mouthSalaryAmount + ? Number(String(formData.mouthSalaryAmount)?.replace(/,/g, "")) + : null, }) .then(async () => { await props.fetchData?.(); diff --git a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue index e0e169407..2beb7b820 100644 --- a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue +++ b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue @@ -588,7 +588,6 @@ function classInput(val: boolean) { label="เงินเดือน" mask="###,###,###,###" reverse-fill-mask - :rules="!isReadonly ? [(val:string) => !!val || `${'กรุณากรอกเงินเดือน'}`] :[]" lazy-rules hide-bottom-space /> diff --git a/src/modules/04_registryPerson/views/edit/components/Table.vue b/src/modules/04_registryPerson/views/edit/components/Table.vue index 90f6edbfb..1d88103f3 100644 --- a/src/modules/04_registryPerson/views/edit/components/Table.vue +++ b/src/modules/04_registryPerson/views/edit/components/Table.vue @@ -136,7 +136,7 @@ const baseColumns = ref([ field: "mouthSalaryAmount", headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), + format: (v) => (v ? Number(v).toLocaleString() : "-"), }, { name: "positionSalaryAmount", @@ -146,7 +146,7 @@ const baseColumns = ref([ field: "positionSalaryAmount", headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => Number(v).toLocaleString(), + format: (v) => (v ? Number(v).toLocaleString() : "-"), }, { name: "organization",