diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f5436c589..c233f34d4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,10 +8,10 @@ on: env: REGISTRY: docker.frappet.com IMAGE_NAME: ehr/bma-ehr-app - DEPLOY_HOST: 49.0.91.80 + DEPLOY_HOST: frappet.com COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr jobs: - # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=version-1.0.110 -s DOCKER_USER=kittapath@frappet.com -s DOCKER_PASS=P@ssw0rd -s SSH_PASSWORD=FPTadmin2357 + # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=latest -s DOCKER_USER=kittapath@frappet.com -s DOCKER_PASS=P@ssw0rd -s SSH_PASSWORD=FPTadmin2357 release-test: runs-on: ubuntu-latest steps: diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index 59f15364e..4695b7b57 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -20,10 +20,10 @@ export default { /** position*/ orgPosPosition: `${orgPos}/position`, orgPosPositionById: (id: string) => `${orgPos}/position/${id}`, - orgPosPositionExecutive : () => `${orgPos}/position/executive`, + orgPosPositionExecutive: () => `${orgPos}/position/executive`, orgPosExecutive: `${orgPos}/executive`, orgPosType: `${orgPos}/type`, - orgPosTypeId: (id: string) => `${orgPos}/type/${id}`, + orgPosTypeId: (id: string) => `${orgPos}/type/${id}`, orgPosLevel: `${orgPos}/level`, orgPosMaster: `${orgPos}/master`, orgPosMasterById: (id: string) => `${orgPos}/master/${id}`, @@ -86,7 +86,10 @@ export default { orgProfileEmp: `${orgEmployeePos}/profile`, orgSearchProfileEmp: `${orgProfile}-employee/search`, - orgProfileById:(id:string,type:string)=>`${orgProfile}${type}/${id}`, + orgProfileById: (id: string, type: string) => `${orgProfile}${type}/${id}`, - orgDeceasedProfile:`${orgPos}/profile/search` + orgDeceasedProfile: `${orgPos}/profile/search`, + + // + orgCheckAvatar: (id: string) => `${orgProfile}/avatar/profileId/${id}`, }; diff --git a/src/api/index.ts b/src/api/index.ts index b147146b2..b29b5fb3d 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -10,7 +10,7 @@ export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL; const config = ref({ development: { - // API_URI: "https://localhost:7260/api", + // API_URI: "http://localhost:13001/api/v1", API_URI: "https://bma-ehr.frappet.synology.me/api/v1", // API_URI_ORG_SERVICE: "https://localhost:7056/api/v1", //ใช้ชั่วคราว API_URI_ORG_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว diff --git a/src/api/registry/api.registry.ts b/src/api/registry/api.registry.ts index ad88412d5..982cc48e9 100644 --- a/src/api/registry/api.registry.ts +++ b/src/api/registry/api.registry.ts @@ -177,4 +177,17 @@ export default { `${registryNew}${empType}/family/${type}`, profileFamilyHistory: (id: string, empType: string, type: string) => `${registryNew}${empType}/family/${type}/history/${id}`, + + //ลูกจ้างชั่วคราว + positionEmployee: (id: string) => `${registryNew}-employee/position/${id}`, + informationEmployee: (id: string) => + `${registryNew}-employee/information/${id}`, + informationHistoryEmployee: (id: string) => + `${registryNew}-employee/information/history/${id}`, + employmentEmployee: (id: string) => + `${registryNew}-employee/employment/${id}`, + employmentEmployeeId: (id: string) => + `${registryNew}-employee/employment/id/${id}`, + employmentHistoryEmployee: (id: string) => + `${registryNew}-employee/employment/history/${id}`, }; diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue index af2afff71..b275af850 100644 --- a/src/components/CardProfile.vue +++ b/src/components/CardProfile.vue @@ -38,7 +38,7 @@ const profileId = ref(""); function fetchDataProfile(data: DataProfile) { if (data.profileId) { - fetchProfile(data.profileId); + fetchCheckAvatar(data.profileId); } profile.id = data.profileId; profile.fullName = `${data.prefix ?? ""}${data.firstName ?? ""} ${ @@ -72,12 +72,19 @@ function fetchDataProfile(data: DataProfile) { } } -function fetchProfile(id: string) { +function fetchCheckAvatar(id: string) { + http.get(config.API.orgCheckAvatar(id)).then((res) => { + const data = res.data.result; + if (data.avatarName) { + fetchProfile(id, data.avatarName); + } + }); +} + +function fetchProfile(id: string, name: string) { if (profile.avatar === "") { http - .get( - config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`) - ) + .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`)) .then(async (res) => { profile.avatar = res.data.downloadUrl; }); diff --git a/src/components/Dialogs/PopupReason.vue b/src/components/Dialogs/PopupReason.vue index d151fe55a..e7916fffe 100644 --- a/src/components/Dialogs/PopupReason.vue +++ b/src/components/Dialogs/PopupReason.vue @@ -47,7 +47,7 @@ const submit = () => { }; function closeModal() { - modal.value = false + modal.value = false; } @@ -57,7 +57,7 @@ function closeModal() { - +
@@ -77,9 +77,8 @@ function closeModal() {
- + import { ref, reactive, onMounted } from "vue"; import { QForm, useQuasar } from "quasar"; @@ -264,407 +265,411 @@ onMounted(() => { diff --git a/src/modules/04_registryNew/components/detail/Employee/02_Employment.vue b/src/modules/04_registryNew/components/detail/Employee/02_Employment.vue new file mode 100644 index 000000000..4f06326be --- /dev/null +++ b/src/modules/04_registryNew/components/detail/Employee/02_Employment.vue @@ -0,0 +1,514 @@ + + + + + diff --git a/src/modules/04_registryNew/components/detail/Employee/Main.vue b/src/modules/04_registryNew/components/detail/Employee/Main.vue new file mode 100644 index 000000000..ae78c760c --- /dev/null +++ b/src/modules/04_registryNew/components/detail/Employee/Main.vue @@ -0,0 +1,43 @@ + + + + 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 e9cdc17a9..edb66ec3c 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/01_Info.vue @@ -660,9 +660,9 @@ onMounted(() => { - +
-
+
{
-
+
{ - + บันทึกข้อมูล diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue index 98f44178d..4a0c26983 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/02_Discipline.vue @@ -598,7 +598,7 @@ onMounted(async () => {
-
+
{
-
+
{ :label="`${'รายละเอียด'}`" />
-
+
{ ) " />
-
+
{ :label="`${'ล้างมลทิน'}`" />
-
+
{
-
+
{ - + บันทึกข้อมูล diff --git a/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue b/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue index 4c45c9d50..d860bfc4d 100644 --- a/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue +++ b/src/modules/04_registryNew/components/detail/GovernmentInformation/03_Leave.vue @@ -1,4 +1,3 @@ -div diff --git a/src/modules/08_registryEmployee/components/DialogAddEmployee.vue b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue new file mode 100644 index 000000000..7a44e1458 --- /dev/null +++ b/src/modules/08_registryEmployee/components/DialogAddEmployee.vue @@ -0,0 +1,562 @@ + + + + + diff --git a/src/modules/08_registryEmployee/components/DialogSelectPos.vue b/src/modules/08_registryEmployee/components/DialogSelectPos.vue new file mode 100644 index 000000000..5e3ab4640 --- /dev/null +++ b/src/modules/08_registryEmployee/components/DialogSelectPos.vue @@ -0,0 +1,929 @@ + + + + + diff --git a/src/modules/08_registryEmployee/components/DialogSendOrder.vue b/src/modules/08_registryEmployee/components/DialogSendOrder.vue new file mode 100644 index 000000000..9d16e92f0 --- /dev/null +++ b/src/modules/08_registryEmployee/components/DialogSendOrder.vue @@ -0,0 +1,327 @@ + + + + + diff --git a/src/modules/08_registryEmployee/interface/index/Main.ts b/src/modules/08_registryEmployee/interface/index/Main.ts index e4ea7770c..cd3e838e8 100644 --- a/src/modules/08_registryEmployee/interface/index/Main.ts +++ b/src/modules/08_registryEmployee/interface/index/Main.ts @@ -1 +1,12 @@ -export type {}; +interface DataOption { + id: string; + name: string; +} +interface NewPagination { + descending: boolean; + page: number; + rowsPerPage: number; + sortBy: string; +} + +export type { DataOption, NewPagination }; diff --git a/src/modules/08_registryEmployee/interface/request/Employee.ts b/src/modules/08_registryEmployee/interface/request/Employee.ts new file mode 100644 index 000000000..ff88efc68 --- /dev/null +++ b/src/modules/08_registryEmployee/interface/request/Employee.ts @@ -0,0 +1,18 @@ +interface FormDataEmployee { + citizenId: string; + prefix: string; + rank: string; + firstName: string; + lastName: string; + birthDate: any; + gender: string; + relationship: string; + nationality: string; + ethnicity: string; + religion: string; + bloodGroup: string; + phone: string; + employeeClass: string; +} + +export type { FormDataEmployee }; diff --git a/src/modules/08_registryEmployee/interface/response/Employee.ts b/src/modules/08_registryEmployee/interface/response/Employee.ts new file mode 100644 index 000000000..44e1f885a --- /dev/null +++ b/src/modules/08_registryEmployee/interface/response/Employee.ts @@ -0,0 +1,119 @@ +interface DataEmployee { + age: string; + child1: null | string; + child1Id: null | string; + child1ShortName: null | string; + child2: null | string; + child2Id: null | string; + child2ShortName: null | string; + child3: null | string; + child3Id: null | string; + child3ShortName: null | string; + child4: null | string; + child4Id: null | string; + child4ShortName: null | string; + citizenId: string; + createdAt: string; + dateAppoint: null | string; + dateRetireLaw: string; + dateStart: null | string; + draftOrgEmployeeStatus: string; + draftOrganizationOrganization: string; + draftPositionEmployee: string; + employeeClass: string; + firstName: string; + govAge: number; + id: string; + lastName: string; + node: null | string; + nodeId: null | string; + nodeName: null | string; + nodeShortName: null | string; + posLevel: number; + posLevelId: string; + posNo: string; + posType: string; + posTypeId: string; + posTypeShortName: string; + position: string; + prefix: string; + rank: string; + root: string; + rootId: string; + rootShortName: string; +} + +interface ResOptionPerson { + createdAt: string; + createdFullName: "สาวิตรี ศรีสมัย"; + createdUserId: string; + id: string; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: string; + name: string; +} + +interface PositionNo { + id: string; + isPosition: boolean; + isSit: boolean; + node: number; + nodeId: string; + orgChild1Id: null | string; + orgChild2Id: null | string; + orgChild3Id: null | string; + orgChild4Id: null | string; + orgRootId: string; + orgShortname: string; + posLevelId: string; + posLevelName: number; + posMasterNo: number; + posMasterNoPrefix: null | string; + posMasterNoSuffix: null | string; + posTypeId: string; + posTypeName: string; + positionIsSelected: boolean; + positionName: string; + position: Position[]; +} + +interface TreeMain { + children: TreeMain[]; // ปรับเป็นชนิดข้อมูลที่ถูกต้องตามโครงสร้างของ children ถ้าเป็นไปได้ + orgCode: string; + orgLevel: number; + orgName: string; + orgRevisionId: string; + orgRootName: string; + orgTreeCode: string; + orgTreeFax: string; + orgTreeId: string; + orgTreeName: string; + orgTreeOrder: number; + orgTreePhoneEx: string; + orgTreePhoneIn: string; + orgTreeRank: string; + orgTreeShortName: string; + totalPosition: number; + totalPositionCurrentUse: number; + totalPositionCurrentVacant: number; + totalPositionNextUse: number; + totalPositionNextVacant: number; + totalRootPosition: number; + totalRootPositionCurrentUse: number; + totalRootPositionCurrentVacant: number; + totalRootPositionNextUse: number; + totalRootPositionNextVacant: number; +} + +interface Position { + id: string; + posLevelId: string; + posLevelName: number; + posTypeId: string; + posTypeName: string; + positionIsSelected: boolean; + positionName: string; +} + +export type { DataEmployee, ResOptionPerson, PositionNo, TreeMain, Position }; diff --git a/src/modules/08_registryEmployee/router.ts b/src/modules/08_registryEmployee/router.ts index 4f0173a0d..e2e718e00 100644 --- a/src/modules/08_registryEmployee/router.ts +++ b/src/modules/08_registryEmployee/router.ts @@ -4,14 +4,17 @@ import { defineAsyncComponent } from "vue"; const Main = defineAsyncComponent( () => import("@/modules/08_registryEmployee/views/Main.vue") ); - -const CreateEmployee = defineAsyncComponent( - () => import("@/modules/08_registryEmployee/views/Add.vue") +const DetailView = defineAsyncComponent( + () => import("@/modules/08_registryEmployee/views/DetailView.vue") ); -const EditDetail = defineAsyncComponent( - () => import("@/modules/08_registryEmployee/views/EditDetail.vue") -); +// const CreateEmployee = defineAsyncComponent( +// () => import("@/modules/08_registryEmployee/views/Add.vue") +// ); + +// const EditDetail = defineAsyncComponent( +// () => import("@/modules/08_registryEmployee/views/EditDetail.vue") +// ); export default [ { @@ -25,23 +28,33 @@ export default [ }, }, { - path: "/registry-employee/add", - name: "registryEmployeeAdd", - component: CreateEmployee, - meta: { - Auth: true, - Key: [11], - Role: "registryEmployee", - }, - }, - { - path: "/registry-employee/edit/:id", - name: "registryEmployeeEdit", - component: EditDetail, + path: "/registry-employee/:id", + name: "registry-employeeId", + component: DetailView, meta: { Auth: true, Key: [11], Role: "registryEmployee", }, }, + // { + // path: "/registry-employee/add", + // name: "registryEmployeeAdd", + // component: CreateEmployee, + // meta: { + // Auth: true, + // Key: [11], + // Role: "registryEmployee", + // }, + // }, + // { + // path: "/registry-employee/edit/:id", + // name: "registryEmployeeEdit", + // component: EditDetail, + // meta: { + // Auth: true, + // Key: [11], + // Role: "registryEmployee", + // }, + // }, ]; diff --git a/src/modules/08_registryEmployee/stores/registry-employee.ts b/src/modules/08_registryEmployee/stores/registry-employee.ts new file mode 100644 index 000000000..0f34dac2e --- /dev/null +++ b/src/modules/08_registryEmployee/stores/registry-employee.ts @@ -0,0 +1,57 @@ +import { defineStore } from "pinia"; + +export const useRegistryEmp = defineStore("registry-employee", () => { + /** + * function คำนวณหาอายุ + * @param birthDate วันเกิด + * @returns อายุ + */ + function calculateAge(birthDate: Date | null) { + if (!birthDate) return null; + const birthDateTimeStamp = new Date(birthDate).getTime(); + const now = new Date(); + const diff = now.getTime() - birthDateTimeStamp; + + const ageDate = new Date(diff); + const years = ageDate.getUTCFullYear() - 1970; + const months = ageDate.getUTCMonth(); + const days = ageDate.getUTCDate() - 1; + const retire = new Date(birthDate); + retire.setFullYear(retire.getFullYear() + 60); + // retireDate.value = retire; + + if (years > 60) { + return "อายุเกิน 60 ปี"; + } + + return `${years} ปี ${months} เดือน ${days} วัน`; + } + + /** + * function convertstatus + * @param val ค่าสภานะ + * @returns textStatus + */ + const statusText = (val: string) => { + switch (val) { + case "WAITTING": + return "รอดำเนินการ"; + case "PENDING": + return "เลือกตำแหน่งแล้ว"; + case "APPROVE": + return "อนุมัติ"; + case "REJECT": + return "ไม่อนุมัติ"; + case "REPORT": + return "ส่งรายชื่อไปออกคำสั่ง"; + case "DONE": + return "ออกคำสั่งเสร็จแล้ว"; + default: + return "-"; + } + }; + return { + calculateAge, + statusText, + }; +}); diff --git a/src/modules/08_registryEmployee/views/DetailView.vue b/src/modules/08_registryEmployee/views/DetailView.vue new file mode 100644 index 000000000..f677ffc94 --- /dev/null +++ b/src/modules/08_registryEmployee/views/DetailView.vue @@ -0,0 +1,9 @@ + + + + + diff --git a/src/modules/08_registryEmployee/views/Main.vue b/src/modules/08_registryEmployee/views/Main.vue index bfbd77bf1..3e068d875 100644 --- a/src/modules/08_registryEmployee/views/Main.vue +++ b/src/modules/08_registryEmployee/views/Main.vue @@ -1,85 +1,85 @@ diff --git a/src/modules/08_registryEmployee/views/MainOld.vue b/src/modules/08_registryEmployee/views/MainOld.vue new file mode 100644 index 000000000..bfbd77bf1 --- /dev/null +++ b/src/modules/08_registryEmployee/views/MainOld.vue @@ -0,0 +1,1045 @@ + + + diff --git a/src/modules/16_positionEmployee/components/DialogFormPosition.vue b/src/modules/16_positionEmployee/components/DialogFormPosition.vue index ea0a09522..83d4e1f32 100644 --- a/src/modules/16_positionEmployee/components/DialogFormPosition.vue +++ b/src/modules/16_positionEmployee/components/DialogFormPosition.vue @@ -713,8 +713,10 @@ watch(
- - + + + บันทึก + diff --git a/src/modules/16_positionEmployee/components/DialogSortPosition.vue b/src/modules/16_positionEmployee/components/DialogSortPosition.vue index 6f796c65a..a7333e620 100644 --- a/src/modules/16_positionEmployee/components/DialogSortPosition.vue +++ b/src/modules/16_positionEmployee/components/DialogSortPosition.vue @@ -119,7 +119,7 @@ watch( /> - + + > + บันทึก diff --git a/src/modules/16_positionEmployee/components/DialogSuccession.vue b/src/modules/16_positionEmployee/components/DialogSuccession.vue index 3334c340b..60e79ace5 100644 --- a/src/modules/16_positionEmployee/components/DialogSuccession.vue +++ b/src/modules/16_positionEmployee/components/DialogSuccession.vue @@ -393,8 +393,10 @@ function clearForm() { - - + + + สืบทอดตำแหน่ง +