diff --git a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue index e04e1dc0e..437b332a8 100644 --- a/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue +++ b/src/modules/13_salary/components/SalaryChart/DialogFormMain.vue @@ -69,6 +69,8 @@ const title = computed(() => { ? "เพิ่มผังบัญชีเงินเดือน" : props.typeAction === "edit" ? "แก้ไขผังบัญชีเงินเดือน" + : props.typeAction === "view" + ? "รายละเอียด" : "บัญชีเงินเดือน"; return name; @@ -131,7 +133,7 @@ function fetchSalaryDetail(id: string) { formData.endDate = data.endDate; formData.details = data.details; formData.isSpecial = data.isSpecial; - isReadonly.value = data.isActive; + isReadonly.value = props.typeAction === 'view'? true: data.isActive; }) .catch((err) => { messageError($q, err); @@ -150,7 +152,7 @@ watch( if (modal.value) { await fetchPosType(); - if (props.typeAction === "edit") { + if (props.typeAction === "edit" || props.typeAction === "view") { showLoader(); setTimeout(() => { if (props.data) { @@ -522,7 +524,7 @@ const getClass = (val: boolean) => { - + บันทึกข้อมูล diff --git a/src/modules/13_salary/components/SalaryChart/DialogFormRate.vue b/src/modules/13_salary/components/SalaryChart/DialogFormRate.vue index b1df17224..eb47b489a 100644 --- a/src/modules/13_salary/components/SalaryChart/DialogFormRate.vue +++ b/src/modules/13_salary/components/SalaryChart/DialogFormRate.vue @@ -16,7 +16,6 @@ import Header from "@/components/DialogHeader.vue"; import { useCounterMixin } from "@/stores/mixin"; /** use*/ - const $q = useQuasar(); const route = useRoute(); const { dialogConfirm, showLoader, hideLoader, messageError, success } = @@ -39,6 +38,7 @@ const props = defineProps({ }, }); +const isReadonly = ref(false); const salaryId = ref(route.params.id.toString()); const formData = reactive({ salaryId: "", @@ -170,6 +170,17 @@ watch( } } ); + +/** + * class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ + * @param val ข้อมูล input สำหรับแก้ไขหรือไม่ + */ +const getClass = (val: boolean) => { + return { + "full-width inputgreen cursor-pointer": val, + "full-width cursor-pointer": !val, + }; +};