From 1993d72e049682ed855dc991de91d7ef2c52b7dc Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Thu, 18 Apr 2024 17:27:03 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=97=E0=B8=B8?= =?UTF-8?q?=E0=B8=99=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A8=E0=B8=B6=E0=B8=81?= =?UTF-8?q?=E0=B8=A9=E0=B8=B2/=E0=B8=9D=E0=B8=B6=E0=B8=81=E0=B8=AD?= =?UTF-8?q?=E0=B8=9A=E0=B8=A3=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../09_scholarship/interface/request/index.ts | 132 + src/modules/09_scholarship/views/detail.vue | 2939 ++++++++++++----- 2 files changed, 2170 insertions(+), 901 deletions(-) diff --git a/src/modules/09_scholarship/interface/request/index.ts b/src/modules/09_scholarship/interface/request/index.ts index e69de29..8b76853 100644 --- a/src/modules/09_scholarship/interface/request/index.ts +++ b/src/modules/09_scholarship/interface/request/index.ts @@ -0,0 +1,132 @@ +interface FormsSholarship { + profileId: string; + rank: string; //ยศ + prefix: string; //คำนำหน้าชื่อ + firstName: string; //ชื่อ + lastName: string; //นามสกุล + citizenId: string; //เลขประจำตัวประชาชน + position: string; //ตำแหน่ง + posExecutive: string; //ชื่อตำแหน่งทางการบริหาร + posLevelId: string | null; //ไอดีระดับตำแหน่ง + posTypeId: string | null; //ไอดีประเภทตำแหน่ง + org: string; + rootId: string | null; + root: string; + orgRootShortName: string; + orgRevisionId: string | null; + guarantorRank: string; //ยศ(ผู้ค้ำ) + guarantorPrefix: string; //คำนำหน้าชื่อ(ผู้ค้ำ) + guarantorFirstName: string; //ชื่อ(ผู้ค้ำ) + guarantorLastName: string; //นามสกุล(ผู้ค้ำ) + guarantorCitizenId: string; //เลขประจำตัวประชาชน(ผู้ค้ำ) + guarantorPosition: string; //ตำแหน่ง(ผู้ค้ำ) + guarantorPosExecutive: string; //ชื่อตำแหน่งทางการบริหาร(ผู้ค้ำ) + guarantorOrg: string; + guarantorRootId: string | null; + guarantorRoot: string; + guarantorOrgRootShortName: string; + guarantorOrgRevisionId: string | null; + posLevelguarantorId: string | null; //ไอดีระดับตำแหน่ง(ผู้ค้ำ) + posTypeguarantorId: string | null; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ) + scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน + budgetSource: string; //แหล่งงบประมาณ + budgetApprove: number | string | null; //งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร + bookNo: string; //เลขที่หนังสืออนุมัติ + bookNoDate: Date | null; //ลงวันที่(หนังสือ) + bookApproveDate: Date | null; //หนังสืออนุมัติเมื่อวันที่ + useOfficialTime: boolean; //ใช้เวลาราชการ + changeDetail: string; //เปลี่ยนแปลงรายละเอียด + scholarshipType: string; //เลือกประเภททุน + fundType: string; //ประเภททุน + contractNo: string; //เลขที่สัญญา + contractDate: Date | null; //ลงวันที่(เลขที่สัญญา) + reportBackNo: string; //เลขที่หนังสือรายงานตัวกลับ + reportBackNoDate: Date | null; //ลงวันที่(เลขที่หนังสือรายงานตัวกลับ) + reportBackDate: Date | null; //รายงานตัวกลับวันที่ + degreeLevel: string; //ระดับปริญญา + course: string; //หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม + field: string; //สาขาวิชา/สาขา + faculty: string; //คณะ + educationalInstitution: string; //สถาบันการศึกษา/สถาบันการศึกษา_หน่วยงานผู้จัดการฝึกอบรม/สถานที่ไปศึกษาดูงานในประเทศ + startDate: Date | null; //วันเริ่มต้นการศึกษา/วันเริ่มต้นการฝึกอบรม/วันเริ่มต้นการศึกษาดูงานในประเทศ + endDate: Date | null; //วันสิ้นสุดการศึกษา/วันสิ้นสุดการฝึกอบรม/วันสิ้นสุดการศึกษาดูงานในประเทศ + studyPlace: string; //สถานที่ไปศึกษาดูงาน + studyTopic: string; //หัวข้อการไปศึกษาดูงาน/หัวข้อการไปศึกษาดูงานในประเทศ + studyStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงาน + studyEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงาน + studyCountry: string; //ประเทศที่เดินทางไปศึกษาดูงาน + studyAbroadTopic: string; //หัวข้อการไปศึกษาดูงานต่างประเทศ + studyAbroadStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงานต่างประเทศ + studyAbroadEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงานต่างประเทศ + totalPeriod: string; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม + planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ + isNoUseBudget: boolean; // + } + + interface DataSholarship { + rank: string; //ยศ + prefix: string; //คำนำหน้าชื่อ + firstName: string; //ชื่อ + lastName: string; //นามสกุล + citizenId: string; //เลขประจำตัวประชาชน + position: string; //ตำแหน่ง + posExecutive: string; //ชื่อตำแหน่งทางการบริหาร + posLevelId: string; //ไอดีระดับตำแหน่ง + posTypeId: string; //ไอดีประเภทตำแหน่ง + posTypeName: string; //ไอดีระดับตำแหน่ง + posLevelName: string; //ไอดีประเภทตำแหน่ง + org: string; + guarantorRank: string; //ยศ(ผู้ค้ำ) + guarantorPrefix: string; //คำนำหน้าชื่อ(ผู้ค้ำ) + guarantorFirstName: string; //ชื่อ(ผู้ค้ำ) + guarantorLastName: string; //นามสกุล(ผู้ค้ำ) + guarantorCitizenId: string; //เลขประจำตัวประชาชน(ผู้ค้ำ) + guarantorPosition: string; //ตำแหน่ง(ผู้ค้ำ) + guarantorPosExecutive: string; //ชื่อตำแหน่งทางการบริหาร(ผู้ค้ำ) + guarantorOrg: string; + guarantorRootId: string | null; + guarantorRoot: string; + guarantorOrgRootShortName: string; + guarantorOrgRevisionId: string | null; + posLevelguarantorId: string; //ไอดีระดับตำแหน่ง(ผู้ค้ำ) + posTypeguarantorId: string; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ) + posTypeguarantorName: string; //ไอดีระดับตำแหน่ง(ผู้ค้ำ) + posLevelguarantorName: string; //ไอดีประเภทตำแหน่ง(ผู้ค้ำ) + scholarshipYear: number | null; //ปีงบประมาณที่ได้รับทุน + budgetSource: string; //แหล่งงบประมาณ + budgetApprove: number | null; //งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร + bookNo: string; //เลขที่หนังสืออนุมัติ + bookNoDate: Date | null; //ลงวันที่(หนังสือ) + bookApproveDate: Date | null; //หนังสืออนุมัติเมื่อวันที่ + useOfficialTime: boolean; //ใช้เวลาราชการ + changeDetail: string; //เปลี่ยนแปลงรายละเอียด + scholarshipType: string; //เลือกประเภททุน + fundType: string; //ประเภททุน + contractNo: string; //เลขที่สัญญา + contractDate: Date | null; //ลงวันที่(เลขที่สัญญา) + reportBackNo: string; //เลขที่หนังสือรายงานตัวกลับ + reportBackNoDate: Date | null; //ลงวันที่(เลขที่หนังสือรายงานตัวกลับ) + reportBackDate: Date | null; //รายงานตัวกลับวันที่ + degreeLevel: string; //ระดับปริญญา + course: string; //หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม + field: string; //สาขาวิชา/สาขา + faculty: string; //คณะ + educationalInstitution: string; //สถาบันการศึกษา/สถาบันการศึกษา_หน่วยงานผู้จัดการฝึกอบรม/สถานที่ไปศึกษาดูงานในประเทศ + startDate: Date | null; //วันเริ่มต้นการศึกษา/วันเริ่มต้นการฝึกอบรม/วันเริ่มต้นการศึกษาดูงานในประเทศ + endDate: Date | null; //วันสิ้นสุดการศึกษา/วันสิ้นสุดการฝึกอบรม/วันสิ้นสุดการศึกษาดูงานในประเทศ + studyPlace: string; //สถานที่ไปศึกษาดูงาน + studyTopic: string; //หัวข้อการไปศึกษาดูงาน/หัวข้อการไปศึกษาดูงานในประเทศ + studyStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงาน + studyEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงาน + studyCountry: string; //ประเทศที่เดินทางไปศึกษาดูงาน + studyAbroadTopic: string; //หัวข้อการไปศึกษาดูงานต่างประเทศ + studyAbroadStartDate: Date | null; //วันเริ่มต้นการศึกษาดูงานต่างประเทศ + studyAbroadEndDate: Date | null; //วันสิ้นสุดการศึกษาดูงานต่างประเทศ + totalPeriod: string; //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม + status: string; + planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ + isNoUseBudget: boolean; // ไม่ใช้งบประมาณ + } + + export type { FormsSholarship,DataSholarship }; + \ No newline at end of file diff --git a/src/modules/09_scholarship/views/detail.vue b/src/modules/09_scholarship/views/detail.vue index c6c08c8..aec400d 100644 --- a/src/modules/09_scholarship/views/detail.vue +++ b/src/modules/09_scholarship/views/detail.vue @@ -9,10 +9,17 @@ import http from "@/plugins/http"; import config from "@/app.config"; import type { DataOptions } from "@/modules/09_scholarship/interface/index/Main"; +import type { + FormsSholarship, + DataSholarship, +} from "@/modules/09_scholarship/interface/request/index"; import DialogReturn from "@/modules/09_scholarship/components/Dialog/DialogReturn.vue"; import genReport from "@/plugins/genreport"; +const isGuarantor = ref(false); +const isGov = ref(false); +const isStatus = ref(""); const fileList = ref(); const route = useRoute(); const $q = useQuasar(); @@ -40,25 +47,44 @@ const budgetSourceOp = ref([ { id: "OTHER", name: "เงินอื่น ๆ" }, ]); -const dataPerson = reactive({ - id: "", - citizenId: "", - name: "", - position: "", - type: "", - level: "", - positionSide: "", - org: "-", - planType: "", - scholarshipYear: null, - budgetSource: "", - budgetApprove: null, - isNoUseBudget: false, - bookNo: "", - bookNoDate: null, - bookApproveDate: null, - useOfficialTime: false, - changeDetail: "", +const formBody = reactive({ + profileId: "", + rank: "", //ยศ + prefix: "", //คำนำหน้าชื่อ + firstName: "", //ชื่อ + lastName: "", //นามสกุล + citizenId: "", //เลขประจำตัวประชาชน + position: "", //ตำแหน่ง + posExecutive: "", //ชื่อตำแหน่งทางการบริหาร + posLevelId: null, //ไอดีระดับตำแหน่ง + posTypeId: null, //ไอดีประเภทตำแหน่ง + org: "", + rootId: null, + root: "", + orgRootShortName: "", + orgRevisionId: null, + guarantorRank: "", //ยศ(ผู้ค้ำ) + guarantorPrefix: "", //คำนำหน้าชื่อ(ผู้ค้ำ) + guarantorFirstName: "", //ชื่อ(ผู้ค้ำ) + guarantorLastName: "", //นามสกุล(ผู้ค้ำ) + guarantorCitizenId: "", //เลขประจำตัวประชาชน(ผู้ค้ำ) + guarantorPosition: "", //ตำแหน่ง(ผู้ค้ำ) + guarantorPosExecutive: "", //ชื่อตำแหน่งทางการบริหาร(ผู้ค้ำ) + guarantorOrg: "", + guarantorRootId: null, + guarantorRoot: "", + guarantorOrgRootShortName: "", + guarantorOrgRevisionId: null, + posLevelguarantorId: null, //ไอดีระดับตำแหน่ง(ผู้ค้ำ) + posTypeguarantorId: null, //ไอดีประเภทตำแหน่ง(ผู้ค้ำ) + scholarshipYear: null, //ปีงบประมาณที่ได้รับทุน + budgetSource: "", //แหล่งงบประมาณ + budgetApprove: null, //งบประมาณที่ได้รับอนุมัติตลอดหลักสูตร + bookNo: "", //เลขที่หนังสืออนุมัติ + bookNoDate: null, //ลงวันที่(หนังสือ) + bookApproveDate: null, //หนังสืออนุมัติเมื่อวันที่ + useOfficialTime: false, //ใช้เวลาราชการ + changeDetail: "", //เปลี่ยนแปลงรายละเอียด scholarshipType: "", //เลือกประเภททุน fundType: "", //ประเภททุน contractNo: "", //เลขที่สัญญา @@ -66,7 +92,6 @@ const dataPerson = reactive({ reportBackNo: "", //เลขที่หนังสือรายงานตัวกลับ reportBackNoDate: null, //ลงวันที่(เลขที่หนังสือรายงานตัวกลับ) reportBackDate: null, //รายงานตัวกลับวันที่ - degreeLevel: "", //ระดับปริญญา course: "", //หลักสูตรการศึกษา/หลักสูตรการฝึกอบรม field: "", //สาขาวิชา/สาขา @@ -83,6 +108,19 @@ const dataPerson = reactive({ studyAbroadStartDate: null, //วันเริ่มต้นการศึกษาดูงานต่างประเทศ studyAbroadEndDate: null, //วันสิ้นสุดการศึกษาดูงานต่างประเทศ totalPeriod: "", //รวมระยะเวลาในการศึกษา/รวมระยะเวลาในการฝึกอบรม + planType: "", + isNoUseBudget: false, +}); + +const dataPerson = reactive({ + id: "", + citizenId: "", + name: "", + position: "", + type: "", + level: "", + positionSide: "", + org: "-", }); const dataGuarantor = reactive({ @@ -127,75 +165,6 @@ const fundTypeOp = ref([ { id: "FUND5", name: "ทุนส่วนตัว" }, ]); -function getDetail() { - showLoader(); - http - .get(config.API.developmentScholarship + `/${id.value}`) - .then((res) => { - const data = res.data.result; - dataPerson.citizenId = data.citizenId; - dataPerson.name = `${data.prefix}${data.firstName} ${data.lastName}`; - dataPerson.position = data.position; - dataPerson.type = data.posTypeName; - dataPerson.level = data.posLevelName; - dataPerson.positionSide = data.posExecutive; - dataPerson.org = data.org; // รอ API - dataPerson.planType = data.planType; - - dataPerson.scholarshipYear = data.scholarshipYear; - dataPerson.budgetSource = data.budgetSource; - dataPerson.budgetApprove = data.budgetApprove; - dataPerson.isNoUseBudget = data.isNoUseBudget; - dataPerson.bookNo = data.bookNo; - dataPerson.bookNoDate = data.bookNoDate; - dataPerson.bookApproveDate = data.bookApproveDate; - dataPerson.useOfficialTime = data.useOfficialTime; - dataPerson.changeDetail = data.changeDetail; - - dataPerson.scholarshipType = data.scholarshipType; - dataPerson.fundType = data.fundType; - - dataPerson.contractNo = data.contractNo; - dataPerson.contractDate = data.contractDate; - dataPerson.reportBackNo = data.reportBackNo; - dataPerson.reportBackNoDate = data.reportBackNoDate; - dataPerson.reportBackDate = data.reportBackDate; - - dataGuarantor.citizenId = data.guarantorCitizenId; - dataGuarantor.name = `${data.guarantorPrefix} ${data.guarantorFirstName} ${data.guarantorLastName}`; - dataGuarantor.prefix = data.guarantorPrefix; - dataGuarantor.firstName = data.guarantorFirstName; - dataGuarantor.lastName = data.guarantorLastName; - dataGuarantor.position = data.position; - dataGuarantor.type = data.posTypeguarantorName; - dataGuarantor.level = data.posLevelguarantorName; - dataGuarantor.positionSide = data.guarantorPosExecutive; - - dataPerson.degreeLevel = data.degreeLevel; - dataPerson.course = data.course; - dataPerson.field = data.field; - dataPerson.faculty = data.faculty; - dataPerson.educationalInstitution = data.educationalInstitution; - dataPerson.startDate = data.startDate; - dataPerson.endDate = data.endDate; - dataPerson.studyPlace = data.studyPlace; - dataPerson.studyTopic = data.studyTopic; - dataPerson.studyStartDate = data.studyStartDate; - dataPerson.studyEndDate = data.studyEndDate; - dataPerson.studyCountry = data.studyCountry; - dataPerson.studyAbroadTopic = data.studyAbroadTopic; - dataPerson.studyAbroadStartDate = data.studyAbroadStartDate; - dataPerson.studyAbroadEndDate = data.studyAbroadEndDate; - dataPerson.totalPeriod = data.totalPeriod; - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); -} - function updateTotalPeriod( startDate: any, endDate: any, @@ -204,37 +173,37 @@ function updateTotalPeriod( if (!toDo && startDate && endDate) { const start = new Date(startDate); const end = new Date(endDate); - dataPerson.totalPeriod = calculateDurationYmd(start, end); + formBody.totalPeriod = calculateDurationYmd(start, end); } } function changeStartDate(type: string) { switch (type) { case "startDate": - if (dataPerson?.startDate !== null && dataPerson?.endDate !== null) { - const startDate = new Date(dataPerson.startDate); - const endDate = new Date(dataPerson?.endDate); + if (formBody?.startDate !== null && formBody?.endDate !== null) { + const startDate = new Date(formBody.startDate); + const endDate = new Date(formBody?.endDate); if (startDate > endDate) { - dataPerson.endDate = null; + formBody.endDate = null; } } break; case "studyStartDate": if ( - dataPerson?.studyStartDate !== null && - dataPerson?.studyEndDate !== null + formBody?.studyStartDate !== null && + formBody?.studyEndDate !== null ) { - const startDate = new Date(dataPerson.studyStartDate); - const endDate = new Date(dataPerson?.studyEndDate); + const startDate = new Date(formBody.studyStartDate); + const endDate = new Date(formBody?.studyEndDate); if (startDate > endDate) { - dataPerson.studyEndDate = null; - if (dataPerson.scholarshipType === "NOABROAD") { - dataPerson.totalPeriod = ""; + formBody.studyEndDate = null; + if (formBody.scholarshipType === "NOABROAD") { + formBody.totalPeriod = ""; } } else { - if (dataPerson.scholarshipType === "NOABROAD") { - dataPerson.totalPeriod = calculateDurationYmd(startDate, endDate); + if (formBody.scholarshipType === "NOABROAD") { + formBody.totalPeriod = calculateDurationYmd(startDate, endDate); } } } @@ -242,15 +211,15 @@ function changeStartDate(type: string) { case "studyAbroadStartDate": if ( - dataPerson?.studyAbroadStartDate !== null && - dataPerson?.studyAbroadEndDate !== null + formBody?.studyAbroadStartDate !== null && + formBody?.studyAbroadEndDate !== null ) { - const startDate = new Date(dataPerson.studyAbroadStartDate); - const endDate = new Date(dataPerson?.studyAbroadEndDate); + const startDate = new Date(formBody.studyAbroadStartDate); + const endDate = new Date(formBody?.studyAbroadEndDate); if (startDate > endDate) { - dataPerson.studyAbroadEndDate = null; + formBody.studyAbroadEndDate = null; } else { - dataPerson.totalPeriod = calculateDurationYmd(startDate, endDate); + formBody.totalPeriod = calculateDurationYmd(startDate, endDate); } } break; @@ -334,7 +303,7 @@ async function uploadFileDoc(uploadUrl: string, file: any) { }) .then((res) => { success($q, "อัปโหลดไฟล์สำเร็จ"); - getDetail(); + fetchDataDetail(id.value); getFile(); }) .catch((e) => { @@ -385,8 +354,111 @@ function downloadFile(file: any) { hideLoader(); }); } + +function fetchDataDetail(id: string) { + showLoader(); + http + .get(config.API.developmentScholarship + `/${id}`) + .then((res) => { + const data: DataSholarship = res.data.result; + console.log(data); + formBody.rank = data.rank; + formBody.prefix = data.prefix; + formBody.firstName = data.firstName; + formBody.lastName = data.lastName; + formBody.citizenId = data.citizenId; + formBody.position = data.position; + formBody.posExecutive = data.posExecutive; + formBody.posLevelId = data.posLevelId; + formBody.posTypeId = data.posTypeId; + formBody.guarantorRank = data.guarantorRank; + formBody.guarantorPrefix = data.guarantorPrefix; + formBody.guarantorFirstName = data.guarantorFirstName; + formBody.guarantorLastName = data.guarantorLastName; + formBody.guarantorCitizenId = data.guarantorCitizenId; + formBody.guarantorPosition = data.guarantorPosition; + formBody.guarantorPosExecutive = data.guarantorPosExecutive; + formBody.guarantorOrg = data.guarantorOrg; + formBody.guarantorRootId = data.guarantorRootId; + formBody.guarantorRoot = data.guarantorRoot; + formBody.guarantorOrgRootShortName = data.guarantorOrgRootShortName; + formBody.guarantorOrgRevisionId = data.guarantorOrgRevisionId; + formBody.posLevelguarantorId = data.posLevelguarantorId; + formBody.posTypeguarantorId = data.posTypeguarantorId; + formBody.scholarshipYear = data.scholarshipYear; + formBody.budgetSource = data.budgetSource; + formBody.budgetApprove = data.budgetApprove; + formBody.bookNo = data.bookNo; + formBody.bookNoDate = data.bookNoDate; + formBody.bookApproveDate = data.bookApproveDate; + formBody.useOfficialTime = data.useOfficialTime + ? data.useOfficialTime + : false; + formBody.changeDetail = data.changeDetail; + formBody.scholarshipType = data.scholarshipType; + formBody.fundType = data.fundType; + formBody.contractNo = data.contractNo; + formBody.contractDate = data.contractDate; + formBody.reportBackNo = data.reportBackNo; + formBody.reportBackNoDate = data.reportBackNoDate; + formBody.reportBackDate = data.reportBackDate; + + formBody.degreeLevel = data.degreeLevel; + formBody.course = data.course; + formBody.field = data.field; + formBody.faculty = data.faculty; + formBody.educationalInstitution = data.educationalInstitution; + formBody.startDate = data.startDate; + formBody.endDate = data.endDate; + formBody.studyPlace = data.studyPlace; + formBody.studyTopic = data.studyTopic; + formBody.studyStartDate = data.studyStartDate; + formBody.studyEndDate = data.studyEndDate; + formBody.studyCountry = data.studyCountry; + formBody.studyAbroadTopic = data.studyAbroadTopic; + formBody.studyAbroadStartDate = data.studyAbroadStartDate; + formBody.studyAbroadEndDate = data.studyAbroadEndDate; + formBody.totalPeriod = data.totalPeriod; + formBody.planType = data.planType ? data.planType : ""; + formBody.isNoUseBudget = data.isNoUseBudget ? data.isNoUseBudget : false; + + dataPerson.citizenId = data.citizenId ? data.citizenId : "-"; + dataPerson.name = `${data.prefix}${data.firstName} ${data.lastName}`; + dataPerson.position = data.position ? data.position : "-"; + dataPerson.type = data.posTypeName ? data.posTypeName : "-"; + dataPerson.level = data.posLevelName ? data.posLevelName : "-"; + dataPerson.positionSide = data.posExecutive ? data.posExecutive : "-"; + dataPerson.org = data.org ? data.org : "-"; + + dataGuarantor.citizenId = data.guarantorCitizenId + ? data.guarantorCitizenId + : "-"; + dataGuarantor.name = `${data.guarantorPrefix}${data.guarantorFirstName} ${data.guarantorLastName}`; + dataGuarantor.position = data.position ? data.position : "-"; + dataGuarantor.type = data.posTypeguarantorName + ? data.posTypeguarantorName + : "-"; + dataGuarantor.level = data.posLevelguarantorName + ? data.posLevelguarantorName + : "-"; + dataGuarantor.positionSide = data.guarantorPosExecutive + ? data.guarantorPosExecutive + : "-"; + dataGuarantor.org = data.guarantorOrg ? data.guarantorOrg : "-"; + isStatus.value = data.status; + isGov.value = data.citizenId ? true : false; + isGuarantor.value = data.guarantorCitizenId ? true : false; + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); +} + onMounted(async () => { - await getDetail(); + await fetchDataDetail(id.value); await getFile(); }); @@ -406,171 +478,210 @@ onMounted(async () => { /> รายละเอียดทุนการศึกษา/ฝึกอบรม -
- - -
-
- - - - - - - - แก้ไขข้อมูลรายงานตัวกลับเข้ารับราชการ - - - - - - - - ดาวน์โหลดฟอร์มต้นแบบ - - - - - - -
- -
- - - - -
-
- - ดาวน์โหลดไฟล์ -
+ + +
+
+ + + + + + + + แก้ไขข้อมูลรายงานตัวกลับเข้ารับราชการ + + + + + + + + ดาวน์โหลดฟอร์มต้นแบบ + + + + + +
- - -
- ข้อมูลราชการ -
- - -
-
-
-
เลขประจำตัวประชาชน
-
- {{ dataPerson.citizenId ? dataPerson.citizenId : "-" }} -
-
ชื่อ-นามสกุล
-
- {{ dataPerson.name ? dataPerson.name : "-" }} -
-
ตำแหน่ง
-
- {{ dataPerson.position ? dataPerson.position : "-" }} -
-
ประเภท
-
- {{ dataPerson.type ? dataPerson.type : "-" }} -
-
+ +
+ + + + +
+
+ + ดาวน์โหลดไฟล์ +
+
+ + + +
+ ข้อมูลราชการ +
+
+
+
+
+
เลขประจำตัวประชาชน
+
+ {{ dataPerson.citizenId }}
-
-
-
ระดับตำแหน่ง
-
- {{ dataPerson.level ? dataPerson.citizenId : "-" }} -
-
ตำแหน่งทางการบริหาร
-
- {{ dataPerson.positionSide ? dataPerson.name : "-" }} -
-
หน่วยงานที่สังกัด
-
- {{ dataPerson.org ? dataPerson.org : "-" }} -
-
+
ชื่อ-นามสกุล
+
+ {{ dataPerson.name }} +
+
ตำแหน่ง
+
+ {{ dataPerson.position }} +
+
ประเภทตำแหน่ง
+
+ {{ dataPerson.type }}
- - -
-
- -
+
+
+
ระดับตำแหน่ง
+
+ {{ dataPerson.level }} +
+
ตำแหน่งทางการบริหาร
+
+ {{ dataPerson.positionSide }} +
+
หน่วยงานที่สังกัด
+
+ {{ dataPerson.org }} +
+
+
+
+
+ + เลือกข้าราชการ + +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +