Merge branch 'develop' into devTee

# Conflicts:
#	src/api/14_KPI/api.KPI.ts
This commit is contained in:
STW_TTTY\stwtt 2024-04-19 14:19:06 +07:00
commit 7f0411e710
19 changed files with 1338 additions and 1192 deletions

View file

@ -2,7 +2,7 @@ import env from "../index";
const KPI = `${env.API_URI}/kpi`; const KPI = `${env.API_URI}/kpi`;
const kpiPeriod = `${env.API_URI}/kpi/period`; const kpiPeriod = `${env.API_URI}/kpi/period`;
const kpiEvaluation = `${env.API_URI}/kpi/evaluation`; const kpiEvaluation = `${env.API_URI}/kpi/evaluation`;
const kpiGroup = `${env.API_URI}/kpi/group`;
export default { export default {
KPI, KPI,
/** รอบการประเมินผล*/ /** รอบการประเมินผล*/
@ -12,5 +12,9 @@ export default {
/** role */ /** role */
kpiRoleMainList:`${KPI}/role` kpiRoleMainList:`${KPI}/role`,
kpiGroup,
kpiGroupById: (id: string) => `${kpiGroup}/${id}`
}; };

View file

@ -52,7 +52,7 @@ const menuList = readonly<any[]>([
role: "dashboard", role: "dashboard",
}, },
{ {
key: 3, key: 2,
icon: "o_person", icon: "o_person",
activeIcon: "person", activeIcon: "person",
label: "ข้อมูลหลัก (ใหม่)", label: "ข้อมูลหลัก (ใหม่)",
@ -60,43 +60,41 @@ const menuList = readonly<any[]>([
role: "metadata", role: "metadata",
children: [ children: [
{ {
key: 3.1, key: 2.0,
label: "ข้อมูลเกี่ยวกับบุคคล", label: "ข้อมูลเกี่ยวกับบุคคล",
path: "masterPersonal", path: "masterPersonal",
}, },
{ {
key: 3.2, key: 2.0,
label: "ข้อมูลตำแหน่งข้าราชการฯ", label: "ข้อมูลตำแหน่งข้าราชการฯ",
path: "masterPosition", path: "masterPosition",
}, },
{ {
key: 3.3, key: 2.0,
label: "ข้อมูลตำแหน่งลูกจ้างประจำ", label: "ข้อมูลตำแหน่งลูกจ้างประจำ",
path: "masterPositionEmployee", path: "masterPositionEmployee",
}, },
{ {
key: 3.4, key: 2.0,
label: "ข้อมูลปฏิทินวันหยุด", label: "ข้อมูลปฏิทินวันหยุด",
path: "masterCalendarWork", path: "masterCalendarWork",
}, },
{ {
key: 3.5, key: 2.0,
label: "ข้อมูลเครื่องราชอิสริยาภรณ์", label: "ข้อมูลเครื่องราชอิสริยาภรณ์",
path: "masterInsignia", path: "masterInsignia",
}, },
{ {
key: 3.6, key: 2.1,
label: "ตัวชี้วัด", label: "ตัวชี้วัด",
role: "evaluateKPI", role: "evaluateKPI",
children: [ children: [
{ {
key: 3.61,
label: "ตามแผน", label: "ตามแผน",
path: "KPIIndicatorByPlan", path: "KPIIndicatorByPlan",
role: "evaluateKPI", role: "evaluateKPI",
}, },
{ {
key: 3.62,
label: "ตามตำแหน่ง", label: "ตามตำแหน่ง",
path: "KPIIndicatorByRole", path: "KPIIndicatorByRole",
role: "evaluateKPI", role: "evaluateKPI",
@ -104,7 +102,7 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 3.7, key: 2.0,
label: "สมรรถนะ", label: "สมรรถนะ",
path: "KPICompetency", path: "KPICompetency",
role: "evaluateKPI", role: "evaluateKPI",
@ -112,52 +110,15 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 4, key: 3,
icon: "o_groups", icon: "o_groups",
activeIcon: "groups", activeIcon: "groups",
label: "โครงสร้างอัตรากำลัง (ใหม่)", label: "โครงสร้างอัตรากำลัง (ใหม่)",
path: "organizationalNew", path: "organizationalNew",
role: "organization", role: "organization",
// children: [
// {
// key: 3.1,
// label: "จัดการตำแหน่ง",
// path: "organizationalMapping",
// },
// {
// key: 3.2,
// label: "แผนภูมิโครงสร้าง",
// path: "organizationalStructChart",
// },
// {
// key: 3.3,
// label: "แผนภูมิองค์กร",
// path: "organizationalOrgChart",
// },
// {
// key: 3.4,
// label: "ผังโครงสร้าง",
// path: "organizationalTree",
// },
// {
// key: 3.5,
// label: "ผังโครงสร้างลูกจ้าง",
// path: "organizationalEmployee",
// },
// {
// key: 3.6,
// label: "จัดการบัญชี 2",
// path: "manageReport2",
// },
// {
// key: 3.7,
// label: "รายงานบัญชี",
// path: "organizationalReport",
// },
// ],
}, },
{ {
key: 4, key: 3,
icon: "o_groups", icon: "o_groups",
activeIcon: "groups", activeIcon: "groups",
label: "อัตรากำลังลูกจ้างประจำฯ", label: "อัตรากำลังลูกจ้างประจำฯ",
@ -173,7 +134,7 @@ const menuList = readonly<any[]>([
role: "organization", role: "organization",
}, },
{ {
key: 2, key: 100,
icon: "o_person", icon: "o_person",
activeIcon: "person", activeIcon: "person",
label: "ข้อมูลหลัก", label: "ข้อมูลหลัก",
@ -181,7 +142,7 @@ const menuList = readonly<any[]>([
role: "metadata", role: "metadata",
}, },
{ {
key: 3, key: 0,
icon: "o_groups", icon: "o_groups",
activeIcon: "groups", activeIcon: "groups",
label: "โครงสร้างอัตรากำลัง", label: "โครงสร้างอัตรากำลัง",
@ -242,7 +203,7 @@ const menuList = readonly<any[]>([
role: "registryverify", role: "registryverify",
}, },
{ {
key: 10, key: 5,
icon: "o_contact_page", icon: "o_contact_page",
activeIcon: "registry_employee_page", activeIcon: "registry_employee_page",
label: "ทะเบียนประวัติลูกจ้าง", label: "ทะเบียนประวัติลูกจ้าง",
@ -250,7 +211,7 @@ const menuList = readonly<any[]>([
role: "registryEmployee", role: "registryEmployee",
}, },
{ {
key: 10, key: 6,
icon: "mdi-file-certificate-outline", icon: "mdi-file-certificate-outline",
activeIcon: "order", activeIcon: "order",
label: "ออกคำสั่ง", label: "ออกคำสั่ง",
@ -258,7 +219,7 @@ const menuList = readonly<any[]>([
role: "order", role: "order",
}, },
{ {
key: 5, key: 7,
icon: "o_search", icon: "o_search",
activeIcon: "search", activeIcon: "search",
label: "สรรหา", label: "สรรหา",
@ -268,13 +229,13 @@ const menuList = readonly<any[]>([
{ {
label: "ตั้งค่าเว็บสรรหา", label: "ตั้งค่าเว็บสรรหา",
path: "editorweb", path: "editorweb",
key: 5.1, key: 7.1,
role: "recruit", role: "recruit",
}, },
{ {
label: "สอบแข่งขัน", label: "สอบแข่งขัน",
path: "", path: "",
key: 5.2, key: 7.2,
role: "recruit", role: "recruit",
children: [ children: [
{ {
@ -292,7 +253,7 @@ const menuList = readonly<any[]>([
{ {
label: "คัดเลือก", label: "คัดเลือก",
path: "", path: "",
key: 5.3, key: 7.3,
role: "recruit", role: "recruit",
children: [ children: [
{ {
@ -325,7 +286,7 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 6, key: 8,
path: "placement", path: "placement",
icon: "how_to_reg", icon: "how_to_reg",
activeIcon: "how_to_reg", activeIcon: "how_to_reg",
@ -333,67 +294,46 @@ const menuList = readonly<any[]>([
role: "placement", role: "placement",
children: [ children: [
{ {
key: 6.1,
label: "รายชื่อผู้สอบผ่าน", label: "รายชื่อผู้สอบผ่าน",
path: "placement", path: "placement",
role: "placement", role: "placement",
}, },
// {
// key: 6.2,
// label: "ออกคำสั่ง",
// path: "Orderplacement",
// role: "placement",
// },
{ {
key: 6.3,
label: "การทดลองปฏิบัติหน้าที่ราชการ", label: "การทดลองปฏิบัติหน้าที่ราชการ",
path: "probation", path: "probation",
role: "probation", role: "probation",
}, },
{ {
key: 6.4,
label: "รายการขอโอน", label: "รายการขอโอน",
path: "transfer", path: "transfer",
role: "placement", role: "placement",
}, },
{ {
key: 6.5,
label: "รายการรับโอน", label: "รายการรับโอน",
path: "receive", path: "receive",
role: "placement", role: "placement",
}, },
{ {
key: 6.6,
label: "รายการช่วยราชการ", label: "รายการช่วยราชการ",
path: "help-government", path: "help-government",
role: "placement", role: "placement",
}, },
{ {
key: 6.7,
label: "รายการส่งตัวกลับ", label: "รายการส่งตัวกลับ",
path: "repatriate", path: "repatriate",
role: "placement", role: "placement",
}, },
{ {
key: 6.8,
label: "รายการแต่งตั้ง-เลื่อน-ย้าย", label: "รายการแต่งตั้ง-เลื่อน-ย้าย",
path: "appoint-promote", path: "appoint-promote",
role: "placement", role: "placement",
}, },
{ {
key: 6.8,
label: "ปรับระดับชั้นงาน-ย้ายลูกจ้าง", label: "ปรับระดับชั้นงาน-ย้ายลูกจ้าง",
path: "appoint-employee", path: "appoint-employee",
role: "placement", role: "placement",
}, },
// {
// key: 6.9,
// label: "รายการย้าย",
// path: "relocation",
// role: "placement",
// },
{ {
key: 6.1,
label: "รายการอื่นๆ", label: "รายการอื่นๆ",
path: "other", path: "other",
role: "placement", role: "placement",
@ -401,7 +341,7 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 7, key: 9,
icon: "mdi-account-cancel-outline", icon: "mdi-account-cancel-outline",
activeIcon: "mdi-account-cancel", activeIcon: "mdi-account-cancel",
label: "พ้นจากราชการ", label: "พ้นจากราชการ",
@ -409,51 +349,34 @@ const menuList = readonly<any[]>([
role: "retirement", role: "retirement",
children: [ children: [
{ {
key: 7.1,
label: "ประกาศเกษียณ", label: "ประกาศเกษียณ",
path: "retirement", path: "retirement",
role: "retirement", role: "retirement",
}, },
{ {
key: 7.2,
label: "รายการลาออก", label: "รายการลาออก",
path: "resign", path: "resign",
role: "retirement", role: "retirement",
}, },
{ {
key: 7.3,
label: "Exit interview", label: "Exit interview",
path: "exit-Interview", path: "exit-Interview",
role: "retirement", role: "retirement",
}, },
{ {
key: 7.4,
label: "รายการบันทึกการถึงแก่กรรม", label: "รายการบันทึกการถึงแก่กรรม",
path: "deceased", path: "deceased",
role: "retirement", role: "retirement",
}, },
{ {
key: 7.5,
label: "รายการให้ออก", label: "รายการให้ออก",
path: "dismiss-order", path: "dismiss-order",
role: "retirement", role: "retirement",
}, },
// {
// key: 7.6,
// label: "รายการปลดออก",
// path: "discharged",
// role: "retirement",
// },
// {
// key: 7.7,
// label: "รายการไล่ออก",
// path: "expulsion",
// role: "retirement",
// },
], ],
}, },
{ {
key: 8, key: 10,
icon: "mdi-medal-outline", icon: "mdi-medal-outline",
activeIcon: "mdi-medal", activeIcon: "mdi-medal",
label: "เครื่องราชฯ", label: "เครื่องราชฯ",
@ -461,37 +384,31 @@ const menuList = readonly<any[]>([
role: "insignia", role: "insignia",
children: [ children: [
{ {
key: 8.1,
label: "รอบการเสนอขอ", label: "รอบการเสนอขอ",
path: "insigniaProposals", path: "insigniaProposals",
role: "insignia", role: "insignia",
}, },
{ {
key: 8.2,
label: "จัดการคำขอ", label: "จัดการคำขอ",
path: "insigniaManage", path: "insigniaManage",
role: "insignia", role: "insignia",
}, },
{ {
key: 8.3,
label: "บันทึกผลการเสนอขอ", label: "บันทึกผลการเสนอขอ",
path: "insigniaRecord", path: "insigniaRecord",
role: "insignia", role: "insignia",
}, },
{ {
key: 8.4,
label: "จัดสรรเครื่องราชฯ", label: "จัดสรรเครื่องราชฯ",
path: "insigniaAllocate", path: "insigniaAllocate",
role: "insignia", role: "insignia",
}, },
{ {
key: 8.6,
label: "ยืม-คืนเครื่องราชฯ", label: "ยืม-คืนเครื่องราชฯ",
path: "insigniaBorrow", path: "insigniaBorrow",
role: "insignia", role: "insignia",
}, },
{ {
key: 8.5,
label: "รายงาน", label: "รายงาน",
path: "insigniaReport", path: "insigniaReport",
role: "insignia", role: "insignia",
@ -499,7 +416,7 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 9, key: 11,
icon: "mdi-calendar", icon: "mdi-calendar",
activeIcon: "mdi-calendar", activeIcon: "mdi-calendar",
label: "การลา", label: "การลา",
@ -507,37 +424,31 @@ const menuList = readonly<any[]>([
role: "leave", role: "leave",
children: [ children: [
{ {
key: 9.1,
label: "รอบการปฏิบัติงาน", label: "รอบการปฏิบัติงาน",
path: "/round-time", path: "/round-time",
role: "leave", role: "leave",
}, },
{ {
key: 9.2,
label: "แก้ไขรอบการปฎิบัติงานผู้ใช้งาน", label: "แก้ไขรอบการปฎิบัติงานผู้ใช้งาน",
path: "/change-round", path: "/change-round",
role: "leave", role: "leave",
}, },
{ {
key: 9.3,
label: "รายการลงเวลาปฏิบัติงาน", label: "รายการลงเวลาปฏิบัติงาน",
path: "/work-list", path: "/work-list",
role: "leave", role: "leave",
}, },
{ {
key: 9.4,
label: "ลงเวลากรณีพิเศษ", label: "ลงเวลากรณีพิเศษ",
path: "/timestamp-special", path: "/timestamp-special",
role: "leave", role: "leave",
}, },
{ {
key: 9.5,
label: "รายการลา", label: "รายการลา",
path: "/leave", path: "/leave",
role: "leave", role: "leave",
}, },
{ {
key: 9.6,
label: "รายงานสถิติการลา", label: "รายงานสถิติการลา",
path: "/leave-report", path: "/leave-report",
role: "leave", role: "leave",
@ -545,56 +456,50 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 11, key: 12,
icon: "mdi-scale-balance", icon: "mdi-scale-balance",
activeIcon: "mdi-scale-balance", activeIcon: "mdi-scale-balance",
label: "วินัย", label: "วินัย",
role: "discipline", role: "discipline",
children: [ children: [
{ {
key: 11.1, key: 12.0,
label: "เรื่องร้องเรียน", label: "เรื่องร้องเรียน",
path: "disciplineComplaints", path: "disciplineComplaints",
role: "discipline", role: "discipline",
}, },
{ {
key: 11.2, key: 12.0,
label: "สืบสวนข้อเท็จจริง", label: "สืบสวนข้อเท็จจริง",
path: "disciplineInvestigatefacts", path: "disciplineInvestigatefacts",
role: "discipline", role: "discipline",
}, },
{ {
key: 11.3, key: 12.0,
label: "สอบสวนความผิดทางวินัย", label: "สอบสวนความผิดทางวินัย",
path: "disciplineDisciplinary", path: "disciplineDisciplinary",
role: "discipline", role: "discipline",
}, },
{ {
key: 11.4, key: 12.0,
label: "สรุปผลการพิจารณาความผิดทางวินัย", label: "สรุปผลการพิจารณาความผิดทางวินัย",
path: "disciplineResult", path: "disciplineResult",
role: "discipline", role: "discipline",
}, },
{ {
key: 11.5, key: 12.0,
label: "รายชื่อผู้ถูกพักราชการ", label: "รายชื่อผู้ถูกพักราชการ",
path: "disciplineListSuspend", path: "disciplineListSuspend",
role: "discipline", role: "discipline",
}, },
// {
// key: 11.5,
// label: "รายงาน",
// path: "disciplineReport",
// role: "discipline",
// },
{ {
key: 11.5, key: 12.0,
label: "อุทธรณ์/ร้องทุกข์", label: "อุทธรณ์/ร้องทุกข์",
path: "appealComplain", path: "appealComplain",
role: "discipline", role: "discipline",
}, },
{ {
key: 11.5, key: 12.0,
label: "ออกคำสั่งลงโทษทางวินัย", label: "ออกคำสั่งลงโทษทางวินัย",
path: "disciplineOrder", path: "disciplineOrder",
role: "discipline", role: "discipline",
@ -602,7 +507,7 @@ const menuList = readonly<any[]>([
{ {
label: "ข้อมูลพื้นฐาน", label: "ข้อมูลพื้นฐาน",
path: "", path: "",
key: 11.7, key: 12.1,
role: "discipline", role: "discipline",
children: [ children: [
{ {
@ -620,14 +525,14 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 11, key: 13,
icon: "mdi-account-check", icon: "mdi-account-check",
activeIcon: "mdi-account-check", activeIcon: "mdi-account-check",
label: "ประเมินบุคคล", label: "ประเมินบุคคล",
role: "evaluate", role: "evaluate",
children: [ children: [
{ {
key: 11.1, key: 13.0,
label: "คำขอประเมิน", label: "คำขอประเมิน",
path: "evaluate", path: "evaluate",
role: "discipline", role: "discipline",
@ -635,7 +540,7 @@ const menuList = readonly<any[]>([
{ {
label: "กรรมการและการประชุม", label: "กรรมการและการประชุม",
path: "", path: "",
key: 11.7, key: 13.1,
role: "evaluate", role: "evaluate",
children: [ children: [
{ {
@ -653,44 +558,38 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 12, key: 14,
icon: "mdi-cash", icon: "mdi-cash",
activeIcon: "mdi-cash", activeIcon: "mdi-cash",
label: "เงินเดือน/ค่าจ้าง", label: "เงินเดือน/ค่าจ้าง",
role: "salary", role: "salary",
children: [ children: [
{ {
key: 12.1,
label: "ผังบัญชีเงินเดือนข้าราชการฯ", label: "ผังบัญชีเงินเดือนข้าราชการฯ",
path: "salaryChart", path: "salaryChart",
role: "salary", role: "salary",
}, },
{ {
key: 12.2,
label: "ผังบัญชีค่าจ้างลูกจ้างประจำ", label: "ผังบัญชีค่าจ้างลูกจ้างประจำ",
path: "salaryEmployeeChart", path: "salaryEmployeeChart",
role: "salary", role: "salary",
}, },
{ {
key: 12.3,
label: "รอบการขึ้นเงินเดือน", label: "รอบการขึ้นเงินเดือน",
path: "salaryRound", path: "salaryRound",
role: "salary", role: "salary",
}, },
{ {
key: 12.4,
label: "เลื่อนเงินเดือนข้าราชการฯ", label: "เลื่อนเงินเดือนข้าราชการฯ",
path: "salaryLists", path: "salaryLists",
role: "salary", role: "salary",
}, },
{ {
key: 12.5,
label: "เลื่อนค่าจ้างลูกจ้างประจำ", label: "เลื่อนค่าจ้างลูกจ้างประจำ",
path: "salaryEmployeeLists", path: "salaryEmployeeLists",
role: "salary", role: "salary",
}, },
{ {
key: 12.6,
label: "ออกคำสั่งเลื่อนเงินเดือน/ค่าจ้าง", label: "ออกคำสั่งเลื่อนเงินเดือน/ค่าจ้าง",
path: "commandSalary", path: "commandSalary",
role: "salary", role: "salary",
@ -698,14 +597,13 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 13, key: 15,
icon: "mdi-account-star", icon: "mdi-account-star",
activeIcon: "mdi-account-star", activeIcon: "mdi-account-star",
label: "ประเมินผลการปฏิบัติราชการระดับบุคคล", label: "ประเมินผลการปฏิบัติราชการระดับบุคคล",
role: "evaluateKPI", role: "evaluateKPI",
children: [ children: [
{ {
key: 13.1,
label: "รอบการประเมิน", label: "รอบการประเมิน",
path: "KPIRound", path: "KPIRound",
role: "evaluateKPI", role: "evaluateKPI",
@ -713,52 +611,39 @@ const menuList = readonly<any[]>([
], ],
}, },
{ {
key: 14, key: 16,
icon: "mdi-briefcase-account", icon: "mdi-briefcase-account",
activeIcon: "mdi-briefcase-account", activeIcon: "mdi-briefcase-account",
label: "พัฒนาบุคลากร", label: "พัฒนาบุคลากร",
role: "development", role: "development",
children: [ children: [
{ {
key: 14.1,
label: "โครงการ/หลักสูตรการฝึกอบรม", label: "โครงการ/หลักสูตรการฝึกอบรม",
path: "developmentMain", path: "developmentMain",
role: "development", role: "development",
}, },
{ {
key: 14.2,
label: "ประวัติฝึกอบรม/ดูงาน ขรก.", label: "ประวัติฝึกอบรม/ดูงาน ขรก.",
path: "developmentHistory", path: "developmentHistory",
role: "development", role: "development",
}, },
{ {
key: 14.3,
label: "ประวัติฝึกอบรม/ดูงานลูกจ้าง", label: "ประวัติฝึกอบรม/ดูงานลูกจ้าง",
path: "developmentEmployeeHistory", path: "developmentEmployeeHistory",
role: "development", role: "development",
}, },
{ {
key: 14.4,
label: "ทุนการศึกษา/ฝึกอบรม", label: "ทุนการศึกษา/ฝึกอบรม",
path: "developmentScholarship", path: "developmentScholarship",
role: "development", role: "development",
}, },
{ {
key: 14.5,
label: "ยุทธศาสตร์", label: "ยุทธศาสตร์",
path: "developmentStrategic", path: "developmentStrategic",
role: "development", role: "development",
}, },
], ],
}, },
// {
// key: 99,
// icon: "mdi-chat",
// activeIcon: "mdi-chat",
// label: "ถาม-ตอบ",
// role: "support",
// path: "support",
// },
]); ]);
const tabList = readonly<tabType[]>([ const tabList = readonly<tabType[]>([

View file

@ -18,23 +18,23 @@ const rows = ref<any>();
const competencyTypeOp = ref<DataOption[]>([ const competencyTypeOp = ref<DataOption[]>([
{ {
id: "ID1", id: "HEAD",
name: "สมรรถนะหลัก", name: "สมรรถนะหลัก",
}, },
{ {
id: "ID2", id: "GROUP",
name: "สมรรถนะประจำกลุ่มงาน", name: "สมรรถนะประจำกลุ่มงาน",
}, },
{ {
id: "ID3", id: "EXECUTIVE",
name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร", name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร",
}, },
{ {
id: "ID4", id: "DIRECTOR",
name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต", name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต",
}, },
{ {
id: "ID5", id: "INSPECTOR",
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ", name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
}, },
]); ]);
@ -64,11 +64,11 @@ const visibleColumns = ref<string[]>(["competency"]);
async function getData() { async function getData() {
const data = [ const data = [
{ {
id: "ID1", id: "1",
competency: "รายการสมรรถะ 1", competency: "รายการสมรรถะ 1",
}, },
{ {
id: "ID2", id: "2",
competency: "รายการสมรรถะ 2", competency: "รายการสมรรถะ 2",
}, },
]; ];

View file

@ -3,21 +3,19 @@ import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import Header from "@/components/DialogHeader.vue"; import dialogHeader from "@/components/DialogHeader.vue";
import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
import type { ResponseObject } from "@/modules/14_KPI/interface/response/KpiGroup";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const router = useRouter(); const rows = ref<ResponseObject[]>([]);
const rows = ref<any>();
const groupName = ref<string>(""); const groupName = ref<string>("");
const editStatus = ref<boolean>(false); const editStatus = ref<boolean>(false);
const editId = ref<string>("");
const competencyTypeOp = ref<DataOption[]>([ const competencyTypeOp = ref<DataOption[]>([
{ {
id: "ID1", id: "ID1",
@ -42,11 +40,11 @@ const competencyTypeOp = ref<DataOption[]>([
]); ]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
name: "groupName", name: "nameGroupKPI",
align: "left", align: "left",
label: "รายการกลุ่มงาน", label: "รายการกลุ่มงาน",
sortable: true, sortable: true,
field: "groupName", field: "nameGroupKPI",
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) =>
@ -56,71 +54,81 @@ const columns = ref<QTableProps["columns"]>([
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin; const {
dialogRemove,
const competencyType = ref<string>("ID1"); dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
} = mixin;
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const visibleColumns = ref<string[]>(["groupName"]); const visibleColumns = ref<string[]>(["nameGroupKPI"]);
/** ดึงข้อมูล */ /** ดึงข้อมูล */
async function getData() { async function fetchData() {
const data = [ showLoader();
{ await http
id: "ID1", .get(config.API.kpiGroup)
groupName: "กลุ่มงาน 1", .then(async (res) => {
}, rows.value = res.data.result.data;
{ })
id: "ID2", .catch((err) => {
groupName: "กลุ่มงาน 2", messageError($q, err);
}, })
]; .finally(() => {
rows.value = data; hideLoader();
// showLoader(); });
// await http }
// .get(config.API.orgPrefix)
// .then(async (res) => { async function addData() {
// }) await http
// .catch((err) => { .post(config.API.kpiGroup, {
// messageError($q, err); nameGroupKPI: groupName.value,
// }) })
// .finally(() => { .then(() => {
// hideLoader(); fetchData();
// }); success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
} }
async function editData(id: string) { async function editData(id: string) {
console.log(id); await http
// await http .put(config.API.kpiGroupById(id), {
// .put(config.API.orgPrefixId(id), { nameGroupKPI: groupName.value,
// name: prefix.value, })
// }) .then(() => {
// .then(() => { fetchData();
// getData(); success($q, "บันทึกข้อมูลสำเร็จ");
// success($q, ""); })
// }) .catch((err) => {
// .catch((err) => { messageError($q, err);
// messageError($q, err); })
// }) .finally(() => {
// .finally(() => { hideLoader();
// hideLoader(); });
// });
} }
async function deleteData(id: string) { async function deleteData(id: string) {
console.log(id); await http
// await http .delete(config.API.kpiGroupById(id))
// .delete(config.API.orgPrefixId(id)) .then(() => {
// .then(() => { fetchData();
// getData(); success($q, "ลบข้อมูลสำเร็จ");
// success($q, ""); })
// }) .catch((err) => {
// .catch((err) => { messageError($q, err);
// messageError($q, err); })
// }) .finally(() => {
// .finally(() => { hideLoader();
// hideLoader();w });
// });
} }
/** เปลี่ยนเป็นหน้าเพิ่มข้อมูล */ /** เปลี่ยนเป็นหน้าเพิ่มข้อมูล */
@ -128,42 +136,38 @@ function onAdd() {
modal.value = true; modal.value = true;
} }
function close() { function closeDialog() {
modal.value = false; modal.value = false;
editStatus.value = false; editStatus.value = false;
groupName.value = '' groupName.value = "";
} }
function onEdit(data: any) { function onEdit(data: any) {
modal.value = true; modal.value = true;
editStatus.value = true; editStatus.value = true;
groupName.value = data.groupName groupName.value = data.nameGroupKPI;
editId.value = data.id;
} }
function onSubmit() { async function onSubmit() {
console.log("save"); dialogConfirm(
close() $q,
async () => {
editStatus.value ? editData(editId.value) : addData();
closeDialog();
},
"ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
);
} }
onMounted(async () => { onMounted(async () => {
getData(); fetchData();
}); });
</script> </script>
<template> <template>
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<!-- <q-select
v-model="competencyType"
outlined
label="ประเภทสมรรถนะ"
dense
option-label="name"
option-value="id"
:options="competencyTypeOp"
style="min-width: 200px"
emit-value
map-options
/> -->
<q-btn flat round color="primary" icon="add" @click="onAdd()"> <q-btn flat round color="primary" icon="add" @click="onAdd()">
<q-tooltip> เพมขอม </q-tooltip> <q-tooltip> เพมขอม </q-tooltip>
</q-btn> </q-btn>
@ -210,15 +214,11 @@ onMounted(async () => {
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td <q-td v-for="col in props.cols" :key="col.id">
v-for="col in props.cols"
:key="col.id"
@click="onEdit(props.row)"
>
{{ col.value }} {{ col.value }}
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<!-- <q-btn <q-btn
color="edit" color="edit"
flat flat
dense dense
@ -227,17 +227,10 @@ onMounted(async () => {
size="12px" size="12px"
icon="edit" icon="edit"
clickable clickable
@click.stop=" @click="onEdit(props.row)"
() => {
dialogStatus = 'edit';
dialog = true;
prefix = props.row.name;
editId = props.row.id;
}
"
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
</q-btn> --> </q-btn>
<q-btn <q-btn
color="red" color="red"
flat flat
@ -261,9 +254,9 @@ onMounted(async () => {
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card flat bordered style="min-width: 50vh"> <q-card flat bordered style="min-width: 50vh">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<Header <dialog-header
:tittle="editStatus ? 'แก้ไขกลุ่มงาน' : 'เพิ่มกลุ่มงาน'" :tittle="editStatus ? 'แก้ไขกลุ่มงาน' : 'เพิ่มกลุ่มงาน'"
:close="close" :close="closeDialog"
/> />
<q-separator /> <q-separator />
<q-card-section> <q-card-section>

View file

@ -2,11 +2,12 @@
import { ref, reactive } from "vue"; import { ref, reactive } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import FormMain from "@/modules/14_KPI/components/competency/Forms/01_FormMain.vue"; import Main from "@/modules/14_KPI/components/competency/Forms/Main.vue";
import FormGroup from "@/modules/14_KPI/components/competency/Forms/02_FormGroup.vue"; // import FormMain from "@/modules/14_KPI/components/competency/Forms/01_FormMain.vue";
import FormExecutive from "@/modules/14_KPI/components/competency/Forms/03_FormExecutive.vue"; // import FormGroup from "@/modules/14_KPI/components/competency/Forms/02_FormGroup.vue";
import FormExecutivePosition from "@/modules/14_KPI/components/competency/Forms/04_FormExecutivePosition.vue"; // import FormExecutive from "@/modules/14_KPI/components/competency/Forms/03_FormExecutive.vue";
import FormExecutiveLevel from "@/modules/14_KPI/components/competency/Forms/05_FormExecutiveLevel.vue"; // import FormExecutivePosition from "@/modules/14_KPI/components/competency/Forms/04_FormExecutivePosition.vue";
// import FormExecutiveLevel from "@/modules/14_KPI/components/competency/Forms/05_FormExecutiveLevel.vue";
import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore"; import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore";
import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
@ -29,23 +30,23 @@ const formData = reactive<FormCompetency>({
const competencyTypeOp = ref<DataOption[]>([ const competencyTypeOp = ref<DataOption[]>([
{ {
id: "ID1", id: "HEAD",
name: "สมรรถนะหลัก", name: "สมรรถนะหลัก",
}, },
{ {
id: "ID2", id: "GROUP",
name: "สมรรถนะประจำกลุ่มงาน", name: "สมรรถนะประจำกลุ่มงาน",
}, },
{ {
id: "ID3", id: "EXECUTIVE",
name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร", name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร",
}, },
{ {
id: "ID4", id: "DIRECTOR",
name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต", name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต",
}, },
{ {
id: "ID5", id: "INSPECTOR",
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ", name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
}, },
]); ]);
@ -108,134 +109,13 @@ function onSubmit() {
/> />
</div> </div>
<FormMain v-if="store.competencyType === 'ID1'" /> <Main />
<!-- <FormMain v-if="store.competencyType === 'ID1'" />
<FormGroup v-else-if="store.competencyType === 'ID2'" /> <FormGroup v-else-if="store.competencyType === 'ID2'" />
<FormExecutive v-else-if="store.competencyType === 'ID3'" /> <FormExecutive v-else-if="store.competencyType === 'ID3'" />
<FormExecutivePosition v-else-if="store.competencyType === 'ID4'" /> <FormExecutivePosition v-else-if="store.competencyType === 'ID4'" />
<FormExecutiveLevel v-else-if="store.competencyType === 'ID5'" /> <FormExecutiveLevel v-else-if="store.competencyType === 'ID5'" /> -->
<!-- <div class="col-12">
<q-input
v-model="formData.competencyName"
dense
outlined
label="ชื่อสมรรถนะ"
:rules="[(val:string) => !!val || `${'กรุณากรอกชื่อสมรรถนะ'}`,]"
hide-bottom-space
/>
</div>
<div class="col-12">
<q-input
v-model="formData.definition"
label="คำจำกัดความ"
dense
type="textarea"
outlined
:rules="[(val:string) => !!val || `${'กรุณากรอกคำจำกัดความ'}`,]"
hide-bottom-space
/>
</div>
<div class="col-12">
<q-card flat bordered>
<q-card-section class="bg-grey-4">
<div
class="row items-center text-dark text-body2 text-weight-medium"
>
<div class="col-3">
<div class="row items-center">
<div class="col-1">
<q-btn
dense
flat
round
color="primary"
icon="add"
@click="ocClickAdd"
>
<q-tooltip>เพ</q-tooltip></q-btn
>
</div>
<div class="col-11 text-center">
<span>ระดบสมรรถนะ</span>
</div>
</div>
</div>
<div class="col-4">
<span>คำอธบายระด/พฤตกรรมทคาดหว/พฤตกรรมยอย</span>
</div>
</div>
</q-card-section>
<q-card-section>
<div
class="row q-pa-sm"
v-for="(items, index) in itemsFormCard"
key="index"
>
<div
class="col-3 text-center self-center text-body1 text-weight-medium"
>
<span>{{ index + 1 }}</span>
</div>
<div class="col-9">
<q-editor
v-model="formData.level_1[index]"
:dense="$q.screen.lt.md"
min-height="5rem"
:toolbar="[
[
'bold',
'italic',
'strike',
'underline',
'subscript',
'superscript',
],
['unordered', 'ordered'],
]"
:fonts="{
arial: 'Arial',
arial_black: 'Arial Black',
comic_sans: 'Comic Sans MS',
courier_new: 'Courier New',
impact: 'Impact',
lucida_grande: 'Lucida Grande',
times_new_roman: 'Times New Roman',
verdana: 'Verdana',
}"
/>
</div>
</div>
</q-card-section>
</q-card>
</div> -->
<!-- <div class="col-12">
<q-input
v-model="formData.definition"
label="กำหนดเกณฑ์การประเมิน"
dense
type="textarea"
outlined
:rules="[(val:string) => !!val || `${'กรุณากรอกกำหนดเกณฑ์การประเมิน'}`,]"
hide-bottom-space
/>
</div> -->
</div> </div>
</q-card-section> </q-card-section>
<!-- <div class="text-right q-pa-sm">
<q-btn
dense
unelevated
label="บันทึก"
id="onSubmit"
type="submit"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div> -->
<!-- </q-form> -->
</q-card> </q-card>
</template> </template>

View file

@ -0,0 +1,240 @@
div
<script setup lang="ts">
import { ref, reactive } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore";
import { useRouter } from "vue-router";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm, showLoader, hideLoader, success, messageError } = mixin;
const router = useRouter();
const store = useKPIDataStore();
const formData = reactive({
competencyType: "",
competencyName: "",
definition: "",
levels: [
{
level: "1",
description: "",
},
],
});
function ocClickAdd() {
// if (formData.levels.length !== 6) {
const levelName = formData.levels.length + 1;
const data = {
level: levelName.toString(),
description: "",
};
formData.levels.push(data);
formData.levels[formData.levels.length].level = levelName.toString();
// }
}
function onSubmit() {
dialogConfirm($q, () => {
const body = {
competencyType: store.competencyType,
competencyName: formData.competencyName,
definition: formData.definition,
levels: formData.levels,
};
// showLoader()
// http
// .put(config.API.???,body)
// .then((res)=>{
// success($q,'')
// router.push(`/KPI-competency`)
// }).catch((e)=>{
// messageError($q,e)
// }).finally(()=>{
// hideLoader()
// })
console.log(body);
});
}
</script>
<template>
<q-form greedy @submit.prevent @validation-success="onSubmit" class="col-12">
<div class="row">
<div class="col-12">
<q-input
v-model="formData.competencyName"
dense
outlined
label="ชื่อสมรรถนะ"
:rules="[(val:string) => !!val || `${'กรุณากรอกชื่อสมรรถนะ'}`,]"
hide-bottom-space
/>
</div>
<q-card-section class="col-12 q-px-none">
<div>
<q-field
class="q_field_p_none"
ref="fieldRef"
v-model="formData.definition"
label-slot
borderless
:rules="[(val) => !!val || 'กรุณากรอกคำจำกัดความสมรรถนะ']"
hide-bottom-space
>
<template #control>
<q-editor
class="full-width"
v-model="formData.definition"
:dense="$q.screen.lt.md"
min-height="7rem"
placeholder="คำจำกัดความสมรรถนะ"
:toolbar="[
[
'bold',
'italic',
'strike',
'underline',
'subscript',
'superscript',
],
['unordered', 'ordered'],
]"
:fonts="{
arial: 'Arial',
arial_black: 'Arial Black',
comic_sans: 'Comic Sans MS',
courier_new: 'Courier New',
impact: 'Impact',
lucida_grande: 'Lucida Grande',
times_new_roman: 'Times New Roman',
verdana: 'Verdana',
}"
/>
</template>
</q-field>
</div>
</q-card-section>
<div class="col-12">
<q-card flat bordered>
<q-card-section class="bg-grey-4">
<div
class="row items-center text-dark text-body2 text-weight-medium"
>
<div class="col-3">
<div class="row items-center">
<div class="col-1">
<q-btn
dense
flat
round
color="primary"
icon="add"
@click="ocClickAdd"
>
<q-tooltip>เพ</q-tooltip></q-btn
>
</div>
<div class="col-11 text-center">
<span>ระดบสมรรถนะ</span>
</div>
</div>
</div>
<div class="col-4">
<span>พฤตกรรมทคาดหว/พฤตกรรมยอย</span>
</div>
</div>
</q-card-section>
<q-card-section>
<div
class="row q-pa-sm"
v-for="(items, index) in formData.levels"
key="index"
>
<div class="col-3 align-center q-pr-lg">
<q-input
:readonly="
store.competencyType === 'HEAD' ||
store.competencyType === 'GROUP'
"
v-model="formData.levels[index].level"
dense
outlined
:rules="[(val:string) => !!val || `${'กรุณากรอกระดับสมรรถนะ'}`,]"
hide-bottom-space
/>
</div>
<div class="col-9">
<q-field
class="q_field_p_none"
ref="fieldRef"
v-model="formData.levels[index].description"
label-slot
borderless
:rules="[
(val) =>
!!val || 'กรุณากรอกพฤติกรรมที่คาดหวัง/พฤติกรรมย่อย',
]"
hide-bottom-space
>
<template #control>
<q-editor
class="full-width"
v-model="formData.levels[index].description"
:dense="$q.screen.lt.md"
min-height="5rem"
:toolbar="[
[
'bold',
'italic',
'strike',
'underline',
'subscript',
'superscript',
],
['unordered', 'ordered'],
]"
:fonts="{
arial: 'Arial',
arial_black: 'Arial Black',
comic_sans: 'Comic Sans MS',
courier_new: 'Courier New',
impact: 'Impact',
lucida_grande: 'Lucida Grande',
times_new_roman: 'Times New Roman',
verdana: 'Verdana',
}"
/>
</template>
</q-field>
</div>
</div>
</q-card-section>
</q-card>
</div>
<div class="col-12 q-my-sm"><q-separator /></div>
<div class="col-12 row justify-end">
<q-btn
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
type="submit"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
</div>
</q-form>
</template>
<style scoped></style>

View file

@ -101,11 +101,15 @@ function updateSelected(data: any) {
planData.strategyChildPlannedId = data.id; planData.strategyChildPlannedId = data.id;
planData.strategyChildPlannedNode = data.level; planData.strategyChildPlannedNode = data.level;
} }
function updateSelectedAgency(data: any) {
planData.agencyId = data.orgTreeId;
planData.agencyLevel = data.orgLevel;
}
onMounted(() => { onMounted(async () => {
// fetchData(); // fetchData();
fetchTree(); await fetchTree();
fetchOrganizationActive(); await fetchOrganizationActive();
setTimeout(async () => { setTimeout(async () => {
store.activeId && (await fetchDataTree(store.activeId)); store.activeId && (await fetchDataTree(store.activeId));
}, 200); }, 200);
@ -116,38 +120,6 @@ onMounted(() => {
<q-form @submit.prevent greedy @validation-success="onSubmit()"> <q-form @submit.prevent greedy @validation-success="onSubmit()">
<div> <div>
<div class="row q-col-gutter-md q-pa-md"> <div class="row q-col-gutter-md q-pa-md">
<div class="col-8">
<q-input
outlined
v-model="planData.tree"
label="หน่วยงาน/ส่วนราชการ"
bg-color="white"
dense
class="inputgreen"
:rules="[(val) => !!val || `${'หน่วยงาน/ส่วนราชการ'}`]"
hide-bottom-space
/>
</div>
<div class="col-2">
<q-select
dense
outlined
v-model="planData.round"
:options="roundOp"
label="รอบการประเมิน"
hide-bottom-space
option-label="name"
option-value="id"
map-options
emit-value
lazy-rules
class="inputgreen"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกรอบการประเมิน'}`,
]"
/>
</div>
<div class="col-2"> <div class="col-2">
<datepicker <datepicker
menu-class-name="modalfix" menu-class-name="modalfix"
@ -179,7 +151,27 @@ onMounted(() => {
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-3"> <div class="col-2">
<q-select
dense
outlined
v-model="planData.round"
:options="roundOp"
label="รอบการประเมิน"
hide-bottom-space
option-label="name"
option-value="id"
map-options
emit-value
lazy-rules
class="inputgreen"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกรอบการประเมิน'}`,
]"
/>
</div>
<div class="col-2">
<q-input <q-input
outlined outlined
v-model="planData.Data1" v-model="planData.Data1"
@ -257,11 +249,11 @@ onMounted(() => {
<q-input <q-input
outlined outlined
v-model="planData.point5" v-model="planData.point5"
label="ระดับคะแนน" label="กรอกผลสำเร็จของงาน"
bg-color="white" bg-color="white"
dense dense
class="inputgreen" class="inputgreen"
:rules="[(val) => !!val || `${'กรุณากรอกระดับคะแนน'}`]" :rules="[(val) => !!val || `${'กรุณากรอกผลสำเร็จของงาน'}`]"
hide-bottom-space hide-bottom-space
/> />
</div> </div>
@ -274,11 +266,11 @@ onMounted(() => {
<q-input <q-input
outlined outlined
v-model="planData.point4" v-model="planData.point4"
label="ระดับคะแนน" label="กรอกผลสำเร็จของงาน"
bg-color="white" bg-color="white"
dense dense
class="inputgreen" class="inputgreen"
:rules="[(val) => !!val || `${'กรุณากรอกระดับคะแนน'}`]" :rules="[(val) => !!val || `${'กรุณากรอกผลสำเร็จของงาน'}`]"
hide-bottom-space hide-bottom-space
/> />
</div> </div>
@ -291,11 +283,11 @@ onMounted(() => {
<q-input <q-input
outlined outlined
v-model="planData.point3" v-model="planData.point3"
label="ระดับคะแนน" label="กรอกผลสำเร็จของงาน"
bg-color="white" bg-color="white"
dense dense
class="inputgreen" class="inputgreen"
:rules="[(val) => !!val || `${'กรุณากรอกระดับคะแนน'}`]" :rules="[(val) => !!val || `${'กรุณากรอกผลสำเร็จของงาน'}`]"
hide-bottom-space hide-bottom-space
/> />
</div> </div>
@ -308,11 +300,11 @@ onMounted(() => {
<q-input <q-input
outlined outlined
v-model="planData.point2" v-model="planData.point2"
label="ระดับคะแนน" label="กรอกผลสำเร็จของงาน"
bg-color="white" bg-color="white"
dense dense
class="inputgreen" class="inputgreen"
:rules="[(val) => !!val || `${'กรุณากรอกระดับคะแนน'}`]" :rules="[(val) => !!val || `${'กรุณากรอกผลสำเร็จของงาน'}`]"
hide-bottom-space hide-bottom-space
/> />
</div> </div>
@ -325,11 +317,11 @@ onMounted(() => {
<q-input <q-input
outlined outlined
v-model="planData.point1" v-model="planData.point1"
label="ระดับคะแนน" label="กรอกผลสำเร็จของงาน"
bg-color="white" bg-color="white"
dense dense
class="inputgreen" class="inputgreen"
:rules="[(val) => !!val || `${'กรุณากรอกระดับคะแนน'}`]" :rules="[(val) => !!val || `${'กรุณากรอกผลสำเร็จของงาน'}`]"
hide-bottom-space hide-bottom-space
/> />
</div> </div>
@ -367,7 +359,7 @@ onMounted(() => {
<div <div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md" class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
> >
หนวยงาน หนวยงาน/วนราชการ
</div> </div>
<q-separator /> <q-separator />
@ -384,11 +376,12 @@ onMounted(() => {
</template> </template>
</q-input> </q-input>
<q-tree <q-tree
style="height: 350px; overflow: scroll"
dense dense
:nodes="nodeAgency" :nodes="nodeAgency"
node-key="orgTreeId" node-key="orgTreeId"
label-key="labelName" label-key="labelName"
default-expand-all selected-color="primary"
:filter="filterAgency" :filter="filterAgency"
:no-results-label="notFound" :no-results-label="notFound"
:no-nodes-label="noData" :no-nodes-label="noData"
@ -397,8 +390,8 @@ onMounted(() => {
<template v-slot:default-header="prop"> <template v-slot:default-header="prop">
<q-item <q-item
clickable clickable
@click.stop="updateSelectedAgency(prop.node)"
:active="nodeId == prop.node.orgTreeId" :active="nodeId == prop.node.orgTreeId"
@click.stop="updateSelected(prop.node)"
active-class="my-list-link text-primary text-weight-medium" active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list" class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
> >
@ -445,6 +438,7 @@ onMounted(() => {
</template> </template>
</q-input> </q-input>
<q-tree <q-tree
style="height: 350px; overflow: scroll"
dense dense
:nodes="nodeplan" :nodes="nodeplan"
selected-color="primary" selected-color="primary"

View file

@ -7,6 +7,7 @@ interface FormQueryRound {
interface FormRound { interface FormRound {
durationKPI: string; durationKPI: string;
year: number | null;
startDate: Date | null; startDate: Date | null;
endDate: Date | null; endDate: Date | null;
} }

View file

@ -0,0 +1,7 @@
//ข้อมูล
interface ResponseObject {
nameGroupKPI: string,
}
export type { ResponseObject };

View file

@ -3,7 +3,7 @@ import { ref } from "vue";
// store // store
export const useKPIDataStore = defineStore("KPIDataStore", () => { export const useKPIDataStore = defineStore("KPIDataStore", () => {
const competencyType = ref<string>("ID1"); const competencyType = ref<string>("HEAD");
return { competencyType }; return { competencyType };
}); });

View file

@ -5,11 +5,13 @@ import { useRouter } from "vue-router";
/** importStore*/ /** importStore*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
/** use*/ /** use*/
const $q = useQuasar(); const $q = useQuasar();
const router = useRouter(); const router = useRouter();
const { showLoader, hideLoader, dialogRemove, success } = useCounterMixin(); const { showLoader, hideLoader, dialogRemove, success, messageError } =
useCounterMixin();
/** หัวตาราง */ /** หัวตาราง */
const rows = ref<any>([]); const rows = ref<any>([]);
@ -42,6 +44,10 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const node = ref<any>([]);
const expanded = ref<any>([]);
const filter = ref<string>("");
const filterMain = ref<string>("");
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"indicatorNo", "indicatorNo",
"indicatorPass", "indicatorPass",
@ -66,6 +72,11 @@ const formFilter = reactive({
keyword: "", keyword: "",
}); });
const nodeData = reactive<any>({
node: null,
nodeId: null,
});
function fetchList() { function fetchList() {
showLoader(); showLoader();
const data = [ const data = [
@ -101,8 +112,49 @@ function onClickDelete(id: number) {
}); });
} }
function fetchActive() {
showLoader();
http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
fetchTree(data.activeId);
})
.catch((err) => {
messageError($q, err);
hideLoader();
});
}
async function fetchTree(id: string) {
showLoader();
http
.get(config.API.orgByid(id.toString()))
.then((res) => {
const data = res.data.result;
node.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function updateSelectedTreeMain(data: any) {
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
nodeData.node = null;
nodeData.nodeId = null;
} else {
nodeData.node = data.orgLevel;
nodeData.nodeId = data.orgTreeId;
}
}
onMounted(() => { onMounted(() => {
fetchList(); fetchList();
fetchActive();
}); });
</script> </script>
@ -111,139 +163,207 @@ onMounted(() => {
รายการตวชดตามแผนฯ รายการตวชดตามแผนฯ
</div> </div>
<q-card flat bordered class="q-pa-md"> <q-card flat bordered class="q-pa-md">
<q-toolbar class="q-pa-none"> <div class="row q-col-gutter-sm">
<div class="row q-gutter-x-sm"> <q-card bordered class="col-4">
<div> <q-card-section class="q-py-sm">
<q-select <div class="text-subtitle2 text-bold">หนวยงาน/วนราชการ</div>
dense </q-card-section>
outlined <div class="col-xs-12 col-sm-3 row">
v-model="formFilter.org" <div class="col-12 row no-wrap">
:options="orgOp" <div class="col-12 q-py-sm q-px-sm">
label="หน่วยงาน/ส่วนราชการ" <div class="q-gutter-sm">
option-label="name" <q-input dense outlined v-model="filterMain" label="ค้นหา">
option-value="id" <template v-slot:append>
emit-value <q-icon
map-options v-if="filterMain !== ''"
/> name="clear"
</div> class="cursor-pointer"
<div> @click="filterMain = ''"
<q-select />
dense <q-icon v-else name="search" color="grey-5" />
outlined </template>
v-model="formFilter.round" </q-input>
:options="roundOp" <div>
label="รอบการประเมิน" <q-tree
option-label="name" class="tree-container"
option-value="id" dense
emit-value :nodes="node"
map-options node-key="orgTreeName"
/> label-key="labelName"
</div> v-model:expanded="expanded"
</div> :filter="filterMain"
<q-toolbar-title> no-results-label="ไม่พบข้อมูลที่ค้นหา"
<q-btn no-nodes-label="ไม่มีข้อมูล"
flat v-model:selected="nodeData.nodeId"
round >
dense <template v-slot:default-header="prop">
icon="add" <q-item
color="primary" clickable
@click="onClickAddOrView()" @click.stop="updateSelectedTreeMain(prop.node)"
> :active="nodeData.nodeId === prop.node.orgTreeId"
<q-tooltip>เพ</q-tooltip> active-class="my-list-link text-primary text-weight-medium"
</q-btn> class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
</q-toolbar-title> >
<div>
<q-space /> <div class="text-weight-medium">
<div class="row q-gutter-sm"> {{ prop.node.orgTreeName }}
<div> </div>
<q-input <div class="text-weight-light text-grey-8">
standout {{
dense prop.node.orgCode == null
v-model="formFilter.keyword" ? null
ref="filterRef" : prop.node.orgCode
outlined }}
debounce="300" {{
placeholder="ค้นหา" prop.node.orgTreeShortName == null
> ? null
<template v-slot:append> : prop.node.orgTreeShortName
<q-icon v-if="formFilter.keyword == ''" name="search" /> }}
<q-icon </div>
v-if="formFilter.keyword !== ''" </div>
name="clear" </q-item>
class="cursor-pointer" </template>
@click="formFilter.keyword = ''" </q-tree>
/> </div>
</template>
</q-input>
</div>
<div>
<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"
options-cover
style="min-width: 150px"
/>
</div>
</div>
</q-toolbar>
<div class="col-12">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="subject"
flat
bordered
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">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</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"
@click="onClickAddOrView(true, props.row.id)"
>
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div> </div>
</q-td> </div>
<q-td> <div class="col-12 row">
<q-btn <q-separator :vertical="!$q.screen.lt.md" />
flat </div>
round </div>
icon="delete" </div>
color="red" </q-card>
@click.stop.pervent="onClickDelete(props.rowIndex)" <div class="col-8">
> <div class="row q-col-gutter-sm q-mb-sm">
<q-tooltip>ลบขอม </q-tooltip> <div class="col-3">
</q-btn> <q-select
</q-td> dense
</q-tr> outlined
</template> v-model="formFilter.round"
</d-table> :options="roundOp"
label="รอบการประเมิน"
option-label="name"
option-value="id"
emit-value
map-options
/>
</div>
<div class="col-2">
<q-btn
flat
round
dense
icon="add"
color="primary"
@click="onClickAddOrView()"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
</div>
<div class="col-4">
<q-input
standout
dense
v-model="formFilter.keyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append>
<q-icon v-if="formFilter.keyword == ''" name="search" />
<q-icon
v-if="formFilter.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="formFilter.keyword = ''"
/>
</template>
</q-input>
</div>
<div class="col-3">
<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"
options-cover
style="min-width: 150px"
/>
</div>
</div>
<div class="col-12">
<d-table
for="table"
ref="table"
:columns="columns"
:rows="rows"
row-key="subject"
flat
bordered
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">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</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"
@click="onClickAddOrView(true, props.row.id)"
>
<div class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td>
<q-btn
flat
round
icon="delete"
color="red"
@click.stop.pervent="onClickDelete(props.rowIndex)"
>
<q-tooltip>ลบขอม </q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
</div>
</div>
</div> </div>
</q-card> </q-card>
</template> </template>
<style scoped></style> <style lang="scss" scoped>
.tree-container {
overflow: auto;
height: 65vh;
border: 1px solid #e6e6e7;
border-radius: 10px;
}
.my-list-link {
color: rgb(118, 168, 222);
border-radius: 5px;
background: #a3d3fb48 !important;
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>

View file

@ -70,17 +70,32 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "isActive",
align: "left",
label: "สถานะ",
sortable: true,
field: "isActive",
format: (val) => (val ? "เปิด" : "ปิดแล้ว"),
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"durationKPI",
"startDate",
"endDate",
"isActive",
]); ]);
const visibleColumns = ref<string[]>(["durationKPI", "startDate", "endDate"]);
/** itemMenu*/ /** itemMenu*/
const itemMenu = ref<ItemsMenu[]>([ const itemMenu = ref<ItemsMenu[]>([
{ // {
label: "เปิดรอบ", // label: "",
value: "open", // value: "open",
icon: "mdi-check", // icon: "mdi-check",
color: "primary", // color: "primary",
}, // },
{ {
label: "ปิดรอบ", label: "ปิดรอบ",
value: "close", value: "close",
@ -113,6 +128,7 @@ const formQuery = reactive<FormQueryRound>({
const totalList = ref<number>(1); const totalList = ref<number>(1);
const formData = reactive<FormRound>({ const formData = reactive<FormRound>({
durationKPI: "", durationKPI: "",
year: null,
startDate: null, startDate: null,
endDate: null, endDate: null,
}); });
@ -172,6 +188,7 @@ function clearFormData() {
formData.durationKPI = ""; formData.durationKPI = "";
formData.startDate = null; formData.startDate = null;
formData.endDate = null; formData.endDate = null;
formData.year = null;
} }
/** function บันทึกข้อมูลเพิ่มรอบการประเมิน*/ /** function บันทึกข้อมูลเพิ่มรอบการประเมิน*/
@ -244,6 +261,7 @@ function onCloseRounde(id: string) {
dialogConfirm( dialogConfirm(
$q, $q,
() => { () => {
showLoader();
http http
.get(config.API.kpiPeriod + `/close/${id}`) .get(config.API.kpiPeriod + `/close/${id}`)
.then(() => { .then(() => {
@ -336,7 +354,9 @@ onMounted(() => {
dense dense
lazy-rules lazy-rules
outlined outlined
:model-value="Number(formQuery.year) + 543" :model-value="
formQuery.year === 0 ? 'ทั้งหมด' : Number(formQuery.year) + 543
"
:label="`${'ปีงบประมาณ'}`" :label="`${'ปีงบประมาณ'}`"
> >
<template v-slot:prepend> <template v-slot:prepend>
@ -347,6 +367,15 @@ onMounted(() => {
> >
</q-icon> </q-icon>
</template> </template>
<template v-if="formQuery.year" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(formQuery.year = 0), (formQuery.page = 1), fetchList()
"
class="cursor-pointer"
/>
</template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
@ -462,7 +491,9 @@ onMounted(() => {
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
v-for="items in itemMenu" v-for="items in props.row.isActive
? itemMenu
: itemMenu.slice(1, 2)"
@click="onClickAction(items.value, props.row.id)" @click="onClickAction(items.value, props.row.id)"
> >
<q-item-section avatar> <q-item-section avatar>
@ -526,6 +557,49 @@ onMounted(() => {
]" ]"
/> />
</div> </div>
<div class="col-12">
<datepicker
menu-class-name="modalfix"
v-model="formData.year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
hide-bottom-space
class="inputgreen"
:model-value="
formData.year === null
? null
: Number(formData.year) + 543
"
:label="`${'ปีงบประมาณ'}`"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกปีงบประมาณ'}`,
]"
>
<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-12"> <div class="col-12">
<datepicker <datepicker
menu-class-name="modalfix" menu-class-name="modalfix"

View file

@ -350,6 +350,7 @@ onMounted(() => {
> >
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width></q-th>
<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">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
@ -357,6 +358,11 @@ onMounted(() => {
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer"> <q-tr :props="props" class="cursor-pointer">
<q-td v-if="props.row.isDone">
<q-icon name="mdi-check" color="green" size="xs">
<q-tooltip>งไปบนทกททะเบยนประวแล</q-tooltip>
</q-icon>
</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>{{ col.value ? col.value : "-" }}</div> <div>{{ col.value ? col.value : "-" }}</div>
</q-td> </q-td>

View file

@ -87,11 +87,13 @@ function fetchData() {
formMainProject.trainingStart = data.dateStart ? data.dateStart : null; formMainProject.trainingStart = data.dateStart ? data.dateStart : null;
formMainProject.trainingEnd = data.dateEnd ? data.dateEnd : null; formMainProject.trainingEnd = data.dateEnd ? data.dateEnd : null;
formMainProject.totalTraining = data.totalDate ? data.totalDate : null; formMainProject.totalTraining = data.totalDate ? data.totalDate : null;
formMainProject.location = data.addressAcademic ? data.addressAcademic : null; formMainProject.location = data.addressAcademic
? data.addressAcademic
: null;
formMainProject.topic = data.topicAcademic ? data.topicAcademic : null; formMainProject.topic = data.topicAcademic ? data.topicAcademic : null;
// formMainProject.studyStart = data.dateStudyStart; // formMainProject.studyStart = data.dateStudyStart;
// formMainProject.studyEnd = data.dateStudyEnd; // formMainProject.studyEnd = data.dateStudyEnd;
formMainProject.organizingTraining = data.org? data.org : null; formMainProject.organizingTraining = data.org ? data.org : null;
dateOrder.value = data.dateOrder; dateOrder.value = data.dateOrder;
order.value = data.order; order.value = data.order;
@ -133,68 +135,76 @@ onMounted(() => {
อมลขาราชการฯ อมลขาราชการฯ
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="row q-col-gutter-md q-pa-md"> <div class="row q-pa-md q-col-gutter-md">
<div class="row col-6"> <div class="col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> <div class="row q-col-gutter-md">
เลขประจาตวประชาชน <div class="row col-12">
</div> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
เลขประจาตวประชาชน
</div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ formMain.citizenId ?? "-" }} {{ formMain.citizenId ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
- นามสก
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.name ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
าแหน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.position ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
ประเภทตาแหน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.type ?? "-" }}
</div>
</div>
</div> </div>
</div> </div>
<div class="row col-6"> <div class="col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> <div class="row q-col-gutter-md">
ระดบตาแหน <div class="row col-12">
</div> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
ระดบตาแหน
</div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ formMain.level ?? "-" }} {{ formMain.level ?? "-" }}
</div> </div>
</div> </div>
<div class="row col-6"> <div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
- นามสก าแหนงทางการบรหาร
</div> </div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ formMain.name ?? "-" }} {{ formMain.positionSide ?? "-" }}
</div> </div>
</div> </div>
<div class="row col-6"> <div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
าแหนงทางการบรหาร หนวยงานทงก
</div> </div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ formMain.positionSide ?? "-" }} {{ formMain.oc ?? "-" }}
</div> </div>
</div> </div>
<div class="row col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
าแหน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.position ?? "-" }}
</div>
</div>
<div class="row col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
หนวยงานทงก
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.oc ?? "-" }}
</div>
</div>
<div class="row col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
ประเภทตาแหน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.type ?? "-" }}
</div> </div>
</div> </div>
</div> </div>
@ -206,85 +216,93 @@ onMounted(() => {
อมลโครงการ อมลโครงการ
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="row q-col-gutter-md q-pa-md"> <div class="row q-pa-md q-col-gutter-md">
<div class="row col-6"> <div class="col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> <div class="row q-col-gutter-md">
อโครงการ/หลกสตรการฝกอบรม <div class="row col-12">
</div> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
อโครงการ/หลกสตรการฝกอบรม
</div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.project ?? "-" }} {{ formMainProject.project ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
งบประมาณทเขารบการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ Number(formMainProject.year) + 543 ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
วขอการไปฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.topic ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
สถานทไปฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.location ?? "-" }}
</div>
</div>
</div> </div>
</div> </div>
<div class="row col-6"> <div class="col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> <div class="row q-col-gutter-md">
นเรมตนการฝกอบรม/กษาดงาน <div class="row col-12">
</div> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
นเรมตนการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ {{
formMainProject.trainingStart formMainProject.trainingStart
? date2Thai(formMainProject.trainingStart) ? date2Thai(formMainProject.trainingStart)
: "-" : "-"
}} }}
</div> </div>
</div> </div>
<div class="row col-6"> <div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
งบประมาณทเขารบการฝกอบรม/กษาดงาน นสนสการฝกอบรม/กษาดงาน
</div> </div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.year ?? "-" }} {{
</div> formMainProject.trainingEnd
</div> ? date2Thai(formMainProject?.trainingEnd)
<div class="row col-6"> : "-"
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium"> }}
นสนสดการฝกอบรม/กษาดงาน </div>
</div> </div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
รวมระยะเวลาในการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ {{ formMainProject.totalTraining ?? "-" }}
formMainProject.trainingEnd </div>
? date2Thai(formMainProject?.trainingEnd) </div>
: "-" <div class="row col-12">
}} <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
</div> หนวยงานทบผดชอบ
</div> </div>
<div class="row col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
วขอการไปฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7"> <div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.topic ?? "-" }} {{ formMainProject.organizingTraining ?? "-" }}
</div> </div>
</div> </div>
<div class="row col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
รวมระยะเวลาในการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.totalTraining ?? "-" }}
</div>
</div>
<div class="row col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
สถานทไปฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.location ?? "-" }}
</div>
</div>
<div class="row col-6">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
หนวยงานทบผดชอบ
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.organizingTraining ?? "-" }}
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,33 +1,27 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type { import type {
FormAddHistoryEmployee, FormAddHistoryEmployee,
FormAddHistoryProject, FormAddHistoryProject,
} from "@/modules/15_development/interface/request/Main"; } from "@/modules/15_development/interface/request/Main";
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import DialogGov from "@/modules/15_development/components/historyEmployee/DialogGov.vue"; /** use*/
import DialogProject from "@/modules/15_development/components/historyEmployee/DialogProject.vue";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id as string);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { dialogConfirm, showLoader, hideLoader, messageError, date2Thai } = const { showLoader, hideLoader, messageError, date2Thai } = mixin;
mixin;
const store = useDevelopmentDataStore();
const modalDialogGov = ref<boolean>(false);
const modalDialogProject = ref<boolean>(false);
const id = ref<string>(route.params.id as string);
const dateOrder = ref<Date | null>(null); const dateOrder = ref<Date | null>(null);
const order = ref<string>(""); const order = ref<string>("");
@ -54,8 +48,8 @@ const formMainProject = reactive<FormAddHistoryProject>({
id: "", id: "",
project: "", /// project: "", ///
year: "", // year: "", //
trainingStart: "", // trainingStart: null, //
trainingEnd: "", // trainingEnd: null, //
totalTraining: "", // totalTraining: "", //
location: "", // location: "", //
topic: "", // topic: "", //
@ -64,90 +58,11 @@ const formMainProject = reactive<FormAddHistoryProject>({
organizingTraining: "", // organizingTraining: "", //
}); });
const fieldLabels = {
citizenId: "เลขประจําตัวประชาชน",
name: "ชื่อ - นามสกุล",
position: "ตําแหน่ง",
type: "กลุ่มงาน",
level: "ระดับชั้นงาน",
oc: "หน่วยงานที่สังกัด",
};
const fieldLabelsProject = {
project: "ชื่อโครงการ/หลักสูตรการฝึกอบรม",
year: "ปีงบประมาณที่เข้ารับการฝึกอบรม",
trainingStart: "วันเริ่มต้นการฝึกอบรม",
trainingEnd: "วันสิ้นสุดการฝึกอบรม",
totalTraining: "รวมระยะเวลาในการฝึกอบรม",
location: "สถานที่ไปศึกษาดูงาน",
topic: "หัวข้อการไปศึกษาดูงาน",
studyStart: "วันเริ่มต้นการศึกษาดูงาน",
studyEnd: "วันสิ้นสุดการศึกษาดูงาน",
organizingTraining: "หน่วยงานที่รับผิดชอบจัดการอบรม",
};
function getClass() { function getClass() {
return "inputgreen"; return "inputgreen";
} }
/** save */
function onSubmit() {
const url = id.value
? config.API.developmentHistoryListByid("employee", id.value)
: config.API.developmentHistoryAdd("employee");
const body = { function fetchDataDetail() {
rank: null,
prefix: formMain.prefix,
firstName: formMain.firstName,
lastName: formMain.lastName,
citizenId: formMain.citizenId,
position: formMain.position,
posExecutive: null,
posLevelId: formMain.posLevelId,
posTypeId: formMain.posTypeId,
developmentId: formMainProject.id,
order: order.value,
dateOrder: dateOrder.value,
};
dialogConfirm($q, () => {
showLoader();
http[id.value ? "put" : "post"](url, body)
.then(() => {
router.push(`/development/employee-history`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
}
function upDate(data: FormAddHistoryEmployee) {
formMain.id = data.id;
formMain.citizenId = data.citizenId;
formMain.name = data.name;
formMain.prefix = data.prefix;
formMain.firstName = data.firstName;
formMain.lastName = data.lastName;
formMain.position = data.position;
formMain.posLevelId = data.posLevelId;
formMain.posTypeId = data.posTypeId;
formMain.type = data.type;
formMain.level = data.level;
}
function upDateProject(data: any) {
formMainProject.id = data.id;
formMainProject.project = data.project;
formMainProject.year = data.year;
}
function getDataEdit() {
showLoader(); showLoader();
http http
.get(config.API.developmentHistoryListByid("employee", id.value)) .get(config.API.developmentHistoryListByid("employee", id.value))
@ -170,17 +85,21 @@ function getDataEdit() {
formMain.positionSide = data.positionSide ? data.positionSide : null; formMain.positionSide = data.positionSide ? data.positionSide : null;
formMain.oc = data.org ? data.org : null; formMain.oc = data.org ? data.org : null;
formMainProject.id = data.developmentId; formMainProject.id = data.developmentId ? data.developmentId : null;
formMainProject.project = data.projectName; formMainProject.project = data.projectName ? data.projectName : null;
formMainProject.year = data.year; formMainProject.year = data.year ? data.year : null;
formMainProject.trainingStart = data.dateStart; formMainProject.trainingStart = data.dateStart ? data.dateStart : null;
formMainProject.trainingEnd = data.dateEnd; formMainProject.trainingEnd = data.dateEnd ? data.dateEnd : null;
formMainProject.totalTraining = data.totalDate; formMainProject.totalTraining = data.totalDate ? data.totalDate : null;
formMainProject.location = data.addressAcademic; formMainProject.location = data.addressAcademic
formMainProject.topic = data.topicAcademic; ? data.addressAcademic
formMainProject.studyStart = data.dateStudyStart; : null;
formMainProject.studyEnd = data.dateStudyEnd; formMainProject.topic = data.topicAcademic ? data.topicAcademic : null;
formMainProject.organizingTraining = data.org; formMainProject.studyStart = data.dateStudyStart
? data.dateStudyStart
: null;
formMainProject.studyEnd = data.dateStudyEnd ? data.dateStudyEnd : null;
formMainProject.organizingTraining = data.org ? data.org : null;
dateOrder.value = data.dateOrder; dateOrder.value = data.dateOrder;
order.value = data.order; order.value = data.order;
@ -195,7 +114,7 @@ function getDataEdit() {
onMounted(() => { onMounted(() => {
if (id.value) { if (id.value) {
getDataEdit(); fetchDataDetail();
} }
}); });
</script> </script>
@ -212,206 +131,234 @@ onMounted(() => {
class="q-mr-sm" class="q-mr-sm"
@click="router.go(-1)" @click="router.go(-1)"
/> />
<span>{{ <span> ประวกอบรม/งานลกจาง </span>
id
? `แก้ไขประวัติฝึกอบรม/ดูงานลูกจ้าง`
: `เพิ่มประวัติฝึกอบรม/ดูงานลูกจ้าง`
}}</span>
</div> </div>
<q-card flat bordered> <q-card flat bordered>
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-card-section>
<q-card-section> <!-- Card อมลลกจาง -->
<q-card flat bordered style="border: 1px solid #d6dee1"> <q-card flat bordered style="border: 1px solid #d6dee1">
<div class="col-12 text-weight-bold bg-grey-1 q-py-sm q-px-md"> <div class="col-12 text-weight-bold bg-grey-1 q-py-sm q-px-md">
อมลลกจาง อมลลกจาง
</div>
<!-- <q-btn <div class="col-12"><q-separator /></div>
flat <div class="row q-pa-md q-col-gutter-md">
class="btn-fixed-width" <div class="col-6">
color="teal" <div class="row q-col-gutter-md">
label="เลือกลูกจ้าง" <div class="row col-12">
icon="add" <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
@click="modalDialogGov = true" เลขประจาตวประชาชน
/> -->
</div>
<div class="col-12"><q-separator /></div>
<div class="row q-col-gutter-md q-pa-md">
<div class="col-12 col-sm-6 col-md-6 q-gutter-y-sm">
<div
class="row"
v-for="(field, index) in Object.keys(fieldLabels).slice(0, 4)"
:key="index"
>
<div class="col-12 col-sm-12 col-md-4">
<span class="text-grey-6 text-weight-medium">{{
fieldLabels[field as keyof typeof fieldLabels]
}}</span>
</div> </div>
<div class="col-12 col-sm-12 col-md-8">
<span>{{ formMain[field] ? formMain[field] : "-" }}</span> <div class="col-12 col-sm-12 col-md-7">
{{ formMain.citizenId ?? "-" }}
</div> </div>
</div> </div>
</div> <div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
<div class="col-12 col-sm-6 col-md-6 q-gutter-y-sm"> - นามสก
<div
class="row"
v-for="(field, index) in Object.keys(fieldLabels).slice(4, 7)"
:key="index"
>
<div class="col-12 col-sm-12 col-md-4">
<span class="text-grey-6 text-weight-medium">{{
fieldLabels[field as keyof typeof fieldLabels]
}}</span>
</div> </div>
<div class="col-12 col-sm-12 col-md-8">
<span>{{ formMain[field] ? formMain[field] : "-" }}</span> <div class="col-12 col-sm-12 col-md-7">
{{ formMain.name ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
ตำแหน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.position ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
กลมงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMain.type ?? "-" }}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</q-card> <div class="col-6">
<div class="row q-col-gutter-md">
<q-card flat bordered class="q-mt-md" style="border: 1px solid #d6dee1"> <div class="row col-12">
<div class="col-12 text-weight-bold bg-grey-1 q-py-sm q-px-md"> <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
อมลโครงการ ระดบชนงาน
<!-- <q-btn
flat
class="btn-fixed-width"
color="teal"
label="เลือกโครงการ"
icon="add"
@click="modalDialogProject = true"
/> -->
</div>
<div class="col-12"><q-separator /></div>
<div class="row q-col-gutter-md q-pa-md">
<div class="col-12 col-sm-6 col-md-6 q-gutter-y-sm">
<div
class="row"
v-for="(field, index) in Object.keys(fieldLabelsProject).slice(
0,
5
)"
:key="index"
>
<div class="col-12 col-sm-12 col-md-4">
<span class="text-grey-6 text-weight-medium">{{
fieldLabelsProject[field as keyof typeof fieldLabelsProject]
}}</span>
</div> </div>
<div class="col-12 col-sm-12 col-md-8">
<span v-if="index == 1">{{ <div class="col-12 col-sm-12 col-md-7">
formMainProject[field] ? formMainProject[field] + 543 : "-" {{ formMain.level ?? "-" }}
}}</span> </div>
<span v-else-if="index == 2 || index == 3">{{ </div>
formMainProject[field] <div class="row col-12">
? date2Thai(formMainProject[field]) <div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
: "-" หนวยงานทงก
}}</span> </div>
<span v-else>{{
formMainProject[field] ? formMainProject[field] : "-" <div class="col-12 col-sm-12 col-md-7">
}}</span> {{ formMain.oc ?? "-" }}
</div> </div>
</div> </div>
</div> </div>
<div class="col-12 col-sm-6 col-md-6 q-gutter-y-sm">
<div
class="row"
v-for="(field, index) in Object.keys(fieldLabelsProject).slice(
5,
10
)"
:key="index"
>
<div class="col-12 col-sm-12 col-md-4">
<span class="text-grey-6 text-weight-medium">{{
fieldLabelsProject[field as keyof typeof fieldLabelsProject]
}}</span>
</div>
<div class="col-12 col-sm-12 col-md-8">
<span>{{
formMainProject[field] ? formMainProject[field] : "-"
}}</span>
</div>
</div>
</div>
</div>
</q-card>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-3">
<q-input
readonly
label="เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"
v-model="order"
dense
outlined
:class="getClass()"
hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง/เลขที่หนังสืออนุมัติ'}`,]"
/>
</div>
<div class="col-3">
<datepicker
readonly
menu-class-name="modalfix"
v-model="dateOrder"
: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
readonly
outlined
dense
:class="getClass()"
hide-bottom-space
:model-value="dateOrder != null ? date2Thai(dateOrder) : null"
:rules="[(val:string) => !!val || `${'กรุณากรอกคำสั่งลงวันที่/หนังสืออนุมัติลงวันที่'}`,]"
label="คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"
>
<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>
</div> </div>
</q-card-section> </q-card>
<!-- <q-separator />
<div class="text-right q-pa-sm">
<q-btn
dense
unelevated
label="บันทึก"
id="onSubmit"
type="submit"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div> -->
</q-form>
</q-card>
<DialogGov v-model:modal="modalDialogGov" :up-date="upDate" /> <!-- Card อมลโครงการ -->
<DialogProject v-model:modal="modalDialogProject" :up-date="upDateProject" /> <q-card flat bordered class="q-mt-md" style="border: 1px solid #d6dee1">
<div class="col-12 text-weight-bold bg-grey-1 q-py-sm q-px-md">
อมลโครงการ
</div>
<div class="col-12"><q-separator /></div>
<div class="row q-pa-md q-col-gutter-md">
<div class="col-6">
<div class="row q-col-gutter-md">
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
อโครงการ/หลกสตรการฝกอบรม
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.project ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
งบประมาณทเขารบการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ Number(formMainProject.year) + 543 ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
วขอการไปฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.topic ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
สถานทไปฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.location ?? "-" }}
</div>
</div>
</div>
</div>
<div class="col-6">
<div class="row q-col-gutter-md">
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
นเรมตนการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{
formMainProject.trainingStart
? date2Thai(formMainProject.trainingStart)
: "-"
}}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
นสนสดการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{
formMainProject.trainingEnd
? date2Thai(formMainProject?.trainingEnd)
: "-"
}}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
รวมระยะเวลาในการฝกอบรม/กษาดงาน
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.totalTraining ?? "-" }}
</div>
</div>
<div class="row col-12">
<div class="col-sm-12 col-md-5 text-grey-6 text-weight-medium">
หนวยงานทบผดชอบ
</div>
<div class="col-12 col-sm-12 col-md-7">
{{ formMainProject.organizingTraining ?? "-" }}
</div>
</div>
</div>
</div>
</div>
</q-card>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-3">
<q-input
readonly
label="เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ"
v-model="order"
dense
outlined
:class="getClass()"
hide-bottom-space
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง/เลขที่หนังสืออนุมัติ'}`,]"
/>
</div>
<div class="col-3">
<datepicker
readonly
menu-class-name="modalfix"
v-model="dateOrder"
: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
readonly
outlined
dense
:class="getClass()"
hide-bottom-space
:model-value="dateOrder != null ? date2Thai(dateOrder) : null"
:rules="[(val:string) => !!val || `${'กรุณากรอกคำสั่งลงวันที่/หนังสืออนุมัติลงวันที่'}`,]"
label="คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่"
>
<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>
</q-card-section>
</q-card>
</template> </template>

View file

@ -6,11 +6,6 @@ import config from "@/app.config";
import genReportXLSX from "@/plugins/genreportxlsx"; import genReportXLSX from "@/plugins/genreportxlsx";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import type {
DataOption,
FormFilter,
} from "@/modules/15_development/interface/index/Main";
/** importStore*/ /** importStore*/
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore"; import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -27,7 +22,7 @@ const pagination = ref({
}); });
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
const formFilter = reactive({ const formFilter = reactive({
root: "", root: null,
page: 1, page: 1,
pageSize: 20, pageSize: 20,
keyword: "", keyword: "",
@ -35,7 +30,6 @@ const formFilter = reactive({
}); });
const rows = ref<any>([]); const rows = ref<any>([]);
const agency = ref<string>("");
const agencyOp = ref<[]>([]); const agencyOp = ref<[]>([]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
@ -111,9 +105,10 @@ function fetchListOrg() {
http http
.get(config.API.developmentHistoryListOrg("employee", formFilter.year)) .get(config.API.developmentHistoryListOrg("employee", formFilter.year))
.then((res) => { .then((res) => {
formFilter.root = ""; formFilter.root = null;
rows.value = []; rows.value = [];
agencyOp.value = res.data.result; agencyOp.value = res.data.result;
getData();
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -148,14 +143,6 @@ function onEdit(id: string) {
} }
function getData() { function getData() {
let queryParams: any = {
page: formFilter.page,
pageSize: formFilter.pageSize,
keyword: formFilter.keyword,
year: formFilter.year,
root: formFilter.root,
};
showLoader(); showLoader();
http http
.post(config.API.developmentHistoryList("employee"), formFilter) .post(config.API.developmentHistoryList("employee"), formFilter)
@ -184,10 +171,6 @@ function getData() {
}); });
} }
function yearAll() {
formFilter.year = 0;
// getData();
}
onMounted(() => { onMounted(() => {
fetchListOrg(); fetchListOrg();
}); });

View file

@ -116,6 +116,7 @@ function fetchListOrg() {
.get(config.API.developmentHistoryListOrg("officer", formFilter.year)) .get(config.API.developmentHistoryListOrg("officer", formFilter.year))
.then((res) => { .then((res) => {
formFilter.root = null; formFilter.root = null;
rows.value = [];
agencyOp.value = res.data.result; agencyOp.value = res.data.result;
getData(); getData();
}) })

View file

@ -213,152 +213,122 @@ onMounted(() => {
<q-card flat bordered class="q-pa-md"> <q-card flat bordered class="q-pa-md">
<q-toolbar class="q-pa-none"> <q-toolbar class="q-pa-none">
<div class="row q-gutter-sm"> <div class="row q-gutter-sm">
<div> <datepicker
<datepicker style="width: 150px"
style="width: 150px" menu-class-name="modalfix"
menu-class-name="modalfix" v-model="formQuery.year"
v-model="formQuery.year" :locale="'th'"
:locale="'th'" autoApply
autoApply year-picker
year-picker :enableTimePicker="false"
:enableTimePicker="false" @update:model-value="fetchNewList"
@update:model-value="fetchNewList" >
> <template #year="{ year }">{{ year + 543 }}</template>
<template #year="{ year }">{{ year + 543 }}</template> <template #year-overlay-value="{ value }">{{
<template #year-overlay-value="{ value }">{{ parseInt(value + 543)
parseInt(value + 543) }}</template>
}}</template> <template #trigger>
<template #trigger> <q-input
<q-input dense
dense lazy-rules
lazy-rules outlined
outlined :model-value="
:model-value=" formQuery.year === 0 ? 'ทั้งหมด' : Number(formQuery.year) + 543
formQuery.year === 0 "
? 'ทั้งหมด' :label="`${'ปีงบประมาณ'}`"
: Number(formQuery.year) + 543 >
" <template v-if="formQuery.year" v-slot:append>
:label="`${'ปีงบประมาณ'}`" <q-icon
> name="cancel"
<template v-if="formQuery.year" v-slot:append> @click.stop.prevent="(formQuery.year = 0), fetchNewList()"
<q-icon class="cursor-pointer"
name="cancel" />
@click.stop.prevent="(formQuery.year = 0), fetchNewList()" </template>
class="cursor-pointer" <template v-slot:prepend>
/> <q-icon
</template> name="event"
<template v-slot:prepend> class="cursor-pointer"
<q-icon style="color: var(--q-primary)"
name="event" >
class="cursor-pointer" </q-icon>
style="color: var(--q-primary)" </template>
> </q-input>
</q-icon> </template>
</template> </datepicker>
</q-input>
</template> <q-select
</datepicker> dense
</div> outlined
<div> v-model="formQuery.type"
<q-select :options="scholarshipTypeOp"
dense emit-value
outlined map-options
v-model="formQuery.type" option-value="id"
:options="scholarshipTypeOp" option-label="name"
emit-value label="เลือกประเภททุน"
map-options @update:model-value="fetchNewList"
option-value="id" class="type"
option-label="name" />
label="เลือกประเภททุน"
@update:model-value="fetchNewList"
style="width: 350px"
/>
</div>
</div> </div>
<q-toolbar-title>
<q-btn
flat
round
dense
icon="add"
color="primary"
@click="onClickAddOrView()"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
<q-space />
<div class="row q-gutter-sm">
<q-btn <q-btn
flat flat
round round
dense dense
icon="add" icon="mdi-arrow-down-bold-circle-outline"
color="primary" color="blue"
@click="onClickAddOrView()" @click="onDownload"
> >
<q-tooltip>เพ</q-tooltip> <q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn> </q-btn>
</q-toolbar-title>
<q-space /> <q-input
<div class="row q-gutter-sm"> standout
<div> dense
<q-btn v-model="formQuery.keyword"
flat ref="filterRef"
round outlined
dense placeholder="ค้นหา"
icon="mdi-arrow-down-bold-circle-outline" @keyup.enter="fetchNewList()"
color="blue" >
@click="onDownload" <template v-slot:append>
> <q-icon v-if="formQuery.keyword == ''" name="search" />
<q-tooltip>ดาวนโหลด</q-tooltip> <q-icon
</q-btn> v-if="formQuery.keyword !== ''"
<!-- <q-btn name="clear"
flat class="cursor-pointer"
round @click="(formQuery.keyword = ''), fetchNewList()"
color="blue" />
icon="mdi-arrow-down-bold-circle-outline" </template>
> </q-input>
<q-menu>
<q-list style="min-width: 100px" dense> <q-select
<q-item clickable v-close-popup v-for="items in itemDownload"> v-model="visibleColumns"
<q-item-section avatar> multiple
<q-icon :color="items.color" :name="items.icon" /> outlined
</q-item-section> dense
<q-item-section :class="`text-${items.color}`">{{ options-dense
items.label :display-value="$q.lang.table.columns"
}}</q-item-section> emit-value
</q-item> map-options
</q-list> :options="columns"
</q-menu> option-value="name"
<q-tooltip>ดาวนโหลด</q-tooltip> options-cover
</q-btn> --> style="min-width: 150px"
</div> />
<div>
<q-input
standout
dense
v-model="formQuery.keyword"
ref="filterRef"
outlined
placeholder="ค้นหา"
@keyup.enter="fetchNewList()"
>
<template v-slot:append>
<q-icon v-if="formQuery.keyword == ''" name="search" />
<q-icon
v-if="formQuery.keyword !== ''"
name="clear"
class="cursor-pointer"
@click="(formQuery.keyword = ''), fetchNewList()"
/>
</template>
</q-input>
</div>
<div>
<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"
options-cover
style="min-width: 150px"
/>
</div>
</div> </div>
</q-toolbar> </q-toolbar>
@ -416,4 +386,11 @@ onMounted(() => {
</q-card> </q-card>
</template> </template>
<style scoped></style> <style scoped>
.q-select.type >>> .q-field__native > span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 200px;
}
</style>

View file

@ -733,15 +733,18 @@ watch(
@click="link = menuItem.label" @click="link = menuItem.label"
active-class="text-primary menuActiveMini text-weight-medium" active-class="text-primary menuActiveMini text-weight-medium"
v-if=" v-if="
menuItem.key == 3 || menuItem.key == 2 ||
menuItem.key == 5 || menuItem.key == 0 ||
menuItem.key == 6 ||
menuItem.key == 7 || menuItem.key == 7 ||
menuItem.key == 8 || menuItem.key == 8 ||
menuItem.key == 9 || menuItem.key == 9 ||
menuItem.key == 10 ||
menuItem.key == 11 || menuItem.key == 11 ||
menuItem.key == 12 || menuItem.key == 12 ||
menuItem.key == 14 menuItem.key == 13 ||
menuItem.key == 14 ||
menuItem.key == 15 ||
menuItem.key == 16
" "
> >
<div class="row items-center no-wrap"> <div class="row items-center no-wrap">
@ -772,8 +775,24 @@ watch(
:to="{ name: `${subMenu.path}` }" :to="{ name: `${subMenu.path}` }"
> >
<!-- เมนอย 2 --> <!-- เมนอย 2 -->
<div v-if="menuItem.key == 5"> <div
<q-item dense clickable v-if="subMenu.key !== 5.1"> v-if="
menuItem.key == 2 ||
menuItem.key == 7 ||
menuItem.key == 12 ||
menuItem.key == 13
"
>
<q-item
dense
clickable
v-if="
subMenu.key !== 2.0 &&
subMenu.key !== 7.1 &&
subMenu.key !== 12.0 &&
subMenu.key !== 13.0
"
>
<q-item-section <q-item-section
>{{ subMenu.label }} >{{ subMenu.label }}
</q-item-section> </q-item-section>
@ -898,16 +917,18 @@ watch(
expand-icon="mdi-chevron-down" expand-icon="mdi-chevron-down"
expanded-icon="mdi-chevron-up" expanded-icon="mdi-chevron-up"
v-if=" v-if="
menuItem.key == 3 || menuItem.key == 2 ||
menuItem.key == 5 || menuItem.key == 0 ||
menuItem.key == 6 ||
menuItem.key == 7 || menuItem.key == 7 ||
menuItem.key == 8 || menuItem.key == 8 ||
menuItem.key == 9 || menuItem.key == 9 ||
menuItem.key == 10 ||
menuItem.key == 11 || menuItem.key == 11 ||
menuItem.key == 12 || menuItem.key == 12 ||
menuItem.key == 13 || menuItem.key == 13 ||
menuItem.key == 14 menuItem.key == 14 ||
menuItem.key == 15 ||
menuItem.key == 16
" "
> >
<template v-slot:header> <template v-slot:header>
@ -924,7 +945,10 @@ watch(
<!-- เมนอย 2 (สรรหา) --> <!-- เมนอย 2 (สรรหา) -->
<div <div
v-if=" v-if="
menuItem.key == 5 || menuItem.key == 11 || menuItem.key == 3 menuItem.key == 2 ||
menuItem.key == 7 ||
menuItem.key == 12 ||
menuItem.key == 13
" "
> >
<div v-for="(subMenu, i) in menuItem.children" :key="i"> <div v-for="(subMenu, i) in menuItem.children" :key="i">
@ -933,18 +957,10 @@ watch(
dense-toggle dense-toggle
:label="subMenu.label" :label="subMenu.label"
v-if=" v-if="
subMenu.key !== 5.1 && subMenu.key !== 2.0 &&
subMenu.key !== 11.1 && subMenu.key !== 7.1 &&
subMenu.key !== 11.2 && subMenu.key !== 12.0 &&
subMenu.key !== 11.3 && subMenu.key !== 13.0
subMenu.key !== 11.4 &&
subMenu.key !== 11.5 &&
subMenu.key !== 3.1 &&
subMenu.key !== 3.2 &&
subMenu.key !== 3.3 &&
subMenu.key !== 3.4 &&
subMenu.key !== 3.5 &&
subMenu.key !== 3.7
" "
class="expan2" class="expan2"
dense dense