Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-10-02 13:59:19 +07:00
commit 65adb2cd38
8 changed files with 139 additions and 21 deletions

View file

@ -57,6 +57,7 @@ export default {
candidateUpload: (candidateId: string) => `${candidate}upload/${candidateId}`,
candidateCheckRegister: (candidateId: string) =>
`${candidate}check-register/${candidateId}`,
candidateCheckRegisters: `${candidate}check-registers`,
candidateRejectRegister: (candidateId: string) =>
`${candidate}reject-register/${candidateId}`,
candidateCheckPayment: (candidateId: string) =>

View file

@ -221,7 +221,6 @@
:borderless="!false"
v-model="rangeDate"
:label="`${'ระยะเวลา'}`"
@update:modelValue="clickEditRow"
hide-bottom-space
/>
</div>
@ -396,10 +395,54 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
await changeExamColumns("career", count);
});
watch(startDate, async (count: Date, prevCount: Date) => {
await calDate();
});
watch(endDate, async (count: Date, prevCount: Date) => {
await calDate();
});
onMounted(async () => {
await fetchData();
});
const calDate = async () => {
let _startDate = new Date(startDate.value.toISOString().substr(0, 10));
let _endDate = new Date(endDate.value.toISOString().substr(0, 10));
if (_startDate > _endDate) {
const swap = _startDate;
_startDate = _endDate;
_endDate = swap;
}
const startYear = _startDate.getFullYear();
const february =
(startYear % 4 === 0 && startYear % 100 !== 0) || startYear % 400 === 0
? 29
: 28;
const daysInMonth = [31, february, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
let yearDiff = _endDate.getFullYear() - startYear;
let monthDiff = _endDate.getMonth() - _startDate.getMonth();
if (monthDiff < 0) {
yearDiff--;
monthDiff += 12;
}
let dayDiff = _endDate.getDate() - _startDate.getDate();
if (dayDiff < 0) {
if (monthDiff > 0) {
monthDiff--;
} else {
yearDiff--;
monthDiff = 11;
}
dayDiff += daysInMonth[_startDate.getMonth()];
}
rangeDate.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${
monthDiff > 0 ? monthDiff + " เดือน " : ""
}${dayDiff > 0 ? dayDiff + " วัน " : ""}`;
};
const fetchData = async () => {
showLoader();
await http
@ -410,8 +453,8 @@ const fetchData = async () => {
data.map((r: any) => {
rows.value.push({
...r,
startDate: r.durationStart,
endDate: r.durationEnd,
startDate: new Date(r.durationStart),
endDate: new Date(r.durationEnd),
});
});
})

View file

@ -9,8 +9,8 @@
:editData="false"
/>
<q-form ref="myform">
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-xs">
<div class="col-12">
<div class="row col-12 items-center">
<div class="col-12 q-pb-sm">
<q-radio
v-model="defaultOccupation.positionType"
label="ลูกจ้างประจำ"
@ -33,8 +33,8 @@
:disable="!(status == 'checkRegister' || status == 'payment')"
/>
</div>
<div class="col-12 row">
<div class="col-3">
<div class="col-12 row q-col-gutter-sm">
<div class="col-4">
<q-input
:class="getClass(status == 'checkRegister' || status == 'payment')"
:outlined="status == 'checkRegister' || status == 'payment'"
@ -48,9 +48,8 @@
:label="`${'ชื่อตำแหน่ง'}`"
/>
</div>
<div class="col-3">
<div class="col-4">
<q-input
class="q-pl-sm"
:class="getClass(status == 'checkRegister' || status == 'payment')"
:outlined="status == 'checkRegister' || status == 'payment'"
dense
@ -64,9 +63,8 @@
:label="`${'เงินเดือน'}`"
/>
</div>
</div>
<div class="col-12 row">
<div class="col-3">
<div class="col-4">
<q-input
:class="getClass(status == 'checkRegister' || status == 'payment')"
:outlined="status == 'checkRegister' || status == 'payment'"
@ -80,9 +78,8 @@
:label="`${'กลุ่ม/ฝ่าย'}`"
/>
</div>
<div class="col-3">
<div class="col-4">
<q-input
class="q-pl-sm"
:class="getClass(status == 'checkRegister' || status == 'payment')"
:outlined="status == 'checkRegister' || status == 'payment'"
dense
@ -95,9 +92,8 @@
:label="`${'กอง'}`"
/>
</div>
<div class="col-3">
<div class="col-4">
<q-input
class="q-pl-sm"
:class="getClass(status == 'checkRegister' || status == 'payment')"
:outlined="status == 'checkRegister' || status == 'payment'"
dense
@ -110,9 +106,8 @@
:label="`${'สังกัด'}`"
/>
</div>
<div class="col-3">
<div class="col-4">
<q-input
class="q-pl-sm"
:class="getClass(status == 'checkRegister' || status == 'payment')"
:outlined="status == 'checkRegister' || status == 'payment'"
dense

View file

@ -69,6 +69,19 @@
>
<q-tooltip>บรรจานการคดเลอก</q-tooltip>
</q-btn>
<q-btn
size="md"
icon="mdi-email-check-outline"
round
flat
color="green-6"
@click="candidateCheckProfileDialog"
:disabled="
attrs.rows.filter((r) => r.status == 'checkRegister').length == 0
"
>
<q-tooltip>ตรวจสอบขอม</q-tooltip>
</q-btn>
<q-space />
<div class="items-center" style="display: flex">
<!-- นหาขอความใน table -->
@ -166,6 +179,7 @@ const table = ref<any>(null);
const files = ref<File[]>([]);
const filterRef = ref<any>(null);
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string[]>([]);
const { messageError, showLoader, hideLoader } = mixin;
const props = defineProps({
inputfilter: String,
@ -391,6 +405,24 @@ const downloadFileDetail = async () => {
});
};
const checkCandidates = async () => {
showLoader();
await http
.post(config.API.candidateCheckRegisters, {
candidateId: candidateId.value,
})
.then((res) => {
success($q, "ตรวจสอบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
props.fetchData();
});
};
const downloadFilePDF = async (res: string, fileName: string) => {
const link = document.createElement("a");
link.href = window.URL.createObjectURL(
@ -426,6 +458,27 @@ const publishModal = () => {
}
};
const candidateCheckProfileDialog = async () => {
dialogMessage(
$q,
"ยืนยันการตรวจสอบข้อมูลนี้หรือไม่?",
"ยืนยันการตรวจสอบข้อมูล",
"mdi-email-check-outline",
"ยืนยัน",
"public",
candidateCheckProfile,
undefined
);
};
const candidateCheckProfile = async () => {
const filter = attrs.value.rows.filter((r: any) => r.check == true);
filter.map((r: any) => {
candidateId.value.push(r.id.toString());
});
await checkCandidates();
};
const resetFilter = () => {
// reset X
emit("update:inputfilter", "");

View file

@ -167,6 +167,9 @@
>
<template #columns="props">
<q-tr :props="props" class="cursor-pointer">
<!-- <q-td auto-width>
<q-checkbox v-model="checkProfile" />
</q-td> -->
<q-td
v-for="col in props.cols"
:key="col.name"
@ -200,6 +203,12 @@
</div>
</div>
</div>
<div v-else-if="col.name == 'check'">
<q-checkbox
v-model="props.row.check"
v-if="props.row.status == 'checkRegister'"
/>
</div>
<div v-else-if="col.name == 'career'">
<div class="col-4">
{{ props.row.career }}
@ -318,10 +327,12 @@ const examId = ref<string>(route.params.examId.toString());
const visible = ref(true); // card
const dataNum = ref<DataNumObject[]>([]); //
const rows = ref<any>([]);
const checkProfile = ref<any>([]);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
});
const visibleColumns = ref<String[]>([
"check",
"no",
"number",
"registerDate",
@ -376,6 +387,15 @@ const optionsStatus = ref<any>([
},
]);
const columns = ref<QTableProps["columns"]>([
{
name: "check",
align: "left",
label: "",
sortable: true,
field: "check",
headerStyle: "font-size: 14px;",
style: "font-size: 14px; ",
},
{
name: "no",
align: "left",
@ -554,6 +574,7 @@ const fetchData = async () => {
pass: r.pass,
email: r.email,
status: r.status,
check: false,
});
});
})

View file

@ -76,6 +76,7 @@ const yearOptions = ref<any>([{ id: "", year: "ทั้งหมด" }]);
onMounted(async () => {
await fetchRetirement(type.value, currentYear);
// fiscalyear.value = currentYear + 543
// await fetchRetirement(type.value, currentYear);
});
//
@ -116,7 +117,11 @@ const fetchRetirement = async (type: string, year: any) => {
yearOptions.value.push(...option);
yearOptionsFilter.value = yearOptions.value;
if (yearOptionsFilter.value.length == 1) {
fiscalyear.value = yearOptionsFilter.value[0].id;
} else {
fiscalyear.value = year;
}
actionOption.value = rows.value;
rows.value.sort((a, b) => a.round - b.round); //
checkststus(rows.value);

View file

@ -197,7 +197,7 @@ const fileOpen = (url: string) => {
bordered
:style="$q.screen.gt.xs ? 'height: 80vh' : 'height: auto;'"
>
<div class="eow col-12" v-for="(d, index) in data" :key="d.no">
<div class=" col-12" v-for="(d, index) in data" :key="index">
<div class="col-12 q-pa-xs">
<q-item>
<q-item-section top avatar>

View file

@ -468,7 +468,7 @@ const clickDelete = (id: string) => {
</div>
<q-list style="min-width: 300px" v-for="n in notiList" :key="n.id">
<q-item v-ripple class="mytry" dense>
<q-item v-ripple class="mytry q-py-xs" dense>
<q-item-section avatar top style="min-width: 40px">
<q-avatar color="primary" size="22px" text-color="white">
<span class="text-weight-medium text-uppercase">{{