diff --git a/src/api/registry/api.profile.ts b/src/api/registry/api.profile.ts index c54f86e9b..62d0e9001 100644 --- a/src/api/registry/api.profile.ts +++ b/src/api/registry/api.profile.ts @@ -202,6 +202,7 @@ export default { profileVerifiedUnlock: (profileId: string) => `${profile}not-verified/${profileId}`, profileSendVerified: (profileId: string) => `${profile}send-verified/${profileId}`, + listVerified: () => `${profile}list-verified`, registryNew, registryNewId: (id: string) => `${registryNew}${id}`, diff --git a/src/modules/04_registry/views/registry-verify.vue b/src/modules/04_registry/views/registry-verify.vue index ef0806790..3b679899c 100644 --- a/src/modules/04_registry/views/registry-verify.vue +++ b/src/modules/04_registry/views/registry-verify.vue @@ -5,6 +5,8 @@ import type { QTableProps } from "quasar"; // import type { ResponseObject } from "@/modules/04_registry/interface/response/Main"; import { useCounterMixin } from "@/stores/mixin"; import { useRouter } from "vue-router"; +import http from "@/plugins/http"; +import config from "@/app.config"; interface RequestItemsObject { id: string; @@ -398,134 +400,164 @@ const next = (id: string) => { router.push(`/registry/${id}`); }; -onMounted(() => { - const data = [ - { - id: "08dbc953-61ac-47eb-82d7-0e72df7669b5", - fullname: "นายณัฐพงศ์ ดิษยบุตร", - fullnameOld: "", - citizenId: "3100903812600", - dateAppoint: "1989-02-01T00:00:00", - dateStart: "1989-02-02T00:00:00", - createdAt: "2023-10-10T12:40:15.334501", - salaryDate: "2023-10-11T00:00:00", - refSalary: - "คำสั่ง {หน่วยงาน/สำนัก} ที่ {เลขที่}/{ปีงบประมาณ} ลว. {วันที่ลงนาม}", - amount: 76800.0, - insigniaLast: null, - insignia: null, - avatar: null, - position: "คีตศิลปิน", - positionPathSide: null, - posNo: "กบห.2", - positionLine: "จัดการงานทั่วไป", - positionType: "ทั่วไป", - positionLevel: "ปฏิบัติงาน", - positionExecutive: "หัวหน้าสำนักงาน ", - positionExecutiveSide: null, - positionEmployeePosition: null, - positionEmployeePositionSide: null, - positionEmployeeLevel: null, - positionEmployeeGroup: null, - govAge: 35, - age: 35, - oc: "กลุ่มงานช่วยนักบริหาร", - leaveReason: null, - isLeave: false, - leaveDateOrder: null, - isVerified: false, - }, - { - id: "08dbc953-6268-4e2c-80a3-aca65eedc6d0", - fullname: "นางสาวอรัญญา พรไชยะ", - fullnameOld: "", - citizenId: "3101502080439", - dateAppoint: "1990-08-16T00:00:00", - dateStart: "1990-08-16T00:00:00", - createdAt: "2023-10-10T12:40:16.746683", - salaryDate: "2023-10-10T00:00:00", - refSalary: "ปรับอัตราเงินเดือนครู บัญชีใหม่ {พ.ศ.}", - amount: 76800.0, - insigniaLast: null, - insignia: null, - avatar: null, - position: "นักบริหาร", - positionPathSide: null, - posNo: "สกก.2", - positionLine: "บริหาร", - positionType: "วิชาการ", - positionLevel: "ปฏิบัติการ", - positionExecutive: "ผู้ช่วยหัวหน้าสำนักงาน ", - positionExecutiveSide: null, - positionEmployeePosition: null, - positionEmployeePositionSide: null, - positionEmployeeLevel: null, - positionEmployeeGroup: null, - govAge: 34, - age: 34, - oc: "สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร", - leaveReason: null, - isLeave: false, - leaveDateOrder: null, - isVerified: true, - }, - ]; - rows.value = data.map((item: ResponseObject) => ({ - id: item.id, - fullname: item.fullname, - fullnameOld: item.fullnameOld == '' ? '-':item.fullnameOld, - avatar: item.avatar, - citizenId: item.citizenId, - position: item.position, - positionPathSide: item.positionPathSide, - numberPosition: item.posNo, - positionLine: item.positionLine, - positionType: item.positionType, - govAge: item.govAge, - positionLevel: item.positionLevel, - positionExecutive: - item.positionExecutive == null ? "-" : item.positionExecutive, - positionExecutiveSide: - item.positionExecutiveSide == null ? "-" : item.positionExecutiveSide, - positionEmployeePosition: - item.positionEmployeePosition == null - ? "-" - : item.positionEmployeePosition, - positionEmployeePositionSide: - item.positionEmployeePositionSide == null - ? "-" - : item.positionEmployeePositionSide, - positionEmployeeLevel: - item.positionEmployeeLevel == null ? "-" : item.positionEmployeeLevel, - positionEmployeeGroup: - item.positionEmployeeGroup == null ? "-" : item.positionEmployeeGroup, - oc: item.oc, - dateAppoint: - item.dateAppoint == null ? null : date2Thai(new Date(item.dateAppoint)), - dateStart: - item.dateStart == null ? null : date2Thai(new Date(item.dateStart)), - createdAt: - item.createdAt == null ? null : date2Thai(new Date(item.createdAt)), - salaryDate: - item.salaryDate == null ? null : date2Thai(new Date(item.salaryDate)), - leaveReason: item.leaveReason, - age: item.age, - amount: item.amount == null ? "" : item.amount.toLocaleString(), - insignia: item.insignia, - insigniaLast: item.insigniaLast, - isLeave: - item.isLeave == false - ? "ครอง" - : `${typeRetire(item.leaveReason as string)}`, - leaveDateOrder: - item.leaveDateOrder == null - ? null - : date2Thai(new Date(item.leaveDateOrder)), - refSalary: item.refSalary, - isVerified: item.isVerified, - })); +async function fetchData() { + // showLoader(); + await http + .get(config.API.listVerified()) + .then((res) => { + let data = res.data.result; + rows.value = []; + data.map((item: ResponseObject) => { + rows.value.push({ + id: item.id, + fullname: item.fullname, + fullnameOld: item.fullnameOld == "" ? "-" : item.fullnameOld, + avatar: item.avatar, + citizenId: item.citizenId, + position: item.position, + positionPathSide: item.positionPathSide, + numberPosition: item.posNo, + positionLine: item.positionLine, + positionType: item.positionType, + govAge: item.govAge, + positionLevel: item.positionLevel, + positionExecutive: + item.positionExecutive == null ? "-" : item.positionExecutive, + positionExecutiveSide: + item.positionExecutiveSide == null + ? "-" + : item.positionExecutiveSide, + positionEmployeePosition: + item.positionEmployeePosition == null + ? "-" + : item.positionEmployeePosition, + positionEmployeePositionSide: + item.positionEmployeePositionSide == null + ? "-" + : item.positionEmployeePositionSide, + positionEmployeeLevel: + item.positionEmployeeLevel == null + ? "-" + : item.positionEmployeeLevel, + positionEmployeeGroup: + item.positionEmployeeGroup == null + ? "-" + : item.positionEmployeeGroup, + oc: item.oc, + dateAppoint: + item.dateAppoint == null + ? null + : date2Thai(new Date(item.dateAppoint)), + dateStart: + item.dateStart == null ? null : date2Thai(new Date(item.dateStart)), + createdAt: + item.createdAt == null ? null : date2Thai(new Date(item.createdAt)), + salaryDate: + item.salaryDate == null + ? null + : date2Thai(new Date(item.salaryDate)), + leaveReason: item.leaveReason, + age: item.age, + amount: item.amount == null ? "" : item.amount.toLocaleString(), + insignia: item.insignia, + insigniaLast: item.insigniaLast, + isLeave: + item.isLeave == false + ? "ครอง" + : `${typeRetire(item.leaveReason as string)}`, + leaveDateOrder: + item.leaveDateOrder == null + ? null + : date2Thai(new Date(item.leaveDateOrder)), + refSalary: item.refSalary, + isVerified: item.isVerified, + }); + }); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +} + +onMounted(async () => { + await fetchData(); + // const data = [ + // { + // id: "08dbc953-61ac-47eb-82d7-0e72df7669b5", + // fullname: "นายณัฐพงศ์ ดิษยบุตร", + // fullnameOld: "", + // citizenId: "3100903812600", + // dateAppoint: "1989-02-01T00:00:00", + // dateStart: "1989-02-02T00:00:00", + // createdAt: "2023-10-10T12:40:15.334501", + // salaryDate: "2023-10-11T00:00:00", + // refSalary: + // "คำสั่ง {หน่วยงาน/สำนัก} ที่ {เลขที่}/{ปีงบประมาณ} ลว. {วันที่ลงนาม}", + // amount: 76800.0, + // insigniaLast: null, + // insignia: null, + // avatar: null, + // position: "คีตศิลปิน", + // positionPathSide: null, + // posNo: "กบห.2", + // positionLine: "จัดการงานทั่วไป", + // positionType: "ทั่วไป", + // positionLevel: "ปฏิบัติงาน", + // positionExecutive: "หัวหน้าสำนักงาน ", + // positionExecutiveSide: null, + // positionEmployeePosition: null, + // positionEmployeePositionSide: null, + // positionEmployeeLevel: null, + // positionEmployeeGroup: null, + // govAge: 35, + // age: 35, + // oc: "กลุ่มงานช่วยนักบริหาร", + // leaveReason: null, + // isLeave: false, + // leaveDateOrder: null, + // isVerified: false, + // }, + // { + // id: "08dbc953-6268-4e2c-80a3-aca65eedc6d0", + // fullname: "นางสาวอรัญญา พรไชยะ", + // fullnameOld: "", + // citizenId: "3101502080439", + // dateAppoint: "1990-08-16T00:00:00", + // dateStart: "1990-08-16T00:00:00", + // createdAt: "2023-10-10T12:40:16.746683", + // salaryDate: "2023-10-10T00:00:00", + // refSalary: "ปรับอัตราเงินเดือนครู บัญชีใหม่ {พ.ศ.}", + // amount: 76800.0, + // insigniaLast: null, + // insignia: null, + // avatar: null, + // position: "นักบริหาร", + // positionPathSide: null, + // posNo: "สกก.2", + // positionLine: "บริหาร", + // positionType: "วิชาการ", + // positionLevel: "ปฏิบัติการ", + // positionExecutive: "ผู้ช่วยหัวหน้าสำนักงาน ", + // positionExecutiveSide: null, + // positionEmployeePosition: null, + // positionEmployeePositionSide: null, + // positionEmployeeLevel: null, + // positionEmployeeGroup: null, + // govAge: 34, + // age: 34, + // oc: "สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร", + // leaveReason: null, + // isLeave: false, + // leaveDateOrder: null, + // isVerified: true, + // }, + // ]; }); +