รายชื่อผู้สอบในรอบ => วันที่รายงานตัว
This commit is contained in:
parent
f3d8aac352
commit
6df41b9881
3 changed files with 133 additions and 3 deletions
|
|
@ -198,11 +198,13 @@ async function fetchPosFind(level: number, id: string) {
|
|||
.post(config.API.orgPosFind, body)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
|
||||
expanded.value = data;
|
||||
nodeId.value = id;
|
||||
positionId.value = props?.dataRow?.posmasterId;
|
||||
seletcId.value = props?.dataRow?.positionId;
|
||||
datePos.value = props?.dataRow?.reportingDateFullDate;
|
||||
datePos.value = props?.dataRow?.reportingDate;
|
||||
|
||||
fetchDataTable(nodeId.value, level);
|
||||
})
|
||||
|
|
@ -277,7 +279,10 @@ watch(
|
|||
async () => {
|
||||
if (modal.value) {
|
||||
await fetchOrganizationActive();
|
||||
console.log(props?.dataRow);
|
||||
|
||||
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
|
||||
|
||||
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
|
||||
} else {
|
||||
expanded.value = [];
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ const {
|
|||
dateText,
|
||||
success,
|
||||
dialogConfirm,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
|
|
@ -363,7 +364,10 @@ async function getTable() {
|
|||
: rowsAll.value.filter((x: any) => x.statusId !== "CONTAIN"));
|
||||
// รายชื่อไปยังหน่วยงาน
|
||||
rowsFilter.value = await rows.value.filter(
|
||||
(e: any) => e.draft == "รอส่งตัว"
|
||||
(e: any) =>
|
||||
e.draft == "รอส่งตัว" &&
|
||||
e.nodeName !== null &&
|
||||
e.reportingDate !== null
|
||||
);
|
||||
|
||||
insertAvatar(rows.value);
|
||||
|
|
@ -621,6 +625,7 @@ async function clickClose() {
|
|||
modalDefermentDisclaim.value = false;
|
||||
modalwaitInfo.value = false;
|
||||
modal.value = false;
|
||||
modalDate.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -699,6 +704,35 @@ function onRestorePos(id: string) {
|
|||
);
|
||||
}
|
||||
|
||||
const modalDate = ref<boolean>(false);
|
||||
const reportingDate = ref<Date | null>(null);
|
||||
const rowId = ref<string>("");
|
||||
function onSelectDate(id: string, date: Date) {
|
||||
modalDate.value = true;
|
||||
rowId.value = id;
|
||||
reportingDate.value = date;
|
||||
}
|
||||
|
||||
function onSubmitDate() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.clearDate(rowId.value), { date: reportingDate.value })
|
||||
.then(() => {
|
||||
getTable();
|
||||
props.statCard();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modalDate.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
|
|
@ -897,7 +931,35 @@ onMounted(async () => {
|
|||
v-if="
|
||||
roleAdmin &&
|
||||
props.row.draft === 'รอส่งตัว' &&
|
||||
props.row.orgName !== null
|
||||
props.row.nodeName !== null
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onSelectDate(
|
||||
props.row.personalId,
|
||||
props.row.reportingDate
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="blue-7"
|
||||
size="xs"
|
||||
name="mdi-calendar-account"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>เลือกวันรายงานตัว</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
roleAdmin &&
|
||||
props.row.draft === 'รอส่งตัว' &&
|
||||
props.row.nodeName !== null
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -1443,6 +1505,67 @@ onMounted(async () => {
|
|||
:fetchStatCard="statCard"
|
||||
:typeCommand="typeCommand"
|
||||
/>
|
||||
|
||||
<!-- dialog วันรายงานตัว-->
|
||||
<q-dialog v-model="modalDate" persistent>
|
||||
<q-card style="width: 500px; max-width: 300px">
|
||||
<q-form
|
||||
ref="myForm"
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="onSubmitDate"
|
||||
>
|
||||
<DialogHeader :tittle="`เลือกวันรายงานตัว`" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="reportingDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:min-date="new Date()"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
ref="dateRef"
|
||||
outlined
|
||||
dense
|
||||
hide-bottom-space
|
||||
:model-value="
|
||||
reportingDate != null ? date2Thai(reportingDate) : null
|
||||
"
|
||||
label="วันที่รายงานตัว"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue