diff --git a/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue b/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue index de3d93189..2bb4519e6 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/01_ProfessionalLicense.vue @@ -19,6 +19,7 @@ const { messageError, success, date2Thai, + pathRegistryEmp, } = mixin; const historyDialog = ref(false); @@ -26,9 +27,7 @@ const mode = ref("table"); const dialog = ref(false); const route = useRoute(); const id = ref(route.params.id.toString()); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const dialogStatus = ref("create"); const editId = ref(""); const keyword = ref(""); diff --git a/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue b/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue index 5439f87d3..b34b81fa3 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/02_Train.vue @@ -21,13 +21,13 @@ const { messageError, success, date2Thai, + pathRegistryEmp, } = mixin; const route = useRoute(); const id = ref(route.params.id.toString()); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const dialog = ref(false); const mode = ref("table"); const columns = ref([ diff --git a/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue b/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue index da6baa35b..1080a96e5 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/03_Insignia.vue @@ -30,13 +30,12 @@ const { hideLoader, messageError, dialogConfirm, + pathRegistryEmp, } = mixin; const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const id = ref(""); const insigniaType = ref(""); diff --git a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue index e3f32e15b..d200d2749 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue @@ -22,13 +22,12 @@ const { showLoader, hideLoader, dialogConfirm, + pathRegistryEmp, } = mixin; const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const id = ref(""); const issueDateYear = ref(0); diff --git a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue index f40030d5b..f6a2e43fe 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue @@ -26,13 +26,12 @@ const { showLoader, hideLoader, dialogConfirm, + pathRegistryEmp, } = mixin; const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const id = ref(""); const resPerformForm = reactive({ diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue index e7b5644e5..db2a03cad 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/01_Info.vue @@ -27,12 +27,11 @@ const { showLoader, hideLoader, success, + pathRegistryEmp, } = mixin; const profileId = ref(route.params.id.toString()); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); /** ตัวแปรข้อมูลหลัก */ const formMain = reactive({ ocId: "", //สังกัด diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue index 6b4e28482..cf439b294 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue @@ -17,12 +17,7 @@ import DialogHistory from "@/modules/04_registryPerson/components/detail/Governm import { useRoute } from "vue-router"; const route = useRoute(); -const profileId = ref( - route.params.id ? route.params.id.toString() : "" -); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); + const $q = useQuasar(); const mixin = useCounterMixin(); const { @@ -32,9 +27,15 @@ const { hideLoader, messageError, success, - + pathRegistryEmp, dialogRemove, } = mixin; + +const profileId = ref( + route.params.id ? route.params.id.toString() : "" +); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const disciplineData = reactive({ date: null, level: "", diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_DisciplineHistory.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_DisciplineHistory.vue index df36ab3b7..d61853389 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_DisciplineHistory.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_DisciplineHistory.vue @@ -19,7 +19,10 @@ const id = defineModel("id", { required: true }); const $q = useQuasar(); const route = useRoute(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, date2Thai } = mixin; +const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } = + mixin; + +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const currentPage = ref(1); const maxPage = ref(1); @@ -147,9 +150,6 @@ const columns = ref([ }, ]); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); function getHistory() { showLoader(); http diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue index f1e024159..3d398ae49 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/03_Leave.vue @@ -23,12 +23,7 @@ import config from "@/app.config"; const rowsTotal = ref([]); const id = ref(""); const route = useRoute(); -const profileId = ref( - route.params.id ? route.params.id.toString() : "" -); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); + const $q = useQuasar(); const mixin = useCounterMixin(); const { @@ -39,8 +34,14 @@ const { success, date2Thai, dateToISO, + pathRegistryEmp, } = mixin; +const profileId = ref( + route.params.id ? route.params.id.toString() : "" +); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const pagination = ref({ page: 1, rowsPerPage: 10, @@ -618,7 +619,6 @@ onMounted(() => {
("id", { required: true }); const $q = useQuasar(); const route = useRoute(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, date2Thai } = mixin; +const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } = + mixin; + +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); const filterKeyword = ref(""); const rows = ref([]); //select data history const formFilter = reactive({ diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue index f0dc5a696..96cc84ab6 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWork.vue @@ -21,9 +21,7 @@ const route = useRoute(); const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); + const $q = useQuasar(); const mixin = useCounterMixin(); const { @@ -33,8 +31,11 @@ const { showLoader, hideLoader, success, + pathRegistryEmp, } = mixin; +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const modal = ref(false); const edit = ref(false); const modalHistory = ref(false); diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue index 17b3189f0..1bbdacece 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue @@ -19,11 +19,11 @@ const id = defineModel("id", { required: true }); const route = useRoute(); const $q = useQuasar(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, date2Thai } = mixin; +const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } = + mixin; + +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); const currentPage = ref(1); const maxPage = ref(1); const filterKeyword = ref(""); diff --git a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue index d7d3ed4d1..1dfd98d59 100644 --- a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue +++ b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue @@ -25,6 +25,7 @@ const { messageError, dialogRemove, dialogConfirm, + pathRegistryEmp, } = mixin; const id = ref(""); @@ -36,9 +37,8 @@ const pagination = ref({ const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const mode = ref("table"); const filterKeyword = ref(""); const rows = ref([]); diff --git a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformationHistory.vue b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformationHistory.vue index bb22ad1b0..24846e062 100644 --- a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformationHistory.vue +++ b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformationHistory.vue @@ -21,7 +21,8 @@ const id = defineModel("id", { required: true }); const $q = useQuasar(); const route = useRoute(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, date2Thai } = mixin; +const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } = + mixin; const historyPagination = ref({ page: 1, rowsPerPage: 10, @@ -42,9 +43,7 @@ const formFilter = reactive({ isShowRetire: false, isProbation: false, }); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const visibleColumns = ref([ "date", diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue index 047be7421..29f1fe76c 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -52,7 +52,11 @@ const profileId = ref( route.params.id ? route.params.id.toString() : "" ); const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" + route.name === "registryNewByid" + ? "" + : route.name === "registry-employeeId" + ? "-temp" + : "-employee" ); const modal = ref(false); diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue index c4db7e7c3..79edee3b2 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue @@ -39,6 +39,7 @@ const { messageError, showLoader, hideLoader, + pathRegistryEmp, } = useCounterMixin(); /** @@ -50,9 +51,8 @@ const props = defineProps({ const submitDisable = ref(true); const profileId = ref(route.params.id.toString()); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const editId = ref(""); const dialog = ref(false); const dialogStatus = ref("create"); diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue index 1db04b0db..4ebc4f6db 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue @@ -33,13 +33,12 @@ const { showLoader, hideLoader, dialogConfirm, + pathRegistryEmp, } = mixin; const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const currentPage = ref(1); const maxPage = ref(1); diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue index e3d0e7c3b..a4b4ba3d8 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue @@ -23,16 +23,20 @@ const $q = useQuasar(); const route = useRoute(); const store = useProfileDataStore(); -const { fetchPerson, filterSelector } = store; -const { dialogConfirm, showLoader, hideLoader, messageError, success } = - useCounterMixin(); +const { filterSelector } = store; +const { + dialogConfirm, + showLoader, + hideLoader, + messageError, + success, + pathRegistryEmp, +} = useCounterMixin(); const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); /** TableHisoty*/ const visibleColumns = ref([ diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue index 8f232367f..be44fabf2 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue @@ -22,6 +22,7 @@ const { messageError, success, date2Thai, + pathRegistryEmp, } = mixin; const dialog = ref(false); @@ -402,9 +403,8 @@ const historyRows = ref([]); const editId = ref(""); const route = useRoute(); const id = ref(route.params.id.toString()); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const isDate = ref("false"); const educationOption = ref([ { label: "ใช่", value: true }, diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue index 9c6568248..27005f003 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue @@ -22,6 +22,7 @@ const { messageError, success, date2Thai, + pathRegistryEmp, } = mixin; const columns = ref([ { @@ -147,9 +148,8 @@ const rows = ref([]); const historyRows = ref([]); const route = useRoute(); const id = ref(route.params.id.toString()); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const editId = ref(""); const keyword = ref(""); const historyKeyword = ref(""); diff --git a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue index eb0d1756b..a8369cc69 100644 --- a/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue +++ b/src/modules/04_registryPerson/components/detail/Salary/01_PositionSalary.vue @@ -26,9 +26,7 @@ const route = useRoute(); const profileId = ref( route.params.id ? route.params.id.toString() : "" ); -const empType = ref( - route.name === "registryNewByid" ? "" : "-employee" -); + const store = useSalaryDataStore(); const { date2Thai, @@ -37,8 +35,11 @@ const { hideLoader, messageError, success, + pathRegistryEmp, } = useCounterMixin(); +const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); + const baseColumns = ref([ { name: "date", @@ -609,9 +610,8 @@ const classInput = (val: boolean) => { >