สอบคัดเลือกเพิ่มฟิวรหัสตำแหน่ง

This commit is contained in:
Kittapath 2023-10-04 15:03:17 +07:00
parent 32ec4bdcd9
commit fd6510b49e
4 changed files with 70 additions and 25 deletions

View file

@ -446,6 +446,7 @@ onMounted(async () => {
const calDate = async () => {
let _startDate = new Date(startDate.value.toISOString().substr(0, 10));
let _endDate = new Date(endDate.value.toISOString().substr(0, 10));
_endDate.setDate(_endDate.getDate() + 1);
if (_startDate > _endDate) {
const swap = _startDate;
_startDate = _endDate;

View file

@ -137,9 +137,15 @@
:pagination-label="paginationLabel"
:pagination="initialPagination"
:rows-per-page-options="paging == true ? [25, 50, 100, 500] : []"
row-key="id"
selection="multiple"
v-model:selected="selected"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width>
<q-checkbox v-model="props.selected" />
</q-th>
<q-th auto-width v-if="boss == true" />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
@ -152,7 +158,6 @@
/>
</q-tr>
</template>
<!-- สำหรบเรยกใช template วขางนอก -->
<template #body="props">
<slot v-bind="props" name="columns"></slot>
</template>
@ -180,6 +185,7 @@ const files = ref<File[]>([]);
const filterRef = ref<any>(null);
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string[]>([]);
const selected = ref<string[]>([]);
const { messageError, showLoader, hideLoader } = mixin;
const props = defineProps({
inputfilter: String,
@ -191,6 +197,10 @@ const props = defineProps({
type: Array,
defualt: [],
},
selected: {
type: Array,
defualt: [],
},
boss: {
type: Boolean,
defualt: false,
@ -406,10 +416,14 @@ const downloadFileDetail = async () => {
};
const checkCandidates = async () => {
var _selected = [];
selected.value.map((r: any) => {
_selected.push(r.id.toString());
});
showLoader();
await http
.post(config.API.candidateCheckRegisters, {
candidateId: candidateId.value,
candidateId: _selected,
})
.then((res) => {
success($q, "ตรวจสอบข้อมูลสำเร็จ");
@ -466,18 +480,18 @@ const candidateCheckProfileDialog = async () => {
"mdi-email-check-outline",
"ยืนยัน",
"public",
candidateCheckProfile,
checkCandidates,
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 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

View file

@ -372,6 +372,21 @@
>
<template #columns="props">
<q-tr :props="props">
<q-td key="code" :props="props">
<q-input
outlined
dense
lazy-rules
v-model="props.row.code"
:rules="[
(val) =>
!!val || `${'กรุณากรอกรหัสประจำตำแหน่งที่สอบ'}`,
]"
:label="`${'รหัสประจำตำแหน่งที่สอบ'}`"
@update:modelValue="clickEditRow"
hide-bottom-space
/>
</q-td>
<q-td key="position" :props="props">
<selector
class=""
@ -1258,12 +1273,24 @@ const columnsPayment = ref<QTableProps["columns"]>([
},
]);
const visibleColumnsPosition = ref<String[]>([
"code",
"position",
"level",
"type",
"highDegree",
]);
const columnsPosition = ref<QTableProps["columns"]>([
{
name: "code",
align: "left",
label: "รหัสประจำตำแหน่งที่สอบ",
sortable: true,
field: "code",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "position",
align: "left",
@ -1372,6 +1399,7 @@ const fetchData = async () => {
id: r.typeId,
name: r.typeName,
},
code: r.code,
highDegree: r.highDegree == true ? "1" : "0",
});
});
@ -1619,6 +1647,7 @@ const sendData = () => {
positionLevelName: r.level.name,
typeId: r.type.id,
typeName: r.type.name,
code: r.code,
highDegree: r.highDegree == "1" ? true : false,
});
});
@ -1825,6 +1854,7 @@ const clickAddPosition = () => {
id: "00000000-0000-0000-0000-000000000000",
position: null,
type: { id: "normol", name: "ทั่วไป" },
code: null,
highDegree: "0",
});
}

View file

@ -167,9 +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 auto-width>
<q-checkbox v-model="props.selected" />
</q-td>
<q-td
v-for="col in props.cols"
:key="col.name"
@ -203,12 +203,12 @@
</div>
</div>
</div>
<div v-else-if="col.name == 'check'">
<!-- <div v-else-if="col.name == 'check'">
<q-checkbox
v-model="props.row.check"
v-if="props.row.status == 'checkRegister'"
/>
</div>
</div> -->
<div v-else-if="col.name == 'career'">
<div class="col-4">
{{ props.row.career }}
@ -332,7 +332,7 @@ const initialPagination = ref<Pagination>({
rowsPerPage: 0,
});
const visibleColumns = ref<String[]>([
"check",
// "check",
"no",
"number",
"registerDate",
@ -387,15 +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: "check",
// align: "left",
// label: "",
// sortable: true,
// field: "check",
// headerStyle: "font-size: 14px;",
// style: "font-size: 14px; ",
// },
{
name: "no",
align: "left",