clear code + comment
This commit is contained in:
parent
a9609d2d7f
commit
ac70090e22
19 changed files with 231 additions and 166 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ function getClass() {
|
|||
return "inputgreen";
|
||||
}
|
||||
|
||||
/** ดึงข้อมูล */
|
||||
function fetchData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -106,6 +107,7 @@ function fetchData() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
|
||||
onMounted(() => {
|
||||
if (id.value) {
|
||||
fetchData();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
() => {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
() => {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
() => {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
() => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 />
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue