ปรับ เครื่องราชฯ
This commit is contained in:
parent
388893395b
commit
981bab8061
4 changed files with 416 additions and 139 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch, reactive, computed, watchEffect } from "vue";
|
||||
import { ref, onMounted, watch, reactive, computed, } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -505,11 +505,14 @@ onMounted(async () => {
|
|||
}
|
||||
await getTable();
|
||||
});
|
||||
watchEffect(() => {
|
||||
if (getTable()) {
|
||||
props.statCard();
|
||||
}
|
||||
});
|
||||
// watch(rowsAll, () => {
|
||||
// props.statCard();
|
||||
// });
|
||||
// watchEffect(() => {
|
||||
// if (getTable()) {
|
||||
// props.statCard();
|
||||
// }
|
||||
// });
|
||||
|
||||
const containStatus = ref<boolean>(false);
|
||||
watch(containStatus, () => {
|
||||
|
|
@ -531,24 +534,27 @@ const savelist = () => {
|
|||
});
|
||||
if (personal_selected.value) {
|
||||
// console.log(personal_selected.value);
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.putPosition(examId), personal_selected.value)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.putPosition(examId), personal_selected.value)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getTable();
|
||||
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันการส่งรายชื่อไปยังหน่วยงาน",
|
||||
"ต้องการยืนยันการส่งรายชื่อไปยังหน่วยงานหรือไม่?")
|
||||
"ต้องการยืนยันการส่งรายชื่อไปยังหน่วยงานหรือไม่?"
|
||||
);
|
||||
}
|
||||
};
|
||||
const handleModalAddListUpdate = (val: boolean) => {
|
||||
|
|
@ -573,22 +579,47 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</script>
|
||||
<template>
|
||||
<q-form ref="myForm">
|
||||
<Table :contain-status="containStatus" :rows="rows" :columns="columns" :filter="filter"
|
||||
:visible-columns="visibleColumns" v-model:inputfilter="filter" v-model:inputvisible="visibleColumns"
|
||||
v-model:editvisible="editvisible" v-model:containfilter="containStatus"
|
||||
@update-modaladdlist="handleModalAddListUpdate" :history="true" :boss="true" :saveNoDraft="true"
|
||||
:role-admin="roleAdmin" :displayAdd="displayAdd" row-key="fullname">
|
||||
<Table
|
||||
:contain-status="containStatus"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
v-model:editvisible="editvisible"
|
||||
v-model:containfilter="containStatus"
|
||||
@update-modaladdlist="handleModalAddListUpdate"
|
||||
:history="true"
|
||||
:boss="true"
|
||||
:saveNoDraft="true"
|
||||
:role-admin="roleAdmin"
|
||||
:displayAdd="displayAdd"
|
||||
row-key="fullname"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props" @click="selectData(props.row.personalId)"
|
||||
class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="selectData(props.row.personalId)"
|
||||
class="cursor-pointer"
|
||||
>
|
||||
<template v-if="col.name === 'position'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</template>
|
||||
<template v-else-if="col.name === 'fullName'" class="table_ellipsis">
|
||||
<template
|
||||
v-else-if="col.name === 'fullName'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
<q-item v-ripple>
|
||||
<q-item-section avatar>
|
||||
<img v-if="props.row.avatar == null" src="@/assets/avatar_user.jpg" class="col-4 img-info" />
|
||||
<img
|
||||
v-if="props.row.avatar == null"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-4 img-info"
|
||||
/>
|
||||
<img v-else :src="props.row.avatar" class="col-4 img-info" />
|
||||
</q-item-section>
|
||||
|
||||
|
|
@ -605,27 +636,30 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</template>
|
||||
|
||||
<template v-else-if="col.name === 'organizationName'">
|
||||
<div v-if="props.row.orgName !== null || props.row.positionPath !== null
|
||||
">
|
||||
<div
|
||||
v-if="
|
||||
props.row.orgName !== null || props.row.positionPath !== null
|
||||
"
|
||||
>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.orgName !== null ? props.row.orgName : "-" }}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -637,14 +671,19 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</div>
|
||||
</template>
|
||||
<template v-else-if="col.name === 'positionCandidate'">
|
||||
<div class="text-weight-medium" v-if="props.row.positionCandidate == null">
|
||||
<div
|
||||
class="text-weight-medium"
|
||||
v-if="props.row.positionCandidate == null"
|
||||
>
|
||||
-
|
||||
</div>
|
||||
<div class="text-weight-medium" v-else>
|
||||
{{ props.row.positionCandidate }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="col.name === 'reportingDate' && col.value !== '-'">
|
||||
<template
|
||||
v-else-if="col.name === 'reportingDate' && col.value !== '-'"
|
||||
>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.reportingDate }}
|
||||
</div>
|
||||
|
|
@ -666,48 +705,121 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</template>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense>
|
||||
<q-btn
|
||||
icon="mdi-dots-vertical"
|
||||
size="12px"
|
||||
color="grey-7"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-list dense style="min-width: 100px">
|
||||
<q-item v-if="(roleAdmin && props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.draft === 'รอส่งตัว' &&
|
||||
props.row.statusId !== 'DISCLAIM')
|
||||
" clickable v-close-popup @click="openAppointModal(props.row.personalId)">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-icon color="primary" size="xs" name="mdi-bookmark-outline" />
|
||||
<q-item
|
||||
v-if="
|
||||
(roleAdmin && props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.draft === 'รอส่งตัว' &&
|
||||
props.row.statusId !== 'DISCLAIM')
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openAppointModal(props.row.personalId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>เลือกหน่วยงานที่รับบรรจุ</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-separator />
|
||||
<q-item v-if="roleAdmin && props.row.statusId === 'UN-CONTAIN'" clickable v-close-popup
|
||||
@click="editDetail(props.row, 'deferment')">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-icon color="blue" size="xs" name="mdi-account-alert-outline" />
|
||||
<q-item
|
||||
v-if="roleAdmin && props.row.statusId === 'UN-CONTAIN'"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="editDetail(props.row, 'deferment')"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="blue"
|
||||
size="xs"
|
||||
name="mdi-account-alert-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>ขอผ่อนผัน</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-else-if="props.row.deferment === true &&
|
||||
props.row.statusId != 'DISCLAIM'
|
||||
" clickable v-close-popup @click="editDetail(props.row, 'defermentInfo')">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-icon color="blue" size="xs" name="mdi-account-details-outline" />
|
||||
<q-item
|
||||
v-else-if="
|
||||
props.row.deferment === true &&
|
||||
props.row.statusId != 'DISCLAIM'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="editDetail(props.row, 'defermentInfo')"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="blue"
|
||||
size="xs"
|
||||
name="mdi-account-details-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>ข้อมูลการผ่อนผัน</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item v-if="props.row.statusId === 'UN-CONTAIN' ||
|
||||
props.row.statusId === 'PREPARE-CONTAIN'
|
||||
" clickable v-close-popup @click="editDetail(props.row, 'disclaim')">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-icon color="pink" size="xs" name="mdi-account-cancel-outline" />
|
||||
<q-item
|
||||
v-if="
|
||||
props.row.statusId === 'UN-CONTAIN' ||
|
||||
props.row.statusId === 'PREPARE-CONTAIN'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="editDetail(props.row, 'disclaim')"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="pink"
|
||||
size="xs"
|
||||
name="mdi-account-cancel-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>สละสิทธิ์</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-else-if="props.row.statusId === 'DISCLAIM'" clickable v-close-popup
|
||||
@click="editDetail(props.row, 'disclaimInfo')">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-icon color="pink" size="xs" name="mdi-account-cancel-outline" />
|
||||
<q-item
|
||||
v-else-if="props.row.statusId === 'DISCLAIM'"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="editDetail(props.row, 'disclaimInfo')"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="pink"
|
||||
size="xs"
|
||||
name="mdi-account-cancel-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>ข้อมูลการสละสิทธิ์</q-item-section>
|
||||
</q-item>
|
||||
|
|
@ -721,26 +833,58 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</q-form>
|
||||
|
||||
<!-- เลือกหน่วยงานที่บรรจุ -->
|
||||
<DialogOrgTree v-model:modal="appointModal" :personalId="personalId" :close="clickCloseModalTree"
|
||||
:personal="personal" />
|
||||
<DialogOrgTree
|
||||
v-model:modal="appointModal"
|
||||
:personalId="personalId"
|
||||
:close="clickCloseModalTree"
|
||||
:personal="personal"
|
||||
/>
|
||||
|
||||
<!-- popup ขอผ่อนผัน / สละสิทธิ์ -->
|
||||
<q-form ref="myForm">
|
||||
<DialogCard v-model:Modal="modal" :personal-id="personalId" :close="clickClose" :validate="validateData" />
|
||||
<DialogCard
|
||||
v-model:Modal="modal"
|
||||
:personal-id="personalId"
|
||||
:close="clickClose"
|
||||
:validate="validateData"
|
||||
/>
|
||||
</q-form>
|
||||
<q-dialog v-model="modalDefermentDisclaim" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :title="`${modalDisclaim ? 'สละสิทธิ์' : 'ขอผ่อนผัน'} ${Name}`" :close="clickClose" />
|
||||
<DialogHeader
|
||||
:title="`${modalDisclaim ? 'สละสิทธิ์' : 'ขอผ่อนผัน'} ${Name}`"
|
||||
:close="clickClose"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input :class="getClass(edit)" hide-bottom-space :outlined="edit" dense lazy-rules
|
||||
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']" :readonly="!edit" :borderless="!edit" v-model="userNote"
|
||||
:label="`${'กรอกเหตุผล'}`" @update:model-value="clickEditRow" type="textarea" />
|
||||
<q-file v-if="getNumFile === 1" v-model="files" dense :label="`${'เลือกไฟล์เอกสารหลักฐาน'}`" outlined
|
||||
use-chips :rules="[(val) => !!val || 'กรุณาเลือกไฟล์เอกสารหลักฐาน']" multiple
|
||||
@update:model-value="clickEditRow" class="q-py-sm">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="userNote"
|
||||
:label="`${'กรอกเหตุผล'}`"
|
||||
@update:model-value="clickEditRow"
|
||||
type="textarea"
|
||||
/>
|
||||
<q-file
|
||||
v-if="getNumFile === 1"
|
||||
v-model="files"
|
||||
dense
|
||||
:label="`${'เลือกไฟล์เอกสารหลักฐาน'}`"
|
||||
outlined
|
||||
use-chips
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกไฟล์เอกสารหลักฐาน']"
|
||||
multiple
|
||||
@update:model-value="clickEditRow"
|
||||
class="q-py-sm"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" color="primary" />
|
||||
</template>
|
||||
|
|
@ -748,7 +892,11 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<DialogFooter :editvisible="true" :validate="validateData" :save="modalDisclaim ? saveDisclaim : saveDeferment" />
|
||||
<DialogFooter
|
||||
:editvisible="true"
|
||||
:validate="validateData"
|
||||
:save="modalDisclaim ? saveDisclaim : saveDeferment"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
@ -757,7 +905,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-dialog v-model="modalwaitInfo" persistent>
|
||||
<q-card style="width: 500px; max-width: 500px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :title="`${modalDisclaim ? 'สละสิทธิ์' : 'ขอผ่อนผัน'} ${Name}`" :close="clickClose" />
|
||||
<DialogHeader
|
||||
:title="`${modalDisclaim ? 'สละสิทธิ์' : 'ขอผ่อนผัน'} ${Name}`"
|
||||
:close="clickClose"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<div class="row">
|
||||
|
|
@ -767,8 +918,17 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<div v-if="!modalDisclaim" class="row q-pt-md">
|
||||
<div class="col-3 text-grey-7 q-mt-sm">เอกสารหลักฐาน</div>
|
||||
<div class="col-2 q-mt-sm">
|
||||
<q-btn type="a" :href="dataInfo.reliefDoc" color="primary" flat dense round size="14px" icon="mdi-download"
|
||||
target="_blank" />
|
||||
<q-btn
|
||||
type="a"
|
||||
:href="dataInfo.reliefDoc"
|
||||
color="primary"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-download"
|
||||
target="_blank"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
|
@ -780,30 +940,68 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<!-- dialog เพิ่มรายชื่อ -->
|
||||
<q-dialog v-model="modaladdlist">
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<DialogHeader title="ส่งรายชื่อไปยังหน่วยงาน" :close="clickCloseSendModal" />
|
||||
<DialogHeader
|
||||
title="ส่งรายชื่อไปยังหน่วยงาน"
|
||||
:close="clickCloseSendModal"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="row justify-end">
|
||||
<div class="col-5">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-input borderless outlined dense debounce="300" v-model="filterlistAdd" placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
v-model="filterlistAdd"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select v-model="visibleColumnslist" multiple outlined dense options-dense
|
||||
:display-value="$q.lang.table.columns" emit-value map-options :options="columns" option-value="name"
|
||||
options-cover style="min-width: 150px" class="gt-xs q-ml-sm" />
|
||||
<q-select
|
||||
v-model="visibleColumnslist"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-table flat bordered dense :rows="rowsFilter" :columns="columns" :filter="filterlistAdd" row-key="name"
|
||||
class="custom-header-table" selection="multiple" v-model:selected="selected" :pagination-label="paginationLabel"
|
||||
:visible-columns="visibleColumnslist">
|
||||
<q-table
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
:rows="rowsFilter"
|
||||
:columns="columns"
|
||||
:filter="filterlistAdd"
|
||||
row-key="name"
|
||||
class="custom-header-table"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
:pagination-label="paginationLabel"
|
||||
:visible-columns="visibleColumnslist"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<!-- <template v-slot:body-selection="scope">
|
||||
<q-checkbox
|
||||
|
|
@ -816,16 +1014,37 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-checkbox keep-color color="primary" dense v-model="props.selected" />
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
>
|
||||
<template v-if="col.name === 'position'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</template>
|
||||
<template v-else-if="col.name === 'fullName'" class="table_ellipsis">
|
||||
<template
|
||||
v-else-if="col.name === 'fullName'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
<div class="row col-12 text-no-wrap items-center">
|
||||
<img v-if="props.row.avatar == null" src="@/assets/avatar_user.jpg" class="col-4 img-info" />
|
||||
<img v-else :src="props.row.avatar" class="col-4 img-info" />
|
||||
<img
|
||||
v-if="props.row.avatar == null"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-4 img-info"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="props.row.avatar"
|
||||
class="col-4 img-info"
|
||||
/>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">{{ props.row.name }}</div>
|
||||
<div class="text-weight-light">
|
||||
|
|
@ -843,9 +1062,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</template>
|
||||
|
||||
<template v-else-if="col.name === 'organizationName'">
|
||||
<div v-if="props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
">
|
||||
<div
|
||||
v-if="
|
||||
props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
"
|
||||
>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{
|
||||
|
|
@ -853,20 +1075,20 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -878,14 +1100,19 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</div>
|
||||
</template>
|
||||
<template v-else-if="col.name === 'positionCandidate'">
|
||||
<div class="text-weight-medium" v-if="props.row.positionCandidate == null">
|
||||
<div
|
||||
class="text-weight-medium"
|
||||
v-if="props.row.positionCandidate == null"
|
||||
>
|
||||
-
|
||||
</div>
|
||||
<div class="text-weight-medium" v-else>
|
||||
{{ props.row.positionCandidate }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="col.name === 'reportingDate' && col.value !== '-'">
|
||||
<template
|
||||
v-else-if="col.name === 'reportingDate' && col.value !== '-'"
|
||||
>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.reportingDate }}
|
||||
</div>
|
||||
|
|
@ -911,14 +1138,26 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination v-model="pagination.page" color="primary" :max="scope.pagesNumber" :max-pages="5" size="sm"
|
||||
boundary-links direction-links></q-pagination>
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
color="primary"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn label="ส่งรายชื่อ" @click="savelist" :disable="checkSelected" color="public" />
|
||||
<q-btn
|
||||
label="ส่งรายชื่อ"
|
||||
@click="savelist"
|
||||
:disable="checkSelected"
|
||||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -101,20 +101,20 @@ const fetchData = async () => {
|
|||
.get(config.API.listRoundInsignia())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = data.map((e: FormProprsalsRound2) =>({
|
||||
period_id: e.period_id,
|
||||
period_name: e.period_name,
|
||||
period_year: e.period_year + 543,
|
||||
period_amount: e.period_amount,
|
||||
period_start: e.period_start == null ? null : date2Thai(new Date(e.period_start)),
|
||||
period_end: e.period_end == null ? null : date2Thai(new Date(e.period_end)),
|
||||
period_isActive: e.period_isActive,
|
||||
period_doc: e.period_doc,
|
||||
period_status: e.period_status.result
|
||||
})
|
||||
|
||||
);
|
||||
console.log(rows.value)
|
||||
rows.value = data.map((e: FormProprsalsRound2) => ({
|
||||
period_id: e.period_id,
|
||||
period_name: e.period_name,
|
||||
period_year: e.period_year + 543,
|
||||
period_amount: e.period_amount,
|
||||
period_start:
|
||||
e.period_start == null ? null : date2Thai(new Date(e.period_start)),
|
||||
period_end:
|
||||
e.period_end == null ? null : date2Thai(new Date(e.period_end)),
|
||||
period_isActive: e.period_isActive,
|
||||
period_doc: e.period_doc,
|
||||
period_status: e.period_status.result,
|
||||
}));
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -179,6 +179,16 @@ const getRequest = async (id: string) => {
|
|||
await fetchData();
|
||||
});
|
||||
};
|
||||
// filename: string
|
||||
const downloadFile = (response: any) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = "filename";
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
|
|
@ -288,10 +298,18 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="period_name" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_name"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.period_name }}
|
||||
</q-td>
|
||||
<q-td key="period_year" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_year"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.period_year }}
|
||||
</q-td>
|
||||
<q-td
|
||||
|
|
@ -301,10 +319,18 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
>
|
||||
{{ props.row.period_start }}
|
||||
</q-td>
|
||||
<q-td key="period_end" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_end"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.period_end }}
|
||||
</q-td>
|
||||
<q-td key="period_isActive" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_isActive"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
<q-icon
|
||||
v-if="props.row.period_isActive == true"
|
||||
name="mdi-close"
|
||||
|
|
@ -358,9 +384,10 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
target="_blank"
|
||||
round
|
||||
color="light-blue-8"
|
||||
:href="props.row.period_doc"
|
||||
icon="mdi-file-download"
|
||||
@click="downloadFile(props.row.period_doc)"
|
||||
>
|
||||
<!-- :href="props.row.period_doc" -->
|
||||
<q-tooltip>ดาวน์โหลดเอกสารประกอบ </q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
|||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const loadview = ref<boolean>(false);
|
||||
const round = ref<string>("");
|
||||
const roundName = ref<string>("");
|
||||
const optionRound = ref<any>([]);
|
||||
|
|
@ -39,7 +40,6 @@ const stat = ref<any>({
|
|||
onMounted(async () => {
|
||||
await checkRole();
|
||||
await fecthlistRound();
|
||||
await fecthAgency();
|
||||
});
|
||||
|
||||
const checkRole = async () => {
|
||||
|
|
@ -60,16 +60,19 @@ const checkRole = async () => {
|
|||
const fecthlistRound = async () => {
|
||||
await http
|
||||
.get(config.API.listRoundInsignia())
|
||||
.then((res: any) => {
|
||||
.then(async (res: any) => {
|
||||
optionRound.value = res.data.result.map((e: any) => ({
|
||||
id: e.period_id,
|
||||
year: e.period_year,
|
||||
name: e.period_name,
|
||||
}));
|
||||
const lastValue = optionRound.value[0];
|
||||
round.value = lastValue.id.toString();
|
||||
roundName.value = lastValue.name;
|
||||
fecthStat(round.value);
|
||||
if (optionRound.value.length !== 0) {
|
||||
const lastValue = optionRound.value[0];
|
||||
round.value = lastValue.id.toString();
|
||||
roundName.value = lastValue.name;
|
||||
await fecthStat(round.value);
|
||||
await fecthAgency();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
|
|
@ -120,6 +123,7 @@ const fecthType = async () => {
|
|||
name: e.organizationName,
|
||||
}));
|
||||
DataStore.fetchOption(optiontypeOc.value);
|
||||
loadview.value = true;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -294,7 +298,7 @@ const requestSendNote = async () => {
|
|||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
<q-card bordered class="row col-12 q-mt-sm">
|
||||
<q-card bordered class="row col-12 q-mt-sm" v-if="loadview">
|
||||
<div class="row col-12 items-center bg-grey-1">
|
||||
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
||||
<q-select
|
||||
|
|
@ -351,6 +355,13 @@ const requestSendNote = async () => {
|
|||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card v-else>
|
||||
<div class="q-pa-md q-gutter-sm">
|
||||
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</q-banner>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ const clickOpenpopup = () => {
|
|||
OrderTypeOption.value = props.OrderTypeOption.filter(
|
||||
(e: any) => e.name !== "ทั้งหมด"
|
||||
);
|
||||
reportType.value = OrderTypeOption.value[0].id;
|
||||
reportType.value = OrderTypeOption.value[0].name;
|
||||
let currentDate = new Date();
|
||||
let currentYear = currentDate.getFullYear();
|
||||
reportYear.value = currentYear;
|
||||
|
|
@ -89,7 +89,7 @@ const clickSearch = async () => {
|
|||
await myForm.value!.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
let body = {
|
||||
commandTypeId: reportType.value,
|
||||
commandType: reportType.value,
|
||||
year: reportYear.value,
|
||||
posno: reportNo.value,
|
||||
};
|
||||
|
|
@ -110,7 +110,7 @@ const clickSearch = async () => {
|
|||
position: e.position,
|
||||
}));
|
||||
} else {
|
||||
notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
||||
// notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
||||
rows.value = [];
|
||||
}
|
||||
})
|
||||
|
|
@ -188,7 +188,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
map-options
|
||||
:options="OrderTypeOption"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
option-value="name"
|
||||
:label="`${' ประเภท'}`"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue