diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index 4c1b74def..6be4c2dde 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -48,4 +48,6 @@ export default { placementPosition: () => `${placement}/position/use`, // putPositiom putPosition: (id:any) => `${placement}/position/${id}`, + // clear Position + clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}` }; diff --git a/src/api/registry/api.profile.ts b/src/api/registry/api.profile.ts index 0e30e10d6..d3333d893 100644 --- a/src/api/registry/api.profile.ts +++ b/src/api/registry/api.profile.ts @@ -156,6 +156,7 @@ export default { `${profile}address/history/${profileId}`, searchProfileByOcId: (OcId: string, type: string) => `${profile}search/new/oc/${OcId}/${type}`, + searchProfileTemp: (type: string) => `${profile}search/new/oc/${type}`, profileAvatarId: (profileId: string) => `${profile}avatar/${profileId}`, profileAvatarHistoryId: (profileId: string) => diff --git a/src/modules/04_registry/components/Profile.vue b/src/modules/04_registry/components/Profile.vue index c9db6d816..a1e71a961 100644 --- a/src/modules/04_registry/components/Profile.vue +++ b/src/modules/04_registry/components/Profile.vue @@ -383,38 +383,104 @@ - - -
แนบใบมรณบัตร
- - - ปิดหน้านี้ - -
- - - - - - -
+
+ + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + +
+
+
@@ -579,8 +645,10 @@ import { ref, onMounted } from "vue"; import { useDataStore } from "@/stores/data"; import { useRoute, useRouter } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; -import { useQuasar } from "quasar"; +import { useQuasar, QForm } from "quasar"; import EducationVue from "@/modules/04_registry/components/Education.vue"; +import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue"; +import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue"; import TrainVue from "@/modules/04_registry/components/Train.vue"; import InsigniaVue from "@/modules/04_registry/components/Insignia.vue"; import CoinedVue from "@/modules/04_registry/components/Coin.vue"; @@ -608,6 +676,9 @@ import config from "@/app.config"; const $q = useQuasar(); const store = useDataStore(); const { changeTab, loaderPage } = store; +const reasonDeath = ref(""); +const deathCertificateNo = ref(""); +const placeDeathCertificate = ref(""); const mixin = useCounterMixin(); const { date2Thai, dateToISO, messageError, dialogMessage, success } = mixin; const route = useRoute(); @@ -616,12 +687,7 @@ const imageUrl = ref(null); const inputImage = ref(null); const fullname = ref(""); const position = ref("นักจัดการงานทั่วไป"); -const pdfSrc = ref(""); -const pdfCurrentPage = ref(); -const pdfTotalPage = ref(); -const pdfSrcShort = ref(""); -const pdfCurrentPageShort = ref(); -const pdfTotalPageShort = ref(); +const dateDeath = ref(new Date()); const dialog = ref(false); const dialogShort = ref(false); const dialogLeave = ref(false); @@ -632,6 +698,11 @@ const statusEdit = ref(false); const activeImage = ref(null); const filePassaway = ref(null); const images = ref([]); +const checkValidate = ref(false); //validate data ผ่านหรือไม่ +const myForm = ref(null); //form data input +const edit = ref(false); //เช็คการกดปุ่มแก้ไขใน dialog +const modal = ref(false); //modal add detail +const modalEdit = ref(false); //modal ที่แสดงใช้สำหรับแก้ไขหรือไม่ const profileId = ref(route.params.id.toString()); const profileType = ref(""); const employeeClass = ref("temp"); @@ -918,6 +989,99 @@ const clickKp7 = async () => { // }); }; +/** + * กดบันทึกใน dialog + */ +const clickSave = async () => { + myForm.value!.validate().then(async (result: boolean) => { + if (result) { + if (modalEdit.value) { + await editData(); + } else { + await saveData(); + } + } + }); +}; + +/** + * บันทึกแก้ไขข้อมูล + */ +const editData = async () => { + // modal.value = false; + // loaderPage(true); + // await http + // .put(config.API.getPositionMasterId(positionMasterId.value), { + // positionMasterId: positionMasterId.value, + // positionTypeId: positionTypeId.value, + // positionLineId: positionLineId.value, + // positionPathId: positionPathId.value, + // positionPathSideId: positionPathSideId.value, + // positionExecutiveId: positionExecutiveId.value, + // positionExecutiveSideId: positionExecutiveSideId.value, + // positionLevelId: positionLevelId.value, + // isDirector: isDirector.value, + // positionStatusId: positionStatusId.value, + // qualification: qualification.value, + // positionCondition: positionCondition.value, + // positionMasterUserNote: positionMasterUserNote.value, + // }) + // .then((res) => { + // success($q, "บันทึกข้อมูลร่างสำเร็จ"); + // }) + // .catch((e) => { + // statusCode.value = e.response.data.status; + // }) + // .finally(async () => { + // edit.value = false; + // await fetchData(); + // }); +}; + +/** + * บันทึกเพิ่มข้อมูล + */ +const saveData = async () => { + // modal.value = false; + // loaderPage(true); + // await http + // .post(config.API.getPositionMaster, { + // positionTypeId: positionTypeId.value, + // positionLineId: positionLineId.value, + // positionPathId: positionPathId.value, + // positionPathSideId: positionPathSideId.value, + // positionExecutiveId: positionExecutiveId.value, + // positionExecutiveSideId: positionExecutiveSideId.value, + // positionLevelId: positionLevelId.value, + // isDirector: isDirector.value, + // positionStatusId: positionStatusId.value, + // qualification: qualification.value, + // positionCondition: positionCondition.value, + // positionMasterUserNote: positionMasterUserNote.value, + // }) + // .then((res) => { + // success($q, "บันทึกข้อมูลร่างสำเร็จ"); + // }) + // .catch((e) => { + // statusCode.value = e.response.data.status; + // }) + // .finally(async () => { + // modal.value = false; + // await fetchData(); + // }); +}; + +/** + * validate input ใน dialog + */ +const validateData = async () => { + checkValidate.value = true; + await myForm.value!.validate().then((result: boolean) => { + if (result == false) { + checkValidate.value = false; + } + }); +}; const downloadFilePDF = async (res: string, fileName: string) => { const link = document.createElement("a"); // link.href = window.URL.createObjectURL(new Blob([res])); diff --git a/src/modules/04_registry/components/profileType.ts b/src/modules/04_registry/components/profileType.ts index e0cefd668..ab3b28b22 100644 --- a/src/modules/04_registry/components/profileType.ts +++ b/src/modules/04_registry/components/profileType.ts @@ -14,7 +14,7 @@ interface Information { prefixId: string | null; firstname: string | null; lastname: string | null; - birthDate: Date; + birthDate: Date | null; genderId: string | null; bloodId: string | null; nationality: string | null; @@ -135,7 +135,7 @@ const defaultInformation: Information = { prefixId: null, firstname: null, lastname: null, - birthDate: new Date(), + birthDate: null, genderId: null, bloodId: null, nationality: null, diff --git a/src/modules/05_placement/components/PersonalList/OrgTree.vue b/src/modules/05_placement/components/PersonalList/OrgTree.vue index ba0f63366..2197e30a8 100644 --- a/src/modules/05_placement/components/PersonalList/OrgTree.vue +++ b/src/modules/05_placement/components/PersonalList/OrgTree.vue @@ -95,6 +95,8 @@ const fetchplacementPosition = async () => { await http .get(config.API.placementPosition()) .then((res: any) => { + console.log("1221111111"); + placementPosition.value = res.data.result; }) .catch((e: any) => { @@ -277,7 +279,7 @@ const positionLevelOptions = ref([ ]); const selectedPosition = async (data: any) => { - console.log("selecteds", data); + // console.log("selecteds", data); if (data.name == null && selected.value != data.keyId) { // console.log("selecteds", data); @@ -361,7 +363,7 @@ const selectedPosition = async (data: any) => { dataForm.positionPathSideId = ""; dataForm.positionTypeId = ""; } - console.log("dataForm", dataForm); + // console.log("dataForm", dataForm); }; const checkPosition = (val: string) => { @@ -374,6 +376,7 @@ const expanded = ref([]); watch(props, () => { expanded.value = []; const dataPersonal = props.personal; + fetchplacementPosition(); if (dataPersonal) { dataPersonal.map((data: any) => { personal.value = data; @@ -382,15 +385,19 @@ watch(props, () => { } // console.log("draft===>", personal.value.draft); - if (personal.value && personal.value.draft === false) { + if ( + personal.value && + personal.value.draft === false && + personal.value.positionNumber !== null + ) { // const findData = dataRespone.value.find(findByPerson); let findData: any = null; dataRespone.value.map((x: any) => { findData = findByPerson(x); - console.log(findData); + // console.log(findData); if (findData != null) { - console.log("findData===>", findData); + // console.log("findData===>", findData); selectedPosition(findData); for (let i = 3; i <= findData.keyId.length; i += 2) { expanded.value.push(findData.keyId.slice(0, i)); @@ -423,6 +430,34 @@ function findByPerson(element: any): any { } return null; } +const clearPosition = () => { + console.log(personal.value); + $q.dialog({ + title: "ยืนยันการคืนตำแหน่ง", + message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?", + cancel: { + flat: true, + const: "negative", + }, + persistent: true, + }) + .onOk(async () => { + showLoader(); + await http + .post(config.API.clearPosition(personal.value.personalId), {}) + .then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ")) + + .catch((e: Object) => { + console.log(e); + }) + .finally(async () => { + hideLoader(); + await closeAndClear(); + }); + }) + .onCancel(() => {}) + .onDismiss(() => {}); +}; \ No newline at end of file diff --git a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue index e0adc68a6..fb54fdd4d 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/Template3.vue @@ -14,17 +14,7 @@ const FormReport = defineAsyncComponent( \ No newline at end of file diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index ff6633ca4..f28af5a48 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -1,87 +1,96 @@ + + + + + - - - - - - - - - -
- - - - - -
-
-
-
-
+ + + + + + + + + +
+ + + + + +
+
+
+
+
\ No newline at end of file + diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 22704c6c7..33ef58904 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -34,15 +34,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - /* { - name: "fixname", - align: "left", - label: "คำนำหน้านาม", - title: "คำนำหน้านาม", - field: "fixname", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, */ + /* { + name: "fixname", + align: "left", + label: "คำนำหน้านาม", + title: "คำนำหน้านาม", + field: "fixname", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, */ { name: "name", align: "left", @@ -253,8 +253,8 @@ const clickDelete = (prop: any) => { } else await fecthlist(retireld_params); }); }) - .onCancel(() => {}) - .onDismiss(() => {}); + .onCancel(() => { }) + .onDismiss(() => { }); }; // note const fetchReason = async (prop: string) => { @@ -269,6 +269,7 @@ const fetchReason = async (prop: string) => { messageError($q, e); }); }; + const saveNote = () => { $q.dialog({ title: "ยืนยันการบันทึกข้อมูลข้อมูล", @@ -297,8 +298,8 @@ const saveNote = () => { modalNote.value = false; }); }) - .onCancel(() => {}) - .onDismiss(() => {}); + .onCancel(() => { }) + .onDismiss(() => { }); }; const UpdateListId = (retireld: string, pId: string) => { @@ -361,26 +362,13 @@ const paginationLabel = (start: number, end: number, total: number) => { @@ -566,38 +502,19 @@ const paginationLabel = (start: number, end: number, total: number) => { - กรอกเหตุผล + กรอกเหตุผล - + - + - +
@@ -623,13 +540,16 @@ const paginationLabel = (start: number, end: number, total: number) => { position: sticky; z-index: 1; } + .q-table thead tr:last-child th { top: 48px; } + .q-table thead tr:first-child th { top: 0; } } + .q-btn-dropdown__arrow { display: none; } diff --git a/src/modules/06_retirement/views/Main.vue b/src/modules/06_retirement/views/Main.vue index 3fc975d5f..335f4f591 100644 --- a/src/modules/06_retirement/views/Main.vue +++ b/src/modules/06_retirement/views/Main.vue @@ -369,9 +369,9 @@ const clickAdd = () => { model: 'opt1', // inline: true items: [ - { label: 'ประกาศแก้ไข (เพิ่มคนเกษียณ)', value: 'opt1'}, - { label: 'ประกาศแก้ไข (เฉพาะราย)', value: 'opt2' }, - { label: 'ประกาศยกเลิก', value: 'opt3' } + { label: 'ประกาศเพิ่มผู้เกษียณ', value: 'ADD'}, + { label: 'ประกาศแก้ไขข้อมูลผู้เกษียน', value: 'EDIT' }, + { label: 'ประกาศยกเลิกผู้เกษียณ', value: 'REMOVE' } ] }, cancel: { @@ -380,6 +380,7 @@ const clickAdd = () => { }, persistent: true, }).onOk(data => { + console.log("option===>", data) router.push(`/retirement/list/${type.value}/${currentYear}`); }).onCancel(() => { }).onDismiss(() => { diff --git a/src/modules/08_registryEmployee/router.ts b/src/modules/08_registryEmployee/router.ts index 67a4cc826..130b90438 100644 --- a/src/modules/08_registryEmployee/router.ts +++ b/src/modules/08_registryEmployee/router.ts @@ -47,7 +47,7 @@ export default [ }, }, { - path: "/registryEmployee/edit/:Id", + path: "/registryEmployee/edit/:id", name: "registryEmployeeEdit", component: EditDetail, meta: { diff --git a/src/modules/08_registryEmployee/views/EditDetail.vue b/src/modules/08_registryEmployee/views/EditDetail.vue index 401ae0b9f..0a123b88d 100644 --- a/src/modules/08_registryEmployee/views/EditDetail.vue +++ b/src/modules/08_registryEmployee/views/EditDetail.vue @@ -137,11 +137,9 @@
- {{ "แก้ไข้ข้อมูลทะเบียนประวัติลูกจ้างชั่วคราว" }} -
-
- {{ "ลูกจ้างชั่วคราว" }} + {{ fullname }}{{ leaveReason }}
+
{{ position }}
diff --git a/src/modules/08_registryEmployee/views/Main.vue b/src/modules/08_registryEmployee/views/Main.vue index edd6bba6f..4e5908aea 100644 --- a/src/modules/08_registryEmployee/views/Main.vue +++ b/src/modules/08_registryEmployee/views/Main.vue @@ -231,7 +231,7 @@ { }; // ดูรายการแก้ไขรายชื่อ -const redirectToPage = (profileId?: string) => { - router.push(`/registryEmployee/edit/${profileId}`); +const redirectToPage = (id?: string) => { + router.push(`/registryEmployee/edit/${id}`); }; const editDetail = async (row: any) => { await getPosition(row.id); @@ -1429,7 +1429,7 @@ const showEmployeeTemp = async () => { if (selected.value == null || selected.value == "") return; showLoader(); await http - .post(config.API.searchProfileByOcId(selected.value, "all"), { + .post(config.API.searchProfileTemp("all"), { criterias: cirteria, }) .then((res) => { @@ -1489,7 +1489,7 @@ const showEmployeeTempOrder = async () => { if (selected.value == null || selected.value == "") return; showLoader(); await http - .post(config.API.searchProfileByOcId(selected.value, "all"), { + .post(config.API.searchProfileTemp("all"), { criterias: cirteria, }) .then((res) => { diff --git a/src/modules/08_registryEmployee/views/information.vue b/src/modules/08_registryEmployee/views/information.vue index ade1f0cfd..6be674a11 100644 --- a/src/modules/08_registryEmployee/views/information.vue +++ b/src/modules/08_registryEmployee/views/information.vue @@ -117,7 +117,11 @@ lazy-rules :readonly="!edit" :borderless="!edit" - :model-value="date2Thai(informaData.birthDate)" + :model-value=" + informaData.birthDate == null + ? null + : date2Thai(informaData.birthDate) + " :rules="[(val:string) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]" :label="`${'วัน/เดือน/ปี เกิด'}`" > @@ -692,7 +696,7 @@ const defaultAdd = () => { prefixId: null, firstname: null, lastname: null, - birthDate: new Date(), + birthDate: null, genderId: null, bloodId: null, nationality: null,