Refactoring code module 15_development

This commit is contained in:
STW_TTTY\stwtt 2024-09-20 14:47:35 +07:00
parent 895bfe98f2
commit 32ff7bdc96
25 changed files with 271 additions and 1440 deletions

View file

@ -2,26 +2,25 @@
import { ref, reactive, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type {
DataOption,
DataPerson,
PersonData
} from "@/modules/15_development/interface/index/Main";
import type { FormsSholarship } from "@/modules/15_development/interface/request/Scholarship";
import type { DataSholarship } from "@/modules/15_development/interface/response/Scholarship";
import DialogGov from "@/modules/15_development/components/history/DialogGov.vue";
import { useCounterMixin } from "@/stores/mixin";
const fileBackReceived = ref<string>("");
const $q = useQuasar();
const router = useRouter();
const route = useRoute();
const checkRouteDetail = ref<boolean>(
route.name == "developmentScholarshipidDetail"
);
const {
dialogConfirm,
showLoader,
@ -32,12 +31,17 @@ const {
calculateDurationYmd,
} = useCounterMixin();
const title = ref<string>(route.params.id ? "แก้ไข" : "เพิ่ม");
const checkRouteDetail = ref<boolean>(
route.name == "developmentScholarshipidDetail"
); // check route
const title = ref<string>(route.params.id ? "แก้ไข" : "เพิ่ม"); //
const scholarshipId = ref<string | null>(
route.params.id ? route.params.id.toLocaleString() : null
);
const isStatus = ref<string>("");
const modalDialogGov = ref<boolean>(false);
); // id route.
const isStatus = ref<string>(""); //
const modalDialogGov = ref<boolean>(false); // popup
const budgetSourceOp = ref<DataOption[]>([
{ id: "BKK", name: "งบประมาณ กทม." },
@ -74,10 +78,11 @@ const fundTypeOp = ref<DataOption[]>([
{ id: "FUND5", name: "ทุนส่วนตัว" },
]);
const isGov = ref<boolean>(false);
const isGuarantor = ref<boolean>(false);
const isSelectGov = ref<boolean>(false);
const dataPerson = reactive({
const isGov = ref<boolean>(false); // . true/false
const isGuarantor = ref<boolean>(false); // /
const isSelectGov = ref<boolean>(false); //
const dataPerson = reactive<PersonData>({
id: "",
citizenId: "",
name: "",
@ -87,7 +92,8 @@ const dataPerson = reactive({
positionSide: "",
org: "-",
});
const dataGuarantor = reactive({
const dataGuarantor = reactive<PersonData>({
id: "",
citizenId: "",
name: "",