clear code + comment

This commit is contained in:
STW_TTTY\stwtt 2024-04-30 14:31:55 +07:00
parent a9609d2d7f
commit ac70090e22
19 changed files with 231 additions and 166 deletions

View file

@ -238,17 +238,6 @@ onMounted(async () => {
</datepicker>
</div>
<div class="col-xs-10 col-sm-10 col-md-10">
<!-- <q-input
dense
outlined
class="inputgreen"
v-model="orgName"
inputgreen
label="ชื่อหน่วยงานที่รับผิดชอบ"
hide-bottom-space
lazy-rules
readonly
/> -->
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-input
@ -311,11 +300,6 @@ onMounted(async () => {
</q-btn>
</div>
</q-form>
<!-- <DialogSelectAgency
v-model:modal="modalDialogSelect"
@update:updateAgency="updateAgency"
/> -->
</template>
<style scoped>

View file

@ -9,15 +9,7 @@ import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const {
date2Thai,
dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
dialogRemove,
} = useCounterMixin();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const modal = defineModel<boolean>("modal", { default: false });
@ -26,11 +18,14 @@ const node = ref<any>([]);
const expanded = ref<any>([]);
const ticked = ref<any>([]);
/** ปิด dialog */
function closeDialog() {
modal.value = false;
ticked.value = [];
expanded.value = [];
}
/** ดึงข้อมูล หน่วยงาน */
function fetchActive() {
showLoader();
http
@ -45,6 +40,10 @@ function fetchActive() {
});
}
/**
* งขอมลหนวยงาน
* @param id idเเตละรายการ
*/
async function fetchTree(id: string) {
showLoader();
http
@ -61,32 +60,25 @@ async function fetchTree(id: string) {
});
}
/**
* update อมลเมอเลอกหนวยงาน
* @param val อมลหนวยงาน
*/
function updateTicked(val: any) {
console.log(expanded.value);
ticked.value = [];
ticked.value.push(val[val.length - 1]);
}
/** บันทึก ส่งข้อมูลกลับไปหน้าหลัก */
function onSubmit() {
emit("update:updateAgency", ticked.value[0]);
closeDialog();
}
function splitWords(sentence: string) {
// split '/'
const words = sentence.split("/");
console.log(words);
// ticked.value = sentence;
// expanded.value = words.reverse();
}
watch(
() => modal.value,
() => {
modal.value && fetchActive();
// splitWords("// ..");
}
);
</script>

View file

@ -17,6 +17,29 @@ import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
const modalDialog = ref<boolean>(false);
const isEdit = ref<boolean>(false);
const indicatorId = ref<string>("");
const formIndicators = reactive<FormIndicators>({
indicators: "",
target: null,
metricType: "",
calculation: "",
measuRement: "",
results: "",
obstacles: "",
suggestions: "",
});
const formProject = reactive<FormProject>({
isBudget: false,
isNoPass: false,
isOutBudget: false,
isPassAllocate: false,
isPassNoAllocate: false,
project: "",
});
const $q = useQuasar();
const {
showLoader,
@ -79,6 +102,7 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px ; ",
},
]);
const visibleColumns = ref<string[]>([
"indicators",
"target",
@ -113,29 +137,7 @@ const metricTypeOp = ref<DataOption[]>([
},
]);
const modalDialog = ref<boolean>(false);
const isEdit = ref<boolean>(false);
const indicatorId = ref<string>("");
const formIndicators = reactive<FormIndicators>({
indicators: "",
target: null,
metricType: "",
calculation: "",
measuRement: "",
results: "",
obstacles: "",
suggestions: "",
});
const formProject = reactive<FormProject>({
isBudget: false,
isNoPass: false,
isOutBudget: false,
isPassAllocate: false,
isPassNoAllocate: false,
project: "",
});
/** ดึงข้อมูลตัวชี้วัด */
function fetchData() {
showLoader();
http
@ -158,6 +160,11 @@ function fetchData() {
});
}
/**
* เป dialog add/edit
* @param statusEdit true/false
* @param data data => EDIT
*/
function onClickAddIndicator(
statusEdit: boolean = false,
data: DevelopmentEvaluations | null = null
@ -179,6 +186,7 @@ function onClickAddIndicator(
modalDialog.value = true;
}
/** close Dialog and Clear */
function closeDialog() {
modalDialog.value = false;
formIndicators.indicators = "";
@ -191,6 +199,7 @@ function closeDialog() {
formIndicators.suggestions = "";
}
/** dialog form save data */
function onSubmitIndicators() {
formIndicators.target = formIndicators.target
? Number(formIndicators.target)
@ -216,6 +225,7 @@ function onSubmitIndicators() {
});
}
/** data delete */
function onClickDeleteIndicator(id: string) {
dialogRemove($q, () => {
showLoader();
@ -234,6 +244,7 @@ function onClickDeleteIndicator(id: string) {
});
}
/** save Main data */
function onSubmit() {
dialogConfirm($q, () => {
if (formProject.project === "NOOFFER") {
@ -260,6 +271,7 @@ function onSubmit() {
});
}
/** fetchData in page */
onMounted(() => {
fetchData();
});
@ -338,19 +350,6 @@ onMounted(() => {
</q-td>
</q-tr>
</template>
<!-- <template v-slot:pagination="scope">
<q-pagination
v-model="formQuery.page"
active-color="primary"
color="dark"
:max="Number(totalList)"
size="sm"
boundary-links
direction-links
:max-pages="5"
@update:model-value="fetchListProject"
></q-pagination>
</template> -->
</d-table>
</div>
</q-card>

View file

@ -53,6 +53,8 @@ const budgetSubOp = ref<DataOption[]>([
name: "เงินอุดหนุน",
},
]);
/** ดึงข้อมูล จังหวัด */
const getProvince = async () => {
showLoader();
http
@ -74,6 +76,7 @@ const getProvince = async () => {
});
};
/** ตัวแปร */
const formData = reactive<FormData>({
dateStart: null, //
dateEnd: null, //
@ -96,6 +99,7 @@ const formData = reactive<FormData>({
provinceActualId: "", //()
});
/** ดึงข้อมูล */
function fetchData() {
http
.get(config.API.developmentMainTab("tab5", projectId.value))
@ -132,6 +136,7 @@ function fetchData() {
});
}
/** ฟังชั่นเคลียค่าวันสิ้นสุดเมื่อวันสิ้นสุดมากกว่าวันเริ่ม */
function changeDateStart() {
if (formData.dateStart !== null && formData.dateEnd !== null) {
const startDate = new Date(formData.dateStart);
@ -145,6 +150,7 @@ function changeDateStart() {
}
}
/** ฟังชั่น เก็บค่า ระยะกี่วันจากวันเริ่ม */
function changeDateEnd() {
formData.totalDate = diffDay(formData.dateStart, formData.dateEnd);
}
@ -162,6 +168,7 @@ const filterSelector = (val: string, update: Function) => {
});
};
/** ระดับความเสี่ยงของโครงการ option */
async function calRiskLevel() {
if (formData.chance && formData.effects) {
const riskLevel =
@ -185,6 +192,7 @@ async function calRiskLevel() {
}
}
/** เพิ่มข้อมูล */
function onClickAddLocation() {
const data = {
address: "",
@ -193,10 +201,12 @@ function onClickAddLocation() {
formData.developmentAddresss.push(data);
}
/** ลบข้อมูล */
function onClickDeleteLocation(index: number) {
formData.developmentAddresss.splice(index, 1);
}
/** บันทึกข้อมูล */
function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
@ -233,6 +243,7 @@ function onSubmit() {
});
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
fetchData();
getProvince();

View file

@ -70,6 +70,8 @@ const notFound = ref<string>("ไม่พบข้อมูลที่ค้
const noData = ref<string>("ไม่มีข้อมูล");
const expanded = ref<Array<string | null>>([]);
const expanded2 = ref<Array<string | null>>([]);
/** ดึงข้อมูลทั้งหมด */
function fetchData() {
showLoader();
http
@ -129,6 +131,7 @@ function fetchData() {
});
}
/** ดึงข้อมูล ยุทธศาสตร์/แผน */
function fetchTree() {
showLoader();
http
@ -145,6 +148,7 @@ function fetchTree() {
});
}
/** Main save */
async function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
@ -161,6 +165,11 @@ async function onSubmit() {
});
}
/**
* update data
* @param data อมลยทธศาสตร/แผน
* @param type 1/2 เพอเเยก ทธศาสตร1 ทธศาสตร2
*/
function updateSelected(data: DataStrategic, type: string) {
if (type === "1") {
formData.strategyChildPlannedId = data.id;
@ -171,6 +180,7 @@ function updateSelected(data: DataStrategic, type: string) {
}
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
fetchData();
fetchTree();

View file

@ -8,6 +8,7 @@ import axios from "axios";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import type { ResRecord } from "@/modules/15_development/interface/response/Main";
const mixin = useCounterMixin();
const route = useRoute();
const $q = useQuasar();
@ -20,6 +21,7 @@ const {
dialogConfirm,
date2Thai,
} = mixin;
const columns = ref<QTableProps["columns"]>([
{
name: "type",
@ -193,6 +195,7 @@ const pagination = ref({
const keyword = ref<string>("");
const rows = ref<ResRecord[]>([]);
/** uoload file */
async function clickUpload(file: any) {
dialogConfirm(
$q,
@ -215,6 +218,7 @@ async function clickUpload(file: any) {
);
}
/** convert status to text */
function formBmaofficer(val: string) {
switch (val) {
case "OFFICER":
@ -228,6 +232,7 @@ function formBmaofficer(val: string) {
}
}
/** ดึงข้อมูล */
async function getData() {
showLoader();
await http
@ -243,6 +248,7 @@ async function getData() {
});
}
/** ส่งไปบันทึกที่ทะเบียนประวัติ */
function sendRecordRegistry() {
//
dialogConfirm(
@ -268,6 +274,7 @@ function sendRecordRegistry() {
);
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
getData();
});

View file

@ -199,6 +199,15 @@ const posTypeOp = ref<DataOption[]>([]);
const posLevelOp = ref<DataOption[]>([]);
const posTypeMain = ref<ResGroup[]>([]);
/** เพิ่ม object ให้ตัวแปร */
const addGroupTargetData = async () => {
formGroupTarget.positions.push({
position: "",
posTypeId: "",
posLevelId: "",
});
};
/** function เรียกข้อมูลประเภทตำแหน่ง*/
function fetchType() {
if (posTypeMain.value.length === 0) {
@ -218,6 +227,7 @@ function fetchType() {
}
}
/** ดึงข้อมูล */
async function fetchData(id: string) {
showLoader();
await http
@ -237,6 +247,7 @@ async function fetchData(id: string) {
});
}
/** เปิด dialog */
function onClickOpenDialog(type: string, target: string) {
isTarget.value = target;
if (type === "group") {
@ -257,6 +268,7 @@ function onClickOpenDialog(type: string, target: string) {
}
}
/** เพิ่ม/แก้ไขกลุ่มเป้าหมาย */
async function onSubmitGroup() {
if (isTarget.value === "planned") {
await http
@ -325,6 +337,7 @@ async function onSubmitGroup() {
}, 100);
}
/** เพิ่มผู้เกี่ยวข้อง */
async function onSubmitRelate() {
if (isTarget.value === "planned") {
await http
@ -375,28 +388,7 @@ async function onSubmitRelate() {
}, 100);
}
function onclickDelete(index: number, type: string) {
dialogRemove($q, () => {
switch (type) {
case "plannedGoals":
plannedGoals.value.splice(index, 1);
break;
case "plannedPeoples":
plannedPeoples.value.splice(index, 1);
break;
case "actualGoals":
actualGoals.value.splice(index, 1);
break;
case "actualPeoples":
actualPeoples.value.splice(index, 1);
break;
default:
break;
}
});
}
/** clear form */
function cleanFormData() {
formGroupTarget.groupTarget = "";
formGroupTarget.groupTargetSub = "";
@ -410,6 +402,7 @@ function cleanFormData() {
isEdit.value = false;
}
/** ปิด dialog */
function onClickCloseDialog() {
newModalGroupTarget.value = false;
modalGroupTarget.value = false;
@ -418,6 +411,10 @@ function onClickCloseDialog() {
cleanFormData();
}
/**
* map อมลตาม option id
* @param id id
*/
function updatePosTypeName(id: string) {
const posLevel = posTypeMain.value.find((e: ResGroup) => e.id === id);
posLevelOp.value =
@ -428,6 +425,10 @@ function updatePosTypeName(id: string) {
formGroupTarget.posLevel = "";
}
/**
* กลมเปาหมาย
* @param val อม กลมเปาหมาย
*/
function updateGroupTarget(val: string) {
if (val === "OUTSIDERS") {
formGroupTarget.groupTargetSub = "NONE";
@ -437,33 +438,30 @@ function updateGroupTarget(val: string) {
} else formGroupTarget.groupTargetSub = "";
}
/** หาชื่อ ตาม id */
function convertNameGoals(id: string) {
const data = groupOp.value.find((e: DataOption) => e.id === id);
return data && data?.name;
}
/** หาชื่อ ตาม id */
function convertNameSubGoals(id: string) {
const data = groupSubOp.value.find((e: DataOption) => e.id === id);
return data && data?.name;
}
/** หาชื่อ ตาม id */
function convertNamePeoples(id: string) {
const data = peoplesOp.value.find((e: DataOption) => e.id === id);
return data && data?.name;
}
const addGroupTargetData = async () => {
formGroupTarget.positions.push({
position: "",
posTypeId: "",
posLevelId: "",
});
};
/** ลบข้อมูลออกตัวตัวแปร จาก ลำดับ */
function deleteTargetData(index: any) {
formGroupTarget.positions.splice(index, 1);
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
fetchType();
fetchData(projectId.value);
@ -474,7 +472,14 @@ onMounted(() => {
<q-card bordered style="border: 1px solid #d6dee1">
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
เปาหมายตามแผน
<q-btn v-if="store.projectStatus !== 'FINISH'" flat round dense icon="add" color="primary">
<q-btn
v-if="store.projectStatus !== 'FINISH'"
flat
round
dense
icon="add"
color="primary"
>
<q-menu>
<q-list style="min-width: 100px">
<q-item
@ -633,7 +638,12 @@ onMounted(() => {
</q-card>
<!--CARD เปาหมายตามจร -->
<q-card v-if="store.projectStatus === 'FINISH'" bordered style="border: 1px solid #d6dee1" class="q-mt-md">
<q-card
v-if="store.projectStatus === 'FINISH'"
bordered
style="border: 1px solid #d6dee1"
class="q-mt-md"
>
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
เปาหมายตามจร
<q-btn flat round dense icon="add" color="primary">

View file

@ -59,6 +59,7 @@ function getClass() {
return "inputgreen";
}
/** ดึงข้อมูล */
function fetchData() {
showLoader();
http
@ -106,6 +107,7 @@ function fetchData() {
});
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
if (id.value) {
fetchData();

View file

@ -181,6 +181,7 @@ function getClass() {
return "inputgreen";
}
/** ดึงข้อมูลตาม keyword */
function searchFilter() {
showLoader();
http
@ -223,16 +224,19 @@ function searchFilter() {
});
}
/** update ค่า เเถวข้อมูล */
function updatePage(val: number) {
formFilter.page = val;
searchFilter();
}
/** update ค่า เเถวข้อมูล */
function updatePageSize(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
/** เช็คเเถวข้อมูลว่ามีการเปลี่ยนแปลงไหม */
watch(
() => formFilter.pageSize,
() => {

View file

@ -13,7 +13,7 @@ import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const rows = ref<any[]>([])
const rows = ref<any[]>([]);
const props = defineProps({
upDate: { type: Function },
@ -72,13 +72,7 @@ const projectOp = ref<DataOption[]>([
// },
]);
const visibleColumns = ref<string[]>([
"project",
"year",
"organizingTraining",
]);
const visibleColumns = ref<string[]>(["project", "year", "organizingTraining"]);
const columns = ref<QTableProps["columns"]>([
{
@ -116,21 +110,19 @@ function onSubmit() {
if (selected.value?.length == 0) {
dialogMessageNotify($q, `กรุณาเลือก 1 รายการ`);
} else {
const data = selected.value[0];
const body = {
id:data.id,
year:data.year,
project:data.project,
dateStart:data.dateStart,
dateEnd:data.dateEnd,
totalDate:data.totalDate,
addressAcademic:data.addressAcademic,
topicAcademic:data.topicAcademic,
};
props.upDate?.(body)
closeDialog();
const data = selected.value[0];
const body = {
id: data.id,
year: data.year,
project: data.project,
dateStart: data.dateStart,
dateEnd: data.dateEnd,
totalDate: data.totalDate,
addressAcademic: data.addressAcademic,
topicAcademic: data.topicAcademic,
};
props.upDate?.(body);
closeDialog();
}
}
@ -139,7 +131,7 @@ function closeDialog() {
modal.value = false;
rows.value = [];
selected.value = [];
inputSearch.value = ''
inputSearch.value = "";
}
/** class */
@ -147,6 +139,7 @@ function getClass() {
return "inputgreen";
}
/** ค้นข้อมูลตาม ฟิลเตอร์ */
function searchFilter() {
let queryParams: any = {
page: formFilter.page,
@ -179,16 +172,19 @@ function searchFilter() {
});
}
function updatePage(val:number){
/** update ค่า เเถวข้อมูล */
function updatePage(val: number) {
formFilter.page = val;
searchFilter();
}
/** update ค่า เเถวข้อมูล */
function updatePageSize(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
/** เช็คเเถวข้อมูลว่ามีการเปลี่ยนแปลงไหม */
watch(
() => formFilter.pageSize,
() => {

View file

@ -58,10 +58,12 @@ const formMainProject = reactive<FormAddHistoryProject>({
organizingTraining: "", //
});
/** class */
function getClass() {
return "inputgreen";
}
/** ดึงข้อมูล */
function fetchDataDetail() {
showLoader();
http
@ -112,6 +114,7 @@ function fetchDataDetail() {
});
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
if (id.value) {
fetchDataDetail();

View file

@ -39,23 +39,17 @@ const pagination = ref({
const $q = useQuasar();
const mixin = useCounterMixin();
const {
dialogConfirm,
messageError,
dialogMessageNotify,
showLoader,
hideLoader,
} = mixin;
const store = useDevelopmentDataStore();
const modal = defineModel<boolean>("modal", { required: true });
const selected = ref<any[]>([]);
const search = ref<string>("citizenId");
const inputSearch = ref<any>("");
const inputType = computed(() => {
return search.value === "citizenId" ? "number" : "text";
});
const govOp = ref<DataOption[]>([
{
id: "citizenId",
@ -165,6 +159,8 @@ function closeDialog() {
function getClass() {
return "inputgreen";
}
/** ดึงข้อมูลตาม keyword */
function searchFilter() {
let queryParams: any = {
page: formFilter.page,
@ -203,16 +199,19 @@ function searchFilter() {
});
}
/** update ค่า เเถวข้อมูล */
function updatePage(val:number){
formFilter.page = val;
searchFilter();
}
/** update ค่า เเถวข้อมูล */
function updatePageSize(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
/** เช็คเเถวข้อมูลว่ามีการเปลี่ยนแปลงไหม */
watch(
() => formFilter.pageSize,
() => {

View file

@ -6,7 +6,6 @@ import type {
FormFilter,
NewPagination,
} from "@/modules/15_development/interface/index/Main";
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
@ -22,13 +21,11 @@ const year = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const {
dialogConfirm,
messageError,
dialogMessageNotify,
showLoader,
hideLoader,
} = mixin;
const store = useDevelopmentDataStore();
const modal = defineModel<boolean>("modal", { required: true });
@ -139,6 +136,8 @@ function closeDialog() {
function getClass() {
return "inputgreen";
}
/** ค้นข้อมูลตาม ฟิลเตอร์ */
function searchFilter() {
let queryParams: any = {
page: formFilter.page,
@ -171,16 +170,19 @@ function searchFilter() {
});
}
/** update ค่า เเถวข้อมูล */
function updatePage(val: number) {
formFilter.page = val;
searchFilter();
}
/** update ค่า เเถวข้อมูล */
function updatePageSize(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
/** เช็คเเถวข้อมูลว่ามีการเปลี่ยนแปลงไหม */
watch(
() => formFilter.pageSize,
() => {

View file

@ -16,6 +16,7 @@ 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();
@ -160,6 +161,10 @@ const formBody = reactive<FormsSholarship>({
isNoUseBudget: false,
});
/**
* งขอมลรายละเอยด
* @param id จาก id
*/
function fetchDataDetail(id: string) {
showLoader();
http
@ -262,6 +267,7 @@ function fetchDataDetail(id: string) {
});
}
/** บันทึกข้อมูล */
function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
@ -299,6 +305,7 @@ function onSubmit() {
});
}
/** เช็ควันที่เริ่ม/สิ้นสุด */
function changeStartDate(type: string) {
switch (type) {
case "startDate":
@ -351,6 +358,7 @@ function changeStartDate(type: string) {
}
}
/** เช็คข้อมูล เรียนจบ/ไม่จบ */
function onClickUpdateStatus(type: string) {
dialogConfirm($q, () => {
if (scholarshipId.value) {
@ -372,6 +380,12 @@ function onClickUpdateStatus(type: string) {
});
}
/**
* update date
* @param startDate นทเร
* @param endDate นทนส
* @param toDo true/false
*/
function updateTotalPeriod(
startDate: any,
endDate: any,
@ -389,6 +403,7 @@ function onSelectGov(isGov: boolean) {
modalDialogGov.value = true;
}
/** update ข้อมูลโ้วยจากเกก็บไว้ในตัวแปร */
function upDate(data: DataPerson) {
if (isSelectGov.value) {
formBody.profileId = data.id;
@ -445,7 +460,10 @@ function upDate(data: DataPerson) {
}
}
const fileBackReceived = ref<string>("");
/**
* งขอม ไฟล
* @param id id ของรายการ
*/
async function checkFileBackReceived(id: string) {
showLoader();
await http
@ -461,14 +479,16 @@ async function checkFileBackReceived(id: string) {
});
}
function downloadFileBackReceived(id: string) {
/** download file */
function downloadFileBackReceived() {
showLoader();
if (scholarshipId.value !== null && fileBackReceived.value !== null) {
http
.get(
config.API.fileByFile(
"ระบบพัฒนาบุคคล",
"ฟอร์มรายงานตัวกลับเข้ารับราชการ",
id,
scholarshipId.value,
fileBackReceived.value
)
)
@ -482,8 +502,10 @@ function downloadFileBackReceived(id: string) {
.finally(async () => {
hideLoader();
});
}
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => {
if (scholarshipId.value) {
fetchDataDetail(scholarshipId.value);
@ -514,7 +536,7 @@ onMounted(() => {
dense
icon="download"
color="blue"
@click="downloadFileBackReceived(scholarshipId)"
@click="downloadFileBackReceived()"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>

View file

@ -22,6 +22,7 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
const maxPage = ref<number>(1);
const totalList = ref<number>(0); //
@ -104,6 +105,7 @@ const columns = ref<QTableProps["columns"]>([
},
]);
/** ดึงข้อมูลหน่วยงาน เเละ เรียกใช้ฟังชั่น ดึงข้อมูล */
function fetchListOrg() {
showLoader();
http
@ -122,6 +124,7 @@ function fetchListOrg() {
});
}
/** download file */
function onDownload() {
showLoader();
http
@ -141,11 +144,13 @@ function onDownload() {
});
}
/** edit page */
function onEdit(id: string) {
store.statusEdit = true;
router.push(`/development/employee-history/${id}`);
}
/** ดึงข้อมูล */
function getData() {
showLoader();
http

View file

@ -25,6 +25,7 @@ const formFilter = reactive({
keyword: "",
year: new Date().getFullYear(),
});
const maxPage = ref<number>(1);
const totalList = ref<number>(0); //
@ -33,9 +34,8 @@ const router = useRouter();
const store = useDevelopmentDataStore();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const rows = ref<any>([]);
const agencyOp = ref<[]>([]);
const visibleColumns = ref<string[]>([
"citizenId",
"name",
@ -113,8 +113,7 @@ const columns = ref<QTableProps["columns"]>([
},
]);
const agencyOp = ref<[]>([]);
/** ดึงข้อมูลหน่วยงาน */
function fetchListOrg() {
showLoader();
http
@ -134,6 +133,7 @@ function fetchListOrg() {
});
}
/** ดึงข้อมูลรายการ */
function getData() {
showLoader();
http
@ -162,6 +162,7 @@ function getData() {
});
}
/** download file */
function onDownload() {
showLoader();
http
@ -184,6 +185,7 @@ function onDownload() {
});
}
/** edit page */
function onEdit(id: string) {
store.statusEdit = true;
router.push(`/development/history/${id}`);
@ -206,6 +208,7 @@ watch(
}
);
/** ดึงข้อมูลเมื่ออยู่ในหน้า */
onMounted(() => {
fetchListOrg();
});
@ -276,10 +279,6 @@ onMounted(() => {
@update:model-value="(formFilter.page = 1), getData()"
/>
</div>
<!-- <q-btn flat round dense icon="add" color="primary" @click="onAdd()">
<q-tooltip>เพ</q-tooltip>
</q-btn> -->
</q-toolbar>
<q-toolbar class="col-4 text-white q-pa-none q-gutter-x-sm">
<q-space />

View file

@ -87,6 +87,7 @@ const formProject = reactive<FormProject>({
nodeId: null,
orgRevisionId: null,
});
/** formQuery*/
const formQuery = reactive<FormQueryListProject>({
year: new Date().getFullYear(),
@ -98,6 +99,7 @@ const formQuery = reactive<FormQueryListProject>({
node: null,
nodeId: null,
});
const totalList = ref<number>(0); //
const totalPage = ref<number>(1);

View file

@ -119,6 +119,7 @@ const formQuery = reactive({
const totalList = ref<number>(1); //
const maxPage = ref<number>(1);
/** ดึงข้อมูล */
function fetchList() {
showLoader();
http
@ -141,11 +142,13 @@ function fetchList() {
});
}
/** ฟังชั่นดึงข้อมูล รายการ ใหม่ */
function fetchNewList() {
formQuery.page = 1;
fetchList();
}
/** ย้ายไป หน้า เพิ่ม หรือ แก้ไข */
function onClickAddOrView(status: boolean = false, id: string = "") {
status
? router.push(`/development/scholarship/${id}`)
@ -161,13 +164,7 @@ function updatePagination(newPagination: NewPagination) {
formQuery.pageSize = newPagination.rowsPerPage;
}
watch(
() => formQuery.pageSize,
() => {
fetchNewList();
}
);
/** download file */
function onDownload() {
showLoader();
http
@ -184,6 +181,15 @@ function onDownload() {
});
}
/** เช็ค เมื่อมีการเปลี่ยนค่าของ ข้อมูลในเเถว */
watch(
() => formQuery.pageSize,
() => {
fetchNewList();
}
);
/** ดึงข้อมูลเมื่ออยู่ในหน้า */
onMounted(() => {
fetchList();
});

View file

@ -46,7 +46,13 @@ const nodes = ref<any[]>([]);
const filter = ref<string>("");
const expanded = ref<Array<string>>([]);
const nodeId = ref<string>("");
const modalDialog = ref<boolean>(false);
const isStatusEdit = ref<boolean>(false);
const strategicName = ref<string>("");
const levelnode = ref<number>(0);
const titleDialog = ref<string>("");
/** ดึงข้อมูล ในรูปแบบ tree */
function fetchDataTree() {
showLoader();
http
@ -63,6 +69,11 @@ function fetchDataTree() {
});
}
/**
* เพ ลบ แกไข
* @param type ประเภท node
* @param data อม
*/
function onClickAction(type: string, data: DataStrategic | null = null) {
switch (type) {
case "ADD":
@ -79,11 +90,11 @@ function onClickAction(type: string, data: DataStrategic | null = null) {
}
}
const modalDialog = ref<boolean>(false);
const isStatusEdit = ref<boolean>(false);
const strategicName = ref<string>("");
const levelnode = ref<number>(0);
const titleDialog = ref<string>("");
/**
* เป dialog
* @param status true/false
* @param data อมลยทธศาสตร
*/
function onClickOpenDialog(
status: boolean = false,
data: DataStrategic | null = null
@ -125,11 +136,13 @@ function onClickOpenDialog(
modalDialog.value = true;
}
/** ปิด dialog */
function closeDialog() {
modalDialog.value = false;
strategicName.value = "";
}
/** บันทึกข้อมูล */
function onSubmit() {
dialogConfirm($q, async () => {
const formData = {
@ -138,9 +151,6 @@ function onSubmit() {
name: strategicName.value,
};
try {
// const url = isStatusEdit.value
// ? config.API.devStrategy;
// : config.API.devStrategy;
const method = isStatusEdit.value ? "patch" : "post";
await http[method](config.API.devStrategy, formData);
fetchDataTree();
@ -154,6 +164,7 @@ function onSubmit() {
});
}
/** ลบข้อมูลตาม id */
function onDelete(data: DataStrategic) {
dialogRemove($q, () => {
showLoader();
@ -176,6 +187,7 @@ function onDelete(data: DataStrategic) {
});
}
/** ดึงข้อมูลเมื่ออยู่ในหน้า */
onMounted(() => {
fetchDataTree();
});