From 38d5697a7ce4e5ccd158e3b7ac878648dbbd74cc Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 9 Aug 2024 16:59:57 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20=3D>=20permission=20?= =?UTF-8?q?=E0=B8=9C=E0=B8=B1=E0=B8=87=E0=B8=9A=E0=B8=B1=E0=B8=8D=E0=B8=8A?= =?UTF-8?q?=E0=B8=B5=E0=B8=84=E0=B9=88=E0=B8=B2=E0=B8=88=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=87=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=88=E0=B8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DialogEmployeeChart.vue | 20 +- .../DialogEmployeeRate.vue | 19 ++ .../DialogEmployeeUpload.vue | 15 +- .../DialogFormCriteria.vue | 108 +++++---- .../salaryEmployeeChart/TabCriteria.vue | 79 ++++--- .../salaryEmployeeChart/TabStructure.vue | 215 +++++++++++------- .../13_salary/views/salaryEmployeeChart.vue | 8 +- .../13_salary/views/salaryEmployeeRate.vue | 100 ++------ src/modules/13_salary/views/salaryRate.vue | 11 +- 9 files changed, 323 insertions(+), 252 deletions(-) diff --git a/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeChart.vue b/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeChart.vue index b2dea615b..dfb1f2ea5 100644 --- a/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeChart.vue +++ b/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeChart.vue @@ -26,6 +26,8 @@ const { /** props*/ const modal = defineModel("modal", { required: true }); +const activeType = defineModel("activeType", { required: true }); + const props = defineProps({ isStatusEdit: { type: Boolean, required: true }, data: { type: Object, required: true }, @@ -65,7 +67,7 @@ function fetchSalaryDetail(id: string) { formData.startDate = data.startDate; formData.endDate = data.endDate; formData.details = data.details; - isReadonly.value = data.isActive ? true : false; + isReadonly.value = activeType.value === "view" ? true : data.isActive; }) .catch((err) => { messageError($q, err); @@ -84,9 +86,9 @@ function onSubmit() { ? config.API.salaryEmployeeChart : config.API.salaryEmployeeChartByid(props.data.id); await http[!props.isStatusEdit ? "post" : "put"](url, formData); - success($q, "บันทีกข้อมูลสำเร็จ"); - props.fetchData?.(); + await props.fetchData?.(); closeDialog(); + success($q, "บันทีกข้อมูลสำเร็จ"); } catch (err) { messageError($q, err); } finally { @@ -150,7 +152,9 @@ const getClass = (val: boolean) => {
{ - - + บันทึกข้อมูล diff --git a/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeRate.vue b/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeRate.vue index daa0e58db..0391b16f1 100644 --- a/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeRate.vue +++ b/src/modules/13_salary/components/salaryEmployeeChart/DialogEmployeeRate.vue @@ -117,6 +117,19 @@ watch( } } ); + +const isReadonly = ref(false); + +/** + * class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ + * @param val ข้อมูล input สำหรับแก้ไขหรือไม่ + */ +const getClass = (val: boolean) => { + return { + "full-width inputgreen cursor-pointer": val, + "full-width cursor-pointer": !val, + }; +}; - + เพิ่ม @@ -388,39 +398,43 @@ onMounted(() => { diff --git a/src/modules/13_salary/components/salaryEmployeeChart/TabStructure.vue b/src/modules/13_salary/components/salaryEmployeeChart/TabStructure.vue index bc9c8d5e5..c5c5870b3 100644 --- a/src/modules/13_salary/components/salaryEmployeeChart/TabStructure.vue +++ b/src/modules/13_salary/components/salaryEmployeeChart/TabStructure.vue @@ -1,5 +1,6 @@