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 @@