diff --git a/src/api/02_organizational/api.organization.ts b/src/api/02_organizational/api.organization.ts index ec907dceb..3afda0fb6 100644 --- a/src/api/02_organizational/api.organization.ts +++ b/src/api/02_organizational/api.organization.ts @@ -57,6 +57,7 @@ export default { /** บรรจุแต่งตั้ง*/ orgPosPlacement: `${orgPos}/placement/search`, + orgPosPlacemenTemp: `${orgPos}/placementemp/search`, orgPosFind: `${organization}/find/node`, orgProfileProbation: `${organization}/profile/probation`, diff --git a/src/components/Dialogs/DialogOrgSelectEmployee.vue b/src/components/Dialogs/DialogOrgSelectEmployee.vue new file mode 100644 index 000000000..41cfc5ab3 --- /dev/null +++ b/src/components/Dialogs/DialogOrgSelectEmployee.vue @@ -0,0 +1,879 @@ + + + diff --git a/src/modules/05_placement/components/AppointEmployee/Detail.vue b/src/modules/05_placement/components/AppointEmployee/Detail.vue index 727a947df..5eb955766 100644 --- a/src/modules/05_placement/components/AppointEmployee/Detail.vue +++ b/src/modules/05_placement/components/AppointEmployee/Detail.vue @@ -7,12 +7,15 @@ import type { ResponseTitle } from "@/modules/05_placement/interface/response/Re import type { appointmentData, ResponseData, + DataProfile } from "@/modules/05_placement/interface/response/AppointMent"; import type { QForm } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue"; +import CardProfile from "@/components/CardProfile.vue"; + const modalPersonal = ref(false); const personId = ref(""); const $q = useQuasar(); @@ -20,6 +23,8 @@ const route = useRoute(); const router = useRouter(); const mixin = useCounterMixin(); +const dataProfile = ref(); + const appointment = ref({ citizenId: "", prefixId: "", @@ -63,6 +68,7 @@ const fecthappointmentByid = async () => { await http .get(config.API.appointEmployeeByid(paramsId.toString())) .then((res: ResponseData) => { + dataProfile.value = res.data.result as unknown as DataProfile; const data = res.data.result; appointment.value = data; profileId.value = data.profileId; @@ -175,56 +181,7 @@ onMounted(async () => { /> รายละเอียดการปรับระดับชั้นงานลูกจ้าง {{ title.fullname }} - -
-
- {{ title.fullname }} -
- - -
-
-
-
-
- - -
-
-
-
ตำแหน่งในสายงาน
-
- {{ title.positionTypeOld }} -
-
-
-
-
-
ระดับ
-
- {{ title.positionLevelOld }} -
-
-
-
-
-
สังกัด
-
- {{ title.organizationPositionOld }} -
-
-
-
-
-
+
diff --git a/src/modules/05_placement/components/AppointEmployee/Dialogbody.vue b/src/modules/05_placement/components/AppointEmployee/Dialogbody.vue index 5cb768b82..9552a83ad 100644 --- a/src/modules/05_placement/components/AppointEmployee/Dialogbody.vue +++ b/src/modules/05_placement/components/AppointEmployee/Dialogbody.vue @@ -9,8 +9,13 @@ import DialogHeader from "@/modules/05_placement/components/AppointMent/DialogHe import http from "@/plugins/http"; import config from "@/app.config"; + +import { useTransferDataStore } from "@/modules/05_placement/store"; +const storeFn = useTransferDataStore(); +const { statusText } = storeFn; + const mixin = useCounterMixin(); -const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin; +const { showLoader, success, messageError, dialogConfirm, hideLoader ,date2Thai} = mixin; const $q = useQuasar(); const selected = ref<[]>([]); @@ -35,7 +40,7 @@ const visibleColumns2 = ref([ "citizenId", "fullname", "organizationName", - "birthday", + "dateOfBirth", ]); const columns2 = ref([ { @@ -68,7 +73,7 @@ const columns2 = ref([ { name: "organizationName", align: "left", - label: "หน่วยงานที่รับการปรับระดับชั้นงาน", + label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย", sortable: true, field: "organizationName", headerStyle: "font-size: 14px", @@ -77,11 +82,11 @@ const columns2 = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "birthday", + name: "dateOfBirth", align: "left", label: "วัน/เดือน/ปี เกิด", sortable: true, - field: "birthday", + field: "dateOfBirth", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -115,7 +120,7 @@ const createdAppoint = async () => { let pId: string[] = []; let Type = props.type as string; selected.value.forEach((e: UserData) => { - pId.push(e.personalId); + pId.push(e.id); }); let data = { id: pId, @@ -228,7 +233,7 @@ watchEffect(() => { diff --git a/src/modules/05_placement/components/AppointEmployee/Main.vue b/src/modules/05_placement/components/AppointEmployee/Main.vue index 5cc4c5b6e..053cc0d8d 100644 --- a/src/modules/05_placement/components/AppointEmployee/Main.vue +++ b/src/modules/05_placement/components/AppointEmployee/Main.vue @@ -17,6 +17,13 @@ import type { OpType } from "@/modules/05_placement/interface/response/Main"; import http from "@/plugins/http"; import config from "@/app.config"; +import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue"; + +const posType = ref(""); +const posLevel = ref(""); +const position = ref(""); +const dataRows = ref([]); + const $q = useQuasar(); const modal = ref(false); const storeFn = useTransferDataStore(); @@ -205,7 +212,7 @@ const columns = ref([ { name: "organizationName", align: "left", - label: "หน่วยงานที่รับการปรับระดับชั้นงาน", + label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย", sortable: true, field: "organizationName", headerStyle: "font-size: 14px", @@ -252,29 +259,31 @@ const fecthlistappointment = async () => { .then((res) => { let response = res.data.result; listRecevice.value = response; - rows.value = response.map((e: resData) => ({ - personalId: e.id, - citizenId: e.citizenId, - fullname: e.prefix + e.firstname + " " + e.lastname, - organizationName: e.organizationName + " " + e.organizationShortName, - orgName: e.organizationName, - organizationShortName: e.organizationShortName, - status: statusText(e.status), - createdAt: date2Thai(e.createdAt), - birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth), - educationOld: e.educationOld, - organizationPositionOld: e.organizationPositionOld, - positionTypeOld: e.positionTypeOld, - positionLevelOld: e.positionLevelOld, - positionNumberOld: e.positionNumberOld, - salary: e.salary, - positionDate: e.positionDate, - })); + rows.value = response + // rows.value = response.map((e: resData) => ({ + // personalId: e.id, + // citizenId: e.citizenId, + // fullname: e.prefix + e.firstname + " " + e.lastname, + // organizationName: e.organizationName + " " + e.organizationShortName, + // orgName: e.organizationName, + // organizationShortName: e.organizationShortName, + // status: statusText(e.status), + // createdAt: date2Thai(e.createdAt), + // birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth), + // educationOld: e.educationOld, + // organizationPositionOld: e.organizationPositionOld, + // positionTypeOld: e.positionTypeOld, + // positionLevelOld: e.positionLevelOld, + // positionNumberOld: e.positionNumberOld, + // salary: e.salary, + // positionDate: e.positionDate, + // })); + rows2.value = rows.value.filter( - (e: orgFilter) => - e.orgName !== null && - e.status !== "ส่งรายชื่อไปออกคำสั่ง" && - e.status !== "ออกคำสั่งเสร็จแล้ว" && + (e: any) => + e.root !== null && + e.status !== "REPORT" && + e.status !== "DONE" && e.educationOld && e.organizationPositionOld && e.positionTypeOld && @@ -474,6 +483,54 @@ const savePosition = async () => { // id.value = ""; // } // }; + + + + +function openModalTree(data:any){ + modalTree.value = true + + personalId.value = data.id; + dataRows.value = data; + posType.value = data.posTypeId; + posLevel.value = data.posLevelId; + position.value = data.positionName; +} + +function onSave(data: any) { + console.log("not save", data); + const dataAppoint = { + // personalId: data.personalId, + node: data.node, + nodeId: data.nodeId, + orgRevisionId: data.orgRevisionId, + positionId: data.positionId, + posMasterNo: data.posMasterNo, + positionName: data.positionName, + posTypeId: data.posTypeId, + posTypeName: data.posTypeName, + posLevelId: data.posLevelId, + posLevelName: data.posLevelName, + reportingDate: data.reportingDate, + posmasterId: data.posmasterId, + }; + + showLoader(); + http + .put(config.API.appointmentPosition(personalId.value), dataAppoint) + .then((res) => { + modalTree.value = false; + success($q, "บันทึกสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + fecthlistappointment(); + hideLoader(); + }); +} +