Merge pull request #227 from Frappet/add_budgetSourceOther

ระบบพัฒนาบุคลากร >> ทุนกาารศึกษา/ฝึกอบรม
This commit is contained in:
Warunee Tamkoo 2025-10-09 11:03:39 +07:00 committed by GitHub
commit f9a5c4e88f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 48 deletions

View file

@ -127,6 +127,7 @@ interface DataSholarship {
status: string; status: string;
planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ planType: string; // INPLAN ในแผนฯ, OUTPLAN นอกแผนฯ
isNoUseBudget: boolean; // ไม่ใช้งบประมาณ isNoUseBudget: boolean; // ไม่ใช้งบประมาณ
budgetSourceOther: string; //
} }
export type { FormsSholarship, DataSholarship }; export type { FormsSholarship, DataSholarship };

View file

@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, reactive, ref } from "vue"; import { onMounted, reactive, ref } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import axios from "axios";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -15,7 +14,6 @@ import type {
} from "@/modules/09_scholarship/interface/request/index"; } from "@/modules/09_scholarship/interface/request/index";
import DialogReturn from "@/modules/09_scholarship/components/Dialog/DialogReturn.vue"; import DialogReturn from "@/modules/09_scholarship/components/Dialog/DialogReturn.vue";
import genReport from "@/plugins/genreport";
const $q = useQuasar(); const $q = useQuasar();
const router = useRouter(); const router = useRouter();
@ -27,8 +25,6 @@ const {
messageError, messageError,
date2Thai, date2Thai,
calculateDurationYmd, calculateDurationYmd,
dialogConfirm,
success,
} = mixin; } = mixin;
const isLoad = ref<boolean>(false); const isLoad = ref<boolean>(false);
@ -39,7 +35,6 @@ const fileList = ref<any[]>();
const dialogReturn = ref<boolean>(false); const dialogReturn = ref<boolean>(false);
const documentFile = ref<any>(null);
const id = ref<string>(route.params.id.toLocaleString()); const id = ref<string>(route.params.id.toLocaleString());
const budgetSourceOp = ref<DataOptions[]>([ const budgetSourceOp = ref<DataOptions[]>([
{ id: "BKK", name: "งบประมาณ กทม." }, { id: "BKK", name: "งบประมาณ กทม." },
@ -190,40 +185,6 @@ const fundTypeOp = ref<DataOptions[]>([
{ id: "FUND5", name: "ทุนส่วนตัว" }, { id: "FUND5", name: "ทุนส่วนตัว" },
]); ]);
const convertStudyPlace = () => {
switch (formBody.studyTopic) {
case "ศึกษา":
return "สถานที่ไปศึกษา (เมือง/ประเทศ)";
case "ฝึกอบรม":
return "สถานที่เข้ารับการฝึกอบรม (เมือง/ประเทศ)";
case "ดูงาน":
return "สถานที่ไปดูงาน";
case "ประชุม":
return "สถานที่จัดประชุม (เมือง/ประเทศ)";
case "ปฏิบัติการวิจัย":
return "สถานที่ไปปฏิบัติการวิจัย (เมือง/ประเทศ)";
default:
return "สถานที่ (เมือง/ประเทศ)";
}
};
const convertCourse = () => {
switch (formBody.studyTopic) {
case "ศึกษา":
return "หลักสูตรการศึกษา";
case "ฝึกอบรม":
return "หลักสูตรการฝึกอบรม";
case "ดูงาน":
return "หัวข้อการไปดูงาน";
case "ประชุม":
return "ชื่อการประชุม";
case "ปฏิบัติการวิจัย":
return "หลักสูตร";
default:
return "หลักสูตร";
}
};
function updateTotalPeriod( function updateTotalPeriod(
startDate: any, startDate: any,
endDate: any, endDate: any,
@ -288,8 +249,8 @@ function changeStartDate(type: string) {
} }
} }
function getFile() { async function getFile() {
http await http
.get( .get(
config.API.developmentSalaryFile( config.API.developmentSalaryFile(
"ระบบพัฒนาบุคคล", "ระบบพัฒนาบุคคล",
@ -302,8 +263,7 @@ function getFile() {
const dataFile = res.data; const dataFile = res.data;
fileList.value = dataFile[0]; fileList.value = dataFile[0];
} }
}) });
.finally(() => {});
} }
function downloadFile(file: any) { function downloadFile(file: any) {
@ -328,9 +288,9 @@ function downloadFile(file: any) {
}); });
} }
function fetchDataDetail(id: string) { async function fetchDataDetail(id: string) {
isLoad.value = true; isLoad.value = true;
http await http
.get(config.API.developmentScholarship + `/${id}`) .get(config.API.developmentScholarship + `/${id}`)
.then((res) => { .then((res) => {
const data: DataSholarship = res.data.result; const data: DataSholarship = res.data.result;
@ -361,6 +321,7 @@ function fetchDataDetail(id: string) {
formBody.posTypeguarantorId = data.posTypeguarantorId; formBody.posTypeguarantorId = data.posTypeguarantorId;
formBody.scholarshipYear = data.scholarshipYear; formBody.scholarshipYear = data.scholarshipYear;
formBody.budgetSource = data.budgetSource; formBody.budgetSource = data.budgetSource;
formBody.budgetSourceOther = data.budgetSourceOther;
formBody.budgetApprove = data.budgetApprove; formBody.budgetApprove = data.budgetApprove;
formBody.bookNo = data.bookNo; formBody.bookNo = data.bookNo;
formBody.bookNoDate = data.bookNoDate; formBody.bookNoDate = data.bookNoDate;
@ -422,7 +383,6 @@ function fetchDataDetail(id: string) {
dataGuarantor.org = data.guarantorOrg ? data.guarantorOrg : "-"; dataGuarantor.org = data.guarantorOrg ? data.guarantorOrg : "-";
isStatus.value = data.status; isStatus.value = data.status;
isGuarantor.value = data.guarantorCitizenId ? true : false; isGuarantor.value = data.guarantorCitizenId ? true : false;
isLoad.value = false;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -433,8 +393,7 @@ function fetchDataDetail(id: string) {
} }
onMounted(async () => { onMounted(async () => {
await fetchDataDetail(id.value); await Promise.all([fetchDataDetail(id.value), getFile()]);
await getFile();
}); });
</script> </script>