Compare commits

..

150 commits
v1.1.89 ... dev

Author SHA1 Message Date
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f054dd54a4 refactor: redirect to landing page on 404 permission error in messageError
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m51s
2026-07-20 10:15:32 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
34d39c7215 refactor(probation): replace Math.round with Math.trunc
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-07-13 17:57:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4dfc9bf4d6 refactor(probation): calculate score4 score5
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m43s
2026-07-13 15:01:41 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
8272a2b291 refactror(probation): add Check Box other_training
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m56s
2026-07-13 10:25:08 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6392659c23 refactor(recruiting): add filter to compete and disable Page import
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m48s
2026-07-02 10:52:22 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
d3936e56b2 refactor(recruiting): add ScoreExpireDate to compete, qualify, and disable period forms
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m54s
2026-07-02 10:40:54 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6f878a0e16 Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m52s
2026-07-01 15:20:40 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4621299dcf refactor(probation): checkType checkbox disable 2026-07-01 15:20:27 +07:00
a72b3afa70 แก้ไข tab ลงเวลา รอประมวลผล
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m10s
2026-06-30 20:15:28 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
faf529c13c feat(leave): show pending comment warning for system cancel case
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m0s
- Display 'ยังไม่ได้แสดงความคิดเห็น' in red when isSysCancel is true
- Hide original comment button when system cancel
- Improve UX for pending comments on cancelled leaves
2026-06-30 16:03:37 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e283468d8c refactor(leave): show banner Comment
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m54s
2026-06-30 13:44:57 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e08d716cf4 refactor(leavel) : label select
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m16s
2026-06-30 09:22:36 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6aa2709986 feat(leave): add pending jobs tab to work-list page
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m53s
2026-06-29 16:39:36 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
2355639f25 Revert "refactor: disable DonwloadCandidatePassExam"
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m57s
This reverts commit 6e8dbfc375.
2026-06-29 15:27:25 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
96bb2faa1e refactor(placement): hide examRound display
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m1s
2026-06-29 13:30:59 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6e8dbfc375 refactor: disable DonwloadCandidatePassExam 2026-06-29 13:24:03 +07:00
08fec651f2 fix clear noti ui
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m11s
2026-06-25 21:47:38 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
44e60d457f fix
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m12s
2026-06-25 18:01:45 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
a9bef5bc42 fix
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m2s
2026-06-25 17:19:10 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
fd665b8b4d refactor(qualify): replace api CandidateExam
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-06-25 14:53:59 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
16c21467e4 fix
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m45s
2026-06-23 16:17:56 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c0aa285675 refactor(notification): update icon and text display
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m42s
2026-06-23 15:54:08 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
607457e921 refactor(timestamp-special): update checkIn/checkOut payload and edit conditions
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m5s
2026-06-23 15:27:42 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
13921f1a9f fix
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m56s
2026-06-23 14:40:50 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
b26396cd4a Revert "fix"
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m52s
This reverts commit 1afe3936bd.
2026-06-23 14:33:12 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
1afe3936bd fix 2026-06-23 14:31:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c74952ed52 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-06-23 13:59:33 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c49669021a feat(notification): add delete notification feature 2026-06-23 13:59:17 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
63f307c70d feat(timestamp-special): add MultipleApprove Special Lists 2026-06-23 13:41:10 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
d040427634 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m48s
2026-06-22 11:04:27 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
76156d03e4 refactor(round-time): replace max-height DialogForm 2026-06-22 11:03:58 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
a401601dac Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m56s
2026-06-22 10:46:07 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
8a9a14a1a0 refactor(command): default isBangkok to true when commandCode is 'C-PM-47' 2026-06-22 10:45:45 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c4fe629cd2 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m57s
2026-06-22 09:29:08 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
2dfe617284 refactor(command): readonly radio commandCode C-PM-47 2026-06-22 09:28:50 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f28758de8d Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m1s
2026-06-19 15:45:36 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
20d80916cb refactor(command): validate commandCode === 'C-PM-47' 2026-06-19 15:45:19 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
68659d3086 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m17s
2026-06-17 18:13:14 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
ee82e63e25 refactor(position-temp): comment checkbox isSit 2026-06-17 18:11:30 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c411e9c0ff Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m57s
2026-06-17 17:30:45 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c1d30de6d2 fix 2026-06-17 17:30:23 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c3f7c78670 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-06-17 16:51:17 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
82411ce499 fix 2026-06-17 16:50:59 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
67f2cec40b Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m54s
2026-06-17 15:27:41 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
695c9ee271 fix 2026-06-17 15:27:20 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
004a0bcdb3 refactor(registry): rules q-select rank 2026-06-17 15:26:47 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
efaaa85fcf Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m53s
2026-06-16 16:07:44 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
df9a8408dd refactor(leave): add isAllDirector field to workflowCommanderOperate API 2026-06-16 16:07:24 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4338d5bbce Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m14s
2026-06-16 10:43:47 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
06ddc1c970 refactor(org): add ROOT_CODE and CHILD_CODE fields for org hierarchy 2026-06-16 10:43:31 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
058fb6c464 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m45s
2026-06-12 17:00:27 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
72cbe6a8dc refactor(registry): itemsMenu RETIRE_MILITARY only SYS_PLACEMENT_OTHER 2026-06-12 17:00:09 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
141a5e40d6 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-06-12 11:10:16 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
bf4b03e643 refactor(registry-officer): prefix 2026-06-12 11:09:55 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
2bbab84f25 fix
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m1s
2026-06-11 18:20:51 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
92c204a7e4 Merge branch 'dev' of https://forgejo.chamomind.com/hrms-bangkok/hrms-mgt into dev 2026-06-11 18:17:29 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
5aed5699b9 fix 2026-06-11 18:17:21 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
60dfe0a6a5 Merge branch 'feat/registry' into develop 2026-06-11 17:55:26 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
d3e45048e8 fix 2026-06-11 16:30:18 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
5bcf07c306 Merge branch 'dev' into develop
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m51s
2026-06-11 16:27:39 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f1b94c0d93 feat(Retired): add convertTypeRetired RETIRE_MILITARY 2026-06-11 16:27:07 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
eb23074454 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m59s
2026-06-11 14:02:29 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f6f2c18d0f feat(resign): add commandType C-PM-48 2026-06-11 14:02:11 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
215e2f157f Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m51s
2026-06-10 16:32:28 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
baadd296cb refactor(recruiting): add rootDnaId to disable and compete API payloads 2026-06-10 16:32:07 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
a8920b4473 feat(changeName): change Rank 2026-06-10 10:59:06 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
a74e12c55c Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m59s
2026-06-09 17:40:21 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
7d1bfd33ff fix: normalizeTreeData 2026-06-09 17:39:55 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6b8fd72277 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m59s
2026-06-09 13:30:58 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
136a17ce8c refactor(appoint-promote): add profileId to /pos/placement/search payload 2026-06-09 09:42:11 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e5265dde98 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m42s
2026-06-08 17:18:23 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
17bb4c9bc4 Merge branch 'develop' into dev 2026-06-08 17:18:18 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
9e83ff02fa refactor(placement): replace 'คัดเลือกคนพิการ' with 'คัดเลือกอื่นๆ' 2026-06-08 17:17:48 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
552fe0a092 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m53s
2026-06-05 16:43:26 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
301ace0659 fix(discipline): refCommandNo 2026-06-05 16:43:05 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
7fe7665778 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m3s
2026-06-05 13:07:07 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
a6681875e9 Merge branch 'registy/discipline' into develop 2026-06-05 13:06:41 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
1da74091a2 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m40s
2026-06-05 10:58:00 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
34f33e57ac refactor(PosmasterNo): replace formatPosmasterNo 2026-06-05 10:57:37 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
efca59a50f Merge branch 'dev' of https://forgejo.chamomind.com/hrms-bangkok/hrms-mgt into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m49s
2026-06-04 15:10:45 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
b76b926175 Merge branch 'develop' into dev 2026-06-04 15:10:37 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6b2d1781b0 Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop 2026-06-04 15:09:39 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
80d3d96180 refactor(resign): replace toUTCString with convertDateToAPI 2026-06-04 15:04:23 +07:00
0d897fb583 Merge branch 'dev' of https://forgejo.chamomind.com/hrms-bangkok/hrms-mgt into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m23s
* 'dev' of https://forgejo.chamomind.com/hrms-bangkok/hrms-mgt:
2026-06-04 12:58:27 +07:00
07cad34910 Merge branch 'develop' into dev
* develop:
  fixed: เปิดให้สามารถแก้ไขข้อมูลขอลาออกได้
  feat: add delete is OWNER
  feat(leave): add delete
2026-06-04 12:58:19 +07:00
ff6671d523 fixed: เปิดให้สามารถแก้ไขข้อมูลขอลาออกได้ 2026-06-04 12:58:07 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
dcfb5ab1a0 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m5s
2026-05-29 10:14:38 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
21401ed519 feat: add delete is OWNER 2026-05-29 10:12:16 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
aa3d41b7b3 Merge branch 'develop' into feat/delete 2026-05-29 09:20:05 +07:00
ed9789b43b Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m0s
* develop:
  fixed OWNER สามารถแก้ชื่อ นามสกุล เพศและคำนำหน้าชื่อได้
2026-05-28 10:44:07 +07:00
d0a7511bbe fixed OWNER สามารถแก้ชื่อ นามสกุล เพศและคำนำหน้าชื่อได้ 2026-05-28 10:43:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
184e124185 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-05-27 15:17:20 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e323e28f73 fix(HelpGovernment): delete rules dateEnd 2026-05-27 15:17:02 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
0c60276589 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-27 12:16:40 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
7b21b1d934 fix(Dialog): prevent space key from closing the dialog 2026-05-27 12:16:17 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f1c4654046 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-27 10:36:04 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
1b36cab885 fix(help-government): clearable dateEnd 2026-05-27 10:35:49 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
51a7b9db19 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m2s
2026-05-27 10:24:00 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
47bd6611b2 fix(Dialog): prevent enter key from closing the dialog 2026-05-27 10:23:36 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
98ed2470b9 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m43s
2026-05-25 16:50:09 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f726aece81 fix(registry-officer): set profile name field to readonly in edit mode 2026-05-25 16:49:18 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
c1c008e899 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m13s
2026-05-25 13:17:39 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
176b22e756 fix: await API fileByFile 2026-05-25 13:17:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
b583e1a6a9 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m2s
2026-05-22 18:18:51 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
7d46985570 fix 2026-05-22 18:18:40 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
487cc537c5 Merge branch 'develop' into dev 2026-05-22 18:14:59 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
a50733c457 fix(registry): icon sortOrderByDate 2026-05-22 18:14:01 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
72286a4c53 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m5s
2026-05-22 17:51:22 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
d73fbf80f9 fix(organization): prevent displaying null for prefix 2026-05-22 17:51:03 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
ce9d8be1b2 feat(leave): add delete 2026-05-22 17:49:36 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
040c67bef0 feat(registry): add PreviewCommand 2026-05-22 15:06:27 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
1886874769 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m44s
2026-05-22 14:04:20 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
660fed8375 Merge branch 'feat/registry-edit' into develop 2026-05-22 14:03:54 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
10c047ffe2 feat(registry-edit): implement API sortOrderByDate 2026-05-22 14:03:41 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
6483f30d07 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m50s
2026-05-22 09:53:44 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
b03fe7d44a fix(placement): send posExecutiveId field in payload 2026-05-22 09:53:21 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
019b43b450 feat(registry-edit): add function SortDataByDate 2026-05-20 18:09:13 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
15fde564ed Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m39s
2026-05-20 15:59:29 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
d978ba870b refactor(placement): display columns posMasterNo 2026-05-20 15:59:10 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
9065af97fd Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m1s
2026-05-19 10:08:41 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
233118e4a3 faet(compete): Trigger fetchData on socket notification 2026-05-19 10:08:22 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
528a8d3feb Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-18 15:16:21 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
99b98c7ec2 refact:or(compete): replace file Score summary 2026-05-18 15:16:05 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
7423b931f6 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m59s
2026-05-18 14:24:25 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4ecf307c32 refactor(compete): replace file compete 2026-05-18 14:23:52 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
7841c33668 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-18 13:44:52 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
985f1bcf23 feat(persons): add router for persons feature 2026-05-18 13:44:38 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
75182f39e2 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-15 17:05:21 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
463a35059e refactor(receive): send prefix rank 2026-05-15 17:01:59 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f909ac4186 fix(compete): message upload 2026-05-15 16:01:36 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4fa804aaca Merge branch 'develop' into dev 2026-05-14 17:49:09 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
4f6d14ef97 refactor(compete): use showUploadSuccessDialog 2026-05-14 17:48:50 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
f58dfbc97f Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m58s
2026-05-14 17:28:21 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
ded0a634d2 feat(compete): upload file 2026-05-14 17:27:40 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
62acc3a5c8 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m52s
2026-05-14 13:36:04 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e85ea0c475 feat(socket): add socket.on "socket-notification" 2026-05-14 13:35:24 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e63aef8b83 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m0s
2026-05-14 10:25:20 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
01b1ee3998 refactor(leave): getStatusColor 2026-05-14 10:24:50 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
20f75d24b0 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m51s
2026-05-12 18:07:41 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
50fdb30920 fix(receive): Display columns posTypeOld 2026-05-12 18:07:29 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
ae8e667922 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m0s
2026-05-12 17:46:12 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
5ead16e528 fix(receive): diaplay rank 2026-05-12 17:45:54 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
9cbe56fb1e Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m56s
2026-05-12 17:15:38 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
95f37cf68d fix(leave): fetch checkOfficer 2026-05-12 17:14:53 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
bee7aa54f0 Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m41s
2026-05-12 15:25:34 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
762ed36190 Merge branch 'feat/receive' into develop 2026-05-12 15:25:10 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
e14ba58df0 refactor(receive): display prefix 2026-05-12 15:24:53 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
8d83bd2b1e Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m56s
2026-05-12 14:25:51 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
9228132052 refactor: display getColumnLabel 2026-05-12 14:25:33 +07:00
DESKTOP-1R2VSQH\Lenovo ThinkPad E490
0739f2b9d7 feat(receive): add input rank 2026-05-07 10:40:58 +07:00
120 changed files with 2967 additions and 479 deletions

View file

@ -36,6 +36,7 @@
"moment": "^2.29.4", "moment": "^2.29.4",
"pdf-lib": "^1.17.1", "pdf-lib": "^1.17.1",
"pinia": "^2.0.29", "pinia": "^2.0.29",
"pinia-plugin-persistedstate": "^3.2.3",
"quasar": "^2.11.1", "quasar": "^2.11.1",
"socket.io-client": "^4.7.4", "socket.io-client": "^4.7.4",
"structure-chart": "^0.0.9", "structure-chart": "^0.0.9",

View file

@ -194,6 +194,7 @@ export default {
`${orgProfile}${type}/profileid/position`, `${orgProfile}${type}/profileid/position`,
uploadProfile: (type: string, id: string) => uploadProfile: (type: string, id: string) =>
`${organization}/upload/${type}-profileSalaryTemp/${id}`, `${organization}/upload/${type}-profileSalaryTemp/${id}`,
sortOrderByDate: `${orgProfile}/salaryTemp/sort-order`,
workflowCommanderOperate: `${workflow}/commander/operate`, workflowCommanderOperate: `${workflow}/commander/operate`,
workflowCommanderSign: `${workflow}/commander/sign`, workflowCommanderSign: `${workflow}/commander/sign`,

View file

@ -25,6 +25,7 @@ export default {
specialTime: () => `${leave}/admin/edit`, specialTime: () => `${leave}/admin/edit`,
specialTimeApprove: (id: string) => `${leave}/admin/edit/approve/${id}`, specialTimeApprove: (id: string) => `${leave}/admin/edit/approve/${id}`,
specialTimeReject: (id: string) => `${leave}/admin/edit/reject/${id}`, specialTimeReject: (id: string) => `${leave}/admin/edit/reject/${id}`,
specialTimeApproveLists: `${leave}/admin/edit/approve-list`,
/** รายการลา*/ /** รายการลา*/
leaveType: () => `${leave}/type`, leaveType: () => `${leave}/type`,
@ -63,4 +64,5 @@ export default {
`${leave}/report/download/time-records/${type}`, `${leave}/report/download/time-records/${type}`,
leaveTask: `${leave}/admin/leave-task/process`, leaveTask: `${leave}/admin/leave-task/process`,
leavePendingJobs: `${leave}/pending-jobs/`,
}; };

View file

@ -98,6 +98,9 @@ export default {
`${env.API_URI}/placement/candidate/pdf/${candidateId}`, `${env.API_URI}/placement/candidate/pdf/${candidateId}`,
downloadCandidateExam: (id: string) => downloadCandidateExam: (id: string) =>
`${periodExam}download/candidate-exam/${id}`, `${exam_report}candidate/candidate-new/${id}`,
downloadPassExam: (id: string) => `${periodExam}download/pass-exam/${id}`, downloadPassExam: (id: string) => `${periodExam}download/pass-exam/${id}`,
downloadCandidatePassExam: (id: string) =>
`${exam_report}candidate/pass-new/${id}`,
}; };

View file

@ -23,6 +23,7 @@ export default {
uploadCandidates: (id: string) => `${recruit}candidate/${id}`, uploadCandidates: (id: string) => `${recruit}candidate/${id}`,
uploadResult: (id: string) => `${recruit}result/${id}`, uploadResult: (id: string) => `${recruit}result/${id}`,
getImportHistory: (id: string) => `${recruit}history/${id}`, getImportHistory: (id: string) => `${recruit}history/${id}`,
getImportStatus: (jobId: string) => `${recruit}import/status/${jobId}`,
//upload //upload
periodRecruitDoc: (examId: string) => `${recruit}doc/${examId}`, periodRecruitDoc: (examId: string) => `${recruit}doc/${examId}`,

View file

@ -8,6 +8,7 @@ import config from "@/app.config";
import type { PropType } from "vue"; import type { PropType } from "vue";
import type { FormProfile } from "@/interface/main"; import type { FormProfile } from "@/interface/main";
import type { DataProfile } from "@/modules/05_placement/interface/index/Main"; import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
import avatarMain from "@/assets/avatar_user.jpg";
/** importComponents*/ /** importComponents*/
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
@ -43,9 +44,9 @@ async function fetchDataProfile(data: DataProfile) {
profile.avatar = data?.avatar ? data.avatar : ""; profile.avatar = data?.avatar ? data.avatar : "";
} }
profile.id = data.profileId; profile.id = data.profileId;
profile.fullName = `${data.prefix ?? ""}${data.firstName ?? ""} ${ profile.fullName = `${data.rank ? data.rank : data.prefix ?? ""}${
data.lastName ?? "" data.firstName ?? ""
} `; } ${data.lastName ?? ""} `;
if (data["posTypeNameOld"] !== undefined) { if (data["posTypeNameOld"] !== undefined) {
profile.position = profile.position =
@ -91,8 +92,11 @@ function fetchProfile(id: string, name: string) {
if (profile.avatar === "") { if (profile.avatar === "") {
http http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`)) .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `${name}`))
.then(async (res) => { .then((res) => {
profile.avatar = res.data.downloadUrl; profile.avatar = res.data.downloadUrl;
})
.catch(() => {
profile.avatar = avatarMain;
}); });
} }
} }

View file

@ -9,6 +9,8 @@
round round
dense dense
@click="close" @click="close"
@keydown.enter.prevent
@keydown.space.prevent
style="color: #ff8080; background-color: #ffdede" style="color: #ff8080; background-color: #ffdede"
/> />
</q-toolbar> </q-toolbar>

View file

@ -7,6 +7,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree"; import { useStructureTree } from "@/stores/structureTree";
import { formatPosmasterNo } from "@/utils/function";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { import type {
@ -262,6 +263,7 @@ async function getDataTable(id: string, level: number = 0) {
posType: posType.value ? posType.value : "", posType: posType.value ? posType.value : "",
isAll: isAll.value, isAll: isAll.value,
isBlank: isBlank.value, isBlank: isBlank.value,
profileId: type.value === "MOVE" ? props.dataRows.profileId : undefined,
}; };
await http await http
@ -282,12 +284,12 @@ async function getDataTable(id: string, level: number = 0) {
const listPosNo: DataPositionNo[] = dataMain.map((e: PositionMain) => ({ const listPosNo: DataPositionNo[] = dataMain.map((e: PositionMain) => ({
id: e.id, id: e.id,
isPosition: e.isPosition, isPosition: e.isPosition,
posMasterNo: posMasterNo: formatPosmasterNo(
e.orgShortname + e.orgShortname,
(e.posMasterNoPrefix != null ? e.posMasterNoPrefix : "") + e.posMasterNoPrefix,
" " + e.posMasterNo.toString(),
e.posMasterNo + e.posMasterNoSuffix
(e.posMasterNoSuffix != null ? e.posMasterNoSuffix : ""), ),
positionName: e.positionName, positionName: e.positionName,
posTypeName: e.posTypeName, posTypeName: e.posTypeName,
posLevelName: e.posLevelName, posLevelName: e.posLevelName,
@ -512,6 +514,7 @@ function onSubmit() {
posLevelId: selectedPos.value[0].posLevelId, // posLevelId: selectedPos.value[0].posLevelId, //
posLevelName: selectedPos.value[0].posLevelName, // posLevelName: selectedPos.value[0].posLevelName, //
posExecutiveName: selectedPos.value[0].posExecutiveName, // posExecutiveName: selectedPos.value[0].posExecutiveName, //
posExecutiveId: selectedPos.value[0].posExecutiveId, //
reportingDate: convertDateToAPI(datePos.value), reportingDate: convertDateToAPI(datePos.value),
posmasterId: dataPosMaster.id, posmasterId: dataPosMaster.id,
typeCommand: type.value, typeCommand: type.value,

View file

@ -7,6 +7,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree"; import { useStructureTree } from "@/stores/structureTree";
import { formatPosmasterNo } from "@/utils/function";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { import type {
@ -232,7 +233,8 @@ function close() {
async function getDataTable(id: string, level: number = 0) { async function getDataTable(id: string, level: number = 0) {
showLoader(); showLoader();
positionNo.value = [];
rowsData.value = [];
const body = { const body = {
node: level, node: level,
nodeId: id, nodeId: id,
@ -262,11 +264,12 @@ async function getDataTable(id: string, level: number = 0) {
const listPosNo: DataPositionNo[] = dataMain.map((e: PositionMain) => ({ const listPosNo: DataPositionNo[] = dataMain.map((e: PositionMain) => ({
id: e.id, id: e.id,
isPosition: e.isPosition, isPosition: e.isPosition,
posMasterNo: posMasterNo: formatPosmasterNo(
e.orgShortname + e.orgShortname,
(e.posMasterNoPrefix != null ? e.posMasterNoPrefix : "") + e.posMasterNoPrefix,
e.posMasterNo + e.posMasterNo.toString(),
(e.posMasterNoSuffix != null ? e.posMasterNoSuffix : ""), e.posMasterNoSuffix
),
positionName: e.positionName, positionName: e.positionName,
posTypeName: e.posTypeName, posTypeName: e.posTypeName,
posLevelName: e.posLevelName, posLevelName: e.posLevelName,
@ -302,9 +305,7 @@ async function getDataTable(id: string, level: number = 0) {
messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
setTimeout(() => {
hideLoader(); hideLoader();
}, 1000);
}); });
} }

View file

@ -14,6 +14,7 @@ import type {
GovermentEmpTemp, GovermentEmpTemp,
} from "@/components/information/interface/response/Government"; } from "@/components/information/interface/response/Government";
import type { Avatar } from "@/components/information/interface/response/avatar"; import type { Avatar } from "@/components/information/interface/response/avatar";
import avatarMain from "@/assets/avatar_user.jpg";
/** importStore*/ /** importStore*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -167,9 +168,9 @@ async function fetchInformation(id: string) {
avatar.position = data.position ? data.position : "-"; avatar.position = data.position ? data.position : "-";
// Function fetchProfile // Function fetchProfile
if (data.avatarName) { if (data.avatarName) {
await fetchProfile(data.id as string, data.avatarName); fetchProfile(data.id as string, data.avatarName);
} else { } else {
avatar.avatar = ""; avatar.avatar = avatarMain;
} }
if (props.id) { if (props.id) {
@ -260,11 +261,14 @@ async function fetchProfileGovTemp(id: string) {
* @param id profileID * @param id profileID
* @param avatarName อไฟล * @param avatarName อไฟล
*/ */
async function fetchProfile(id: string, avatarName: string) { function fetchProfile(id: string, avatarName: string) {
await http http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
.then(async (res) => { .then((res) => {
avatar.avatar = await res.data.downloadUrl; avatar.avatar = res.data.downloadUrl;
})
.catch(() => {
avatar.avatar = avatarMain;
}); });
} }

View file

@ -5,7 +5,6 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { getColumnLabel } from "@/utils/function";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -254,7 +253,7 @@ watch(modal, (val) => {
<q-th auto-width /> <q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props"> <q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium"> <span class="text-weight-medium">
{{ getColumnLabel(col, isAct) }} {{ col.label }}
</span> </span>
</q-th> </q-th>
</q-tr> </q-tr>

View file

@ -13,6 +13,7 @@ import th from "quasar/lang/th";
import "@vuepic/vue-datepicker/dist/main.css"; import "@vuepic/vue-datepicker/dist/main.css";
import http from "./plugins/http"; import http from "./plugins/http";
import { createPinia } from "pinia"; import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
// import './assets/main.css' // import './assets/main.css'
@ -20,6 +21,7 @@ import filters from "./plugins/filters";
const app = createApp(App); const app = createApp(App);
const pinia = createPinia(); const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
// เพิ่ม Global Filters ลงใน App // เพิ่ม Global Filters ลงใน App
app.config.globalProperties.$filters = filters; app.config.globalProperties.$filters = filters;

View file

@ -89,6 +89,11 @@ const formData = reactive<FormDataAgency>({
DIVISION_CODE: "", DIVISION_CODE: "",
SECTION_CODE: "", SECTION_CODE: "",
JOB_CODE: "", JOB_CODE: "",
ROOT_CODE: "",
CHILD1_CODE: "",
CHILD2_CODE: "",
CHILD3_CODE: "",
CHILD4_CODE: "",
}); });
/** /**
@ -160,6 +165,11 @@ function onSubmit() {
DIVISION_CODE: formData.DIVISION_CODE, DIVISION_CODE: formData.DIVISION_CODE,
SECTION_CODE: formData.SECTION_CODE, SECTION_CODE: formData.SECTION_CODE,
JOB_CODE: formData.JOB_CODE, JOB_CODE: formData.JOB_CODE,
ROOT_CODE: formData.ROOT_CODE,
CHILD1_CODE: formData.CHILD1_CODE,
CHILD2_CODE: formData.CHILD2_CODE,
CHILD3_CODE: formData.CHILD3_CODE,
CHILD4_CODE: formData.CHILD4_CODE,
}; };
// //
@ -189,18 +199,20 @@ function onSubmit() {
body body
) )
.then(async () => { .then(async () => {
await props.fetchDataTree(store.draftId); await Promise.all([
await props.fetchDataTree(store.draftId),
await props.edit?.( await props.edit?.(
props.dataNode?.orgTreeId, props.dataNode?.orgTreeId,
type, type,
body, body,
props.dataNode?.orgRootCode props.dataNode?.orgRootCode
); ),
await props.fetchDataTable( await props.fetchDataTable(
props?.dataNode?.orgTreeId, props?.dataNode?.orgTreeId,
props?.dataNode?.orgLevel, props?.dataNode?.orgLevel,
false false
); ),
]);
await success($q, "บันทึกข้อมูลสำเร็จ"); await success($q, "บันทึกข้อมูลสำเร็จ");
closeClear(); closeClear();
}) })
@ -231,6 +243,11 @@ function closeClear() {
formData.isCommission = false; formData.isCommission = false;
formData.isInformation = false; formData.isInformation = false;
formData.misId = ""; formData.misId = "";
formData.ROOT_CODE = "";
formData.CHILD1_CODE = "";
formData.CHILD2_CODE = "";
formData.CHILD3_CODE = "";
formData.CHILD4_CODE = "";
formData.DEPARTMENT_CODE = ""; formData.DEPARTMENT_CODE = "";
formData.DIVISION_CODE = ""; formData.DIVISION_CODE = "";
formData.SECTION_CODE = ""; formData.SECTION_CODE = "";
@ -456,6 +473,7 @@ watch(
else { else {
props.dataNode?.orgLevel === 1 && checkOfficer(); props.dataNode?.orgLevel === 1 && checkOfficer();
if (props.dataNode) { if (props.dataNode) {
console.log(props.dataNode);
formData.orgName = props.dataNode.orgTreeName; formData.orgName = props.dataNode.orgTreeName;
formData.orgShortName = props.dataNode.orgTreeShortName; formData.orgShortName = props.dataNode.orgTreeShortName;
formData.orgCode = props.dataNode.orgTreeCode; formData.orgCode = props.dataNode.orgTreeCode;
@ -474,6 +492,11 @@ watch(
formData.DIVISION_CODE = props.dataNode.DIVISION_CODE; formData.DIVISION_CODE = props.dataNode.DIVISION_CODE;
formData.SECTION_CODE = props.dataNode.SECTION_CODE; formData.SECTION_CODE = props.dataNode.SECTION_CODE;
formData.JOB_CODE = props.dataNode.JOB_CODE; formData.JOB_CODE = props.dataNode.JOB_CODE;
formData.ROOT_CODE = props.dataNode.ROOT_CODE;
formData.CHILD1_CODE = props.dataNode.CHILD1_CODE;
formData.CHILD2_CODE = props.dataNode.CHILD2_CODE;
formData.CHILD3_CODE = props.dataNode.CHILD3_CODE;
formData.CHILD4_CODE = props.dataNode.CHILD4_CODE;
orgLevelOption.value = orgLevelOption.value =
props.dataNode.orgTreeRank === "DEPARTMENT" props.dataNode.orgTreeRank === "DEPARTMENT"
? orgLevelOptionMain.value ? orgLevelOptionMain.value
@ -730,6 +753,66 @@ watch(
</div> </div>
</div> </div>
</div> </div>
<div class="col-12">
<div class="col-12 row q-col-gutter-sm">
<div class="col">
<q-input
v-model="formData.ROOT_CODE"
dense
outlined
label="ROOT CODE"
hide-bottom-space
:class="classInput(false)"
maxlength="3"
/>
</div>
<div class="col">
<q-input
v-model="formData.CHILD1_CODE"
dense
outlined
label="CHILD1 CODE"
hide-bottom-space
:class="classInput(false)"
maxlength="3"
/>
</div>
<div class="col">
<q-input
v-model="formData.CHILD2_CODE"
dense
outlined
label="CHILD2 CODE"
hide-bottom-space
:class="classInput(false)"
maxlength="3"
/>
</div>
<div class="col">
<q-input
v-model="formData.CHILD3_CODE"
dense
outlined
label="CHILD3 CODE"
hide-bottom-space
:class="classInput(false)"
maxlength="3"
/>
</div>
<div class="col">
<q-input
v-model="formData.CHILD4_CODE"
dense
outlined
label="CHILD4 CODE"
hide-bottom-space
:class="classInput(false)"
maxlength="3"
/>
</div>
</div>
</div>
<div class="col-12"> <div class="col-12">
<q-input <q-input
v-model="formData.responsibility" v-model="formData.responsibility"

View file

@ -213,7 +213,9 @@ function formatHistoryOwnerData(data: HistoryPos[]) {
return data.map((item) => ({ return data.map((item) => ({
...item, ...item,
fullname: item.firstName fullname: item.firstName
? `${item.prefix}${item.firstName} ${item.lastName}`.trim() ? `${item.prefix || ""}${item.firstName || ""} ${
item.lastName || ""
}`.trim()
: "ว่าง", : "ว่าง",
})); }));
} }

View file

@ -48,7 +48,7 @@ const modal = defineModel<boolean>("modal", { required: true });
let reqMaster = defineModel<FilterMaster>("reqMaster", { required: true }); let reqMaster = defineModel<FilterMaster>("reqMaster", { required: true });
const totalPage = defineModel<number>("totalPage", { required: true }); const totalPage = defineModel<number>("totalPage", { required: true });
const nodeTree = defineModel<OrgTree[]>("nodeTree", { required: true }); const nodeTree = defineModel<OrgTree[]>("nodeTree", { required: true });
const columns = defineModel<QTableProps[]>("columns", {}); const columns = defineModel<QTableProps['columns']>("columns", {});
const rows = defineModel<PosMaster2[]>("rows", { required: true }); const rows = defineModel<PosMaster2[]>("rows", { required: true });
const props = defineProps({ const props = defineProps({
fetchDataTree: { fetchDataTree: {

View file

@ -36,6 +36,11 @@ const formData = reactive({
responsibility: "", // responsibility: "", //
isCommission: "", // isCommission: "", //
isDeputy: "", // . isDeputy: "", // .
rootCode: "", //ROOT CODE
child1Code: "", //CHILD1 CODE
child2Code: "", //CHILD2 CODE
child3Code: "", //CHILD3 CODE
child4Code: "", //CHILD4 CODE
}); });
/** /**
@ -76,6 +81,11 @@ async function fetchDetailTree(id: string, type: string) {
formData.responsibility = data.responsibility ? data.responsibility : "-"; formData.responsibility = data.responsibility ? data.responsibility : "-";
formData.isDeputy = data.isDeputy ? "ใช่" : "-"; formData.isDeputy = data.isDeputy ? "ใช่" : "-";
formData.isCommission = data.isCommission ? "ใช่" : "-"; formData.isCommission = data.isCommission ? "ใช่" : "-";
formData.rootCode = data.ROOT_CODE ? data.ROOT_CODE : "-";
formData.child1Code = data.CHILD1_CODE ? data.CHILD1_CODE : "-";
formData.child2Code = data.CHILD2_CODE ? data.CHILD2_CODE : "-";
formData.child3Code = data.CHILD3_CODE ? data.CHILD3_CODE : "-";
formData.child4Code = data.CHILD4_CODE ? data.CHILD4_CODE : "-";
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -208,6 +218,41 @@ watch(
</div> </div>
</div> </div>
<div class="row q-col-gutter-sm q-mb-xs">
<div class="col-4 text-bold">ROOT CODE</div>
<div class="col-8 text-grey-8">
<p>{{ formData.rootCode }}</p>
</div>
</div>
<div class="row q-col-gutter-sm q-mb-xs">
<div class="col-4 text-bold">CHILD1 CODE</div>
<div class="col-8 text-grey-8">
<p>{{ formData.child1Code }}</p>
</div>
</div>
<div class="row q-col-gutter-sm q-mb-xs">
<div class="col-4 text-bold">CHILD2 CODE</div>
<div class="col-8 text-grey-8">
<p>{{ formData.child2Code }}</p>
</div>
</div>
<div class="row q-col-gutter-sm q-mb-xs">
<div class="col-4 text-bold">CHILD3 CODE</div>
<div class="col-8 text-grey-8">
<p>{{ formData.child3Code }}</p>
</div>
</div>
<div class="row q-col-gutter-sm q-mb-xs">
<div class="col-4 text-bold">CHILD4 CODE</div>
<div class="col-8 text-grey-8">
<p>{{ formData.child4Code }}</p>
</div>
</div>
<div class="row q-col-gutter-sm q-mb-xs"> <div class="row q-col-gutter-sm q-mb-xs">
<div class="col-4 text-bold">หนาทความรบผดชอบ</div> <div class="col-4 text-bold">หนาทความรบผดชอบ</div>
<div class="col-8 text-grey-8"> <div class="col-8 text-grey-8">

View file

@ -9,6 +9,7 @@ import { checkPermission } from "@/utils/permissions";
import { updateCurrentPage } from "@/utils/function"; import { updateCurrentPage } from "@/utils/function";
import { useOrganizational } from "@/modules/02_organization/store/organizational"; import { useOrganizational } from "@/modules/02_organization/store/organizational";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { formatPosmasterNo } from "@/utils/function";
/** importType*/ /** importType*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -205,6 +206,14 @@ const columns = ref<QTableProps["columns"]>([
sortable: false, sortable: false,
field: "posMasterNo", field: "posMasterNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
format(val, row) {
return formatPosmasterNo(
row.orgShortname,
row.posMasterNoPrefix,
row.posMasterNoMain,
row.posMasterNoSuffix
);
},
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
@ -1124,7 +1133,7 @@ watch(
<DialogMovePos <DialogMovePos
v-model:modal="modalDialogMMove" v-model:modal="modalDialogMMove"
v-model:nodeTree="nodeTree" v-model:nodeTree="nodeTree"
v-model:columns="columns as QTableProps[]" v-model:columns="columns"
v-model:rows="posMaster" v-model:rows="posMaster"
v-model:totalPage="totalPage" v-model:totalPage="totalPage"
v-model:reqMaster="reqMaster" v-model:reqMaster="reqMaster"

View file

@ -44,6 +44,11 @@ interface FormDataAgency {
DIVISION_CODE: string; DIVISION_CODE: string;
SECTION_CODE: string; SECTION_CODE: string;
JOB_CODE: string; JOB_CODE: string;
ROOT_CODE: string;
CHILD1_CODE: string;
CHILD2_CODE: string;
CHILD3_CODE: string;
CHILD4_CODE: string;
} }
interface FormDataPosition { interface FormDataPosition {

View file

@ -108,6 +108,11 @@ export const useOrganizational = defineStore("organizationalStore", () => {
posLevelName: e.isSit ? e.profilePoslevel : e.posLevelName, posLevelName: e.isSit ? e.profilePoslevel : e.posLevelName,
posExecutiveName: e.posExecutiveName, posExecutiveName: e.posExecutiveName,
isSit: e.isSit, isSit: e.isSit,
orgShortname: e.orgShortname,
posMasterNoPrefix: e.posMasterNoPrefix,
posMasterNoSuffix: e.posMasterNoSuffix,
posMasterNoMain: e.posMasterNo,
})); }));
return newPosMaster || []; return newPosMaster || [];

View file

@ -56,6 +56,7 @@ const optionsStatus = ref<ExamResultOption[]>([
{ label: "ขาดสอบ", value: "missed_exam" }, { label: "ขาดสอบ", value: "missed_exam" },
{ label: "ผ่าน", value: "pass" }, { label: "ผ่าน", value: "pass" },
{ label: "ไม่ผ่าน", value: "notpass" }, { label: "ไม่ผ่าน", value: "notpass" },
{ label: "อื่น ๆ", value: "other" },
]); ]);
const emit = defineEmits([ const emit = defineEmits([

View file

@ -363,37 +363,59 @@ async function downloadFileDashboard() {
} }
async function clickPassExam() { async function clickPassExam() {
try {
showLoader(); showLoader();
await http const res = await http.get(
.get(config.API.downloadPassExam(examId.value)) config.API.downloadCandidatePassExam(examId.value),
.then(async (res) => { {
const data = res.data.result; headers: {
data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; "Content-Type": "application/pdf",
await genReport(data, data.reportName, "pdf"); Accept: "application/pdf",
}) },
.catch((e) => { responseType: "blob",
messageError($q, e); }
}) );
.finally(() => { const url = window.URL.createObjectURL(new Blob([res.data]));
const link = document.createElement("a");
link.href = url;
link.setAttribute(
"download",
`Candidate_Dashboard_${dateToISO(new Date())}` + ".pdf"
);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
} catch (error) {
messageError($q, error);
} finally {
hideLoader(); hideLoader();
}); }
} }
async function clickCandidateList() { async function clickCandidateList() {
try {
showLoader(); showLoader();
await http const res = await http.get(config.API.downloadCandidateExam(examId.value), {
.get(config.API.downloadCandidateExam(examId.value)) headers: {
.then(async (res) => { "Content-Type": "application/pdf",
const data = res.data.result; Accept: "application/pdf",
data.reportName = `Candidate_Dashboard_${dateToISO(new Date())}`; },
await genReport(data, data.reportName, "pdf"); responseType: "blob",
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
}); });
const url = window.URL.createObjectURL(new Blob([res.data]));
const link = document.createElement("a");
link.href = url;
link.setAttribute("download", "รายชื่อผู้มีสิทธิ์สอบ" + ".pdf");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(url);
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
} }
async function onCheckShowExaminfo() { async function onCheckShowExaminfo() {
@ -549,8 +571,20 @@ watch(
</q-btn> </q-btn>
</div> </div>
<div> <div>
<q-btn icon="mdi-download" round color="green-6" flat> <q-btn
<q-tooltip>ดาวนโหลดไฟล</q-tooltip> icon="mdi-download"
round
color="green-6"
flat
:disable="attrs.rows.length === 0"
>
<q-tooltip>
{{
attrs.rows.length !== 0
? "ดาวน์โหลดไฟล์"
: "ไม่มีข้อมูลผู้สอบคัดเลือก"
}}</q-tooltip
>
<q-menu> <q-menu>
<q-list style="min-width: 100px"> <q-list style="min-width: 100px">
<!-- <q-item clickable v-close-popup @click="downloadFileDashboard"> <!-- <q-item clickable v-close-popup @click="downloadFileDashboard">

View file

@ -45,6 +45,8 @@ interface RequestPeriodCompete {
order: number; order: number;
year: number; year: number;
announcementDate: string | null; announcementDate: string | null;
rootDnaId: string;
scoreExpireDate: string | null;
} }
interface RequestPeriodDisable { interface RequestPeriodDisable {
@ -63,6 +65,8 @@ interface RequestPeriodDisable {
round: number; round: number;
year: number; year: number;
announcementDate: string | null; announcementDate: string | null;
rootDnaId: string;
scoreExpireDate: string | null;
} }
interface RequestPosition { interface RequestPosition {

View file

@ -232,7 +232,7 @@ export default [
component: PeriodDisable, component: PeriodDisable,
meta: { meta: {
Auth: true, Auth: true,
Key: "SYS_EXAM_SELECT_LISTNAME", Key: "SYS_EXAM_SELECT_PERIOD_DIS",
Role: "STAFF", Role: "STAFF",
}, },
}, },
@ -242,7 +242,7 @@ export default [
component: PeriodDisableAdd, component: PeriodDisableAdd,
meta: { meta: {
Auth: true, Auth: true,
Key: "SYS_EXAM_SELECT_LISTNAME", Key: "SYS_EXAM_SELECT_PERIOD_DIS",
Role: "STAFF", Role: "STAFF",
}, },
}, },
@ -252,7 +252,7 @@ export default [
component: PeriodDisableAdd, component: PeriodDisableAdd,
meta: { meta: {
Auth: true, Auth: true,
Key: "SYS_EXAM_SELECT_LISTNAME", Key: "SYS_EXAM_SELECT_PERIOD_DIS",
Role: "STAFF", Role: "STAFF",
}, },
}, },
@ -262,7 +262,7 @@ export default [
component: MainDisableDetail, component: MainDisableDetail,
meta: { meta: {
Auth: true, Auth: true,
Key: "SYS_EXAM_SELECT_LISTNAME", Key: "SYS_EXAM_SELECT_PERIOD_DIS",
Role: "STAFF", Role: "STAFF",
}, },
}, },
@ -272,7 +272,7 @@ export default [
component: MainDisableEx, component: MainDisableEx,
meta: { meta: {
Auth: true, Auth: true,
Key: "SYS_EXAM_SELECT_LISTNAME", Key: "SYS_EXAM_SELECT_PERIOD_DIS",
Role: "STAFF", Role: "STAFF",
}, },
}, },

View file

@ -1,7 +1,7 @@
<!-- page:ดการรอบการสอบ สรรหา --> <!-- page:ดการรอบการสอบ สรรหา -->
<script setup lang="ts"> <script setup lang="ts">
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { onMounted, ref } from "vue"; import { onMounted, ref, watch } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import genReport from "@/plugins/genreport"; import genReport from "@/plugins/genreport";
@ -11,6 +11,9 @@ import config from "@/app.config";
import { checkPermission } from "@/utils/permissions"; import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function"; import { calculateFiscalYear } from "@/utils/function";
import { useUploadProgressStore } from "@/stores/uploadProgress";
import { useSocketStore } from "@/stores/socket";
import { storeToRefs } from "pinia";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main"; import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import type { import type {
@ -33,9 +36,14 @@ const {
messageError, messageError,
onSearchDataTable, onSearchDataTable,
dialogRemove, dialogRemove,
dialogMessage,
} = mixin; } = mixin;
const router = useRouter(); const router = useRouter();
const uploadProgress = useUploadProgressStore();
const socketStore = useSocketStore();
const { notificationCounter } = storeToRefs(socketStore);
const name = ref<string>(""); const name = ref<string>("");
const year = ref<number>(calculateFiscalYear(new Date()) + 543); const year = ref<number>(calculateFiscalYear(new Date()) + 543);
const order = ref<number>(1); const order = ref<number>(1);
@ -49,6 +57,11 @@ const modalScore = ref<boolean>(false);
const modalCandidate = ref<boolean>(false); const modalCandidate = ref<boolean>(false);
const modalResult = ref<boolean>(false); const modalResult = ref<boolean>(false);
const selected_row_id = ref<string>(""); const selected_row_id = ref<string>("");
const jobStatus = ref<{
candidate?: "running" | "completed" | "failed";
score?: "running" | "completed" | "failed";
result?: "running" | "completed" | "failed";
}>({});
const rowsHistory = ref<ResponseHistoryObject[]>([]); //select data history const rowsHistory = ref<ResponseHistoryObject[]>([]); //select data history
const tittleHistory = ref<string>("ประวัติการนำเข้าข้อมูล"); // const tittleHistory = ref<string>("ประวัติการนำเข้าข้อมูล"); //
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
@ -62,6 +75,54 @@ const textTittle = ref<string>("");
const textTittleScore = ref<string>(""); const textTittleScore = ref<string>("");
const textTittleCandidate = ref<string>(""); const textTittleCandidate = ref<string>("");
const textTittleResult = ref<string>(""); const textTittleResult = ref<string>("");
// Dialog message constants
const UPLOAD_RUNNING_DIALOG = {
title: "ไม่สามารถอัปโหลดไฟล์ได้",
message: "อยู่ระหว่างนำเข้าข้อมูล ระบบจะแจ้งผลให้ทราบทันทีเมื่อเสร็จสิ้น",
icon: "mdi-progress-alert",
btnLabel: "ตกลง",
color: "primary",
};
const UPLOAD_SUCCESS_DIALOG = {
title: "อัปโหลดไฟล์สำเร็จ",
message:
"ระบบกำลังนำเข้าข้อมูลคุณสามารถใช้งานเมนูอื่นในระหว่างนี้ได้ โดยระบบจะแจ้งผลการดำเนินการให้ทราบทันทีเมื่อเสร็จสิ้น",
icon: "check",
btnLabel: "ตกลง",
color: "primary",
};
// Function to show upload running dialog
function showUploadRunningDialog() {
dialogMessage(
$q,
UPLOAD_RUNNING_DIALOG.title,
UPLOAD_RUNNING_DIALOG.message,
UPLOAD_RUNNING_DIALOG.icon,
UPLOAD_RUNNING_DIALOG.btnLabel,
UPLOAD_RUNNING_DIALOG.color,
undefined,
undefined,
true
);
}
// Function to show upload success dialog
function showUploadSuccessDialog() {
dialogMessage(
$q,
UPLOAD_SUCCESS_DIALOG.title,
UPLOAD_SUCCESS_DIALOG.message,
UPLOAD_SUCCESS_DIALOG.icon,
UPLOAD_SUCCESS_DIALOG.btnLabel,
UPLOAD_SUCCESS_DIALOG.color,
undefined,
undefined,
true
);
}
const rows = ref<ResponseRecruitPeriod[]>([]); const rows = ref<ResponseRecruitPeriod[]>([]);
const rowsData = ref<ResponseRecruitPeriod[]>([]); const rowsData = ref<ResponseRecruitPeriod[]>([]);
const initialPagination = ref<Pagination>({ const initialPagination = ref<Pagination>({
@ -335,9 +396,15 @@ function clickDetail(id: string) {
* @param id รอบสอบเเขงข * @param id รอบสอบเเขงข
*/ */
async function clickUpload(id: string) { async function clickUpload(id: string) {
selected_row_id.value = id;
const isRunning = await checkJobStatus(id, "candidate");
if (isRunning) {
showUploadRunningDialog();
} else {
modalCandidate.value = true; modalCandidate.value = true;
textTittleCandidate.value = "นำเข้าผู้สมัครสอบแข่งขัน"; textTittleCandidate.value = "นำเข้าผู้สมัครสอบแข่งขัน";
selected_row_id.value = id; }
} }
/** /**
@ -345,9 +412,15 @@ async function clickUpload(id: string) {
* @param id รอบสอบเเขงข * @param id รอบสอบเเขงข
*/ */
async function clickEdit(id: string) { async function clickEdit(id: string) {
selected_row_id.value = id;
const isRunning = await checkJobStatus(id, "score");
if (isRunning) {
showUploadRunningDialog();
} else {
modalScore.value = true; modalScore.value = true;
textTittleScore.value = "นำเข้าบัญชีรวมคะแนน"; textTittleScore.value = "นำเข้าบัญชีรวมคะแนน";
selected_row_id.value = id; }
} }
/** /**
@ -355,9 +428,57 @@ async function clickEdit(id: string) {
* @param id รอบสอบเเขงข * @param id รอบสอบเเขงข
*/ */
async function clickResult(id: string) { async function clickResult(id: string) {
selected_row_id.value = id;
const isRunning = await checkJobStatus(id, "result");
if (isRunning) {
showUploadRunningDialog();
} else {
modalResult.value = true; modalResult.value = true;
textTittleResult.value = "นำเข้าไฟล์ผลการสอบ"; textTittleResult.value = "นำเข้าไฟล์ผลการสอบ";
selected_row_id.value = id; }
}
/**
* ตรวจสอบสถานะการนำเขาขอม
* @param id รอบสอบเเขงข
* @param type ประเภทไฟลองการตรวจสอบ
* @return true ากำล running, false าไม job หร job เสรจแล
*/
async function checkJobStatus(
id: string,
type: "candidate" | "score" | "result"
): Promise<boolean> {
const uploads = uploadProgress.pendingUploads.filter(
(u) => u.periodId === id && u.type === type
);
let hasRunningJob = false;
for (const upload of uploads) {
try {
const res = await http.get(config.API.getImportStatus(upload.jobId));
const status = res.data.result.status.toLowerCase(); // 'running', 'completed', 'failed'
if (status === "completed" || status === "failed") {
status === "completed" && fetchData();
uploadProgress.removeUpload(upload.jobId);
} else if (status === "running") {
jobStatus.value[type] = "running";
hasRunningJob = true;
}
} catch (e) {
// if error, remove from pending
uploadProgress.removeUpload(upload.jobId);
}
}
// if no running jobs, clear status
if (!uploadProgress.isUploading(id, type)) {
jobStatus.value[type] = undefined;
}
return hasRunningJob;
} }
/** /**
@ -463,11 +584,13 @@ async function checkSaveCandidate() {
await http await http
.post(config.API.uploadCandidates(selected_row_id.value), fd) .post(config.API.uploadCandidates(selected_row_id.value), fd)
.then((res) => { .then((res) => {
success($q, "นำเข้าข้อมูลผู้สมัครสอบสำเร็จ"); const jobId = res.data.result.jobId;
uploadProgress.addUpload(jobId, selected_row_id.value, "candidate");
success($q, UPLOAD_SUCCESS_DIALOG.message);
modalCandidate.value = false; modalCandidate.value = false;
files_candidate.value = null; files_candidate.value = null;
selected_row_id.value = ""; selected_row_id.value = "";
fetchData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -477,7 +600,7 @@ async function checkSaveCandidate() {
}); });
} }
/** บันทึด คะเนน */ /** บันทึด คะเนน */
async function checkSaveScore() { async function checkSaveScore() {
const fd = new FormData(); const fd = new FormData();
fd.append("attachment", files_score.value[0]); fd.append("attachment", files_score.value[0]);
@ -485,11 +608,12 @@ async function checkSaveScore() {
await http await http
.post(config.API.saveScores(selected_row_id.value), fd) .post(config.API.saveScores(selected_row_id.value), fd)
.then((res) => { .then((res) => {
success($q, "นำเข้าข้อมูลผลคะแนนสอบสำเร็จ"); const jobId = res.data.result.jobId;
uploadProgress.addUpload(jobId, selected_row_id.value, "score");
success($q, UPLOAD_SUCCESS_DIALOG.message);
modalScore.value = false; modalScore.value = false;
files_score.value = null; files_score.value = null;
selected_row_id.value = ""; selected_row_id.value = "";
fetchData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -507,11 +631,12 @@ async function checkSaveResult() {
await http await http
.post(config.API.uploadResult(selected_row_id.value), fd) .post(config.API.uploadResult(selected_row_id.value), fd)
.then((res) => { .then((res) => {
success($q, "นำเข้าข้อมูลผลการสอบแข่งขันฯ (บัญชีรายชื่อ)"); const jobId = res.data.result.jobId;
uploadProgress.addUpload(jobId, selected_row_id.value, "result");
success($q, UPLOAD_SUCCESS_DIALOG.message);
modalResult.value = false; modalResult.value = false;
files_result.value = null; files_result.value = null;
selected_row_id.value = ""; selected_row_id.value = "";
fetchData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -532,6 +657,9 @@ async function checkSave() {
await http await http
.post(config.API.saveCandidates, fd) .post(config.API.saveCandidates, fd)
.then((res) => { .then((res) => {
const jobId = res.data.result.jobId;
uploadProgress.addUpload(jobId, selected_row_id.value, "period");
success($q, "นำเข้าข้อมูลผู้สมัครสอบแข่งขันสำเร็จ"); success($q, "นำเข้าข้อมูลผู้สมัครสอบแข่งขันสำเร็จ");
modalAdd.value = false; modalAdd.value = false;
fetchData(); fetchData();
@ -557,12 +685,18 @@ onMounted(async () => {
hideLoader(); hideLoader();
await fetchData(); await fetchData();
}); });
/** Watch notification counter on socket */
watch(notificationCounter, () => {
fetchData();
});
</script> </script>
<template> <template>
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
ดการรอบสอบแขงข ดการรอบสอบแขงข
</div> </div>
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md"> <q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<div> <div>
<Table <Table
@ -669,16 +803,16 @@ onMounted(async () => {
</div> </div>
<div v-else-if="col.name == 'examCount'" class="table_ellipsis2"> <div v-else-if="col.name == 'examCount'" class="table_ellipsis2">
<q-btn <q-btn
v-if="
(col.value == null || col.value == '0') &&
checkPermission($route)?.attrIsUpdate
"
flat flat
dense dense
size="12px" size="12px"
color="green" color="green"
round round
@click.stop.prevent="clickUpload(props.row.id)" @click.stop.prevent="clickUpload(props.row.id)"
v-if="
(col.value == null || col.value == '0') &&
checkPermission($route)?.attrIsUpdate
"
> >
<q-icon name="mdi-file-excel-outline" size="20px" /> <q-icon name="mdi-file-excel-outline" size="20px" />
<q-tooltip>นำเขาไฟลสมครสอบ</q-tooltip> <q-tooltip>นำเขาไฟลสมครสอบ</q-tooltip>
@ -715,6 +849,9 @@ onMounted(async () => {
</div> </div>
<div v-else-if="col.name == 'scoreCount'" class="table_ellipsis2"> <div v-else-if="col.name == 'scoreCount'" class="table_ellipsis2">
<q-btn <q-btn
v-if="
col.value == null && checkPermission($route)?.attrIsUpdate
"
:disable="props.row.examCount == 0" :disable="props.row.examCount == 0"
flat flat
dense dense
@ -722,9 +859,6 @@ onMounted(async () => {
round round
color="green" color="green"
@click.stop.prevent="clickEdit(props.row.id)" @click.stop.prevent="clickEdit(props.row.id)"
v-if="
col.value == null && checkPermission($route)?.attrIsUpdate
"
> >
<q-icon name="mdi-file-excel-outline" size="20px" /> <q-icon name="mdi-file-excel-outline" size="20px" />
<!-- นำเขาไฟลผลคะแนนสอบ --> <!-- นำเขาไฟลผลคะแนนสอบ -->
@ -751,6 +885,11 @@ onMounted(async () => {
<div v-else-if="col.name == 'result'" class="table_ellipsis2"> <div v-else-if="col.name == 'result'" class="table_ellipsis2">
<q-btn <q-btn
v-if="
(props.row.score == null ||
props.row.score.resultCount == 0) &&
checkPermission($route)?.attrIsUpdate
"
:disable="props.row.score == null" :disable="props.row.score == null"
flat flat
dense dense
@ -758,11 +897,6 @@ onMounted(async () => {
color="green" color="green"
round round
@click.stop.prevent="clickResult(props.row.id)" @click.stop.prevent="clickResult(props.row.id)"
v-if="
(props.row.score == null ||
props.row.score.resultCount == 0) &&
checkPermission($route)?.attrIsUpdate
"
> >
<q-icon name="mdi-file-excel-outline" size="20px" /> <q-icon name="mdi-file-excel-outline" size="20px" />
<q-tooltip>นำเขาไฟลผลการสอบ (ญชรายช)</q-tooltip> <q-tooltip>นำเขาไฟลผลการสอบ (ญชรายช)</q-tooltip>
@ -921,12 +1055,12 @@ onMounted(async () => {
<q-dialog v-model="modalCandidate" persistent> <q-dialog v-model="modalCandidate" persistent>
<q-card style="width: 600px"> <q-card style="width: 600px">
<q-form ref="myFormScore">
<DialogHeadTemplate <DialogHeadTemplate
:title="textTittleCandidate" :title="textTittleCandidate"
:close="clickCloseCandidate" :close="clickCloseCandidate"
title-type="ข้อมูลผู้สมัครสอบ" title-type="ข้อมูลผู้สมัครสอบ"
/> />
<q-form ref="myFormScore">
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="col-12 row items-center q-col-gutter-sm"> <div class="col-12 row items-center q-col-gutter-sm">
@ -965,12 +1099,12 @@ onMounted(async () => {
<q-dialog v-model="modalScore" persistent> <q-dialog v-model="modalScore" persistent>
<q-card style="width: 600px"> <q-card style="width: 600px">
<q-form ref="myFormScore">
<DialogHeadTemplate <DialogHeadTemplate
:title="textTittleScore" :title="textTittleScore"
:close="clickCloseScore" :close="clickCloseScore"
title-type="บัญชีรวมคะแนน" title-type="บัญชีรวมคะแนน"
/> />
<q-form ref="myFormScore">
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="col-12 row items-center q-col-gutter-sm"> <div class="col-12 row items-center q-col-gutter-sm">
@ -1009,12 +1143,12 @@ onMounted(async () => {
<q-dialog v-model="modalResult" persistent> <q-dialog v-model="modalResult" persistent>
<q-card style="width: 600px"> <q-card style="width: 600px">
<q-form ref="myFormScore">
<DialogHeadTemplate <DialogHeadTemplate
:title="textTittleResult" :title="textTittleResult"
:close="clickCloseResult" :close="clickCloseResult"
title-type="ผลการสอบ (บัญชีรายชื่อ)" title-type="ผลการสอบ (บัญชีรายชื่อ)"
/> />
<q-form ref="myFormScore">
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<div class="col-12 row items-center q-col-gutter-sm"> <div class="col-12 row items-center q-col-gutter-sm">

View file

@ -2,11 +2,13 @@
import { onMounted, ref, watch, computed } from "vue"; import { onMounted, ref, watch, computed } from "vue";
import { useQuasar, QForm } from "quasar"; import { useQuasar, QForm } from "quasar";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { storeToRefs } from "pinia";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function"; import { calculateFiscalYear } from "@/utils/function";
import { usePositionKeycloakStore } from "@/stores/positionKeycloak";
import type { RequestPeriodCompete } from "@/modules/03_recruiting/interface/request/Period"; import type { RequestPeriodCompete } from "@/modules/03_recruiting/interface/request/Period";
import type { import type {
@ -16,6 +18,7 @@ import type {
const $q = useQuasar(); // show dialog const $q = useQuasar(); // show dialog
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { dataPositionKeycloak } = storeToRefs(usePositionKeycloakStore());
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const { const {
@ -53,6 +56,7 @@ const fileImgDataUpload = ref<File[]>([]);
const fileImgs = ref<UploadType[]>([]); const fileImgs = ref<UploadType[]>([]);
const id = ref<string>(""); const id = ref<string>("");
const edit = ref<boolean>(false); const edit = ref<boolean>(false);
const scoreExpireDate = ref<Date | null>(null); //
/** กลับไปหน้าหลัก */ /** กลับไปหน้าหลัก */
function clickBack() { function clickBack() {
@ -98,6 +102,7 @@ async function fetchData() {
fileDocs.value = files; fileDocs.value = files;
fileImgs.value = images; fileImgs.value = images;
scoreExpireDate.value = data.scoreExpireDate;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -253,6 +258,11 @@ function sendData() {
year: yearly.value, year: yearly.value,
announcementDate: announcementDate:
dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null, dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null,
scoreExpireDate:
scoreExpireDate.value !== null
? convertDateToAPI(scoreExpireDate.value)
: null,
rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined,
}; };
return valueData; return valueData;
} }
@ -355,6 +365,13 @@ function dateThaiRange(val: [Date, Date]) {
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`; return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
} }
} }
function onUpdateScoreExpireDate(val: Date | null) {
if (val) {
const newDate = new Date(val);
newDate.setFullYear(newDate.getFullYear() + 2);
scoreExpireDate.value = newDate;
}
}
watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => { watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => {
organizationNameOptions.value = []; organizationNameOptions.value = [];
@ -451,6 +468,7 @@ onMounted(async () => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-xs-12 col-sm-4 col-md-2" v-if="announcementExam"> <div class="col-xs-12 col-sm-4 col-md-2" v-if="announcementExam">
<q-input <q-input
outlined outlined
@ -466,6 +484,7 @@ onMounted(async () => {
input-class="text-right" input-class="text-right"
></q-input> ></q-input>
</div> </div>
<div class="col-xs-12 col-sm-4 col-md-3" v-if="announcementExam"> <div class="col-xs-12 col-sm-4 col-md-3" v-if="announcementExam">
<datepicker <datepicker
v-model="dateExam" v-model="dateExam"
@ -501,6 +520,7 @@ onMounted(async () => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-xs-12 col-sm-3 col-md-3"> <div class="col-xs-12 col-sm-3 col-md-3">
<datepicker <datepicker
v-model="dateAnnouncement" v-model="dateAnnouncement"
@ -543,6 +563,7 @@ onMounted(async () => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam"> <div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker <datepicker
v-model="dateRegister" v-model="dateRegister"
@ -568,6 +589,7 @@ onMounted(async () => {
dateRegister != null ? dateThaiRange(dateRegister) : null dateRegister != null ? dateThaiRange(dateRegister) : null
" "
:label="`${'วันที่สมัคร'}`" :label="`${'วันที่สมัคร'}`"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -581,6 +603,7 @@ onMounted(async () => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div <div
class="col-xs-12 col-sm-3 col-md-3" class="col-xs-12 col-sm-3 col-md-3"
v-if="announcementExam && isFeeNotZero" v-if="announcementExam && isFeeNotZero"
@ -610,6 +633,7 @@ onMounted(async () => {
" "
:label="`${'วันที่ชำระเงิน'}`" :label="`${'วันที่ชำระเงิน'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -632,6 +656,7 @@ onMounted(async () => {
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
@update:model-value="onUpdateScoreExpireDate"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -649,6 +674,48 @@ onMounted(async () => {
" "
:label="`${'วันประกาศผลสอบ'}`" :label="`${'วันประกาศผลสอบ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker
v-model="scoreExpireDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="full-width datepicker q-mb-md"
:model-value="
scoreExpireDate != null ? date2Thai(scoreExpireDate) : null
"
:label="`${'วันหมดอายุบัญชี'}`"
clearable
@clear="scoreExpireDate = null"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon

View file

@ -309,8 +309,8 @@ async function fetchData(actionType?: string) {
if (data.length > 0) { if (data.length > 0) {
data.map((r: ResponseRecruitPeriod) => { data.map((r: ResponseRecruitPeriod) => {
if (r.score != null) { if (r.score != null) {
r.scoreCount = r.score.scoreCount; r.scoreCount = r.score.scoreCount ? r.score.scoreCount : 0;
r.scoreImportDate = r.score.importDate; r.scoreImportDate = r.score.importDate ? r.score.importDate : "-";
} }
result.push(r); result.push(r);
}); });
@ -715,7 +715,11 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลผลคะแนนสอบ</q-tooltip> <q-tooltip>นำเขาไฟลผลคะแนนสอบ</q-tooltip>
</q-btn> </q-btn>
<div v-else> <div v-else>
{{ props.row.score.scoreCount.toLocaleString() }} {{
props.row.score
? props.row.score.scoreCount.toLocaleString()
: "-"
}}
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsUpdate" v-if="checkPermission($route)?.attrIsUpdate"
dense dense
@ -750,7 +754,11 @@ onMounted(async () => {
<q-tooltip>นำเขาไฟลผลการสอบ (ญชรายช)</q-tooltip> <q-tooltip>นำเขาไฟลผลการสอบ (ญชรายช)</q-tooltip>
</q-btn> </q-btn>
<div v-else> <div v-else>
{{ props.row.score.resultCount.toLocaleString() }} {{
props.row.score
? props.row.score.resultCount.toLocaleString()
: "-"
}}
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsUpdate" v-if="checkPermission($route)?.attrIsUpdate"
dense dense

View file

@ -3,11 +3,13 @@
import { onMounted, ref, watch } from "vue"; import { onMounted, ref, watch } from "vue";
import { useQuasar, QForm } from "quasar"; import { useQuasar, QForm } from "quasar";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { storeToRefs } from "pinia";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { calculateFiscalYear } from "@/utils/function"; import { calculateFiscalYear } from "@/utils/function";
import { usePositionKeycloakStore } from "@/stores/positionKeycloak";
import type { RequestPeriodDisable } from "@/modules/03_recruiting/interface/request/Period"; import type { RequestPeriodDisable } from "@/modules/03_recruiting/interface/request/Period";
import type { import type {
@ -17,6 +19,7 @@ import type {
const $q = useQuasar(); // show dialog const $q = useQuasar(); // show dialog
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { dataPositionKeycloak } = storeToRefs(usePositionKeycloakStore());
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const { const {
@ -44,7 +47,7 @@ const positionPathOptions = ref<DataOption2[]>([]);
const organizationShortName = ref<DataOption2>({ id: "", name: "" }); const organizationShortName = ref<DataOption2>({ id: "", name: "" });
const organizationName = ref<DataOption2>({ id: "", name: "" }); const organizationName = ref<DataOption2>({ id: "", name: "" });
const organizationNameOptions = ref<DataOption2[]>([]); const organizationNameOptions = ref<DataOption2[]>([]);
const scoreExpireDate = ref<Date | null>(null); //
const fileDocDataUpload = ref<File[]>([]); const fileDocDataUpload = ref<File[]>([]);
const fileDocs = ref<UploadType[]>([]); const fileDocs = ref<UploadType[]>([]);
const fileImgDataUpload = ref<File[]>([]); const fileImgDataUpload = ref<File[]>([]);
@ -90,6 +93,7 @@ async function fetchData() {
data.announcementDate != null ? new Date(data.announcementDate) : null; data.announcementDate != null ? new Date(data.announcementDate) : null;
fileDocs.value = data.documents; fileDocs.value = data.documents;
fileImgs.value = data.images; fileImgs.value = data.images;
scoreExpireDate.value = data.scoreExpireDate;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -159,6 +163,11 @@ function sendData() {
year: yearly.value, year: yearly.value,
announcementDate: announcementDate:
dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null, dateAnnounce.value !== null ? convertDateToAPI(dateAnnounce.value) : null,
rootDnaId: !edit.value ? dataPositionKeycloak.value.rootDnaId : undefined,
scoreExpireDate:
scoreExpireDate.value !== null
? convertDateToAPI(scoreExpireDate.value)
: null,
}; };
return valueData; return valueData;
} }
@ -348,6 +357,14 @@ function dateThaiRange(val: [Date, Date] | null) {
} }
} }
function onUpdateScoreExpireDate(val: Date | null) {
if (val) {
const newDate = new Date(val);
newDate.setFullYear(newDate.getFullYear() + 2);
scoreExpireDate.value = newDate;
}
}
watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => { watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => {
organizationNameOptions.value = []; organizationNameOptions.value = [];
}); });
@ -386,7 +403,7 @@ onMounted(async () => {
<q-form ref="myForm"> <q-form ref="myForm">
<q-card-section class="q-pa-md"> <q-card-section class="q-pa-md">
<div class="col-xs-12 col-sm-8"></div> <div class="col-xs-12 col-sm-8"></div>
<div class="col-12 row items-center q-col-gutter-x-sm"> <div class="col-12 row q-col-gutter-sm">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
outlined outlined
@ -398,8 +415,10 @@ onMounted(async () => {
(val:string) => (val:string) =>
!!val || `${'กรุณากรอกชื่อรอบคัดเลือก/ชื่อประกาศ'}`, !!val || `${'กรุณากรอกชื่อรอบคัดเลือก/ชื่อประกาศ'}`,
]" ]"
hide-bottom-space
></q-input> ></q-input>
</div> </div>
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam"> <div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
<q-input <q-input
outlined outlined
@ -409,8 +428,10 @@ onMounted(async () => {
dense dense
lazy-rules lazy-rules
:rules="[(val:number) => val > 0 || `${'กรุณากรอกรอบการสอบให้ถูกต้อง'}`]" :rules="[(val:number) => val > 0 || `${'กรุณากรอกรอบการสอบให้ถูกต้อง'}`]"
hide-bottom-space
></q-input> ></q-input>
</div> </div>
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam"> <div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
<datepicker <datepicker
v-model="yearly" v-model="yearly"
@ -431,6 +452,7 @@ onMounted(async () => {
:model-value="yearly + 543" :model-value="yearly + 543"
:rules="[(val:string) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
:label="`${'ปีงบประมาณ'}`" :label="`${'ปีงบประมาณ'}`"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -456,6 +478,7 @@ onMounted(async () => {
:rules="[ :rules="[
(val:any) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`, (val:any) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`,
]" ]"
hide-bottom-space
></q-input> ></q-input>
</div> </div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam"> <div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
@ -480,6 +503,7 @@ onMounted(async () => {
:model-value="dateExam != null ? date2Thai(dateExam) : null" :model-value="dateExam != null ? date2Thai(dateExam) : null"
:label="`${'วันที่สอบ'}`" :label="`${'วันที่สอบ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สอบ'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สอบ'}`]"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -513,10 +537,11 @@ onMounted(async () => {
<q-input <q-input
outlined outlined
dense dense
class="full-width datepicker q-mb-md" class="full-width datepicker"
:model-value="dateThaiRange(dateAnnouncement)" :model-value="dateThaiRange(dateAnnouncement)"
:label="`${'วันที่ประกาศ'}`" :label="`${'วันที่ประกาศ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ประกาศ'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ประกาศ'}`]"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -550,10 +575,11 @@ onMounted(async () => {
<q-input <q-input
outlined outlined
dense dense
class="full-width datepicker q-mb-md" class="full-width datepicker"
:model-value="dateThaiRange(dateRegister)" :model-value="dateThaiRange(dateRegister)"
:label="`${'วันที่สมัคร'}`" :label="`${'วันที่สมัคร'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สมัคร'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่สมัคร'}`]"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -590,12 +616,13 @@ onMounted(async () => {
<q-input <q-input
outlined outlined
dense dense
class="full-width datepicker q-mb-md" class="full-width datepicker"
:model-value=" :model-value="
datePayment != null ? dateThaiRange(datePayment) : null datePayment != null ? dateThaiRange(datePayment) : null
" "
:label="`${'วันที่ชำระเงิน'}`" :label="`${'วันที่ชำระเงิน'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันที่ชำระเงิน'}`]"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -618,6 +645,7 @@ onMounted(async () => {
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
@update:model-value="onUpdateScoreExpireDate"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -629,12 +657,54 @@ onMounted(async () => {
<q-input <q-input
outlined outlined
dense dense
class="full-width datepicker q-mb-md" class="full-width datepicker"
:model-value=" :model-value="
dateAnnounce != null ? date2Thai(dateAnnounce) : null dateAnnounce != null ? date2Thai(dateAnnounce) : null
" "
:label="`${'วันประกาศผลสอบ'}`" :label="`${'วันประกาศผลสอบ'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวันประกาศผลสอบ'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker
v-model="scoreExpireDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="full-width datepicker"
:model-value="
scoreExpireDate != null ? date2Thai(scoreExpireDate) : null
"
:label="`${'วันหมดอายุบัญชี'}`"
clearable
@clear="scoreExpireDate = null"
hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon

View file

@ -93,6 +93,7 @@ const examTypeOptions = [
{ name: "แพทย์", id: "docter" }, { name: "แพทย์", id: "docter" },
]; ];
const category = ref<string>(""); const category = ref<string>("");
const scoreExpireDate = ref<Date | null>(null);
const fileDocDataUpload = ref<File[]>([]); const fileDocDataUpload = ref<File[]>([]);
const fileDocs = ref<UploadType[]>([]); const fileDocs = ref<UploadType[]>([]);
@ -333,6 +334,7 @@ async function fetchData() {
refNo1.value = data.refNo1; refNo1.value = data.refNo1;
reason.value = data.reason; reason.value = data.reason;
graduationYearLock.value = data.graduationYearLock; graduationYearLock.value = data.graduationYearLock;
scoreExpireDate.value = data.scoreExpireDate;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -506,6 +508,10 @@ function sendData() {
refNo1: refNo1.value, refNo1: refNo1.value,
reason: reason.value, reason: reason.value,
graduationYearLock: Number(graduationYearLock.value), graduationYearLock: Number(graduationYearLock.value),
scoreExpireDate:
scoreExpireDate.value != null
? convertDateToAPI(scoreExpireDate.value)
: null,
}; };
return valueData; return valueData;
} }
@ -939,6 +945,14 @@ watch(
} }
); );
function onUpdateScoreExpireDate(val: Date | null) {
if (val) {
const newDate = new Date(val);
newDate.setFullYear(newDate.getFullYear() + 2);
scoreExpireDate.value = newDate;
}
}
onMounted(async () => { onMounted(async () => {
hideLoader(); hideLoader();
if (route.params.id != undefined) { if (route.params.id != undefined) {
@ -1242,6 +1256,7 @@ onMounted(async () => {
borderless borderless
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
@update:model-value="onUpdateScoreExpireDate"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -1275,8 +1290,51 @@ onMounted(async () => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="row col-12" v-if="announcementExam">
<div class="col-xs-12 col-md-2"> <div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
<datepicker
v-model="scoreExpireDate"
:locale="'th'"
autoApply
:readonly="checkRoutePermisson"
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
:readonly="checkRoutePermisson"
dense
class="full-width datepicker q-mb-md"
:model-value="
scoreExpireDate != null ? date2Thai(scoreExpireDate) : null
"
:label="`${'วันหมดอายุบัญชี'}`"
clearable
@clear="scoreExpireDate = null"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-12 col-sm-2 col-md-2" v-if="announcementExam">
<q-input <q-input
outlined outlined
v-model="graduationYearLock" v-model="graduationYearLock"
@ -1290,7 +1348,6 @@ onMounted(async () => {
type="number" type="number"
></q-input> ></q-input>
</div> </div>
</div>
<div class="col-12" v-if="announcementExam"> <div class="col-12" v-if="announcementExam">
<div class="col-12 q-mb-sm"> <div class="col-12 q-mb-sm">

View file

@ -16,9 +16,11 @@ import type {
DisciplineOps, DisciplineOps,
DataOption, DataOption,
} from "@/modules/04_registryPerson/interface/index/discipline"; } from "@/modules/04_registryPerson/interface/index/discipline";
import type { Discipline } from "@/modules/04_registryPerson/interface/response/Discipline";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue";
import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue";
const route = useRoute(); const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
@ -47,6 +49,9 @@ const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const isLeave = defineModel<boolean>("isLeave", { const isLeave = defineModel<boolean>("isLeave", {
required: true, required: true,
}); });
const citizenId = defineModel<string>("citizenId", {
required: true,
});
const baseColumns = ref<QTableColumn[]>([ const baseColumns = ref<QTableColumn[]>([
{ {
@ -152,8 +157,8 @@ const baseVisibleColumns = ref<string[]>([
"lastUpdatedAt", "lastUpdatedAt",
]); ]);
const rows = ref<RequestItemsObject[]>([]); // const rows = ref<Discipline[]>([]); //
const rowsMain = ref<RequestItemsObject[]>([]); // const rowsMain = ref<Discipline[]>([]); //
const mode = ref<string>("table"); // Table card const mode = ref<string>("table"); // Table card
const filterKeyword = ref<string>(""); // const filterKeyword = ref<string>(""); //
@ -244,6 +249,10 @@ const fileUpload = ref<File | null>(null);
const fileData = ref<ResFileData | null>(null); const fileData = ref<ResFileData | null>(null);
const isUpload = ref<boolean>(false); const isUpload = ref<boolean>(false);
const modalCommand = ref<boolean>(false);
const command = ref<string>("");
const commandId = ref<string>("");
/** /**
* function นหา คำใน option * function นหา คำใน option
* @param val คำคนหา * @param val คำคนหา
@ -305,7 +314,7 @@ async function fetchData(id: string) {
* กดเลอกขอมลทจะแกไข * กดเลอกขอมลทจะแกไข
* @param props props ใน row เลอก * @param props props ใน row เลอก
*/ */
async function openDialogEdit(props: RequestItemsObject) { async function openDialogEdit(props: Discipline) {
showLoader(); showLoader();
try { try {
modal.value = true; modal.value = true;
@ -478,6 +487,12 @@ function handleDelete(id: string) {
}); });
} }
function openViewCommand(data: Discipline) {
command.value = data.refCommandNo;
commandId.value = data.refCommandId;
modalCommand.value = true;
}
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
onMounted(() => { onMounted(() => {
fetchData(profileId.value); fetchData(profileId.value);
@ -621,7 +636,19 @@ onMounted(() => {
:key="col.id" :key="col.id"
:class="props.row.isEntry ? 'text-grey' : ''" :class="props.row.isEntry ? 'text-grey' : ''"
> >
<div> <div
v-if="col.name == 'refCommandNo' && props.row.refCommandId"
@click="col.value ? openViewCommand(props.row) : null"
:class="
col.value
? 'table_ellipsis text-blue cursor-pointer'
: 'table_ellipsis'
"
>
{{ col.value ? col.value : "-" }}
<q-tooltip v-if="col.value">ดูคำสั่ง</q-tooltip>
</div>
<div v-else>
{{ col.value ? col.value : "-" }} {{ col.value ? col.value : "-" }}
</div> </div>
</q-td> </q-td>
@ -975,6 +1002,13 @@ onMounted(() => {
:visible-columns="visibleColumnsHistory" :visible-columns="visibleColumnsHistory"
:fetch-data="fetchDataHistory" :fetch-data="fetchDataHistory"
/> />
<DialogPreviewCommand
v-model:modal="modalCommand"
v-model:command="command"
v-model:command-id="commandId"
:citizen-id="citizenId"
/>
</template> </template>
<style scoped></style> <style scoped></style>

View file

@ -866,7 +866,8 @@ onMounted(() => {
outlined outlined
dense dense
:model-value="date2Thai(formData.dateEnd)" :model-value="date2Thai(formData.dateEnd)"
:rules="[(val:string) => !!val || `${'กรุณาเลือก วันที่สิ้นสุด'}`]" clearable
@clear="formData.dateEnd = null"
hide-bottom-space hide-bottom-space
:label="`${'วันที่สิ้นสุด'}`" :label="`${'วันที่สิ้นสุด'}`"
> >

View file

@ -58,7 +58,10 @@ const storeRegistry = useRegistryNewDataStore();
<Info :is-leave="storeRegistry.isLeave" /> <Info :is-leave="storeRegistry.isLeave" />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="2"> <q-tab-panel name="2">
<Discipline :is-leave="storeRegistry.isLeave" /> <Discipline
:is-leave="storeRegistry.isLeave"
:citizen-id="storeRegistry.citizenId"
/>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="3"> <q-tab-panel name="3">
<Leave :is-leave="storeRegistry.isLeave" /> <Leave :is-leave="storeRegistry.isLeave" />

View file

@ -96,11 +96,11 @@ const columnsHistory = ref<QTableColumn[]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "prefix", name: "prefixMain",
align: "left", align: "left",
label: "คำนำหน้าชื่อ", label: "คำนำหน้าชื่อ",
sortable: true, sortable: true,
field: "prefix", field: "prefixMain",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
@ -256,7 +256,7 @@ const columnsHistory = ref<QTableColumn[]>([
]); ]);
const visibleColumnsHistory = ref<string[]>([ const visibleColumnsHistory = ref<string[]>([
"citizenId", "citizenId",
"prefix", "prefixMain",
"rank", "rank",
"firstName", "firstName",
"lastName", "lastName",
@ -408,7 +408,8 @@ function calculateMinDate() {
function prefixRankRule() { function prefixRankRule() {
return [ return [
() => !!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ", () =>
!!formData.rank || !!formData.prefix || "กรุณาเลือกคำนำหน้าชื่อ หรือยศ",
]; ];
} }
@ -588,6 +589,8 @@ onMounted(() => {
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-select <q-select
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
:class="checkPermission($route)?.attrOwnership === 'OWNER' ? 'inputgreen' : ''"
dense dense
outlined outlined
use-input use-input
@ -602,7 +605,6 @@ onMounted(() => {
option-value="name" option-value="name"
v-model="formData.prefix" v-model="formData.prefix"
clearable clearable
class="inputgreen"
:options="store.Ops.prefixOps" :options="store.Ops.prefixOps"
:label="dataLabel.prefix" :label="dataLabel.prefix"
:rules="prefixRankRule()" :rules="prefixRankRule()"
@ -640,24 +642,24 @@ onMounted(() => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
dense dense
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
v-model="formData.firstName" v-model="formData.firstName"
class="inputgreen"
:label="dataLabel.firstName" :label="dataLabel.firstName"
:rules="[(val: string) => !!val || `${'กรุณากรอก ชื่อ'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอก ชื่อ'}`]"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
dense dense
outlined outlined
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
v-model="formData.lastName" v-model="formData.lastName"
class="inputgreen"
:label="dataLabel.lastName" :label="dataLabel.lastName"
:rules="[(val: string) => !!val || `${'กรุณากรอก นามสกุล'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอก นามสกุล'}`]"
/> />
@ -721,6 +723,7 @@ onMounted(() => {
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-select <q-select
:readonly="checkPermission($route)?.attrOwnership !== 'OWNER'"
dense dense
outlined outlined
use-input use-input
@ -735,7 +738,6 @@ onMounted(() => {
option-label="name" option-label="name"
option-value="name" option-value="name"
v-model="formData.gender" v-model="formData.gender"
class="inputgreen"
:options="store.Ops.genderOps" :options="store.Ops.genderOps"
:label="dataLabel.gender" :label="dataLabel.gender"
@filter="(inputValue: string, @filter="(inputValue: string,

View file

@ -59,6 +59,7 @@ const changeNameData = reactive<FormChangeName>({
profileId: profileId.value, profileId: profileId.value,
prefixId: "", // id prefixId: "", // id
prefix: "", // prefix: "", //
rank: "", //
firstName: "", // firstName: "", //
lastName: "", // lastName: "", //
status: "", // status: "", //
@ -69,11 +70,13 @@ const selection = ref<string[]>([]); // ตัวเลือก
const prefixChange = ref<string | null | undefined>(""); // const prefixChange = ref<string | null | undefined>(""); //
const firstNameChange = ref<string | null | undefined>(""); // const firstNameChange = ref<string | null | undefined>(""); //
const lastNameChange = ref<string | null | undefined>(""); // const lastNameChange = ref<string | null | undefined>(""); //
const rankChange = ref<string | null | undefined>(""); //
const profileInfo = ref<DataProfile>(); // Profile const profileInfo = ref<DataProfile>(); // Profile
const statusOption = ref<string[]>([ const statusOption = ref<string[]>([
"เปลี่ยนคำนำหน้าชื่อ", "เปลี่ยนคำนำหน้าชื่อ",
"เปลี่ยนยศ",
"เปลี่ยนชื่อ", "เปลี่ยนชื่อ",
"เปลี่ยนนามสกุล", "เปลี่ยนนามสกุล",
"เปลี่ยนชื่อ-นามสกุล", "เปลี่ยนชื่อ-นามสกุล",
@ -84,6 +87,7 @@ const statusOption = ref<string[]>([
const statusOptionFilter = ref<string[]>([ const statusOptionFilter = ref<string[]>([
"เปลี่ยนคำนำหน้าชื่อ", "เปลี่ยนคำนำหน้าชื่อ",
"เปลี่ยนชื่อ", "เปลี่ยนชื่อ",
"เปลี่ยนยศ",
"เปลี่ยนนามสกุล", "เปลี่ยนนามสกุล",
"เปลี่ยนชื่อ-นามสกุล", "เปลี่ยนชื่อ-นามสกุล",
"เปลี่ยนคำนำหน้าชื่อ และชื่อ", "เปลี่ยนคำนำหน้าชื่อ และชื่อ",
@ -107,6 +111,17 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{
name: "rank",
align: "left",
label: "ยศ",
sortable: true,
field: "rank",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "firstName", name: "firstName",
align: "left", align: "left",
@ -156,6 +171,7 @@ const columns = ref<QTableProps["columns"]>([
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"prefix", "prefix",
"rank",
"firstName", "firstName",
"lastName", "lastName",
"lastUpdateFullName", "lastUpdateFullName",
@ -215,6 +231,7 @@ function onSubmit() {
firstName: changeNameData.firstName, firstName: changeNameData.firstName,
lastName: changeNameData.lastName, lastName: changeNameData.lastName,
status: changeNameData.status, status: changeNameData.status,
rank: changeNameData.rank,
documentId: changeNameData.documentId, documentId: changeNameData.documentId,
}) })
.then(async (res) => { .then(async (res) => {
@ -346,6 +363,14 @@ function filterSelector(val: string, update: Function, refData: string) {
); );
}); });
break; break;
case "rankOps":
update(() => {
store.Ops.rankOps = store.OpsFilter.rankOps.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
});
break;
default: default:
break; break;
} }
@ -390,12 +415,14 @@ watch(
changeNameData.prefix, changeNameData.prefix,
changeNameData.firstName, changeNameData.firstName,
changeNameData.lastName, changeNameData.lastName,
changeNameData.rank,
], ],
() => { () => {
submitDisable.value = submitDisable.value =
changeNameData.prefix === prefixChange.value && changeNameData.prefix === prefixChange.value &&
changeNameData.firstName === firstNameChange.value && changeNameData.firstName === firstNameChange.value &&
changeNameData.lastName === lastNameChange.value; changeNameData.lastName === lastNameChange.value &&
changeNameData.rank === rankChange.value;
} }
); );
@ -411,6 +438,9 @@ watch(
if (!selection.value.includes("lastname")) { if (!selection.value.includes("lastname")) {
changeNameData.lastName = lastNameChange.value; changeNameData.lastName = lastNameChange.value;
} }
if (!selection.value.includes("rank")) {
changeNameData.rank = rankChange.value;
}
} }
); );
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
@ -448,9 +478,11 @@ onMounted(async () => {
changeNameData.prefix = profileInfo?.prefixMain; changeNameData.prefix = profileInfo?.prefixMain;
changeNameData.firstName = profileInfo?.firstName; changeNameData.firstName = profileInfo?.firstName;
changeNameData.lastName = profileInfo?.lastName; changeNameData.lastName = profileInfo?.lastName;
changeNameData.rank = profileInfo?.rank;
prefixChange = changeNameData.prefix; prefixChange = changeNameData.prefix;
firstNameChange = changeNameData.firstName; firstNameChange = changeNameData.firstName;
lastNameChange = changeNameData.lastName; lastNameChange = changeNameData.lastName;
rankChange = changeNameData.rank;
changeNameData.status = ''; changeNameData.status = '';
dialogStatus = 'create'; dialogStatus = 'create';
submitDisable = true; submitDisable = true;
@ -533,7 +565,7 @@ onMounted(async () => {
:class="props.row.isEntry ? 'text-grey' : ''" :class="props.row.isEntry ? 'text-grey' : ''"
> >
<div class="table_ellipsis"> <div class="table_ellipsis">
{{ col.value }} {{ col.value ? col.value : "-" }}
</div> </div>
</q-td> </q-td>
@ -563,12 +595,17 @@ onMounted(async () => {
<div class="row q-mb-sm"> <div class="row q-mb-sm">
<div class="col-12"> <div class="col-12">
<div class="row"> <div class="row">
<div class="q-gutter-sm"> <div class="q-col-gutter-sm">
<q-checkbox <q-checkbox
v-model="selection" v-model="selection"
val="prefix" val="prefix"
label="เปลี่ยนคำนำหน้าชื่อ" label="เปลี่ยนคำนำหน้าชื่อ"
/> />
<q-checkbox
v-model="selection"
val="rank"
label="เปลี่ยนยศ"
/>
<q-checkbox <q-checkbox
v-model="selection" v-model="selection"
val="firstname" val="firstname"
@ -609,6 +646,30 @@ onMounted(async () => {
) " ) "
/> />
</div> </div>
<div class="col">
<q-select
:readonly="!selection.includes('rank')"
v-model="changeNameData.rank"
:options="store.Ops.rankOps"
label="ยศ"
dense
:class="!selection.includes('rank') ? '' : 'inputgreen'"
outlined
use-input
hide-selected
fill-input
lazy-rules
emit-value
map-options
hide-bottom-space
input-debounce="0"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'rankOps'
) "
/>
</div>
<div class="col"> <div class="col">
<q-input <q-input
:readonly="!selection.includes('firstname')" :readonly="!selection.includes('firstname')"

View file

@ -66,6 +66,7 @@ interface FormChangeName {
profileId: string; profileId: string;
prefixId: string | null | undefined; prefixId: string | null | undefined;
prefix: string | null | undefined; prefix: string | null | undefined;
rank: string | null | undefined;
firstName: string | null | undefined; firstName: string | null | undefined;
lastName: string | null | undefined; lastName: string | null | undefined;
status: string | null | undefined; status: string | null | undefined;

View file

@ -0,0 +1,23 @@
interface Discipline {
createdAt: Date | null;
createdFullName: string;
createdUserId: string;
date: Date | null;
detail: string;
id: string;
isDeleted: false;
isEntry: false;
isUpload: true;
lastUpdateFullName: string;
lastUpdateUserId: string;
lastUpdatedAt: Date | null;
level: string;
profileEmployeeId: string;
profileId: string;
refCommandDate: Date | null;
refCommandNo: string;
refCommandId: string;
unStigma: string;
}
export type { Discipline };

View file

@ -25,8 +25,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
{ {
id: "posNo", id: "posNo",
name: name:
route.name === "registryNew" || route.name === "registryNew" || route.name === "registryRetireOfficer"
route.name === "registryRetireOfficer"
? "เลขที่ตำแหน่ง" ? "เลขที่ตำแหน่ง"
: "ตำแหน่งเลขที่", : "ตำแหน่งเลขที่",
}, },
@ -130,6 +129,8 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
return "ให้ออกจากราชการ"; return "ให้ออกจากราชการ";
case "DISCIPLINE_TEMP_SUSPEND": case "DISCIPLINE_TEMP_SUSPEND":
return "ให้ออกจากราชการไว้ก่อน"; return "ให้ออกจากราชการไว้ก่อน";
case "RETIRE_MILITARY":
return "ลาออกเพื่อไปรับราชการทหาร";
default: default:
return ""; return "";
} }

View file

@ -121,7 +121,8 @@ const itemsMenu = computed(() => {
if ( if (
leaveType.value === "DISCIPLINE_TEMP_SUSPEND" || leaveType.value === "DISCIPLINE_TEMP_SUSPEND" ||
leaveType.value === "RETIRE_RESIGN" || leaveType.value === "RETIRE_RESIGN" ||
leaveType.value === "DISCIPLINE_SUSPEND" leaveType.value === "DISCIPLINE_SUSPEND" ||
leaveType.value === "RETIRE_MILITARY"
) { ) {
return ( return (
baseItemsMenu.value?.filter( baseItemsMenu.value?.filter(
@ -323,10 +324,10 @@ async function uploadFileURL(uploadUrl: string, file: any) {
* งกนดงขอมลรปโปรไฟล * งกนดงขอมลรปโปรไฟล
* @param id โปรไฟล * @param id โปรไฟล
*/ */
async function fetchProfile(id: string) { function fetchProfile(id: string) {
await http http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value)) .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value))
.then(async (res) => { .then((res) => {
profilePicture.value = res.data.downloadUrl; profilePicture.value = res.data.downloadUrl;
}) })
.catch(() => { .catch(() => {
@ -403,7 +404,7 @@ async function fetchDataPersonal() {
fileName.value = res.data.result.avatarName; fileName.value = res.data.result.avatarName;
if (formDetail.value?.avatarName) { if (formDetail.value?.avatarName) {
await fetchProfile(profileId.value); fetchProfile(profileId.value);
} else { } else {
profilePicture.value = avatar; profilePicture.value = avatar;
} }
@ -857,7 +858,8 @@ onMounted(async () => {
])) || ])) ||
leaveType === 'DISCIPLINE_TEMP_SUSPEND' || leaveType === 'DISCIPLINE_TEMP_SUSPEND' ||
leaveType === 'RETIRE_RESIGN' || leaveType === 'RETIRE_RESIGN' ||
leaveType === 'DISCIPLINE_SUSPEND' leaveType === 'DISCIPLINE_SUSPEND' ||
leaveType === 'RETIRE_MILITARY'
" "
size="md" size="md"
rounded rounded

View file

@ -437,66 +437,6 @@ function classColorRow(isDelete: boolean, isEdit: boolean, isEntry: boolean) {
/** ฟังก์ชันดาวน์โหลดไฟล Excel */ /** ฟังก์ชันดาวน์โหลดไฟล Excel */
function exportToExcel() { function exportToExcel() {
exportToExcelPosition(rows.value); exportToExcelPosition(rows.value);
// const newData = rows.value.map((e: DataPosition) => {
// return {
// commandDateAffect: date2Thai(e.commandDateAffect),
// positionName: e.positionName,
// positionType: e.positionType,
// positionLevel: e.positionLevel
// ? e.positionLevel
// : e.positionCee
// ? e.positionCee
// : "",
// positionExecutive: e.positionExecutive,
// amount: e.amount,
// mouthSalaryAmount: e.mouthSalaryAmount,
// positionSalaryAmount: e.positionSalaryAmount,
// organization: findOrgName({
// root: e.orgRoot,
// child1: e.orgChild1,
// child2: e.orgChild2,
// child3: e.orgChild3,
// child4: e.orgChild4,
// }),
// posNo:
// e.posNoAbb && e.posNo
// ? `${e.posNoAbb} ${e.posNo}`
// : e.posNo
// ? e.posNo
// : "",
// posNumCodeSit:
// e.posNumCodeSitAbb && e.posNumCodeSit
// ? `${e.posNumCodeSit} (${e.posNumCodeSitAbb})`
// : e.posNumCodeSit
// ? e.posNumCodeSit
// : "",
// commandNo:
// e.commandNo && e.commandYear
// ? `${e.commandNo}/${Number(e.commandYear) + 543}`
// : "",
// commandDateSign: date2Thai(e.commandDateSign),
// commandCode: store.convertCommandCodeName(e.commandCode),
// remark: e.remark,
// };
// });
// const headers = columns.value.map((item: any) => item.label) || []; //
// const worksheet = XLSX.utils.json_to_sheet(newData, {
// header: visibleColumns.value,
// });
// // ( A1, B1, C1 )
// XLSX.utils.sheet_add_aoa(worksheet, [headers], { origin: "A1" });
// // Create a new workbook and append the worksheet
// const workbook = XLSX.utils.book_new();
// XLSX.utils.book_append_sheet(
// workbook,
// worksheet,
// ``
// );
// XLSX.writeFile(workbook, ".xlsx");
} }
const commandCodeOptions = ref<DataOption[]>(store.commandCodeData); // const commandCodeOptions = ref<DataOption[]>(store.commandCodeData); //
@ -931,6 +871,29 @@ function onCancelUpload() {
excelPreviewModal.value = false; excelPreviewModal.value = false;
} }
/** ฟังก์ชันจัดเรียงข้อมูลตามวันที่*/
function handleSortByDate() {
dialogConfirm(
$q,
async () => {
try {
showLoader();
await http.put(config.API.sortOrderByDate, {
type: empType.value.toLocaleUpperCase(),
profileId: profileId.value,
});
await fetchData();
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
},
"ยืนยันการจัดลำดับ",
"ต้องการยืนยันการจัดลำดับข้อมูลตามวันที่คำสั่งมีผลใช่หรือไม่?"
);
}
onMounted(async () => { onMounted(async () => {
await Promise.all([fetchData(), fetchType()]); await Promise.all([fetchData(), fetchType()]);
}); });
@ -966,8 +929,23 @@ onMounted(async () => {
icon="mdi-sort" icon="mdi-sort"
@click="modalSort = true" @click="modalSort = true"
> >
<q-tooltip>ดลำดบขอม</q-tooltip></q-btn <q-tooltip>ดลำดบขอม</q-tooltip>
</q-btn>
<q-btn
v-if="
tabs === 'PENDING' && statusCheckEdit == 'PENDING' && isConfirmEdit
"
class="q-ml-sm"
round
flat
dense
color="indigo-5"
icon="mdi-calendar-export"
@click="handleSortByDate()"
> >
<q-tooltip>ดลำดบตามวนทคำสงมผล</q-tooltip>
</q-btn>
<q-space /> <q-space />
<div> <div>
<q-btn <q-btn

View file

@ -316,9 +316,10 @@ onMounted(() => {
:model-value=" :model-value="
dateEnd !== null ? date2Thai(dateEnd) : null dateEnd !== null ? date2Thai(dateEnd) : null
" "
:rules="edit ? [(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]:[]"
hide-bottom-space hide-bottom-space
:label="`${'ถึงวันที่'}`" :label="`${'ถึงวันที่'}`"
clearable
@clear="dateEnd = null"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon

View file

@ -48,12 +48,12 @@ const props = defineProps({
</div> </div>
</div> </div>
<div class="col"> <!-- <div class="col">
<div class="header-text-right q-px-xs">จำนวนครงทสมครสอบ</div> <div class="header-text-right q-px-xs">จำนวนครงทสมครสอบ</div>
<div class="sub-text-right q-px-xs q-pb-sm"> <div class="sub-text-right q-px-xs q-pb-sm">
{{ props.data.examRound ? props.data.examRound : "-" }} {{ props.data.examRound ? props.data.examRound : "-" }}
</div> </div>
</div> </div> -->
</div> </div>
</q-card> </q-card>
</div> </div>

View file

@ -525,14 +525,14 @@ watch(props, () => {
<div class="col-7 header-sub-text"> <div class="col-7 header-sub-text">
<div class="q-pb-sm">ผลการสอบ</div> <div class="q-pb-sm">ผลการสอบ</div>
<div class="q-pb-sm">ลำดบทสอบได</div> <div class="q-pb-sm">ลำดบทสอบได</div>
<div class="q-pb-sm">จำนวนครงทสมครสอบ</div> <!-- <div class="q-pb-sm">จำนวนครงทสมครสอบ</div> -->
</div> </div>
<div class="col-5 sub-text-exam"> <div class="col-5 sub-text-exam">
<div class="q-pb-sm"> <div class="q-pb-sm">
{{ personalForm?.pass }} {{ personalForm?.pass }}
</div> </div>
<div class="q-pb-sm">{{ personalForm?.examNumber }}</div> <div class="q-pb-sm">{{ personalForm?.examNumber }}</div>
<div class="q-pb-sm">{{ personalForm?.examRound }}</div> <!-- <div class="q-pb-sm">{{ personalForm?.examRound }}</div> -->
</div> </div>
</div> </div>
</div> </div>

View file

@ -242,7 +242,7 @@ watch(
v.code === "C-PM-04" || v.code === "C-PM-04" ||
v.code === "C-PM-06")) || v.code === "C-PM-06")) ||
((status?.examTypeName === "สอบคัดเลือก" || ((status?.examTypeName === "สอบคัดเลือก" ||
status?.examTypeName === "คัดเลือกคนพิการ") && status?.examTypeName === "คัดเลือกอื่นๆ") &&
(v.code === "C-PM-02" || (v.code === "C-PM-02" ||
v.code === "C-PM-03" || v.code === "C-PM-03" ||
v.code === "C-PM-04" || v.code === "C-PM-04" ||

View file

@ -165,7 +165,9 @@ async function fetchDataTable(id: string, level: number = 0) {
(e) => e !== props.dataRow?.posmasterId (e) => e !== props.dataRow?.posmasterId
); );
positionNo.value = posMain.filter((e: DataPositionNo) => !newUse.includes(e.id)); positionNo.value = posMain.filter(
(e: DataPositionNo) => !newUse.includes(e.id)
);
} else { } else {
positionNo.value = posMain.filter( positionNo.value = posMain.filter(
(e: DataPositionNo) => !positionUse.value.includes(e.id) (e: DataPositionNo) => !positionUse.value.includes(e.id)
@ -241,6 +243,7 @@ async function onClickSubmit() {
posLevelId: selectedPos.value[0].posLevelId, // posLevelId: selectedPos.value[0].posLevelId, //
posLevelName: selectedPos.value[0].posLevelName, // posLevelName: selectedPos.value[0].posLevelName, //
posExecutiveName: selectedPos.value[0].posExecutiveName, posExecutiveName: selectedPos.value[0].posExecutiveName,
posExecutiveId: selectedPos.value[0].posExecutiveId,
reportingDate: convertDateToAPI(datePos.value), reportingDate: convertDateToAPI(datePos.value),
posmasterId: dataPosMaster.id, posmasterId: dataPosMaster.id,
positionExecutiveField: selectedPos.value[0].positionExecutiveField, // positionExecutiveField: selectedPos.value[0].positionExecutiveField, //
@ -290,7 +293,10 @@ watch(
if (modal.value) { if (modal.value) {
await fetchPositionUes(); await fetchPositionUes();
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) { if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
await fetchPosFind(props?.dataRow?.node ?? 0, props?.dataRow?.nodeId ?? ""); await fetchPosFind(
props?.dataRow?.node ?? 0,
props?.dataRow?.nodeId ?? ""
);
} else { } else {
expanded.value = []; expanded.value = [];
} }
@ -345,7 +351,7 @@ function onPosType() {
watch( watch(
[isAll, isBlank, () => isPosition.value], [isAll, isBlank, () => isPosition.value],
([newAll, newBlank, newPos], [oldAll, oldBlank, oldPos]) => { ([newAll, newBlank, newPos], [oldAll, oldBlank, oldPos]) => {
const shouldFetch = (newAll !== oldAll) || (newBlank !== oldBlank); const shouldFetch = newAll !== oldAll || newBlank !== oldBlank;
const isSelectMode = newPos === "select" && oldPos !== "select"; const isSelectMode = newPos === "select" && oldPos !== "select";
if (shouldFetch || isSelectMode) { if (shouldFetch || isSelectMode) {

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, watch, reactive, computed } from "vue"; import { ref, onMounted, watch, reactive, computed, type PropType } from "vue";
import { useQuasar, QForm } from "quasar"; import { useQuasar, QForm } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -48,7 +48,7 @@ const {
/** รับค่ามาจากหน้าหลัก */ /** รับค่ามาจากหน้าหลัก */
const props = defineProps({ const props = defineProps({
statCard: { statCard: {
type: Function, type: Function as PropType<() => Promise<void>>,
default: () => console.log("getStat"), default: () => console.log("getStat"),
}, },
}); });

View file

@ -20,7 +20,7 @@ const dataMapToSend = computed(() => {
return selected.value.map((i: any) => ({ return selected.value.map((i: any) => ({
id: i.id, id: i.id,
profileId: i.profileId, profileId: i.profileId,
prefix: i.prefix, prefix: i.rank ? i.rank : i.prefix,
firstName: i.firstName, firstName: i.firstName,
lastName: i.lastName, lastName: i.lastName,
citizenId: i.citizenId, citizenId: i.citizenId,
@ -89,7 +89,9 @@ const columns2 = ref<QTableProps["columns"]>([
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) { format(val, row) {
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`; return `${row.rank ? row.rank : row.prefix ?? ""}${row.firstName ?? ""} ${
row.lastName ?? ""
}`;
}, },
}, },
{ {
@ -110,9 +112,11 @@ const columns2 = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.positionTypeOld return row.positionTypeOld && row.positionTypeOl !== "-"
? `${row.positionTypeOld}${ ? `${row.positionTypeOld}${
row.positionLevelOld ? `(${row.positionLevelOld})` : "" row.positionLevelOld && row.positionLevelOld !== "-"
? `(${row.positionLevelOld})`
: ""
}` }`
: ""; : "";
}, },

View file

@ -48,6 +48,7 @@ const informaData = ref<FormAddPerson>({
employeeType: null, employeeType: null,
employeeClass: null, employeeClass: null,
profileType: null, profileType: null,
rank: "",
}); });
// //
@ -60,6 +61,7 @@ const Ops = ref<InformationOps>({
religionOps: [], religionOps: [],
employeeClassOps: [], employeeClassOps: [],
employeeTypeOps: [], employeeTypeOps: [],
rankOps: [],
}); });
// //
const OpsFilter = ref<InformationOps>({ const OpsFilter = ref<InformationOps>({
@ -71,6 +73,7 @@ const OpsFilter = ref<InformationOps>({
religionOps: [], religionOps: [],
employeeClassOps: [], employeeClassOps: [],
employeeTypeOps: [], employeeTypeOps: [],
rankOps: [],
}); });
// profile // profile
@ -135,6 +138,16 @@ async function fetchPerson() {
}); });
Ops.value.religionOps = optionreligions; Ops.value.religionOps = optionreligions;
OpsFilter.value.religionOps = optionreligions; OpsFilter.value.religionOps = optionreligions;
let rank: DataOption[] = [];
data.rank.map((r: DataOptioninfo) => {
rank.push({
id: r.id.toString(),
name: r.name.toString(),
});
});
Ops.value.rankOps = rank;
OpsFilter.value.rankOps = rank;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -204,7 +217,13 @@ function filterSelector(val: string, update: Function, refData: string) {
); );
}); });
break; break;
case "rankOps":
update(() => {
Ops.value.rankOps = OpsFilter.value.rankOps.filter(
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
default: default:
break; break;
} }
@ -227,7 +246,7 @@ function onSubmit() {
if (fileData.value != null) formData.append("File", fileData.value); // if (fileData.value != null) formData.append("File", fileData.value); //
if (informaData.value.citizenId != undefined) if (informaData.value.citizenId != undefined)
formData.append("citizenId", informaData.value.citizenId); formData.append("citizenId", informaData.value.citizenId);
if (informaData.value.prefix != undefined) if (informaData.value.prefix != undefined && informaData.value.prefix != "")
formData.append("prefix", informaData.value.prefix); formData.append("prefix", informaData.value.prefix);
if (informaData.value.firstName != undefined) if (informaData.value.firstName != undefined)
formData.append("firstName", informaData.value.firstName); formData.append("firstName", informaData.value.firstName);
@ -256,6 +275,8 @@ function onSubmit() {
formData.append("employeeType", informaData.value.employeeType); formData.append("employeeType", informaData.value.employeeType);
if (informaData.value.employeeClass != undefined) if (informaData.value.employeeClass != undefined)
formData.append("employeeClass", informaData.value.employeeClass); formData.append("employeeClass", informaData.value.employeeClass);
if (informaData.value.rank != undefined && informaData.value.rank != "")
formData.append("rank", informaData.value.rank);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
showLoader(); showLoader();
@ -289,6 +310,15 @@ function updateBirthDate(v: Date) {
age.value = calculateAge(v); age.value = calculateAge(v);
} }
function prefixRankRule() {
return [
() =>
!!informaData.value.rank ||
!!informaData.value.prefix ||
"กรุณาเลือกคำนำหน้าชื่อ หรือยศ",
];
}
/** /**
* ทำงานเมอมการเรยกใช Components * ทำงานเมอมการเรยกใช Components
*/ */
@ -383,7 +413,7 @@ onMounted(async () => {
</div> </div>
<q-card-section class="q-px-lg"> <q-card-section class="q-px-lg">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-3"> <div class="col-2">
<q-input <q-input
bg-color="white" bg-color="white"
outlined outlined
@ -404,13 +434,14 @@ onMounted(async () => {
mask="#############" mask="#############"
/> />
</div> </div>
<div class="col-3"> <div class="col-2">
<q-select <q-select
bg-color="white" bg-color="white"
v-model="informaData.prefix" v-model="informaData.prefix"
label="คำนำหน้าชื่อ" label="คำนำหน้าชื่อ"
outlined outlined
dense dense
clearable
lazy-rules lazy-rules
class="inputgreen" class="inputgreen"
:options="Ops.prefixOps" :options="Ops.prefixOps"
@ -418,11 +449,8 @@ onMounted(async () => {
option-value="name" option-value="name"
map-options map-options
hide-bottom-space hide-bottom-space
:rules="[ :rules="prefixRankRule()"
(val:string) => { reactive-rules
return val.length > 0 || 'กรุณาเลือกคำนำหน้าชื่อ';
},
]"
emit-value emit-value
use-input use-input
hide-selected hide-selected
@ -432,6 +460,32 @@ onMounted(async () => {
)" )"
/> />
</div> </div>
<div class="col-2">
<q-select
bg-color="white"
v-model="informaData.rank"
label="ยศ"
outlined
dense
lazy-rules
clearable
class="inputgreen"
:options="Ops.rankOps"
option-label="name"
option-value="name"
map-options
hide-bottom-space
:rules="prefixRankRule()"
reactive-rules
emit-value
use-input
hide-selected
fill-input
@filter="(inputValue:string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'rankOps'
)"
/>
</div>
<div class="col-3"> <div class="col-3">
<q-input <q-input
bg-color="white" bg-color="white"

View file

@ -113,6 +113,7 @@ const Ops = ref<InformationOps>({
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" }, { id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" }, { id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
], ],
rankOps: [],
}); });
const OpsFilter = ref<InformationOps>({ const OpsFilter = ref<InformationOps>({
prefixOps: [], prefixOps: [],
@ -129,6 +130,7 @@ const OpsFilter = ref<InformationOps>({
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" }, { id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" }, { id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
], ],
rankOps: [],
}); });
/** ฟังก์ชันดึงข้อมูลรายการข้อมูลเกี่ยวกับบุคคล (dropdown list)*/ /** ฟังก์ชันดึงข้อมูลรายการข้อมูลเกี่ยวกับบุคคล (dropdown list)*/
@ -186,6 +188,16 @@ async function fetchPerson() {
}); });
Ops.value.religionOps = optionreligions; Ops.value.religionOps = optionreligions;
OpsFilter.value.religionOps = optionreligions; OpsFilter.value.religionOps = optionreligions;
let rank: DataOption[] = [];
data.rank.map((r: DataOptioninfo) => {
rank.push({
id: r.id.toString(),
name: r.name.toString(),
});
});
Ops.value.rankOps = rank;
OpsFilter.value.rankOps = rank;
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -215,9 +227,9 @@ async function getData() {
} }
rows.value = list; rows.value = list;
profileId.value = data.profileId; profileId.value = data.profileId;
title.value.fullname = `${data.prefix ?? ""}${data.firstName ?? ""} ${ title.value.fullname = `${data.rank ? data.rank : data.prefix ?? ""}${
data.lastName ?? "" data.firstName ?? ""
}`; } ${data.lastName ?? ""}`;
title.value.organizationPositionOld = data.organizationPositionOld ?? "-"; title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
title.value.positionLevelOld = data.positionLevelOld ?? "-"; title.value.positionLevelOld = data.positionLevelOld ?? "-";
title.value.positionTypeOld = data.positionTypeOld ?? "-"; title.value.positionTypeOld = data.positionTypeOld ?? "-";
@ -230,6 +242,7 @@ async function getData() {
(data.prefix == "00000000-0000-0000-0000-000000000000" (data.prefix == "00000000-0000-0000-0000-000000000000"
? null ? null
: data.prefix) ?? "", : data.prefix) ?? "",
rank: data.rank ?? "",
firstname: data.firstName ?? "", firstname: data.firstName ?? "",
lastname: data.lastName ?? "", lastname: data.lastName ?? "",
birthDate: birthDate:
@ -295,6 +308,7 @@ async function fetchData(data: any) {
(data.prefix == "00000000-0000-0000-0000-000000000000" (data.prefix == "00000000-0000-0000-0000-000000000000"
? null ? null
: data.prefix) ?? "", : data.prefix) ?? "",
rank: data.rank ?? "",
firstname: data.firstName ?? "", firstname: data.firstName ?? "",
lastname: data.lastName ?? "", lastname: data.lastName ?? "",
birthDate: data.dateOfBirth !== null ? new Date(data.dateOfBirth) : null, birthDate: data.dateOfBirth !== null ? new Date(data.dateOfBirth) : null,
@ -436,6 +450,14 @@ function filterSelector(val: string, update: Function, refData: string) {
}); });
break; break;
case "rankOps":
update(() => {
Ops.value.rankOps = OpsFilter.value.rankOps.filter(
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
);
});
break;
default: default:
break; break;
} }
@ -470,6 +492,7 @@ function saveData() {
positionNumberOld: posNo.value, positionNumberOld: posNo.value,
amount: 0, amount: 0,
amountOld: salary.value, amountOld: salary.value,
rank: informaData.value.rank,
}; };
showLoader(); showLoader();
http http
@ -517,6 +540,15 @@ function updateBirthDate(v: Date) {
informaData.value.age = calculateAge(v); informaData.value.age = calculateAge(v);
} }
function prefixRankRule() {
return [
() =>
!!informaData.value.rank ||
!!informaData.value.prefixId ||
"กรุณาเลือกคำนำหน้าชื่อ หรือยศ",
];
}
/** ทำงานเมื่อมีการเรียกใช้ Components*/ /** ทำงานเมื่อมีการเรียกใช้ Components*/
onMounted(async () => { onMounted(async () => {
await fetchPerson(); await fetchPerson();
@ -598,7 +630,7 @@ onMounted(async () => {
<div class="col-xs-12"> <div class="col-xs-12">
<div class="text-weight-bold text-grey">อมลสวนต</div> <div class="text-weight-bold text-grey">อมลสวนต</div>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-2 col-md-2">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
@ -614,7 +646,7 @@ onMounted(async () => {
mask="#############" mask="#############"
/> />
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-2 col-md-2">
<selector <selector
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
@ -634,10 +666,42 @@ onMounted(async () => {
option-value="name" option-value="name"
:label="`${'คำนำหน้าชื่อ'}`" :label="`${'คำนำหน้าชื่อ'}`"
use-input use-input
clearable
input-debounce="0" input-debounce="0"
:rules="prefixRankRule()"
reactive-rules
@filter="(inputValue:string, doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps' ) " @filter="(inputValue:string, doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps' ) "
/> />
</div> </div>
<div class="col-xs-6 col-sm-2 col-md-2">
<selector
:hide-dropdown-icon="!edit"
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
:outlined="edit"
dense
lazy-rules
v-model="informaData.rank"
emit-value
map-options
hide-selected
fill-input
:rules="prefixRankRule()"
option-label="name"
:options="Ops.rankOps"
option-value="name"
:label="`${'ยศ'}`"
reactive-rules
use-input
input-debounce="0"
@filter="(inputValue:string, doneFn:Function) => filterSelector(inputValue, doneFn,'rankOps' ) "
clearable
/>
</div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input <q-input
:class="getClass(edit)" :class="getClass(edit)"

View file

@ -341,7 +341,7 @@ watch(
keep-color keep-color
color="primary" color="primary"
dense dense
:disable="commandType" :disable="!commandType ? true : false"
v-model="scope.selected" v-model="scope.selected"
/> />
</template> </template>
@ -352,7 +352,7 @@ watch(
keep-color keep-color
color="primary" color="primary"
dense dense
:disable="commandType" :disable="!commandType ? true : false"
v-model="props.selected" v-model="props.selected"
/> />
</q-td> </q-td>

View file

@ -97,6 +97,8 @@ const develop_result_option = ref<any>([
const isCheckFile = ref<boolean>(false); const isCheckFile = ref<boolean>(false);
const isSelectionPartfour = ref<boolean>(false);
// score // score
const score1 = computed(() => { const score1 = computed(() => {
if ( if (
@ -212,20 +214,21 @@ const percent_sum: any = computed(() => {
}); });
const score4 = computed(() => { const score4 = computed(() => {
return ( return (
(Number(orientation.value) + Number(orientation.value) +
Number(self_learning.value) + Number(self_learning.value) +
Number(training_seminar.value) + Number(training_seminar.value) +
Number(other_training.value)) / (isSelectionPartfour.value ? Number(other_training.value) : 0)
4
); );
}); });
const score5 = computed(() => { const score5 = computed(() => {
const total = const rawTotal =
(Number(orientation_percent.value) + (Number(orientation_percent.value) +
Number(self_learning_percent.value) + Number(self_learning_percent.value) +
Number(training_seminar_percent.value) + Number(training_seminar_percent.value) +
Number(other_training_percent.value)) / Number(other_training_percent.value)) /
4; (isSelectionPartfour.value ? 4 : 3);
const total = Math.trunc(rawTotal);
develop_result.value = total > 60 ? 1 : 0; develop_result.value = total > 60 ? 1 : 0;
@ -1133,10 +1136,20 @@ onMounted(async () => {
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md"> <div class="row q-gutter-md align-center q-pl-md">
<div class="col-8"> <div class="col-8">
<q-checkbox
class="q-mr-sm"
dense
v-model="isSelectionPartfour"
@update:model-value="
other_training = 0;
other_training_percent = 0;
"
/>
4. การอบรมอ ตามทหนวยงานกำหนด (าม) 4. การอบรมอ ตามทหนวยงานกำหนด (าม)
</div> </div>
<div class="col"> <div class="col">
<q-input <q-input
:disable="!isSelectionPartfour"
outlined outlined
dense dense
type="number" type="number"
@ -1148,6 +1161,7 @@ onMounted(async () => {
</div> </div>
<div class="col"> <div class="col">
<q-input <q-input
:disable="!isSelectionPartfour"
outlined outlined
dense dense
type="number" type="number"

View file

@ -90,6 +90,8 @@ const develop_result_option = ref<any>([
// footer // footer
const dateAutherise = ref<any>(null); const dateAutherise = ref<any>(null);
const isSelectionPartfour = ref<boolean>(false);
onMounted(() => { onMounted(() => {
fecthAssign(assignId.value); fecthAssign(assignId.value);
}); });
@ -239,20 +241,21 @@ const percent_sum: any = computed(() => {
}); });
const score4 = computed(() => { const score4 = computed(() => {
return ( return (
(Number(orientation.value) + Number(orientation.value) +
Number(self_learning.value) + Number(self_learning.value) +
Number(training_seminar.value) + Number(training_seminar.value) +
Number(other_training.value)) / (isSelectionPartfour.value ? Number(other_training.value) : 0)
4
); );
}); });
const score5 = computed(() => { const score5 = computed(() => {
const total = const rawTotal =
(Number(orientation_percent.value) + (Number(orientation_percent.value) +
Number(self_learning_percent.value) + Number(self_learning_percent.value) +
Number(training_seminar_percent.value) + Number(training_seminar_percent.value) +
Number(other_training_percent.value)) / Number(other_training_percent.value)) /
4; (isSelectionPartfour.value ? 4 : 3);
const total = Math.trunc(rawTotal);
develop_result.value = total > 60 ? 1 : 0; develop_result.value = total > 60 ? 1 : 0;
@ -1214,10 +1217,20 @@ watch(lengthdiscipline_level, (newLength) => {
<q-separator class="q-my-xs" /> <q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md"> <div class="row q-gutter-md align-center q-pl-md">
<div class="col-8"> <div class="col-8">
<q-checkbox
class="q-mr-sm"
dense
v-model="isSelectionPartfour"
@update:model-value="
other_training = 0;
other_training_percent = 0;
"
/>
4. การอบรมอ ตามทหนวยงานกำหนด (าม) 4. การอบรมอ ตามทหนวยงานกำหนด (าม)
</div> </div>
<div class="col"> <div class="col">
<q-input <q-input
:disable="!isSelectionPartfour"
outlined outlined
dense dense
type="number" type="number"
@ -1231,6 +1244,7 @@ watch(lengthdiscipline_level, (newLength) => {
outlined outlined
dense dense
type="number" type="number"
:disable="!isSelectionPartfour"
v-model="other_training_percent" v-model="other_training_percent"
:rules="[(val:number) => val <= 100 || 'ร้อยละต้องไม่เกิน 100']" :rules="[(val:number) => val <= 100 || 'ร้อยละต้องไม่เกิน 100']"
hide-bottom-space hide-bottom-space

View file

@ -7,6 +7,7 @@ interface InformationOps {
religionOps: DataOption[]; religionOps: DataOption[];
employeeClassOps: DataOption[]; employeeClassOps: DataOption[];
employeeTypeOps: DataOption[]; employeeTypeOps: DataOption[];
rankOps: DataOption[];
} }
//ข้อมูลส่วนตัว //ข้อมูลส่วนตัว
@ -63,6 +64,7 @@ interface FormAddPerson {
employeeType: string | null; employeeType: string | null;
employeeClass: string | null; employeeClass: string | null;
profileType: string | null; profileType: string | null;
rank?: string;
} }
const defaultInformation: Information = { const defaultInformation: Information = {
@ -83,6 +85,7 @@ const defaultInformation: Information = {
employeeType: null, employeeType: null,
employeeClass: null, employeeClass: null,
profileType: null, profileType: null,
rank: null,
}; };
export { defaultInformation }; export { defaultInformation };

View file

@ -152,6 +152,7 @@ interface FormDataAppoint {
reportingDate: string; reportingDate: string;
posmasterId: string; posmasterId: string;
posExecutiveName?: string; posExecutiveName?: string;
posExecutiveId?: string;
typeCommand: string; typeCommand: string;
positionExecutiveField?: string; positionExecutiveField?: string;
positionArea?: string; positionArea?: string;

View file

@ -10,8 +10,7 @@ import type {
} from "@/modules/05_placement/interface/request/Main"; } from "@/modules/05_placement/interface/request/Main";
import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main"; import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main";
export const useProfileDataStore = defineStore("profilePlacenent", () => { interface profile {
interface profile {
main: { columns: String[] }; main: { columns: String[] };
education: { columns: String[] }; education: { columns: String[] };
certicate: { columns: String[] }; certicate: { columns: String[] };
@ -27,8 +26,9 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
record: { columns: String[] }; record: { columns: String[] };
other: { columns: String[] }; other: { columns: String[] };
document: { columns: String[] }; document: { columns: String[] };
} }
export const useProfileDataStore = defineStore("profilePlacenent", () => {
const birthDate = ref<Date>(new Date()); const birthDate = ref<Date>(new Date());
const retireText = ref<string | null>(null); const retireText = ref<string | null>(null);
const changeRetireText = (val: string | null) => { const changeRetireText = (val: string | null) => {
@ -87,15 +87,15 @@ export const useProfileDataStore = defineStore("profilePlacenent", () => {
changeRetireText, changeRetireText,
}; };
}); });
interface placement {
mappingPosition: { columns: String[] };
}
export const usePlacementDataStore = defineStore("placement", () => { export const usePlacementDataStore = defineStore("placement", () => {
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
const tabsMain = ref<string>("probation"); const tabsMain = ref<string>("probation");
const isOfficer = ref<boolean | null>(null); const isOfficer = ref<boolean | null>(null);
const isStaff = ref<boolean | null>(null); const isStaff = ref<boolean | null>(null);
const { hideLoader } = mixin; const { hideLoader } = mixin;
interface placement {
mappingPosition: { columns: String[] };
}
const placementData = ref<placement>({ const placementData = ref<placement>({
mappingPosition: { columns: [] }, mappingPosition: { columns: [] },
}); });
@ -218,10 +218,10 @@ export const usePlacementDataStore = defineStore("placement", () => {
isStaff, isStaff,
}; };
}); });
export const useOrderPlacementDataStore = defineStore("placementOrder", () => { interface placementOrder {
interface placementOrder {
mappingPosition: { columns: String[] }; mappingPosition: { columns: String[] };
} }
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
const placementOrderData = ref<placementOrder>({ const placementOrderData = ref<placementOrder>({
mappingPosition: { columns: [] }, mappingPosition: { columns: [] },
}); });
@ -369,6 +369,8 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
]); ]);
const statusOp = ref<DataOptions[]>(statusMainOp.value); const statusOp = ref<DataOptions[]>(statusMainOp.value);
const statusDelete = ["REPORT", "WAITING", "DONE"];
const statusText = (val: string) => { const statusText = (val: string) => {
switch (val) { switch (val) {
case "WAITTING": case "WAITTING":
@ -438,5 +440,6 @@ export const useTransferDataStore = defineStore("transferDataStore", () => {
statusOp, statusOp,
statusMainOp, statusMainOp,
filterOption, filterOption,
statusDelete,
}; };
}); });

View file

@ -1,5 +1,5 @@
import { defineStore } from "pinia"; import { defineStore } from "pinia";
import { ref } from "vue"; import { formatPosmasterNo } from "@/utils/function";
/** importType*/ /** importType*/
import type { PositionMaim } from "@/modules/05_placement/interface/response/SelectOrg"; import type { PositionMaim } from "@/modules/05_placement/interface/response/SelectOrg";
import type { DataPositionNo } from "@/modules/05_placement/interface/index/SelectOrg"; import type { DataPositionNo } from "@/modules/05_placement/interface/index/SelectOrg";
@ -12,11 +12,13 @@ export const useSelectOrgStore = defineStore("selectorg", () => {
const listPosNo: DataPositionNo[] = data.map((e: PositionMaim) => ({ const listPosNo: DataPositionNo[] = data.map((e: PositionMaim) => ({
id: e.id, id: e.id,
isPosition: e.isPosition, isPosition: e.isPosition,
posMasterNo: posMasterNo: formatPosmasterNo(
e.orgShortname + e.orgShortname,
(e.posMasterNoPrefix != null ? e.posMasterNoPrefix : " ") + e.posMasterNoPrefix,
e.posMasterNo + e.posMasterNo.toString(),
(e.posMasterNoSuffix != null ? e.posMasterNoSuffix : " "), e.posMasterNoSuffix
),
positionName: e.positionName, positionName: e.positionName,
posTypeName: e.posTypeName, posTypeName: e.posTypeName,
posLevelName: e.posLevelName, posLevelName: e.posLevelName,

View file

@ -2,7 +2,7 @@
import { ref, onMounted, computed } from "vue"; import { ref, onMounted, computed } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { import {
checkPermission, checkPermission,
checkPermissionList, checkPermissionList,
@ -20,11 +20,19 @@ import DialogOrders from "@/modules/05_placement/components/Transfer/DialogOrder
const $q = useQuasar(); const $q = useQuasar();
const router = useRouter(); const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const store = useTransferDataStore(); const store = useTransferDataStore();
const { statusText, filterOption } = useTransferDataStore(); const { statusText, filterOption } = useTransferDataStore();
const { date2Thai, messageError, showLoader, hideLoader, onSearchDataTable } = const {
mixin; date2Thai,
messageError,
showLoader,
hideLoader,
onSearchDataTable,
dialogRemove,
success,
} = mixin;
const modal = ref<boolean>(false); // const modal = ref<boolean>(false); //
const dataTransfer = ref<ResponseData[]>([]); // const dataTransfer = ref<ResponseData[]>([]); //
@ -141,6 +149,15 @@ const visibleColumns = ref<string[]>([
"createdAt", "createdAt",
]); ]);
const isPermissionDelete = computed(() => {
return (status: string) => {
return (
checkPermission(route)?.attrOwnership === "OWNER" &&
!store.statusDelete.includes(status)
);
};
});
/** ฟังก์ชันดึงข้อมูรายการขอโอน*/ /** ฟังก์ชันดึงข้อมูรายการขอโอน*/
async function fetchData() { async function fetchData() {
showLoader(); showLoader();
@ -194,6 +211,21 @@ function onSearch() {
); );
} }
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.transfer + `/admin/${id}`);
await fetchData();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/** /**
* ทำงานเม Components กเรยกใชงาน * ทำงานเม Components กเรยกใชงาน
* จะเรยกใช fetchData เพอดงขอมลรายการขอโอน * จะเรยกใช fetchData เพอดงขอมลรายการขอโอน
@ -337,6 +369,18 @@ onMounted(async () => {
> >
<q-tooltip>รายละเอยด</q-tooltip> <q-tooltip>รายละเอยด</q-tooltip>
</q-btn> </q-btn>
<q-btn
v-if="isPermissionDelete(props.row.status)"
flat
round
dense
icon="mdi-delete"
color="red"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td> </q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'"> <div v-if="col.name === 'no'">

View file

@ -110,7 +110,9 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
format(val, row) { format(val, row) {
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`; return ` ${row.rank ? row.rank : row.prefix ?? ""}${
row.firstName ?? ""
} ${row.lastName ?? ""}`;
}, },
}, },
{ {
@ -131,9 +133,11 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.positionTypeOld return row.positionTypeOld && row.positionTypeOld !== "-"
? `${row.positionTypeOld}${ ? `${row.positionTypeOld}${
row.positionLevelOld ? `(${row.positionLevelOld})` : "" row.positionLevelOld && row.positionLevelOld !== "-"
? `(${row.positionLevelOld})`
: ""
}` }`
: ""; : "";
}, },
@ -309,7 +313,7 @@ function openDelete(id: string) {
dialogRemove($q, async () => { dialogRemove($q, async () => {
showLoader(); showLoader();
await http await http
.delete(config.API.receiveDataId(id)) .delete(config.API.receiveData() + `/admin/${id}`)
.then(async () => { .then(async () => {
await fecthlistRecevice(); await fecthlistRecevice();
await success($q, "ลบข้อมูลสำเร็จ"); await success($q, "ลบข้อมูลสำเร็จ");
@ -378,6 +382,7 @@ async function onSave(data: FormDataAppoint) {
typeCommand: data.typeCommand, typeCommand: data.typeCommand,
positionExecutiveField: data.positionExecutiveField, positionExecutiveField: data.positionExecutiveField,
positionArea: data.positionArea, positionArea: data.positionArea,
posExecutiveId: data.posExecutiveId,
}; };
showLoader(); showLoader();
@ -601,8 +606,10 @@ onMounted(async () => {
<q-item <q-item
v-if=" v-if="
checkPermission($route)?.attrIsDelete && checkPermission($route)?.attrOwnership ===
'OWNER' &&
props.row.status !== 'REPORT' && props.row.status !== 'REPORT' &&
props.row.status !== 'WAITING' &&
props.row.status !== 'DONE' props.row.status !== 'DONE'
" "
clickable clickable

View file

@ -77,7 +77,7 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return findPosMasterNoOld(row); return row.positionNumberOld ?? "-";
}, },
}, },
{ {
@ -236,8 +236,7 @@ function openModalOrder() {
item.status == "APPROVE") && item.status == "APPROVE") &&
item.organizationPositionOld && item.organizationPositionOld &&
item.organization && item.organization &&
item.dateStart && item.dateStart
item.dateEnd
); );
rows2.value = row; rows2.value = row;
rows2Data.value = row; rows2Data.value = row;

View file

@ -457,6 +457,7 @@ async function onSave(data: FormDataAppoint) {
typeCommand: data.typeCommand, typeCommand: data.typeCommand,
positionExecutiveField: data.positionExecutiveField, positionExecutiveField: data.positionExecutiveField,
positionArea: data.positionArea, positionArea: data.positionArea,
posExecutiveId: data.posExecutiveId,
}; };
showLoader(); showLoader();

View file

@ -286,6 +286,7 @@ async function onSaveSelectOrg(data: any) {
typeCommand: data.typeCommand, typeCommand: data.typeCommand,
positionExecutiveField: data.positionExecutiveField, positionExecutiveField: data.positionExecutiveField,
positionArea: data.positionArea, positionArea: data.positionArea,
posExecutiveId: data.posExecutiveId,
}; };
showLoader(); showLoader();

View file

@ -5,10 +5,12 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main"; import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow"; import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
import { useCommandMainStore } from "@/modules/18_command/store/Main";
import type { PropType } from "vue"; import type { PropType } from "vue";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main"; import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue"; import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
@ -16,6 +18,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
/** use */ /** use */
const $q = useQuasar(); const $q = useQuasar();
const stroe = useRetirementDataStore(); const stroe = useRetirementDataStore();
const storeCommand = useCommandMainStore();
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore(); const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
const { statusText } = stroe; const { statusText } = stroe;
const selected = ref<ResponseItems[]>([]); const selected = ref<ResponseItems[]>([]);
@ -47,6 +50,10 @@ const props = defineProps({
cancel: { type: Boolean, default: false }, cancel: { type: Boolean, default: false },
}); });
const commandType = ref<string>("");
const commandMainOp = ref<ListCommand[]>([]); //
const commandOp = ref<ListCommand[]>([]); //
//Table //Table
const filterKeyword = defineModel<string>("filterKeyword", { required: true }); const filterKeyword = defineModel<string>("filterKeyword", { required: true });
const rowsData = ref<ResponseItems[]>([]); const rowsData = ref<ResponseItems[]>([]);
@ -169,6 +176,11 @@ const visibleColumns = ref<string[]>([
]); ]);
const modalCommand = ref<boolean>(false); const modalCommand = ref<boolean>(false);
const isDisable = computed(() => {
return props.mainTabs === "1"
? selected.value.length === 0 || commandType.value === ""
: selected.value.length === 0;
});
/** popup ยืนยันส่งัว */ /** popup ยืนยันส่งัว */
function saveOrder() { function saveOrder() {
@ -210,6 +222,19 @@ async function fetchCheckOfficer() {
} }
} }
/**
* ลเตอร คำส
* @param val าจาก Input
* @param update Funtion quasar
*/
function filterSelector(val: string, update: Function) {
update(() => {
commandOp.value = commandMainOp.value.filter(
(v: ListCommand) => v.name.indexOf(val) > -1
);
});
}
watch( watch(
() => props.modal, () => props.modal,
async (val) => { async (val) => {
@ -231,6 +256,11 @@ watch(
rowsData.value = data ? data : []; rowsData.value = data ? data : [];
rowsDataMain.value = data ? data : []; rowsDataMain.value = data ? data : [];
commandType.value = "";
const dataCommandTypes = await storeCommand.getCommandTypes();
commandMainOp.value = dataCommandTypes.filter(
(e: ListCommand) => e.code === "C-PM-17" || e.code === "C-PM-48"
);
} else { } else {
rowsData.value = []; rowsData.value = [];
rowsDataMain.value = []; rowsDataMain.value = [];
@ -238,6 +268,7 @@ watch(
} }
); );
</script> </script>
<template> <template>
<q-dialog v-model="props.modal" persistent> <q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 85%"> <q-card style="min-width: 85%">
@ -249,6 +280,33 @@ watch(
<q-card-section> <q-card-section>
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div class="col-12 row"> <div class="col-12 row">
<q-select
v-if="props.mainTabs === '1'"
v-model="commandType"
dense
outlined
label="ประเภทคำสั่ง"
:options="commandOp"
option-label="name"
option-value="code"
emit-value
map-options
use-input
hide-selected
fill-input
@update:model-value="onSearch"
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn
) "
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
<q-space /> <q-space />
<q-input <q-input
borderless borderless
@ -332,7 +390,7 @@ watch(
<q-btn <q-btn
label="ส่งไปออกคำสั่ง" label="ส่งไปออกคำสั่ง"
@click="saveOrder" @click="saveOrder"
:disable="selected.length === 0" :disable="isDisable"
color="public" color="public"
/> />
</q-card-actions> </q-card-actions>
@ -341,7 +399,7 @@ watch(
<DialogCreateCommand <DialogCreateCommand
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="props.mainTabs === '1' ? 'C-PM-17' : 'C-PM-41'" :command-type-code="props.mainTabs === '1' ? commandType : 'C-PM-41'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fecthList" :fetch-data="props.fecthList"
/> />

View file

@ -47,6 +47,7 @@ const {
success, success,
dialogConfirm, dialogConfirm,
dialogRemove, dialogRemove,
convertDateToAPI,
} = mixin; } = mixin;
/** ตัวแปร */ /** ตัวแปร */
@ -477,9 +478,8 @@ function onSubmitConditions() {
function onSubmitAttached() { function onSubmitAttached() {
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
const formData = new FormData(); const formData = new FormData();
const send = date.value !== null ? new Date(date.value).toUTCString() : ""; const send: string = convertDateToAPI(date.value) ?? "";
const activeDate = const activeDate: string = convertDateToAPI(dateLeave.value) ?? "";
dateLeave.value !== null ? new Date(dateLeave.value).toUTCString() : "";
formData.append("Location", location.value); formData.append("Location", location.value);
formData.append("SendDate", send); formData.append("SendDate", send);
formData.append("ActiveDate", activeDate); formData.append("ActiveDate", activeDate);
@ -771,10 +771,13 @@ onMounted(async () => {
<q-space /> <q-space />
<div <div
v-if=" v-if="
!checkRoutePermisson && (!checkRoutePermisson &&
isStaff && isStaff &&
status === 'WAITTING' && status === 'WAITTING' &&
checkPermission($route)?.attrIsUpdate checkPermission($route)?.attrIsUpdate) ||
(!checkRoutePermisson &&
((isStaff && group === '1.1' && approveStep === 'st1') ||
(isOfficer && group !== '1.1' && approveStep === 'st3')))
" "
> >
<q-btn <q-btn

View file

@ -34,6 +34,7 @@ const {
hideLoader, hideLoader,
success, success,
dialogConfirm, dialogConfirm,
convertDateToAPI,
} = useCounterMixin(); } = useCounterMixin();
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailreject"); const checkRoutePermisson = ref<boolean>(route.name == "resignDetailreject");
@ -313,9 +314,8 @@ async function clickCancel() {
function onSubmitAttached() { function onSubmitAttached() {
dialogConfirm($q, () => { dialogConfirm($q, () => {
const formData = new FormData(); const formData = new FormData();
const send = date.value !== null ? new Date(date.value).toUTCString() : ""; const send: string = convertDateToAPI(date.value) ?? "";
const activeDate = const activeDate: string = convertDateToAPI(dateLeave.value) ?? "";
dateLeave.value !== null ? new Date(dateLeave.value).toUTCString() : "";
formData.append("Location", location.value); formData.append("Location", location.value);
formData.append("SendDate", send); formData.append("SendDate", send);
formData.append("ActiveDate", activeDate); formData.append("ActiveDate", activeDate);

View file

@ -33,7 +33,8 @@ const {
showLoader, showLoader,
hideLoader, hideLoader,
onSearchDataTable, onSearchDataTable,
findOrgName, dialogRemove,
success,
} = mixin; } = mixin;
/** Table */ /** Table */
@ -257,6 +258,21 @@ function onSearch() {
); );
} }
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.listResign() + `/admin/${id}`);
await fecthlist();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/**Hook */ /**Hook */
onMounted(async () => { onMounted(async () => {
status.value = stroeResign.formQurey.status; status.value = stroeResign.formQurey.status;
@ -308,7 +324,11 @@ onMounted(async () => {
color="primary" color="primary"
icon="mdi-account-arrow-right" icon="mdi-account-arrow-right"
> >
<q-tooltip>{{ `ส่งไปออกคำสั่ง${stroeResign.mainTabs == '2'?"ยกเลิกการ":''}ลาออก` }}</q-tooltip> <q-tooltip>{{
`ส่งไปออกคำสั่ง${
stroeResign.mainTabs == "2" ? "ยกเลิกการ" : ""
}ลาออก`
}}</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<q-space /> <q-space />
@ -393,6 +413,26 @@ onMounted(async () => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </q-btn>
<q-btn
v-if="
checkPermission($route)?.attrOwnership === 'OWNER' &&
props.row.status !== 'REPORT' &&
props.row.status !== 'WAITING' &&
props.row.status !== 'DONE' &&
props.row.status !== 'CANCELING' &&
props.row.status !== 'CANCEL' &&
stroeResign.mainTabs === '1'
"
flat
dense
round
color="red"
icon="delete"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td> </q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
<div <div

View file

@ -801,10 +801,11 @@ onMounted(async () => {
<q-space /> <q-space />
<div <div
v-if=" v-if="
!checkRoutePermisson && (!checkRoutePermisson &&
isStaff && isStaff &&
status === 'WAITTING' && status === 'WAITTING' &&
checkPermission($route)?.attrIsUpdate checkPermission($route)?.attrIsUpdate) ||
(!checkRoutePermisson && isStaff && approveStep === 'st1')
" "
> >
<q-btn <q-btn

View file

@ -38,6 +38,7 @@ const {
hideLoader, hideLoader,
success, success,
dialogConfirm, dialogConfirm,
convertDateToAPI,
} = mixin; } = mixin;
/** ตัวแปร */ /** ตัวแปร */
@ -301,9 +302,9 @@ async function clickCancel() {
function onSubmitAttached() { function onSubmitAttached() {
dialogConfirm($q, () => { dialogConfirm($q, () => {
const formData = new FormData(); const formData = new FormData();
const send = date.value !== null ? new Date(date.value).toUTCString() : ""; const send: string = convertDateToAPI(date.value) ?? "";
const activeDate = const activeDate: string = convertDateToAPI(dateLeave.value) ?? "";
dateLeave.value !== null ? new Date(dateLeave.value).toUTCString() : "";
formData.append("Location", location.value); formData.append("Location", location.value);
formData.append("SendDate", send); formData.append("SendDate", send);
formData.append("ActiveDate", activeDate); formData.append("ActiveDate", activeDate);

View file

@ -27,8 +27,15 @@ const stroeResign = useDataStore();
const { statusText } = stroe; const { statusText } = stroe;
const router = useRouter(); const router = useRouter();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader, onSearchDataTable } = const {
mixin; messageError,
date2Thai,
showLoader,
hideLoader,
onSearchDataTable,
dialogRemove,
success,
} = mixin;
/** Table */ /** Table */
const rows = ref<ResponseItems[]>([]); const rows = ref<ResponseItems[]>([]);
@ -129,7 +136,7 @@ const columns = ref<QTableProps["columns"]>([
sortable: true, sortable: true,
field: "status", field: "status",
format(val, row) { format(val, row) {
return stroeResign.mainTabs === "1" return stroeResign.mainTabsEMP === "1"
? statusText(row.status) ? statusText(row.status)
: statusText(row.status, "อนุญาต"); : statusText(row.status, "อนุญาต");
}, },
@ -252,6 +259,21 @@ function onSearch() {
); );
} }
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.listResignEMP() + `/admin/${id}`);
await fecthlist();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/**Hook */ /**Hook */
onMounted(async () => { onMounted(async () => {
statusEMP.value = stroeResign.formQureyEMP.status; statusEMP.value = stroeResign.formQureyEMP.status;
@ -391,6 +413,26 @@ onMounted(async () => {
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> </q-btn>
<q-btn
v-if="
checkPermission($route)?.attrOwnership === 'OWNER' &&
props.row.status !== 'REPORT' &&
props.row.status !== 'WAITING' &&
props.row.status !== 'DONE' &&
props.row.status !== 'CANCELING' &&
props.row.status !== 'CANCEL' &&
stroeResign.mainTabsEMP === '1'
"
flat
dense
round
color="red"
icon="delete"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td> </q-td>
<q-td v-for="col in props.cols" :key="col.id"> <q-td v-for="col in props.cols" :key="col.id">
<div <div

View file

@ -4,7 +4,6 @@ import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { getColumnLabel } from "@/utils/function";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
@ -309,9 +308,7 @@ watch(
:key="col.name" :key="col.name"
:props="props" :props="props"
> >
<span class="text-weight-medium">{{ <span class="text-weight-medium">{{ col.label }}</span>
getColumnLabel(col, isAct)
}}</span>
</q-th> </q-th>
</q-tr> </q-tr>
</template> </template>

View file

@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree"; import { useStructureTree } from "@/stores/structureTree";
import { formatPosmasterNo } from "@/utils/function";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -74,7 +75,12 @@ const columns = ref<QTableProps["columns"]>([
sortable: true, sortable: true,
field: "posMasterNo", field: "posMasterNo",
format(val, row) { format(val, row) {
return `${row.orgShortname} ${row.posMasterNo}`; return formatPosmasterNo(
row.orgShortname,
row.posMasterNoPrefix,
row.posMasterNo.toString(),
row.posMasterNoSuffix
);
}, },
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",

View file

@ -212,7 +212,7 @@ watch(
:close="close" :close="close"
/> />
<q-separator color="grey-4" /> <q-separator color="grey-4" />
<q-card-section style="max-height: 80vh" class="scroll q-pa-none"> <q-card-section style="max-height: 55vh" class="scroll q-pa-none">
<div <div
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium" class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
> >
@ -362,6 +362,7 @@ watch(
</datepicker> </datepicker>
</div> </div>
</div> </div>
<div <div
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium" class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
> >
@ -513,6 +514,7 @@ watch(
</datepicker> </datepicker>
</div> </div>
</div> </div>
<q-input <q-input
class="col-12 bg-white q-ma-md" class="col-12 bg-white q-ma-md"
outlined outlined
@ -522,7 +524,8 @@ watch(
label="คำอธิบาย" label="คำอธิบาย"
hide-bottom-space hide-bottom-space
type="textarea" type="textarea"
></q-input> />
<div <div
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium" class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
> >
@ -541,6 +544,7 @@ watch(
</label> </label>
</div> </div>
</div> </div>
<div <div
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium" class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
> >
@ -559,6 +563,7 @@ watch(
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator color="grey-4" v-if="!isRead" /> <q-separator color="grey-4" v-if="!isRead" />
<div class="q-pa-sm" v-if="!isRead"> <div class="q-pa-sm" v-if="!isRead">
<div class="row justify-end"> <div class="row justify-end">

View file

@ -0,0 +1,263 @@
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { DataOption } from "@/interface/main";
import type { DataPendingJobs } from "@/modules/09_leave/interface/response/work";
const $q = useQuasar();
const { showLoader, hideLoader, messageError, date2Thai, onSearchDataTable } =
useCounterMixin();
/** ข้อมูลตาราง*/
const keyword = ref<string>("");
const timeOutMinutes = ref<string>("30");
const rowsMain = ref<DataPendingJobs[]>([]);
const rows = ref<DataPendingJobs[]>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "createdFullName",
align: "left",
label: "ชื่อ-นามสกุล",
sortable: true,
field: "createdFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "checkType",
align: "left",
label: "ลงเวลาเข้า/ลงเวลาออก",
sortable: true,
field: "checkType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return val ? convertcheckType(val) : "-";
},
},
{
name: "status",
align: "left",
label: "สถานะ ",
sortable: true,
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return val ? convertStatus(val) : "-";
},
},
{
name: "createdDate",
align: "left",
label: "ลงเวลาเมื่อ",
sortable: true,
field: "createdDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return val ? date2Thai(val, false, true) : "-";
},
},
{
name: "processingDate",
align: "left",
label: "เริ่มประมวลผล",
sortable: true,
field: "processingDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return val ? date2Thai(val, false, true) : "-";
},
},
{
name: "completedDate",
align: "left",
label: "ประมวลผลเสร็จ",
sortable: true,
field: "completedDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return val ? date2Thai(val, false, true) : "-";
},
},
]);
const visibleColumns = ref<string[]>([
"no",
"createdFullName",
"checkType",
"status",
"createdDate",
"processingDate",
"completedDate",
]);
const timeOutMinutesOption = ref<DataOption[]>([
{ id: "30", label: "30 นาที" },
{ id: "60", label: "1 ชั่วโมง" },
{ id: "1440", label: "1 วัน" },
{ id: "10080", label: "7 วัน" },
]);
/** ฟังก์ชันดึงข้อมูลจาก API */
async function fetchData() {
try {
showLoader();
const res = await http.get(
`${config.API.leavePendingJobs}${Number(timeOutMinutes.value)}`
);
rowsMain.value = res.data.result;
serchDataTable();
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
}
/** ฟังก์ชันค้นหาข้อมูลในตาราง */
function serchDataTable() {
rows.value = onSearchDataTable(
keyword.value,
rowsMain.value,
columns.value ? columns.value : []
);
}
/**
* งกนแปลงสถานะเปนขอความ
* @param val
*/
function convertStatus(val: string) {
switch (val) {
case "PENDING":
return "รอดำเนินการ";
case "COMPLETED":
return "ดำเนินการเสร็จสิ้น";
default:
break;
}
}
function convertcheckType(val: string) {
switch (val) {
case "CHECK_OUT":
return "ลงเวลาออก";
case "CHECK_IN":
return "ลงเวลาเข้า";
default:
break;
}
}
onMounted(() => {
fetchData();
});
</script>
<template>
<div class="row items-center q-gutter-x-sm q-pb-sm">
<q-select
emit-value
map-options
outlined
dense
option-value="id"
option-label="label"
label="เวลาย้อนหลัง"
use-input
v-model="timeOutMinutes"
hide-selected
fill-input
:options="timeOutMinutesOption"
@update:model-value="fetchData"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
</q-select>
<q-space />
<q-input
dense
outlined
v-model="keyword"
label="ค้นหา"
@keydown.enter.prevent="serchDataTable"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
<d-table
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
style="color: #000000; font-weight: 500"
>
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
</d-table>
</template>
<style scoped></style>

View file

@ -97,7 +97,7 @@ watch(
formData.note = ""; formData.note = "";
} else if (props.editCheck === "PENDING") { } else if (props.editCheck === "PENDING") {
if (props.detailData) { if (props.detailData) {
if (props.detailData.checkInEdit) { if (props.detailData.checkInEdit && props.detailData.checkOutEdit) {
formData.checkIn = props.detailData.startTimeMorning; formData.checkIn = props.detailData.startTimeMorning;
formData.checkOut = props.detailData.endTimeAfternoon; formData.checkOut = props.detailData.endTimeAfternoon;
} else if ( } else if (

View file

@ -0,0 +1,344 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useSpecialTimeStore } from "@/modules/09_leave/stores/SpecialTimeStore";
import { usePagination } from "@/composables/usePagination";
import type { QTableProps } from "quasar";
import type { DataSpecialTime } from "@/modules/09_leave/interface/index/Main";
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const store = useSpecialTimeStore();
const {
hideLoader,
messageError,
showLoader,
success,
date2Thai,
dialogConfirm,
dialogMessageNotify,
dateToISO,
} = useCounterMixin();
const { pagination, params, onRequest } = usePagination("", fetchDataList);
/** props*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
fetchData: { type: Function, default: () => {} },
dateThaiRange: { type: Function, default: () => {} },
columns: { type: Array as () => QTableProps["columns"], default: () => [] },
visibleColumnsMain: { type: Array as () => string[], default: () => [] },
});
const filterKeyword = ref<string>("");
const filterStatus = ref<string>("PENDING");
const filterDate = ref<[Date, Date] | null>([new Date(), new Date()]); //
const rows = ref<DataSpecialTime[]>([]);
const visibleColumns = ref<string[]>(props.visibleColumnsMain);
const selected = ref<DataSpecialTime[]>([]);
const reason = ref<string>("");
/** ฟังก์ชันเรียกข้อมูลรายการลงเวลากรณีพิเศษ*/
async function fetchDataList() {
showLoader();
selected.value = [];
await http
.get(config.API.specialTime(), {
params: {
...params.value,
keyword: filterKeyword.value.trim(),
status: filterStatus.value,
startDate: filterDate.value ? dateToISO(filterDate.value[0]) : null,
endDate: filterDate.value ? dateToISO(filterDate.value[1]) : null,
},
})
.then(async (res) => {
const result = await res.data.result;
pagination.value.rowsNumber = result.total;
if (result.data.length > 0) {
rows.value = result.data.map((e: DataSpecialTime) => ({
...e,
date: date2Thai(new Date(e.createdAt), false, true),
dateFix: date2Thai(new Date(e.checkDate)),
timeMorning:
e.startTimeMorning == null
? "-"
: e.checkInEdit == true
? e.startTimeMorning + " - " + e.endTimeMorning
: "-",
timeAfternoon:
e.startTimeAfternoon == null
? "-"
: e.checkOutEdit == true
? e.startTimeAfternoon + " - " + e.endTimeAfternoon
: "-",
checkIn: e.checkInTime,
checkOut: e.checkOutTime,
checkInStatus: store.convertStatus(e.checkInStatus),
checkOutStatus: store.convertStatus(e.checkOutStatus),
checkInStatusMain: e.checkInStatus,
checkOutStatusMain: e.checkOutStatus,
}));
} else {
rows.value = [];
}
})
.catch((e) => {
rows.value = [];
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/** ฟังก์ชันบันทึกข้อมูล*/
function onSubmit() {
if (selected.value.length === 0) {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ");
} else {
dialogConfirm($q, async () => {
showLoader();
const payload = selected.value.map((e: DataSpecialTime) => {
let checkInTime: string;
let checkOutTime: string;
if (e.checkInEdit && e.checkOutEdit) {
checkInTime = e.startTimeMorning;
checkOutTime = e.endTimeAfternoon;
} else if (e.checkInEdit && !e.checkOutEdit) {
checkInTime = e.startTimeMorning;
checkOutTime = e.endTimeMorning;
} else if (!e.checkInEdit && e.checkOutEdit) {
checkInTime = e.startTimeAfternoon;
checkOutTime = e.endTimeAfternoon;
} else {
checkInTime = e.checkInTime;
checkOutTime = e.checkOutTime;
}
return {
recId: e.id,
checkInTime,
checkOutTime,
checkInStatus: e.checkInEdit ? "NORMAL" : e.checkInStatusMain,
checkOutStatus: e.checkOutEdit ? "NORMAL" : e.checkOutStatusMain,
reason: reason.value,
};
});
try {
await http.put(config.API.specialTimeApproveLists, payload);
await props.fetchData();
success($q, "บันทึกข้อมูลสำเร็จ");
handleClose();
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
}
/** ฟังก์ชั่นค้นหาข้อมูล */
function onSearchData() {
pagination.value.page = 1;
fetchDataList();
}
/** ฟังก์ชันปิด*/
function handleClose() {
modal.value = false;
selected.value = [];
rows.value = [];
reason.value = "";
filterDate.value = [new Date(), new Date()];
filterKeyword.value = "";
pagination.value.page = 1;
}
watch(modal, async (val) => {
if (val) {
await fetchDataList();
}
});
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 800px">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader
tittle="อนุมัติการลงเวลากรณีพิเศษแบบหลายรายการ"
:close="handleClose"
/>
<q-separator />
<q-card-section class="row q-col-gutter-sm">
<div class="col-12">
<div class="row col-12 q-col-gutter-sm">
<div class="col-xs-12 col-sm-6 col-md-5">
<datepicker
v-model="filterDate"
:locale="'th'"
autoApply
borderless
range
:enableTimePicker="false"
week-start="0"
@update:modelValue="onSearchData()"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="full-width datepicker"
:model-value="
filterDate != null ? dateThaiRange(filterDate) : null
"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<q-space v-if="!$q.screen.xs && !$q.screen.sm" />
<div class="col-xs-12 col-sm-6 col-md-4">
<q-input
standout
dense
v-model="filterKeyword"
outlined
placeholder="ค้นหาชื่อ-นามสกุล"
@keydown.enter.prevent="onSearchData()"
>
<template v-slot:append>
<q-icon name="search" />
</template>
</q-input>
</div>
<div class="col-xs-12 col-sm-6 col-md-2">
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
/>
</div>
</div>
</div>
<span class="text-red"
>*หมายเหตเลอกทงหมดเฉพาะรายการทแสดงเทาน</span
>
<div class="col-12">
<p-table
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
:paging="false"
dense
:visible-columns="visibleColumns"
:rows-per-page-options="[10, 25, 50, 100]"
v-model:pagination="pagination"
@request="onRequest"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.selected"
/>
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td>
<q-checkbox
keep-color
color="primary"
dense
v-model="props.selected"
/>
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div
v-else-if="col.name === 'description'"
class="table_ellipsis"
>
{{ col.value ?? "-" }}
</div>
<div v-else>
{{ col.value ?? "-" }}
</div>
</q-td>
</q-tr>
</template>
</p-table>
</div>
<div class="col-12">
<q-input
outlined
v-model="reason"
dense
lazy-rules
type="textarea"
:rules="[(val:string) => !!val || 'กรุณาเหตุผลการอนุมัติ']"
label="เหตุผลการอนุมัติ"
hide-bottom-space
rows="3"
/>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn label="บันทึก" color="public" id="onSubmit" type="submit">
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>
<style scoped></style>

View file

@ -228,8 +228,12 @@ onMounted(async () => {
<template> <template>
<div class="q-mt-sm"> <div class="q-mt-sm">
<div class="row q-gutter-sm"> <div class="row q-gutter-sm">
<div class="col-3"> <div class="col-3 scrollable-list">
<q-list bordered class="rounded-borders"> <q-list
bordered
class="rounded-borders"
style="max-height: 80vh; overflow-y: auto"
>
<q-item <q-item
v-for="(item, i) in filterLists" v-for="(item, i) in filterLists"
:key="i" :key="i"

View file

@ -260,6 +260,14 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const isSysCancel = computed(() => {
return (
formData.reasonOligarch === "อนุมัติการขอยกเลิกการลา โดยระบบ" &&
statusCheck.value === "DELETE"
);
});
/** /**
* งกนเรยกรายละเอยดของขอม * งกนเรยกรายละเอยดของขอม
* @param paramsId ID จาก paramID * @param paramsId ID จาก paramID
@ -692,10 +700,10 @@ onMounted(async () => {
fetchOptionType(), fetchOptionType(),
fetchKeycloakPositionData(), fetchKeycloakPositionData(),
fetchDetailLeave(paramsId), fetchDetailLeave(paramsId),
checkOfficer(),
]); ]);
await checkLeaveType(formData.leaveTypeId, formData); await checkLeaveType(formData.leaveTypeId, formData);
await checkOfficer();
} finally { } finally {
hideLoader(); hideLoader();
} }
@ -1036,7 +1044,12 @@ onMounted(async () => {
props.row.comment == '' props.row.comment == ''
" "
> >
<div v-if="isSysCancel" class="text-red-6">
งไมไดแสดงความคดเห
</div>
<q-btn <q-btn
v-else
dense dense
:disable=" :disable="
statusCheck == 'NEW' || statusCheck == 'NEW' ||
@ -1133,7 +1146,13 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="row col-12 q-pa-md"> <div v-if="isSysCancel" class="row col-12 q-pa-md">
<q-banner class="bg-red-2 text-red-6 full-width" rounded>
อำนาจยงไมไดจารณา ใบลานกยกเลกแล
</q-banner>
</div>
<div class="row col-12 q-pa-md" v-else>
<div class="col-12 row bg-white q-col-gutter-md"> <div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-6 row items-start"> <div class="col-xs-6 row items-start">
<div class="col-12 text-weight-bold text-top"> <div class="col-12 text-weight-bold text-top">

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onMounted, computed } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
@ -158,6 +158,13 @@ const isLoadData = ref<boolean>(false);
const leaveType = ref<LeaveType[]>([]); // const leaveType = ref<LeaveType[]>([]); //
const checkForm = ref<string>(""); // const checkForm = ref<string>(""); //
const isSysCancel = computed(() => {
return (
formData.reasonOligarch === "อนุมัติการขอยกเลิกการลา โดยระบบ" &&
statusCheck.value === "DELETE"
);
});
/** /**
* งกเรยกขอมลรายละเอยดของการยกเลกลา * งกเรยกขอมลรายละเอยดของการยกเลกลา
* @param paramsId ID จาก paramID * @param paramsId ID จาก paramID
@ -769,7 +776,13 @@ onMounted(async () => {
</div> </div>
</div> </div>
<q-separator /> <q-separator />
<div class="row col-12 q-pa-md">
<div v-if="isSysCancel" class="row col-12 q-pa-md">
<q-banner class="bg-green-2 text-green-6 full-width" rounded>
{{ formDataReject.leaveDirectorComment }}
</q-banner>
</div>
<div class="row col-12 q-pa-md" v-else>
<div class="col-12 row bg-white q-col-gutter-md"> <div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-6 row items-start"> <div class="col-xs-6 row items-start">
<div class="col-12 text-weight-bold text-top"> <div class="col-12 text-weight-bold text-top">
@ -799,7 +812,7 @@ onMounted(async () => {
<div class="col-xs-6 row items-start"> <div class="col-xs-6 row items-start">
<div class="col-12 text-weight-bold text-top"> <div class="col-12 text-weight-bold text-top">
ผลการพจารณา ผลการพจารณายกเลกวนลา
</div> </div>
<div class="col-12 text-detail"> <div class="col-12 text-detail">
{{ {{

View file

@ -4,7 +4,6 @@ import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { getColumnLabel } from "@/utils/function";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
@ -36,6 +35,7 @@ const props = defineProps({
const pageId = ref<string>(route.params.id as string); const pageId = ref<string>(route.params.id as string);
const keyword = ref<string>(""); const keyword = ref<string>("");
const isAct = ref<boolean>(false); const isAct = ref<boolean>(false);
const isAllDirector = ref<boolean>(false);
const total = ref<number>(0); const total = ref<number>(0);
const totalList = ref<number>(1); const totalList = ref<number>(1);
@ -106,6 +106,7 @@ async function getData() {
page: pagination.value.page, page: pagination.value.page,
keyword: keyword.value, keyword: keyword.value,
isAct: isAct.value, isAct: isAct.value,
isAllDirector: isAllDirector.value,
keycloakId: props.keycloakUserId, keycloakId: props.keycloakUserId,
type: type:
props.profileType?.toLocaleLowerCase() === "officer" props.profileType?.toLocaleLowerCase() === "officer"
@ -197,6 +198,7 @@ function closeDialog() {
modal.value = false; modal.value = false;
rows.value = []; rows.value = [];
selected.value = []; selected.value = [];
isAllDirector.value = false;
} }
watch( watch(
@ -232,19 +234,45 @@ watch(
<q-card-section> <q-card-section>
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12"> <div class="col-12">
<div class="row q-gutter-x-xs"> <div class="row items-center q-mb-sm">
<q-input <q-input
dense dense
outlined outlined
label="ค้นหา" label="ค้นหา"
v-model="keyword" v-model="keyword"
style="width: 300px" class="col-grow"
style="max-width: 400px"
@keydown.enter.prevent="onSearchData()" @keydown.enter.prevent="onSearchData()"
> >
<template v-slot:append> <template v-slot:append>
<q-icon name="search"></q-icon> <q-icon name="search"></q-icon>
</template> </template>
</q-input> </q-input>
<q-space />
<q-btn
color="primary"
icon="search"
label="ค้นหา"
class="q-px-md"
@click.prevent="onSearchData"
style="width: 150px"
/>
</div>
<div
class="row items-center q-gutter-x-md text-subtitle2 text-grey-8"
>
<q-checkbox
keep-color
v-model="isAllDirector"
label="หัวหน้าทั้งหน่วยงาน"
color="primary"
@update:model-value="onSearchData"
>
<q-tooltip>วหนาทงหนวยงาน</q-tooltip>
</q-checkbox>
<q-checkbox <q-checkbox
keep-color keep-color
v-model="isAct" v-model="isAct"
@ -252,20 +280,11 @@ watch(
color="primary" color="primary"
@update:model-value="onSearchData" @update:model-value="onSearchData"
> >
<q-tooltip>แสดงเฉพาะรกษาการแทน </q-tooltip> <q-tooltip>แสดงเฉพาะรกษาการแทน</q-tooltip>
</q-checkbox> </q-checkbox>
<q-space />
<q-btn
color="primary"
icon="search"
label="ค้นหา"
class="q-pa-sm"
@click.prevent="onSearchData"
style="width: 200px"
>
</q-btn>
</div> </div>
</div> </div>
<div class="col-12 text-red"> <div class="col-12 text-red">
{{ {{
props.type == "APPROVER" props.type == "APPROVER"
@ -319,9 +338,7 @@ watch(
:key="col.name" :key="col.name"
:props="props" :props="props"
> >
<span class="text-weight-medium">{{ <span class="text-weight-medium">{{ col.label }}</span>
getColumnLabel(col, isAct)
}}</span>
</q-th> </q-th>
</q-tr> </q-tr>
</template> </template>

View file

@ -1,17 +1,59 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, watch } from "vue"; import { ref, onMounted, computed } from "vue";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { useRouter } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { checkPermission } from "@/utils/permissions"; import { checkPermission } from "@/utils/permissions";
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore"; import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const leaveStore = useLeavelistDataStore(); const leaveStore = useLeavelistDataStore();
const route = useRoute();
const router = useRouter(); const router = useRouter();
const { showLoader, hideLoader, messageError, dialogRemove, success } =
useCounterMixin();
const total = defineModel<number>("total", { required: true }); const total = defineModel<number>("total", { required: true });
const totalList = defineModel<number>("totalList", { required: true }); const totalList = defineModel<number>("totalList", { required: true });
const pagination = defineModel<any>("pagination", { required: true }); const pagination = defineModel<any>("pagination", { required: true });
const props = defineProps({
getList: Function,
rows: {
type: Object,
require: true,
},
page: {
type: Number,
require: true,
},
rowsPerPage: {
type: Number,
require: true,
},
maxPage: {
type: Number,
require: true,
},
totalList: {
type: Number,
require: true,
},
dataToobar: Object,
});
const isPermissionDelete = computed(() => {
return (status: string) => {
return (
checkPermission(route)?.attrOwnership === "OWNER" &&
!leaveStore.statusDelete.includes(status) &&
leaveStore.tabMenu === "1"
);
};
});
/** ข้อมูลหัวตาราง รายการลา */ /** ข้อมูลหัวตาราง รายการลา */
const columnsLeave = ref<QTableProps["columns"]>([ const columnsLeave = ref<QTableProps["columns"]>([
@ -212,31 +254,6 @@ const visibleReject = ref<string[]>([
"status", "status",
]); ]);
const props = defineProps({
getList: Function,
rows: {
type: Object,
require: true,
},
page: {
type: Number,
require: true,
},
rowsPerPage: {
type: Number,
require: true,
},
maxPage: {
type: Number,
require: true,
},
totalList: {
type: Number,
require: true,
},
dataToobar: Object,
});
/** ไปหน้ารายละเอียด */ /** ไปหน้ารายละเอียด */
function redirectToDetail(id: string) { function redirectToDetail(id: string) {
const routePrefix = leaveStore.tabMenu === "1" ? "/leave" : "/leave-reject"; const routePrefix = leaveStore.tabMenu === "1" ? "/leave" : "/leave-reject";
@ -248,6 +265,37 @@ function updatePagination(newPagination: any) {
pagination.value.rowsPerPage = newPagination.rowsPerPage; pagination.value.rowsPerPage = newPagination.rowsPerPage;
} }
/**
* งกนสำหรบดงช CSS Class ตามสถานะ
* @param statusText สถานะของรายการ
*/
function getStatusColor(statusText: string) {
const statusMap: Record<string, string> = {
APPROVE: "text-green-6",
REJECT: "text-red",
NEW: "text-blue",
PENDING: "text-warning",
// DELETE DELETING
};
return statusMap[statusText.toUpperCase()] ?? "";
}
function handleDelete(id: string) {
dialogRemove($q, async () => {
try {
showLoader();
await http.delete(config.API.leaveList() + `/${id}`);
await props.getList?.();
success($q, "ลบข้อมูลสำเร็จ");
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
});
}
/** Hook*/ /** Hook*/
onMounted(() => { onMounted(() => {
if (leaveStore.tabMenu === "1") { if (leaveStore.tabMenu === "1") {
@ -297,23 +345,23 @@ onMounted(() => {
> >
<q-tooltip>รายละเอยด</q-tooltip> <q-tooltip>รายละเอยด</q-tooltip>
</q-btn> </q-btn>
<q-btn
v-if="isPermissionDelete(props.row.statusText)"
flat
round
dense
icon="mdi-delete"
color="red"
@click.prevent="handleDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td> </q-td>
<q-td <q-td
v-for="col in props.cols" v-for="col in props.cols"
:key="col.name" :key="col.name"
:props="props" :props="props"
:class=" :class="getStatusColor(props.row.statusText)"
props.row.statusText == 'REJECT'
? 'text-red'
: props.row.statusText == 'NEW'
? 'text-blue'
: props.row.statusText == 'PENDING'
? 'text-warning'
: props.row.statusText == 'DELETE' ||
props.row.statusText == 'DELETING'
? 'text-orange'
: ''
"
> >
<div v-if="col.name == 'no'"> <div v-if="col.name == 'no'">
{{ {{

View file

@ -68,6 +68,8 @@ interface DataSpecialTime {
statusSort: number; statusSort: number;
timeAfternoon: string; timeAfternoon: string;
timeMorning: string; timeMorning: string;
checkInStatusMain: string;
checkOutStatusMain: string;
} }
export type { export type {
DataOption, DataOption,

View file

@ -98,6 +98,26 @@ interface DataProcess {
errorMessage: string | null; errorMessage: string | null;
} }
interface DataPendingJobs {
taskId: string;
keycloakUserId: string;
createdDate: string | Date;
processingDate: string | Date;
completedDate: string | Date;
status: string;
checkType: string;
checkInId: string;
errorMessage: string;
additionalData: string;
id: string;
createdAt: string | Date;
createdUserId: string;
lastUpdatedAt: string;
lastUpdateUserId: string;
createdFullName: string;
lastUpdateFullName: string;
}
export type { export type {
TableRows, TableRows,
DataResLog, DataResLog,
@ -105,4 +125,5 @@ export type {
TableRowsTime, TableRowsTime,
FormDetail, FormDetail,
DataProcess, DataProcess,
DataPendingJobs,
}; };

View file

@ -44,6 +44,8 @@ export const useLeavelistDataStore = defineStore("leave", () => {
const leaveType = ref<LeaveType[]>([]); const leaveType = ref<LeaveType[]>([]);
const statusDelete = ["APPROVE", "DELETING", "DELETE"];
/** /**
* fetchListLeave * fetchListLeave
* @param data Page * @param data Page
@ -264,5 +266,6 @@ export const useLeavelistDataStore = defineStore("leave", () => {
leaveTypeOption, leaveTypeOption,
leaveTypeList, leaveTypeList,
fetchKeycloakPosition, fetchKeycloakPosition,
statusDelete,
}; };
}); });

View file

@ -9,6 +9,7 @@ import { useRoute } from "vue-router";
import Tab1 from "@/modules/09_leave/components/02_WorkList/Tab1.vue"; import Tab1 from "@/modules/09_leave/components/02_WorkList/Tab1.vue";
import Tab2 from "@/modules/09_leave/components/02_WorkList/Tab2.vue"; import Tab2 from "@/modules/09_leave/components/02_WorkList/Tab2.vue";
import Tab3 from "@/modules/09_leave/components/02_WorkList/Tab3_Processed_Late.vue"; import Tab3 from "@/modules/09_leave/components/02_WorkList/Tab3_Processed_Late.vue";
import Tab4_Pending from "@/modules/09_leave/components/02_WorkList/Tab4_Pending.vue";
const stores = useWorklistDataStore(); const stores = useWorklistDataStore();
const route = useRoute(); const route = useRoute();
@ -21,6 +22,10 @@ const isPermissionTab3 = computed(() => {
checkPermission(route)?.attrIsUpdate) checkPermission(route)?.attrIsUpdate)
); );
}); });
const isPermissionTab4 = computed(() => {
return checkPermission(route)?.attrOwnership === "OWNER";
});
</script> </script>
<template> <template>
@ -46,6 +51,7 @@ const isPermissionTab3 = computed(() => {
name="3" name="3"
label="ประมวลผลการขาดราชการ/มาสาย" label="ประมวลผลการขาดราชการ/มาสาย"
/> />
<q-tab v-if="isPermissionTab4" name="4" label="รอประมวลผล" />
<!-- เพมแทบใหม --> <!-- เพมแทบใหม -->
</q-tabs> </q-tabs>
@ -62,6 +68,9 @@ const isPermissionTab3 = computed(() => {
<q-tab-panel name="3"> <q-tab-panel name="3">
<Tab3 /> <Tab3 />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="4">
<Tab4_Pending />
</q-tab-panel>
</q-tab-panels> </q-tab-panels>
</div> </div>
</q-card> </q-card>

View file

@ -17,6 +17,7 @@ import type {
import DialogReason from "@/components/Dialogs/PopupReason.vue"; import DialogReason from "@/components/Dialogs/PopupReason.vue";
import DialogApprove from "@/modules/09_leave/components/04_SpecialTime/DialogApprove.vue"; import DialogApprove from "@/modules/09_leave/components/04_SpecialTime/DialogApprove.vue";
import DialogMultipleApprove from "@/modules/09_leave/components/04_SpecialTime/DialogMultipleApprove.vue";
const $q = useQuasar(); // show dialog const $q = useQuasar(); // show dialog
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -47,6 +48,7 @@ const name = ref<string>("");
const id = ref<string>(""); const id = ref<string>("");
const dateDialog = ref<string>(""); const dateDialog = ref<string>("");
const dateFixDialog = ref<string>(""); const dateFixDialog = ref<string>("");
const modalMultiple = ref<boolean>(false);
// //
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
@ -54,7 +56,7 @@ const filterStatus = ref<string>("PENDING");
const filterDate = ref<[Date, Date] | null>([new Date(), new Date()]); // const filterDate = ref<[Date, Date] | null>([new Date(), new Date()]); //
const optionStatus = ref<DataOption[]>(store.optionStatusMain); const optionStatus = ref<DataOption[]>(store.optionStatusMain);
const rows = ref<DataSpecialTime[]>([]); const rows = ref<DataSpecialTime[]>([]);
const visibleColumns = ref<String[]>([ const visibleColumns = ref<string[]>([
"no", "no",
"fullName", "fullName",
"createdAt", "createdAt",
@ -283,6 +285,20 @@ onMounted(async () => {
<template> <template>
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
รายการลงเวลากรณเศษ รายการลงเวลากรณเศษ
<q-space />
<q-btn
v-if="
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
class="q-px-md"
color="primary"
dense
unelevated
@click="modalMultiple = true"
>
อนแบบหลายรายการ
</q-btn>
</div> </div>
<q-card flat bordered class="col-12 q-pa-md"> <q-card flat bordered class="col-12 q-pa-md">
@ -492,6 +508,14 @@ onMounted(async () => {
:detailData="detailData" :detailData="detailData"
:fetch-data="fetchData" :fetch-data="fetchData"
/> />
<DialogMultipleApprove
v-model:modal="modalMultiple"
:fetch-data="fetchData"
:dateThaiRange="dateThaiRange"
:columns="columns"
:visibleColumnsMain="visibleColumns"
/>
</template> </template>
<style></style> <style></style>

View file

@ -50,7 +50,7 @@ const id = ref<string>(route.params.id as string); // id รายการป
const isLoadView = ref<boolean>(false); // view const isLoadView = ref<boolean>(false); // view
const modalHistory = ref<boolean>(false); // popup const modalHistory = ref<boolean>(false); // popup
// //
const formCommand = reactive<FormCommand>({ const formCommand = reactive({
elementaryFullName: "", // elementaryFullName: "", //
elementaryPosition: "", // elementaryPosition: "", //
abovelevelFullname: "", // 1 abovelevelFullname: "", // 1

View file

@ -58,6 +58,7 @@ export const useEvalutuonStore = defineStore("EvalutuonStore", () => {
const dataList: EvaluateList[] = data.map( const dataList: EvaluateList[] = data.map(
(data: EvaluateRes) => (data: EvaluateRes) =>
({ ({
...data,
id: data.id, id: data.id,
citizenId: data.citizenId, citizenId: data.citizenId,
fullName: data.fullName, fullName: data.fullName,
@ -133,7 +134,7 @@ export const useEvalutuonStore = defineStore("EvalutuonStore", () => {
align: "left", align: "left",
label: "เลขที่ตำแหน่ง", label: "เลขที่ตำแหน่ง",
sortable: true, sortable: true,
field: "positionNumber", field: "posNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },

View file

@ -351,7 +351,7 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div v-else> <div v-else>
{{ !col.value ? "-" : col.value }} {{ col.value ? col.value : "-" }}
</div> </div>
</q-td> </q-td>
</q-tr> </q-tr>

View file

@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
import { usePagination } from "@/composables/usePagination"; import { usePagination } from "@/composables/usePagination";
import { formatPosmasterNo } from "@/utils/function";
import config from "@/app.config"; import config from "@/app.config";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -72,9 +73,12 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.orgShortName && row.posMasterNo return formatPosmasterNo(
? `${row.orgShortName} ${row.posMasterNo}` row.orgShortName,
: "-"; row.posMasterNoPrefix,
row.posMasterNo,
row.posMasterNoSuffix
);
}, },
}, },
{ {

View file

@ -19,6 +19,7 @@ import DialogMoveLevel from "@/modules/13_salary/components/04_salaryLists/Dialo
/** importStore*/ /** importStore*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
import { formatPosmasterNo } from "@/utils/function";
/** use*/ /** use*/
const $q = useQuasar(); const $q = useQuasar();
@ -87,9 +88,12 @@ const baseColumns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.orgShortName && row.posMasterNo return formatPosmasterNo(
? `${row.orgShortName} ${row.posMasterNo}` row.orgShortName,
: "-"; row.posMasterNoPrefix,
row.posMasterNo,
row.posMasterNoSuffix
);
}, },
}, },
{ {

View file

@ -19,6 +19,7 @@ import DialogInfo from "@/modules/13_salary/components/DialogInfoMain.vue";
/** importStore*/ /** importStore*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
import { formatPosmasterNo } from "@/utils/function";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -98,9 +99,12 @@ const columns = ref<QTableColumn[]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.orgShortName && row.posMasterNo return formatPosmasterNo(
? `${row.orgShortName} ${row.posMasterNo}` row.orgShortName,
: "-"; row.posMasterNoPrefix,
row.posMasterNo,
row.posMasterNoSuffix
);
}, },
}, },
{ {

View file

@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore"; import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
import { usePagination } from "@/composables/usePagination"; import { usePagination } from "@/composables/usePagination";
import { formatPosmasterNo } from "@/utils/function";
import config from "@/app.config"; import config from "@/app.config";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -71,9 +72,12 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.orgShortName && row.posMasterNo return formatPosmasterNo(
? `${row.orgShortName} ${row.posMasterNo}` row.orgShortName,
: "-"; row.posMasterNoPrefix,
row.posMasterNo,
row.posMasterNoSuffix
);
}, },
}, },
{ {

View file

@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
import { checkPermission } from "@/utils/permissions"; import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore"; import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
import { formatPosmasterNo } from "@/utils/function";
import config from "@/app.config"; import config from "@/app.config";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -84,6 +85,14 @@ const baseColumns = ref<QTableProps["columns"]>([
field: "orgShortName", field: "orgShortName",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) {
return formatPosmasterNo(
row.orgShortName,
row.posMasterNoPrefix,
row.posMasterNo,
row.posMasterNoSuffix
);
},
}, },
{ {
name: "position", name: "position",

View file

@ -6,6 +6,7 @@ import { checkPermission } from "@/utils/permissions";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore"; import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
import { formatPosmasterNo } from "@/utils/function";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -98,9 +99,12 @@ const columns = ref<QTableColumn[]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format(val, row) { format(val, row) {
return row.orgShortName && row.posMasterNo return formatPosmasterNo(
? `${row.orgShortName} ${row.posMasterNo}` row.orgShortName,
: "-"; row.posMasterNoPrefix,
row.posMasterNo,
row.posMasterNoSuffix
);
}, },
}, },

View file

@ -52,7 +52,7 @@ function fetchInformation() {
citizenId.value = data.citizenId; citizenId.value = data.citizenId;
if (data.avatarName) { if (data.avatarName) {
await fetchProfile(data.id as string, data.avatarName); fetchProfile(data.id as string, data.avatarName);
} else { } else {
avatar.value = avatarMain; avatar.value = avatarMain;
} }
@ -70,11 +70,14 @@ function fetchInformation() {
* @param id profileId * @param id profileId
* @param avatarName อไฟล * @param avatarName อไฟล
*/ */
async function fetchProfile(id: string, avatarName: string) { function fetchProfile(id: string, avatarName: string) {
http http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName)) .get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, avatarName))
.then(async (res) => { .then((res) => {
avatar.value = res.data.downloadUrl; avatar.value = res.data.downloadUrl;
})
.catch(() => {
avatar.value = avatarMain;
}); });
} }

View file

@ -8,6 +8,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store"; import { useKpiDataStore } from "@/modules/14_KPI/store";
import avatar from "@/assets/avatar_user.jpg";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import type { FormProfile } from "@/modules/14_KPI/interface/request/index"; import type { FormProfile } from "@/modules/14_KPI/interface/request/index";
@ -65,7 +66,7 @@ async function fetchEvaluation() {
await store.checkCompetency(); await store.checkCompetency();
await store.checkCompetencyDefaultCompetencyLevel(); await store.checkCompetencyDefaultCompetencyLevel();
await fetchProfile(data.profileId); fetchProfile(data.profileId);
plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint; plannedPoint.value = data.plannedPoint == null ? "" : data.plannedPoint;
rolePoint.value = data.rolePoint == null ? "" : data.rolePoint; rolePoint.value = data.rolePoint == null ? "" : data.rolePoint;
@ -81,8 +82,8 @@ async function fetchEvaluation() {
// }); // });
} }
async function fetchProfile(id: string) { function fetchProfile(id: string) {
await http http
.get( .get(
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`) config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
) )
@ -90,6 +91,7 @@ async function fetchProfile(id: string) {
store.dataEvaluation.avartar = res.data.downloadUrl; store.dataEvaluation.avartar = res.data.downloadUrl;
}) })
.catch(() => { .catch(() => {
store.dataEvaluation.avartar = avatar;
// profilePicture.value = avatar; // profilePicture.value = avatar;
}); });
} }

View file

@ -50,7 +50,7 @@ const modal = defineModel<boolean>("modal", { required: true });
let reqMaster = defineModel<FilterMaster>("reqMaster", { required: true }); let reqMaster = defineModel<FilterMaster>("reqMaster", { required: true });
const totalPage = defineModel<number>("totalPage", { required: true }); const totalPage = defineModel<number>("totalPage", { required: true });
const nodeTree = defineModel<OrgTree[]>("nodeTree", { required: true }); const nodeTree = defineModel<OrgTree[]>("nodeTree", { required: true });
const columns = defineModel<QTableProps[]>("columns", {}); const columns = defineModel<QTableProps["columns"]>("columns", { required: true });
const rows = defineModel<PosMaster2[]>("rows", { required: true }); const rows = defineModel<PosMaster2[]>("rows", { required: true });
const props = defineProps({ const props = defineProps({
fetchDataTree: { fetchDataTree: {

View file

@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational"; import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
import { formatPosmasterNo } from "@/utils/function";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -135,11 +136,12 @@ async function fetchTable() {
const data = res.data.result.data; const data = res.data.result.data;
const list = data.map((e: PosMaster) => ({ const list = data.map((e: PosMaster) => ({
...e, ...e,
posMasterNo: posMasterNo: formatPosmasterNo(
(e.orgShortname !== null ? e.orgShortname : "") + e.orgShortname,
(e.posMasterNoPrefix ? e.posMasterNoPrefix : "") + e.posMasterNoPrefix,
(e.posMasterNo !== null ? e.posMasterNo : "") + e.posMasterNo.toString(),
(e.posMasterNoSuffix !== null ? e.posMasterNoPrefix : ""), e.posMasterNoSuffix ?? ""
),
})); }));
rows.value = list; rows.value = list;
}) })

View file

@ -5,7 +5,7 @@ import { useQuasar } from "quasar";
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational"; import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions"; import { checkPermission } from "@/utils/permissions";
import { updateCurrentPage } from "@/utils/function"; import { updateCurrentPage, formatPosmasterNo } from "@/utils/function";
import genreport from "@/plugins/genreportxlsx"; import genreport from "@/plugins/genreportxlsx";
import config from "@/app.config"; import config from "@/app.config";
import http from "@/plugins/http"; import http from "@/plugins/http";
@ -145,6 +145,13 @@ const columns = ref<QTableProps["columns"]>([
label: "ตำแหน่งเลขที่", label: "ตำแหน่งเลขที่",
sortable: false, sortable: false,
field: "posMasterNo", field: "posMasterNo",
format: (val: any, row: any) =>
formatPosmasterNo(
row.orgShortname,
row.posMasterNoPrefix,
row.posMasterNoMain,
row.posMasterNoSuffix
),
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
@ -777,7 +784,7 @@ watch(
<DialogMovePos <DialogMovePos
v-model:modal="modalDialogMMove" v-model:modal="modalDialogMMove"
v-model:nodeTree="nodeTree" v-model:nodeTree="nodeTree"
v-model:columns="columns as QTableProps[]" v-model:columns="columns"
v-model:rows="posMaster" v-model:rows="posMaster"
v-model:totalPage="totalPage" v-model:totalPage="totalPage"
v-model:reqMaster="reqMaster" v-model:reqMaster="reqMaster"

Some files were not shown because too many files have changed in this diff Show more