update by req
This commit is contained in:
parent
71884b950f
commit
3aa9b68b23
4 changed files with 185 additions and 296 deletions
|
|
@ -7,7 +7,7 @@ export default {
|
||||||
yearOptions: () => `${placement}/fiscal`,
|
yearOptions: () => `${placement}/fiscal`,
|
||||||
redirectToPage: (examId: string) => `${placement}/pass/${examId}`,
|
redirectToPage: (examId: string) => `${placement}/pass/${examId}`,
|
||||||
disclaimF: () => `${placement}/pass/disclaim`,
|
disclaimF: () => `${placement}/pass/disclaim`,
|
||||||
defermentF: () => `${placement}/pass/deferment`,
|
deferment: () => `${placement}/pass/deferment`,
|
||||||
getStatCard: (examId: string) => `${placement}/pass/stat/${examId}`,
|
getStatCard: (examId: string) => `${placement}/pass/stat/${examId}`,
|
||||||
getDatapersonal: (id: string) => `${placement}/personal/${id}`,
|
getDatapersonal: (id: string) => `${placement}/personal/${id}`,
|
||||||
putProperty: (id: string) => `${placement}/property/${id}`,
|
putProperty: (id: string) => `${placement}/property/${id}`,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
import { onMounted, ref, reactive } from "vue";
|
import { onMounted, ref, reactive } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import type { FormPlacementMainData } from "@/modules/05_placement/interface/request/Main";
|
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
DataOption1,
|
DataOption1,
|
||||||
|
|
@ -17,7 +16,6 @@ const DataStore = usePlacementDataStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||||
const selectedFiscalYear = ref(0);
|
|
||||||
|
|
||||||
// หัวตาราง
|
// หัวตาราง
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -84,24 +82,20 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "accountStartDate",
|
name: "accountStartDate",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่เริ่มคำสั่ง",
|
label: "วันที่บัญชีใช้ได้ตั้งแต่",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "accountStartDate",
|
field: "accountStartDate",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "accountExpirationDate",
|
name: "accountExpirationDate",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่บัญชีหมดอายุ",
|
label: "วันที่บัญชีใช้ได้ถึง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "accountExpirationDate",
|
field: "accountExpirationDate",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
// ข้อมูลตาราง (จำลอง)
|
// ข้อมูลตาราง (จำลอง)
|
||||||
|
|
@ -128,11 +122,6 @@ const visibleColumns = ref([
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchYearOptions();
|
await fetchYearOptions();
|
||||||
// await fiscalYearFilter();
|
|
||||||
// examTimeFilter();
|
|
||||||
// await examTypeFilter();
|
|
||||||
// expiredAccountFilter();
|
|
||||||
// await searchFilterTable();
|
|
||||||
});
|
});
|
||||||
const fetchPlacementData = async (val: number) => {
|
const fetchPlacementData = async (val: number) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -159,12 +148,12 @@ const fetchYearOptions = async () => {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const response = res.data.result;
|
const response = res.data.result;
|
||||||
yearOptions.push(...response);
|
yearOptions.push(...response);
|
||||||
const maxNumber = yearOptions.reduce((max, e) => {
|
const maxNumber = yearOptions.reduce((max: any, e: any) => {
|
||||||
return e.id > max ? e.id : max;
|
return e.id > max ? e.id : max;
|
||||||
}, "");
|
}, "");
|
||||||
searchYear.value = maxNumber;
|
searchYear.value = maxNumber;
|
||||||
DataStore.DataMainYearSet(searchYear.value);
|
DataStore.DataMainYearSet(searchYear.value);
|
||||||
DataStore.DataMainYear = yearOptions.value;
|
// DataStore.DataMainYear = yearOptions.value;
|
||||||
fetchPlacementData(searchYear.value);
|
fetchPlacementData(searchYear.value);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -176,83 +165,11 @@ const filterYear = () => {
|
||||||
fetchPlacementData(searchYear.value);
|
fetchPlacementData(searchYear.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
// watchEffect(() => {
|
|
||||||
// rows.value = OriginalData.value;
|
|
||||||
// });
|
|
||||||
// const OriginalDataFetch = async (year: number) => {
|
|
||||||
// yearValue.value = year;
|
|
||||||
// try {
|
|
||||||
// const response = await http.get(config.API.MainDetail(year));
|
|
||||||
// const apiData = response.data.result;
|
|
||||||
// console.log(`🚀 ข้อมูลจากการ get (${year})`, apiData);
|
|
||||||
// await DataStore.DataMain(apiData);
|
|
||||||
// OriginalData.value = await DataStore.DataMainOrig;
|
|
||||||
// UpdataData.value = OriginalData.value.filter(
|
|
||||||
// (data) => data.fiscalYear === year
|
|
||||||
// );
|
|
||||||
// } catch (error) {
|
|
||||||
// messageError($q, error);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// ดูรายการสอบแข่งขัน หน้าต่อไป
|
// ดูรายการสอบแข่งขัน หน้าต่อไป
|
||||||
const redirectToPage = (examId?: number) => {
|
const redirectToPage = (examId?: number) => {
|
||||||
router.push(`/placement/pass/${examId}`);
|
router.push(`/placement/pass/${examId}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
//-------------------|เลือกปีงบประมาณ|-----------------------//
|
|
||||||
const fiscalyear = ref<number>(0);
|
|
||||||
const fiscalyearOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
|
||||||
const addedfiscalYearValues: number[] = [];
|
|
||||||
// const fiscalYearFilter = async () => {
|
|
||||||
// try {
|
|
||||||
// const response = await http.get(config.API.yearOptions());
|
|
||||||
// const dataOptions = response.data.result;
|
|
||||||
// fiscalyearOP.push(...dataOptions);
|
|
||||||
|
|
||||||
// let maxYear = 0;
|
|
||||||
// for (let data of dataOptions) {
|
|
||||||
// if (data.id > maxYear) {
|
|
||||||
// maxYear = data.id;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// fiscalyear.value = maxYear;
|
|
||||||
|
|
||||||
// // อัพเดตค่าของ selectedFiscalYear
|
|
||||||
// selectedFiscalYear.value = fiscalyear.value;
|
|
||||||
|
|
||||||
// // โหลดข้อมูลใหม่เมื่อตัวเลือกปีเปลี่ยนแปลง
|
|
||||||
// await OriginalDataFetch(selectedFiscalYear.value);
|
|
||||||
// } catch (e) {
|
|
||||||
// messageError($q, e);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
//-------------------|เลือกปีงบประมาณตาม API|--------------------//
|
|
||||||
|
|
||||||
// const searchfiscalyear = async () => {
|
|
||||||
// try {
|
|
||||||
// const res = await http.get(config.API.yearOptions());
|
|
||||||
// const dataOptions: YearOption[] = res.data.result;
|
|
||||||
// if (fiscalyear.value === 0) {
|
|
||||||
// await OriginalDataFetch(0);
|
|
||||||
// } else {
|
|
||||||
// const selectedYearObject = dataOptions.find(
|
|
||||||
// (option: YearOption) => option.id === fiscalyear.value
|
|
||||||
// );
|
|
||||||
// OriginalDataFetch(fiscalyear.value);
|
|
||||||
|
|
||||||
// if (selectedYearObject) {
|
|
||||||
// } else {
|
|
||||||
// console.log("No Selected Year Object");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch (e) {
|
|
||||||
// messageError($q, e);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
//-------------------|ค้นหาในตาราง|-----------------//
|
//-------------------|ค้นหาในตาราง|-----------------//
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const filterRef = ref<any>(null);
|
const filterRef = ref<any>(null);
|
||||||
|
|
@ -286,38 +203,8 @@ const examTimeFilter = async () => {
|
||||||
const examType = ref<string | null>("all");
|
const examType = ref<string | null>("all");
|
||||||
const examTypeOP = ref<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
|
const examTypeOP = ref<DataOption1[]>([{ id: "all", name: "ทั้งหมด" }]);
|
||||||
const addedExamTypeValues: Set<string> = new Set();
|
const addedExamTypeValues: Set<string> = new Set();
|
||||||
const data = [
|
|
||||||
{
|
|
||||||
accountEndDate: "2024-06-21T01:22:59.251572",
|
|
||||||
accountExpirationDate: "2024-06-21T01:22:59.251572",
|
|
||||||
accountStartDate: "2023-06-22T01:22:59.251572",
|
|
||||||
examOrder: "1",
|
|
||||||
examRound:
|
|
||||||
"การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
|
||||||
examTypeName: "แข่งขัน",
|
|
||||||
examTypeValue: "0a846508-4932-40de-9a9e-5b519492211c",
|
|
||||||
fiscalYear: 2566,
|
|
||||||
id: "0a846508-4932-40de-9a9e-5b519492216c",
|
|
||||||
isExpired: false,
|
|
||||||
numberOfCandidates: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accountEndDate: "2024-06-21T01:22:59.251572",
|
|
||||||
accountExpirationDate: "2024-06-21T01:22:59.251572",
|
|
||||||
accountStartDate: "2023-06-22T01:22:59.251572",
|
|
||||||
examOrder: "2",
|
|
||||||
examRound:
|
|
||||||
"การสอบแข่งขันเพื่อรับบุคคลทั่วไปเข้ารับราชการ ส่วนการจัดการทั่วไป",
|
|
||||||
examTypeName: "แข่งขัน",
|
|
||||||
examTypeValue: "0a846508-4932-40de-9a9e-5b519492211c",
|
|
||||||
fiscalYear: 2566,
|
|
||||||
id: "0a846508-4932-40de-9a9e-5b519492216c",
|
|
||||||
isExpired: false,
|
|
||||||
numberOfCandidates: 1,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const examTypeFilter = () => {
|
const examTypeFilter = () => {
|
||||||
dataPlacement.value.forEach((item) => {
|
dataPlacement.value.forEach((item: any) => {
|
||||||
const examTypeName = item.examTypeName;
|
const examTypeName = item.examTypeName;
|
||||||
const examTypeValue = item.examTypeValue;
|
const examTypeValue = item.examTypeValue;
|
||||||
if (examTypeName && !addedExamTypeValues.has(examTypeName)) {
|
if (examTypeName && !addedExamTypeValues.has(examTypeName)) {
|
||||||
|
|
@ -345,7 +232,7 @@ const searchFilterTable = async () => {
|
||||||
const expiredAccount = ref<boolean>(false);
|
const expiredAccount = ref<boolean>(false);
|
||||||
const expiredAccountFilter = async () => {
|
const expiredAccountFilter = async () => {
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
const updatedRows = dataPlacement.value.map((data) => {
|
const updatedRows = dataPlacement.value.map((data: any) => {
|
||||||
let expirationDate = new Date(data.accountExpirationDate);
|
let expirationDate = new Date(data.accountExpirationDate);
|
||||||
let isExpired = currentDate > expirationDate;
|
let isExpired = currentDate > expirationDate;
|
||||||
|
|
||||||
|
|
@ -356,7 +243,7 @@ const expiredAccountFilter = async () => {
|
||||||
|
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "desc",
|
sortBy: "accountStartDate",
|
||||||
descending: false,
|
descending: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import Table from "@/modules/05_placement/components/pass/TableView.vue";
|
||||||
import DialogCard from "@/modules/05_placement/components/pass/TableDetail.vue";
|
import DialogCard from "@/modules/05_placement/components/pass/TableDetail.vue";
|
||||||
import DialogFooter from "@/modules/05_placement/components/pass/DialogFooter.vue";
|
import DialogFooter from "@/modules/05_placement/components/pass/DialogFooter.vue";
|
||||||
import DialogHeader from "@/modules/05_placement/components/pass/DialogHeader.vue";
|
import DialogHeader from "@/modules/05_placement/components/pass/DialogHeader.vue";
|
||||||
import type { TableName } from "@/modules/05_placement/interface/request/placement";
|
|
||||||
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
||||||
import DialogOrgTree from "@/modules/05_placement/components/pass/OrgTree.vue";
|
import DialogOrgTree from "@/modules/05_placement/components/pass/OrgTree.vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
@ -80,7 +79,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "number",
|
name: "number",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
@ -153,9 +151,9 @@ const getTable = async () => {
|
||||||
positionPath: data.positionPath,
|
positionPath: data.positionPath,
|
||||||
reportingDate: dateText(new Date(data.reportingDate)),
|
reportingDate: dateText(new Date(data.reportingDate)),
|
||||||
number: data.number,
|
number: data.number,
|
||||||
bmaOfficer: data.bmaOfficer,
|
bmaOfficer: data.bmaOfficer == 'OFFICER' ? 'ขรก.กทม. สามัญ' : data.bmaOfficer == 'EMPLOYEE_PERM' ? 'ลูกจ้างประจำ' : data.bmaOfficer == 'EMPLOYEE_TEMP' ? 'ลูกจ้างชั่วคราว' : data.bmaOfficer == null ? 'บุคคลภายนอก' : '-',
|
||||||
statusId: data.statusId,
|
statusId: data.statusId,
|
||||||
statusName: data.statusId == 'un-contain' ? 'ยังไม่บรรจุ' : data.statusId == 'PREPARE-CONTAIN' ? 'เตรียมบรรจุ' : data.statusId == 'CONTAIN'? 'บรรจุแล้ว' : data.statusId == 'DISCLAIM' ? 'สละสิทธิ์' : '-',
|
statusName: data.statusId == 'UN-CONTAIN' ? 'ยังไม่บรรจุ' : data.statusId == 'PREPARE-CONTAIN' ? 'เตรียมบรรจุ' : data.statusId == 'CONTAIN' ? 'บรรจุแล้ว' : data.statusId == 'DISCLAIM' ? 'สละสิทธิ์' : '-',
|
||||||
deferment: data.deferment,
|
deferment: data.deferment,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -172,16 +170,17 @@ const getTable = async () => {
|
||||||
|
|
||||||
const appointModal = ref<boolean>(false);
|
const appointModal = ref<boolean>(false);
|
||||||
|
|
||||||
const savePostpone = async () => {
|
const saveDeferment = async () => {
|
||||||
myForm.value.validate().then(async (result: boolean) => {
|
myForm.value.validate().then(async (result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
showLoader()
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("personalId", personalId.value);
|
formData.append("personalId", personalId.value);
|
||||||
formData.append("note", userNote.value),
|
formData.append("note", userNote.value);
|
||||||
formData.append("files", files.value);
|
formData.append("files", files.value[0]);
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.post(config.API.defermentF(), formData)
|
.post(config.API.deferment(), formData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "บันทึกสำเร็จ");
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
})
|
||||||
|
|
@ -200,6 +199,7 @@ const savePostpone = async () => {
|
||||||
const saveDisclaim = async () => {
|
const saveDisclaim = async () => {
|
||||||
myForm.value.validate().then(async (result: boolean) => {
|
myForm.value.validate().then(async (result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
showLoader()
|
||||||
const dataPost = {
|
const dataPost = {
|
||||||
note: userNote.value,
|
note: userNote.value,
|
||||||
personId: personalId.value,
|
personId: personalId.value,
|
||||||
|
|
@ -271,7 +271,7 @@ const editDetail = (
|
||||||
.get(config.API.placementDefermentInfo(props.personalId))
|
.get(config.API.placementDefermentInfo(props.personalId))
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
dataInfo.reason = res.data.result.reliefReason;
|
dataInfo.reason = res.data.result.reliefReason;
|
||||||
dataInfo.reliefDoc = res.data.reliefDoc
|
dataInfo.reliefDoc = res.data.result.reliefDoc
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -350,6 +350,13 @@ const expiredAccount = ref<boolean>(false);
|
||||||
watch(expiredAccount, () => {
|
watch(expiredAccount, () => {
|
||||||
console.log("expiredAccount===>", expiredAccount.value);
|
console.log("expiredAccount===>", expiredAccount.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pagination = ref({
|
||||||
|
sortBy: "number",
|
||||||
|
descending: false,
|
||||||
|
page: 1,
|
||||||
|
rowsPerPage: 10,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -515,7 +522,7 @@ watch(expiredAccount, () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<DialogFooter :editvisible="true" :validate="validateData" :save="modalDisclaim ? saveDisclaim : savePostpone" />
|
<DialogFooter :editvisible="true" :validate="validateData" :save="modalDisclaim ? saveDisclaim : saveDeferment" />
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
|
||||||
|
|
@ -46,15 +46,10 @@ import { ref, useAttrs } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
|
||||||
const { dialogMessage } = mixin;
|
|
||||||
const editvisible = ref<boolean>(false);
|
|
||||||
const attrs = ref<any>(useAttrs());
|
const attrs = ref<any>(useAttrs());
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
const table = ref<any>(null);
|
const table = ref<any>(null);
|
||||||
const filterRef = ref<any>(null);
|
const filterRef = ref<any>(null);
|
||||||
const modalPublish = ref<boolean>(false);
|
|
||||||
const modalDelete = ref<boolean>(false);
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
inputfilter: String,
|
inputfilter: String,
|
||||||
inputvisible: Array,
|
inputvisible: Array,
|
||||||
|
|
@ -143,8 +138,8 @@ const props = defineProps({
|
||||||
roleAdmin: Boolean
|
roleAdmin: Boolean
|
||||||
});
|
});
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "desc",
|
sortBy: "number",
|
||||||
descending: false,
|
descending: true,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue