diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index 1a7087759..a2c7078ca 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -30,12 +30,13 @@ export default { `${registryNew}${type}/address/history/${dataId}`, // บันทึกวันที่ไม่ได้รับเงินเดือนฯ - profileNewNoPaid: `${registryNew}/nopaid`, - profileNewNoPaidByProfileId: (profileId: string) => - `${registryNew}/nopaid/${profileId}`, - profileNewNoPaidById: (dataId: string) => `${registryNew}/nopaid/${dataId}`, - profileNewNoPaidHisById: (dataId: string) => - `${registryNew}/nopaid/history/${dataId}`, + profileNewNoPaid: (type: string) => `${registryNew}${type}/nopaid`, + profileNewNoPaidByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/nopaid/${profileId}`, + profileNewNoPaidById: (dataId: string, type: string) => + `${registryNew}${type}/nopaid/${dataId}`, + profileNewNoPaidHisById: (dataId: string, type: string) => + `${registryNew}${type}/nopaid/history/${dataId}`, // เครื่องราชฯ profileNewInsign: `${registryNew}/insignia`, @@ -72,22 +73,22 @@ export default { `${registryNew}/training/history/${trainingId}`, // ประวัติการศึกษา - profileNewEducation: `${registryNew}/educations`, - profileNewEducationByProfileId: (profileId: string) => - `${registryNew}/educations/${profileId}`, - profileNewEducationByEducationId: (educationId: string) => - `${registryNew}/educations/${educationId}`, - profileNewEducationHisByEducationId: (educationsId: string) => - `${registryNew}/educations/history/${educationsId}`, + profileNewEducation: (type: string) => `${registryNew}${type}/educations`, + profileNewEducationByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/educations/${profileId}`, + profileNewEducationByEducationId: (educationId: string, type: string) => + `${registryNew}${type}/educations/${educationId}`, + profileNewEducationHisByEducationId: (educationsId: string, type: string) => + `${registryNew}${type}/educations/history/${educationsId}`, // ความสามารถพิเศษ - profileNewAbility: `${registryNew}/ability`, - profileNewAbilityByProfileId: (profileId: string) => - `${registryNew}/ability/${profileId}`, - profileNewAbilityByAbilityId: (abilityId: string) => - `${registryNew}/ability/${abilityId}`, - profileNewAbilityHisByAbilityId: (abilityId: string) => - `${registryNew}/ability/history/${abilityId}`, + profileNewAbility: (type: string) => `${registryNew}${type}/ability`, + profileNewAbilityByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/ability/${profileId}`, + profileNewAbilityByAbilityId: (abilityId: string, type: string) => + `${registryNew}${type}/ability/${abilityId}`, + profileNewAbilityHisByAbilityId: (abilityId: string, type: string) => + `${registryNew}${type}/ability/history/${abilityId}`, // ใบอนุญาตประกอบวิชาชีพ profileNewCertificate: `${registryNew}/certificate`, @@ -107,51 +108,56 @@ export default { `${registryNew}/other/history/${dataId}`, // ข้อมูลครอบครัว - profileNewFamily: `${registryNew}/family`, - profileNewFamilyByProfileId: (profileId: string) => - `${registryNew}/family/${profileId}`, - profileNewFamilyByFamilyId: (familyId: string) => - `${registryNew}/family/${familyId}`, - profileNewFamilyHisByFamilyId: (familyId: string) => - `${registryNew}/family/history/${familyId}`, + profileNewFamily: (type: string) => `${registryNew}${type}/family`, + profileNewFamilyByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/family/${profileId}`, + profileNewFamilyByFamilyId: (familyId: string, type: string) => + `${registryNew}${type}/family/${familyId}`, + profileNewFamilyHisByFamilyId: (familyId: string, type: string) => + `${registryNew}${type}/family/history/${familyId}`, // วินัย - profileNewDiscipline: `${registryNew}/discipline`, - profileNewDisciplineByProfileId: (profileId: string) => - `${registryNew}/discipline/${profileId}`, - profileNewDisciplineByDisciplineId: (disciplineId: string) => - `${registryNew}/discipline/${disciplineId}`, - profileNewDisciplineHisByDisciplineId: (disciplineId: string) => - `${registryNew}/discipline/history/${disciplineId}`, + profileNewDiscipline: (type: string) => `${registryNew}${type}/discipline`, + profileNewDisciplineByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/discipline/${profileId}`, + profileNewDisciplineByDisciplineId: (disciplineId: string, type: string) => + `${registryNew}${type}/discipline/${disciplineId}`, + profileNewDisciplineHisByDisciplineId: (disciplineId: string, type: string) => + `${registryNew}${type}/discipline/history/${disciplineId}`, // ปฏิบัติราชการพิเศษ - profileNewDuty: `${registryNew}/duty`, - profileNewDutyByProfileId: (profileId: string) => - `${registryNew}/duty/${profileId}`, - profileNewDutyByDutyId: (dutyId: string) => `${registryNew}/duty/${dutyId}`, - profileNewDutyHisByDutyId: (dutyId: string) => - `${registryNew}/duty/history/${dutyId}`, + profileNewDuty: (type: string) => `${registryNew}${type}/duty`, + profileNewDutyByProfileId: (profileId: string, type: string) => + `${registryNew}${type}/duty/${profileId}`, + profileNewDutyByDutyId: (dutyId: string, type: string) => + `${registryNew}${type}/duty/${dutyId}`, + profileNewDutyHisByDutyId: (dutyId: string, type: string) => + `${registryNew}${type}/duty/history/${dutyId}`, //ข้อมูลราชการ - profileNewGovernment: () => `${registryNew}/government`, - profileNewGovernmentById: (id: string) => `${registryNew}/government/${id}`, - profileNewGovernmentHistory: (id: string) => - `${registryNew}/government/history/${id}`, + profileNewGovernment: (type: string) => `${registryNew}${type}/government`, + profileNewGovernmentById: (id: string, type: string) => + `${registryNew}${type}/government/${id}`, + profileNewGovernmentHistory: (id: string, type: string) => + `${registryNew}${type}/government/history/${id}`, //การลา - profileNewLeave: () => `${registryNew}/leave`, - profileNewLeaveById: (id: string) => `${registryNew}/leave/${id}`, - profileNewLeaveHistory: (id: string) => `${registryNew}/leave/history/${id}`, + profileNewLeave: (type: string) => `${registryNew}${type}/leave`, + profileNewLeaveById: (id: string, type: string) => + `${registryNew}${type}/leave/${id}`, + profileNewLeaveHistory: (id: string, type: string) => + `${registryNew}${type}/leave/history/${id}`, profileCheckDate: () => `${env.API_URI}/leave/user/check`, profileNewLeaveType: () => `${env.API_URI}/leave/type`, /** ตำแหน่งเงินเดือน*/ - profileSalaryNew: `${salaryNew}`, - profileListSalaryNew: (id: string) => `${salaryNew}/${id}`, - profileListSalaryHistoryNew: (profileId: string) => - `${salaryNew}/history/${profileId}`, - profileSalarySwapNew: (type: string, id: string) => - `${salaryNew}/swap/${type}/${id}`, + profileSalaryNew: (type: string) => `${registryNew}${type}/salary`, + profileListSalaryNew: (id: string, type: string) => + `${registryNew}${type}/salary/${id}`, + profileListSalaryHistoryNew: (profileId: string, type: string) => + `${registryNew}${type}/salary/history/${profileId}`, + profileSalarySwapNew: (type: string, id: string, type2: string) => + `${registryNew}${type2}/salary/swap/${type}/${id}`, // ประวัติการเปลี่ยนชื่อ-นามสกุล profileNewChangeName: (type: string) => `${registryNew}${type}/changeName`, diff --git a/src/modules/02_organizationalNew/components/DialogFormAgency.vue b/src/modules/02_organizationalNew/components/DialogFormAgency.vue index 402f1f118..498efc2ae 100644 --- a/src/modules/02_organizationalNew/components/DialogFormAgency.vue +++ b/src/modules/02_organizationalNew/components/DialogFormAgency.vue @@ -68,9 +68,7 @@ const orgLevelOption = ref([]); const orgNameRef = ref(null); const orgShortNameRef = ref(null); const orgCodeRef = ref(null); -// const orgPhoneExRef = ref(null); -// const orgPhoneInRef = ref(null); -// const orgFaxRef = ref(null); + const orgLevelRef = ref(null); const orgLevelSubRef = ref(null); @@ -83,6 +81,7 @@ const formData = reactive({ orgFax: "", orgLevel: "", orgLevelSub: "", + responsibility: "", }); /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ @@ -90,9 +89,7 @@ const objectComplaintsRef: FormAgencyRef = { orgName: orgNameRef, orgShortName: orgShortNameRef, orgCode: orgCodeRef, - // orgPhoneEx: orgPhoneExRef, - // orgPhoneIn: orgPhoneInRef, - // orgFax: orgFaxRef, + orgLevel: orgLevelRef, orgLevelSub: orgLevelSubRef, }; @@ -149,6 +146,7 @@ function onSubmit() { ["org" + type + "RankSub"]: level.value !== 0 ? formData.orgLevelSub : undefined, [nameId]: rootId, + responsibility: formData.responsibility, }; if (actionType.value === "ADD") { @@ -194,7 +192,6 @@ function onSubmit() { messageError($q, err); }) .finally(async () => { - // await props.fetchDataTree?.(); hideLoader(); })); } @@ -209,6 +206,7 @@ function closeClear() { formData.orgPhoneIn = ""; formData.orgFax = ""; formData.orgLevel = ""; + formData.responsibility = ""; props.close?.(); } @@ -468,6 +466,19 @@ function selectOrgLevele(val: string, status: boolean = true) { hide-bottom-space /> +
+ +
diff --git a/src/modules/02_organizationalNew/interface/index/Main.ts b/src/modules/02_organizationalNew/interface/index/Main.ts index 368efa449..cc8103605 100644 --- a/src/modules/02_organizationalNew/interface/index/Main.ts +++ b/src/modules/02_organizationalNew/interface/index/Main.ts @@ -23,6 +23,7 @@ interface FormDataAgency { orgFax: string; orgLevel: string; orgLevelSub: string; + responsibility: string; } interface FormDataPosition { diff --git a/src/modules/04_registryNew/components/TableView.vue b/src/modules/04_registryNew/components/TableView.vue index 35fa9fd72..c413313f4 100644 --- a/src/modules/04_registryNew/components/TableView.vue +++ b/src/modules/04_registryNew/components/TableView.vue @@ -18,12 +18,13 @@ const router = useRouter(); const formFilter = defineModel("formFilter", { required: true }); const maxPage = defineModel("maxPage", { required: true }); +const empType = defineModel("empType", { required: true }); const props = defineProps({ rows: { type: Array }, fetchData: { type: Function }, fetchType: { type: Function }, total: { type: Number }, - empType: { type: String }, + // empType: { type: String }, }); const columns = ref([ @@ -167,7 +168,7 @@ function onClickHistory() { } function onClickViewDetail(id: string) { - if (props.empType === "officer") { + if (empType.value === "officer") { router.push(`/registry-new/${id}`); } else { router.push(`/registry-new-employee/${id}`); @@ -299,8 +300,8 @@ watch(
- - + + @@ -371,7 +372,11 @@ watch( - ประเภทตำแหน่ง + + {{ + empType === "officer" ? "ประเภทตำแหน่ง" : "กลุ่มงาน" + }} @@ -384,7 +389,11 @@ watch( - ระดับตำแหน่ง + + {{ + empType === "officer" ? "ระดับตำแหน่ง" : "ระดับชั้นงาน" + }} diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue index b4c2b5857..b83e128d5 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue @@ -28,6 +28,9 @@ const { } = mixin; const profileId = ref(route.params.id.toString()); +const empType = ref( + route.name === "registryNewByid" ? "" : "-employee" +); /** ตัวแปรข้อมูลหลัก */ const formMain = reactive({ ocId: "", //สังกัด @@ -324,6 +327,7 @@ function openDialogEdit() { function openDialogHistory() { modalHistory.value = true; + filterKeyword.value = ""; getDataHistory(); } /** ปิด dialog */ @@ -355,15 +359,18 @@ function onSubmit() { dialogConfirm($q, () => { showLoader(); http - .patch(config.API.profileNewGovernmentById(profileId.value), { - dateAppoint: containDate.value, - dateStart: workDate.value, - reasonSameDate: - dateToISO(containDate.value as Date) === - dateToISO(workDate.value as Date) - ? "" - : reasonSameDate.value, - }) + .patch( + config.API.profileNewGovernmentById(profileId.value, empType.value), + { + dateAppoint: containDate.value, + dateStart: workDate.value, + reasonSameDate: + dateToISO(containDate.value as Date) === + dateToISO(workDate.value as Date) + ? "" + : reasonSameDate.value, + } + ) .then((res) => { closeDialog(); getData(); @@ -383,7 +390,7 @@ function onSubmit() { function getData() { showLoader(); http - .get(config.API.profileNewGovernmentById(profileId.value)) + .get(config.API.profileNewGovernmentById(profileId.value, empType.value)) .then((res) => { const data = res.data.result; formMain.ocId = data.org; //สังกัด @@ -416,7 +423,7 @@ function getData() { function getDataHistory() { showLoader(); http - .get(config.API.profileNewGovernmentHistory(profileId.value)) + .get(config.API.profileNewGovernmentHistory(profileId.value, empType.value)) .then((res) => { let data = res.data.result; rowsHistory.value = []; @@ -447,21 +454,22 @@ function getDataHistory() { }) .catch((e) => { messageError($q, e); + modalHistory.value = false }) .finally(() => { hideLoader(); }); } -watch( - () => modalHistory.value, - (isOpen) => { - if (isOpen === true) { - filterKeyword.value = ""; - getDataHistory(); - } - } -); +// watch( +// () => modalHistory.value, +// (isOpen) => { +// if (isOpen === true) { +// filterKeyword.value = ""; +// getDataHistory(); +// } +// } +// ); onMounted(() => { getData(); @@ -709,9 +717,7 @@ onMounted(() => { ? date2Thai(workDate as Date) : null " - :rules="[ - (val) => !!val || 'กรุณาเลือกเริ่มปฎิบัติราชการ', - ]" + :rules="[(val) => !!val || 'กรุณาเลือกเริ่มปฎิบัติราชการ']" label="วัน/เดือน/ปี เริ่มปฎิบัติราชการ" >