diff --git a/src/api/00_dashboard/api.message.ts b/src/api/00_dashboard/api.message.ts new file mode 100644 index 000000000..85e0c7b86 --- /dev/null +++ b/src/api/00_dashboard/api.message.ts @@ -0,0 +1,11 @@ +/** + * API Structure + Org Chart + */ +import env from "../index"; + +const message = `${env.API_DASHBOARD_URI}/message`; + +export default { + msgNotificate: `${message}/my-notifications`, + msgInbox: `${message}/my-inboxes`, +}; diff --git a/src/api/index.ts b/src/api/index.ts index bbe765fc9..9eae75a3b 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -29,6 +29,7 @@ const config = ref({ // API_PROBATION_URI: "https://ehr.joolsoft.com/v1", API_PROBATION_URI: "https://bmaehr.joolsoft.com/nodeapi/v1", // API_PROBATION_URI: "http://192.168.1.151:7776/v1", + API_DASHBOARD_URI: "http://192.168.1.9:6026/api/v1", }, test: { API_URI: "http://localhost:5010/api/v1", @@ -73,7 +74,13 @@ const API_RETIREMENT_URI = ref( config.value[env.value].API_RETIREMENT_URI ); const API_URI_ORG_TREE = ref(config.value[env.value].API_URI_ORG_TREE); -const API_PROBATION_URI = ref(config.value[env.value].API_PROBATION_URI); +const API_PROBATION_URI = ref( + config.value[env.value].API_PROBATION_URI +); + +const API_DASHBOARD_URI = ref( + config.value[env.value].API_DASHBOARD_URI +); export default { env: env.value, @@ -87,6 +94,7 @@ export default { API_PLACEMENT_URI: API_PLACEMENT_URI.value, API_URI_ORG_TREE: API_URI_ORG_TREE.value, MEET_URI: MEET_URI.value, - API_RETIREMENT_URI:API_RETIREMENT_URI.value, - API_PROBATION_URI: API_PROBATION_URI.value + API_RETIREMENT_URI: API_RETIREMENT_URI.value, + API_PROBATION_URI: API_PROBATION_URI.value, + API_DASHBOARD_URI: API_DASHBOARD_URI.value, }; diff --git a/src/app.config.ts b/src/app.config.ts index ef0aa5f39..b8bb88983 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -37,6 +37,9 @@ import retirement from "./api/06_retirement/api.retirement"; /** API ระบบงานเครื่องราชอิสริยาภรณ์ List */ import insignia from "./api/07_insignia/api.insignia"; +/** API dashboard */ +import message from "./api/00_dashboard/api.message"; + // environment variables export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL; export const qualifyDisableExamPanel = import.meta.env @@ -74,6 +77,9 @@ const API = { ...probation, ...retirement, ...insignia, + + //dashboard + ...message, }; export default { diff --git a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts index 78f2ecd9b..6277348a8 100644 --- a/src/interface/request/main/main.ts +++ b/src/interface/request/main/main.ts @@ -28,10 +28,10 @@ interface menuType { } interface notiType { - id: number; + id: string; sender: string; body: string; - timereceive: string; + timereceive: Date; } interface optionType { diff --git a/src/interface/response/dashboard/dashboard.ts b/src/interface/response/dashboard/dashboard.ts new file mode 100644 index 000000000..e6320ecfa --- /dev/null +++ b/src/interface/response/dashboard/dashboard.ts @@ -0,0 +1,27 @@ +interface ResponseInbox { + body: string; + createdAt: Date; + createdFullName: string; + createdUserId: string; + id: string; + isOpen: boolean; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: Date; + openDate: Date | null; + payload: string; + receiveDate: Date; + receiverUserId: string; + subject: string; +} + +interface DataInbox { + no: string; + sender: string; + subject: string; + timereceive: Date; + body: string; + ratingModel: number; +} + +export type { ResponseInbox, DataInbox }; diff --git a/src/modules/05_placement/components/Other/Detail.vue b/src/modules/05_placement/components/Other/Detail.vue index a03165d3c..d8f09f9b1 100644 --- a/src/modules/05_placement/components/Other/Detail.vue +++ b/src/modules/05_placement/components/Other/Detail.vue @@ -5,17 +5,30 @@ import { useRoute, useRouter } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive"; +import type { + TypeFile, + ResponseDataDetail, +} from "@/modules/05_placement/interface/response/Transfer"; +import type { QTableProps, QForm } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; +import keycloak from "@/plugins/keycloak"; const $q = useQuasar(); const route = useRoute(); const router = useRouter(); const mixin = useCounterMixin(); - const paramsId = route.params.id; -const { messageError, showLoader, hideLoader } = mixin; +const { + messageError, + showLoader, + hideLoader, + date2Thai, + dialogConfirm, + success, +} = mixin; +const roleAdmin = ref(false); const title = ref({ fullname: "", @@ -23,8 +36,37 @@ const title = ref({ positionLevelOld: "", positionTypeOld: "", }); +const responseData = ref({ + avataPath: "", + createdAt: new Date(), + date: new Date(), + id: "", + organization: "", + organizationPositionOld: "", + positionLevelOld: "", + positionNumberOld: "", + positionTypeOld: "", + reason: "", + salary: 0, + status: "", + fullname: "", +}); +const edit = ref(false); +const organizationPositionOld = ref(""); +const positionTypeOld = ref(""); +const positionLevelOld = ref(""); +const posNo = ref(""); +const salary = ref(0); +const organization = ref(""); +const date = ref(null); +const reason = ref(""); +const Otherdata = ref([]); onMounted(async () => { + if (keycloak.tokenParsed != null) { + roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1"); + console.log("roleAdmin===>", roleAdmin.value); + } await fecthOther(); }); @@ -32,22 +74,92 @@ const fecthOther = async () => { showLoader(); await http .get(config.API.otherByid(paramsId.toString())) + // .get(config.API.transferId(paramsId.toString())) .then((res: any) => { const data = res.data.result; + Otherdata.value = res.data.result; console.log(data); title.value.fullname = `${data.firstName ?? "-"} ${data.lastName ?? "-"}`; title.value.organizationPositionOld = data.organizationPositionOld ?? "-"; title.value.positionLevelOld = data.positionLevelOld ?? "-"; title.value.positionTypeOld = data.positionTypeOld ?? "-"; + + responseData.value.createdAt = data.createdAt; + responseData.value.date = + data.date !== null ? new Date(data.date) : new Date(); + responseData.value.id = data.id ?? ""; + responseData.value.organization = data.organization ?? ""; + responseData.value.organizationPositionOld = + data.organizationPositionOld ?? ""; + responseData.value.positionLevelOld = data.positionLevelOld ?? ""; + responseData.value.positionNumberOld = data.positionNumberOld ?? ""; + responseData.value.positionTypeOld = data.positionTypeOld ?? ""; + responseData.value.reason = data.reason ?? ""; + responseData.value.salary = data.salary !== null ? data.salary : 0; + responseData.value.status = data.status ?? ""; + responseData.value.avataPath = data.avataPath ?? ""; + responseData.value.fullname = `${data.firstName ?? "-"} ${ + data.lastName ?? "-" + }`; + + organizationPositionOld.value = data.organizationPositionOld ?? ""; + positionTypeOld.value = data.positionTypeOld ?? ""; + positionLevelOld.value = data.positionLevelOld ?? ""; + posNo.value = data.positionNumberOld ?? ""; + salary.value = data.amountOld ?? ""; + organization.value = data.organization ?? ""; + date.value = + data.positionDate !== null ? new Date(data.positionDate) : null; + reason.value = data.reason ?? ""; }) .catch((e) => { messageError($q, e); }) .finally(() => { hideLoader(); + edit.value = false; }); }; +const clickEdit = () => { + dialogConfirm($q, () => saveOther()); +}; +const saveOther = async () => { + // showLoader(); + let data = { + citizenId: Otherdata.value.citizenId, + prefixId: Otherdata.value.prefixId, + firstname: Otherdata.value.firstname, + lastname: Otherdata.value.lastname, + reason: reason.value, + organizationPositionOld: organizationPositionOld.value, + positionDate: date.value, + positionTypeOld: positionTypeOld.value, + positionLevelOld: positionLevelOld.value, + positionNumberOld: posNo.value, + amountOld: Number(salary.value), + }; + console.log(data); + + await http + .put(config.API.otherByid(paramsId.toString()), data) + .then(() => { + success($q, "แก้ไข้ข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + console.log(e); + }) + .finally(async () => { + await fecthOther(); + }); +}; +const getClass = (val: boolean) => { + return { + "full-width inputgreen cursor-pointer": val, + "full-width cursor-pointer": !val, + }; +}; diff --git a/src/modules/05_placement/components/Receive/receiveDetail2.vue b/src/modules/05_placement/components/Receive/receiveDetail2.vue index 77c473d6d..258159c26 100644 --- a/src/modules/05_placement/components/Receive/receiveDetail2.vue +++ b/src/modules/05_placement/components/Receive/receiveDetail2.vue @@ -65,14 +65,525 @@ + + +
+
+ แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย +
+ +
+ +
+
+ + +
+
+
+ +
+
+
+
+
ข้อมูลส่วนตัว
+
+
+ + +
+
+ +
+ +
+ +
+
+ +
+
+ + + + + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ ตำแหน่งและหน่วยงานเดิม +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+