ปรับแก้ไขเครื่องราช
This commit is contained in:
parent
64152f72d9
commit
7611d51974
11 changed files with 386 additions and 71 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
const reason = ref<string>("");
|
||||
const props = defineProps({
|
||||
|
|
@ -17,11 +17,16 @@ const props = defineProps({
|
|||
},
|
||||
clickClose: {
|
||||
type: Function,
|
||||
default: () => { }
|
||||
default: () => {},
|
||||
},
|
||||
savaForm: {
|
||||
type: Function,
|
||||
default: () => { }
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
watch(props, () => {
|
||||
if (props.modal === true) {
|
||||
reason.value = "";
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -29,7 +34,7 @@ const myForm = ref<any>();
|
|||
const submit = () => {
|
||||
myForm.value.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
props.savaForm(reason.value)
|
||||
props.savaForm(reason.value);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -40,16 +45,31 @@ const submit = () => {
|
|||
<q-card style="width: 500px; max-width: 500px">
|
||||
<q-toolbar class="q-py-md">
|
||||
<q-toolbar-title class="header-text">{{ props.title }}</q-toolbar-title>
|
||||
<q-btn icon="close" unelevated round dense @click="clickClose"
|
||||
style="color: #ff8080; background-color: #ffdede" />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="clickClose"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
|
||||
<q-separator />
|
||||
<q-form ref="myForm">
|
||||
<q-card-section class="q-p-sm">
|
||||
<div class="row col-12">
|
||||
<q-input type="textarea" class="full-width inputgreen cursor-pointer" hide-bottom-space outlined dense
|
||||
lazy-rules :rules="[(val) => !!val || `กรุณากรอก${label}`]" v-model="reason" :label="`${label}`" />
|
||||
<q-input
|
||||
type="textarea"
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => !!val || `กรุณากรอก${label}`]"
|
||||
v-model="reason"
|
||||
:label="`${label}`"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
|
|
@ -60,7 +80,6 @@ const submit = () => {
|
|||
<q-btn label="บันทึก" color="secondary" @click="submit" />
|
||||
</q-toolbar>
|
||||
</q-form>
|
||||
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,14 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
|||
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError, success } = mixin;
|
||||
const {
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
const $q = useQuasar();
|
||||
const DataStore = useInsigniaDataStore();
|
||||
|
||||
|
|
@ -29,6 +36,7 @@ const visibleColumns = ref<string[]>([
|
|||
"no",
|
||||
"citizenId",
|
||||
"name",
|
||||
"employeeType",
|
||||
"position",
|
||||
"level",
|
||||
"salary",
|
||||
|
|
@ -51,7 +59,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
field: "citizenId",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -66,6 +74,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
align: "left",
|
||||
label: "สถานภาพ",
|
||||
sortable: true,
|
||||
field: "employeeType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -225,6 +242,8 @@ const changtypeOc = () => {
|
|||
const clickmodalAdd = () => {
|
||||
showLoader();
|
||||
fecthlistRetire();
|
||||
fecthInsignia();
|
||||
insigniaType.value = "";
|
||||
};
|
||||
// fecth profile
|
||||
const fecthlistRetire = async () => {
|
||||
|
|
@ -257,14 +276,16 @@ const fecthlistperson = async (id: string) => {
|
|||
criterias: data,
|
||||
})
|
||||
.then((res) => {
|
||||
rows2.value = res.data.result.map((e: any) => ({
|
||||
let data = res.data.result.map((e: any) => ({
|
||||
id: e.id,
|
||||
fullname: e.fullname == null ? "-" : e.fullname,
|
||||
position: e.position == null ? "-" : e.position,
|
||||
level: e.positionEmployeeLevel == null ? "-" : e.positionEmployeeLevel,
|
||||
organizationOrganization: e.oc == null ? "-" : e.oc,
|
||||
ocId: DataStore.convertOcid(e.oc),
|
||||
}));
|
||||
modalAdd.value = true;
|
||||
rows2.value = data.filter((e: any) => e.ocId === DataStore.typeOc);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -274,20 +295,23 @@ const fecthlistperson = async (id: string) => {
|
|||
});
|
||||
};
|
||||
const clickAdd = async (id: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await addlistperson(id);
|
||||
},
|
||||
"ยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ",
|
||||
"ต้องการยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ นี้หรือไม่ ?"
|
||||
);
|
||||
if (insigniaType.value !== "") {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await addlistperson(id);
|
||||
},
|
||||
"ยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ",
|
||||
"ต้องการยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ นี้หรือไม่ ?"
|
||||
);
|
||||
} else dialogMessageNotify($q, "กรุณาเลือกรายชื่อขอพระราชทานเครื่องราชฯ");
|
||||
};
|
||||
|
||||
const addlistperson = async (id: string) => {
|
||||
showLoader();
|
||||
let data = {
|
||||
profileId: id,
|
||||
insigniaId: insigniaType.value,
|
||||
insigniaPeriodId: props.roundId,
|
||||
};
|
||||
await http
|
||||
|
|
@ -493,13 +517,13 @@ const resetFilter = () => {
|
|||
filterRef.value.focus();
|
||||
};
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
sortBy: "name",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const pagination2 = ref({
|
||||
sortBy: "desc",
|
||||
sortBy: "name",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
|
|
@ -557,6 +581,27 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
style="min-width: 150px"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
/>
|
||||
<div>
|
||||
<q-select
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'สถานภาพ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="DataStore.employeeClassOps"
|
||||
option-value="id"
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.selectEmployeeClass(DataStore.employeeClass)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<q-btn size="md" icon="mdi-download" flat round color="primary">
|
||||
<!-- @click="downloadReport('pdf')" -->
|
||||
|
|
@ -591,6 +636,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
color="add"
|
||||
icon="mdi-plus"
|
||||
@click="clickmodalAdd"
|
||||
v-if="DataStore.isLock !== true"
|
||||
>
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -655,7 +701,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
<q-th auto-width v-if="DataStore.isLock !== true" />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -673,6 +719,9 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
<q-td key="name" :props="props">
|
||||
{{ props.row.name }}
|
||||
</q-td>
|
||||
<q-td key="employeeType" :props="props">
|
||||
{{ props.row.employeeType }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props">
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
|
|
@ -694,7 +743,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
<q-td key="dateSend" :props="props">
|
||||
{{ props.row.dateSend }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-td auto-width v-if="DataStore.isLock !== true">
|
||||
<q-btn
|
||||
v-if="
|
||||
roleUser == 'admin' ||
|
||||
|
|
@ -790,6 +839,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
<q-card style="width: 850px; max-width: 80vw" class="q-pb-md">
|
||||
<q-toolbar class="q-py-md">
|
||||
<q-toolbar-title class="text-h6">เพิ่มรายชื่อ </q-toolbar-title>
|
||||
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
|
|
@ -802,15 +852,33 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
<q-separator />
|
||||
<div class="q-pa-md">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-select
|
||||
v-model="insigniaType"
|
||||
label="ปรเภทเครื่องราชฯ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="insigniaOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 250px"
|
||||
/>
|
||||
<q-space />
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
v-model="filterKeyword2"
|
||||
>
|
||||
<!-- style="width: 850px; max-width: auto"? -->
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ const visibleColumns = ref<string[]>([
|
|||
"no",
|
||||
"citizenId",
|
||||
"name",
|
||||
"employeeType",
|
||||
"position",
|
||||
"level",
|
||||
"salary",
|
||||
|
|
@ -52,7 +53,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
field: "citizenId",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -67,6 +68,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
align: "left",
|
||||
label: "สถานภาพ",
|
||||
sortable: true,
|
||||
field: "employeeType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -76,6 +86,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "level",
|
||||
align: "left",
|
||||
|
|
@ -172,7 +183,7 @@ const resetFilter = () => {
|
|||
filterRef.value.focus();
|
||||
};
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
sortBy: "name",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
|
|
@ -237,6 +248,27 @@ const closeReson = () => {
|
|||
style="min-width: 150px"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
/>
|
||||
<div>
|
||||
<q-select
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'สถานภาพ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="DataStore.employeeClassOps"
|
||||
option-value="id"
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.selectEmployeeClass(DataStore.employeeClass)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
|
|
@ -315,6 +347,9 @@ const closeReson = () => {
|
|||
<q-td key="name" :props="props">
|
||||
{{ props.row.name }}
|
||||
</q-td>
|
||||
<q-td key="employeeType" :props="props">
|
||||
{{ props.row.employeeType }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props">
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
|
|
@ -324,7 +359,6 @@ const closeReson = () => {
|
|||
<q-td key="salary" :props="props">
|
||||
{{ Number(props.row.salary).toLocaleString() }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="insigniaType" :props="props">
|
||||
{{ props.row.insigniaType }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ const visibleColumns = ref<string[]>([
|
|||
"no",
|
||||
"citizenId",
|
||||
"name",
|
||||
"employeeType",
|
||||
"position",
|
||||
"level",
|
||||
"salary",
|
||||
|
|
@ -53,7 +54,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
field: "citizenId",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -68,6 +69,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "employeeType",
|
||||
align: "left",
|
||||
label: "สถานภาพ",
|
||||
sortable: true,
|
||||
field: "employeeType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -171,7 +181,7 @@ const resetFilter = () => {
|
|||
filterRef.value.focus();
|
||||
};
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
sortBy: "name",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
|
|
@ -235,6 +245,27 @@ const closeReson = () => {
|
|||
style="min-width: 150px"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
/>
|
||||
<div>
|
||||
<q-select
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'สถานภาพ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="DataStore.employeeClassOps"
|
||||
option-value="id"
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.selectEmployeeClass(DataStore.employeeClass)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
|
|
@ -313,6 +344,9 @@ const closeReson = () => {
|
|||
<q-td key="name" :props="props">
|
||||
{{ props.row.name }}
|
||||
</q-td>
|
||||
<q-td key="employeeType" :props="props">
|
||||
{{ props.row.employeeType }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props">
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ const fecthOrg = async () => {
|
|||
};
|
||||
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
sortBy: "name",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
|
|
|
|||
|
|
@ -138,8 +138,9 @@ const changround = async () => {
|
|||
const roundFilter = await optionRound.value.find(
|
||||
(x: any) => round.value === x.id
|
||||
);
|
||||
roundName.value = `รอบการเสนอขอพระราชทานเครื่องราชปี ${roundFilter.year + 543
|
||||
}`;
|
||||
roundName.value = `รอบการเสนอขอพระราชทานเครื่องราชปี ${
|
||||
roundFilter.year + 543
|
||||
}`;
|
||||
};
|
||||
const requestNote = ref<string>("");
|
||||
const requestStatus = ref<string>("");
|
||||
|
|
@ -153,10 +154,11 @@ const fecthInsigniaByOc = async (
|
|||
await http
|
||||
.get(config.API.insigniaList(roundId, ocId, role, status))
|
||||
.then(async (res) => {
|
||||
console.log(res);
|
||||
requestNote.value = res.data.result.requestNote;
|
||||
requestStatus.value = res.data.result.requestStatus;
|
||||
|
||||
await DataStore.fetchData(res.data.result.items);
|
||||
DataStore.isLock = await res.data.result.isLock;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -293,76 +295,173 @@ const requestSendNote = async () => {
|
|||
<q-card bordered class="row col-12 q-mt-sm">
|
||||
<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 borderless dense v-model="round" :options="optionRound" map-options emit-value option-value="id"
|
||||
option-label="name" @update:model-value="changround" />
|
||||
<q-select
|
||||
borderless
|
||||
dense
|
||||
v-model="round"
|
||||
:options="optionRound"
|
||||
map-options
|
||||
emit-value
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="changround"
|
||||
/>
|
||||
|
||||
<q-space />
|
||||
<!-- สกจ. Freez ข้อมูล -->
|
||||
<q-btn v-if="roleUser == 'admin'" dense unelevated label="ล็อกข้อมูล" color="public" class="q-px-md q-ml-md"
|
||||
@click="requestSendNote">
|
||||
<q-btn
|
||||
v-if="roleUser == 'admin'"
|
||||
dense
|
||||
unelevated
|
||||
label="ล็อกข้อมูล"
|
||||
color="public"
|
||||
class="q-px-md q-ml-md"
|
||||
@click="requestSendNote"
|
||||
>
|
||||
<q-tooltip>ล็อกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div v-if="roleUser == 'admin'" class="col-12 row bg-white">
|
||||
<div class="fit q-px-md q-py-sm">
|
||||
<div class="row col-12 q-col-gutter-sm fit">
|
||||
<cardTop :amount="stat.orgAllCount" label="หน่วยงานทั้งหมด" color="#016987" />
|
||||
<cardTop :amount="stat.orgSendCount" label="หน่วยงานที่ส่งรายชื่อเเล้ว" color="#02A998" />
|
||||
<cardTop :amount="stat.orgNoSendCount" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" color="#2EA0FF" />
|
||||
<cardTop :amount="stat.allUserUser" label="จำนวนคนที่ยื่นขอ" color="#4154B3" />
|
||||
<cardTop
|
||||
:amount="stat.orgAllCount"
|
||||
label="หน่วยงานทั้งหมด"
|
||||
color="#016987"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.orgSendCount"
|
||||
label="หน่วยงานที่ส่งรายชื่อเเล้ว"
|
||||
color="#02A998"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.orgNoSendCount"
|
||||
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
|
||||
color="#2EA0FF"
|
||||
/>
|
||||
<cardTop
|
||||
:amount="stat.allUserUser"
|
||||
label="จำนวนคนที่ยื่นขอ"
|
||||
color="#4154B3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
|
||||
<div v-if="roleUser == 'insignia1' && requestStatus == 'st4'" class="q-pa-md q-gutter-sm">
|
||||
<q-banner inline-actions bordered class="bg-orange-1 text-orange border-orange">
|
||||
<div
|
||||
v-if="roleUser == 'insignia1' && requestStatus == 'st4'"
|
||||
class="q-pa-md q-gutter-sm"
|
||||
>
|
||||
<q-banner
|
||||
inline-actions
|
||||
bordered
|
||||
class="bg-orange-1 text-orange border-orange"
|
||||
>
|
||||
<q-icon name="mdi-information-outline" size="20px" /> หมายเหตุ ตีกลับ
|
||||
{{ requestNote }}
|
||||
</q-banner>
|
||||
</div>
|
||||
<div class="row col-12">
|
||||
<q-tabs v-model="tab" dense class="text-grey" active-color="primary" active-class="bg-teal-1"
|
||||
indicator-color="primary" align="left">
|
||||
<q-tabs
|
||||
v-model="tab"
|
||||
dense
|
||||
class="text-grey"
|
||||
active-color="primary"
|
||||
active-class="bg-teal-1"
|
||||
indicator-color="primary"
|
||||
align="left"
|
||||
>
|
||||
<q-tab name="pending" label="คนที่ยื่นขอ" />
|
||||
<q-tab name="reject" label="คนที่ไม่ยื่นขอ" />
|
||||
<q-tab name="delete" label="คนที่ถูกลบออก" />
|
||||
<q-tab v-if="roleUser == 'admin'" name="organization" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" />
|
||||
<q-tab
|
||||
v-if="roleUser == 'admin'"
|
||||
name="organization"
|
||||
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
|
||||
/>
|
||||
</q-tabs>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
<q-tab-panel name="pending" class="q-pa-none">
|
||||
<tab1 :tab="tab" :roundId="round" :roundName="roundName" :fecthInsigniaByOc="fecthInsigniaByOc"
|
||||
:role-user="roleUser" :request-status="requestStatus" />
|
||||
<tab1
|
||||
:tab="tab"
|
||||
:roundId="round"
|
||||
:roundName="roundName"
|
||||
:fecthInsigniaByOc="fecthInsigniaByOc"
|
||||
:role-user="roleUser"
|
||||
:request-status="requestStatus"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="reject" class="q-pa-none">
|
||||
<tab2 :tab="tab" :roundId="round" :fecthInsigniaByOc="fecthInsigniaByOc" :role-user="roleUser" />
|
||||
<tab2
|
||||
:tab="tab"
|
||||
:roundId="round"
|
||||
:fecthInsigniaByOc="fecthInsigniaByOc"
|
||||
:role-user="roleUser"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="delete" class="q-pa-none">
|
||||
<tab3 :tab="tab" :roundId="round" :fecthInsigniaByOc="fecthInsigniaByOc" :role-user="roleUser" />
|
||||
<tab3
|
||||
:tab="tab"
|
||||
:roundId="round"
|
||||
:fecthInsigniaByOc="fecthInsigniaByOc"
|
||||
:role-user="roleUser"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel v-if="roleUser == 'admin'" name="organization" class="q-pa-none">
|
||||
<q-tab-panel
|
||||
v-if="roleUser == 'admin'"
|
||||
name="organization"
|
||||
class="q-pa-none"
|
||||
>
|
||||
<tab4 :tab="tab" :roundId="round" :role-user="roleUser" />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
|
||||
<q-toolbar class="q-py-md text-right">
|
||||
<q-space />
|
||||
<q-btn v-if="roleUser == 'insignia1' &&
|
||||
(requestStatus == 'st1' || requestStatus == 'st4')
|
||||
" dense unelevated label="บันทึกข้อมูล" color="public" class="q-px-md" @click="sendToDirector" />
|
||||
<q-btn v-if="roleUser == 'insignia2' && requestStatus == 'st3'" dense unelevated label="ตีกลับ" color="orange"
|
||||
class="q-px-md" @click="popupBackToEdit" />
|
||||
<q-btn v-if="roleUser == 'insignia2' && requestStatus == 'st3'" dense unelevated label="อนุมัติ" color="positive"
|
||||
class="q-px-md q-ml-md" @click="directorApproved" />
|
||||
<q-btn
|
||||
v-if="
|
||||
roleUser == 'insignia1' &&
|
||||
(requestStatus == 'st1' || requestStatus == 'st4')
|
||||
"
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึกข้อมูล"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
@click="sendToDirector"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="roleUser == 'insignia2' && requestStatus == 'st3'"
|
||||
dense
|
||||
unelevated
|
||||
label="ตีกลับ"
|
||||
color="orange"
|
||||
class="q-px-md"
|
||||
@click="popupBackToEdit"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="roleUser == 'insignia2' && requestStatus == 'st3'"
|
||||
dense
|
||||
unelevated
|
||||
label="อนุมัติ"
|
||||
color="positive"
|
||||
class="q-px-md q-ml-md"
|
||||
@click="directorApproved"
|
||||
/>
|
||||
</q-toolbar>
|
||||
|
||||
<DialogPopupReason :modal="modalPopupBackToEdit" title="หมายเหตุการตีกลับ" label="หมายเหตุ"
|
||||
:click-close="closeModalPopupBackToEdit" :savaForm="backToEdit" />
|
||||
<DialogPopupReason
|
||||
:modal="modalPopupBackToEdit"
|
||||
title="หมายเหตุการตีกลับ"
|
||||
label="หมายเหตุ"
|
||||
:click-close="closeModalPopupBackToEdit"
|
||||
:savaForm="backToEdit"
|
||||
/>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
field: "citizenId",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -350,6 +350,17 @@ const resetFilter = () => {
|
|||
filter.value = "";
|
||||
filterRef.value!.focus();
|
||||
};
|
||||
const pagination = ref({
|
||||
sortBy: "name",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const paging = ref<boolean>(true);
|
||||
const paginationLabel = (start: number, end: number, total: number) => {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -498,6 +509,8 @@ const resetFilter = () => {
|
|||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:body-cell="props">
|
||||
<q-td :props="props">
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ const mixin = useCounterMixin();
|
|||
const { date2Thai } = mixin;
|
||||
|
||||
export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||
const isLock = ref<boolean>(false)
|
||||
let optionsTypeOc = ref<any>([]);
|
||||
let typeOc = ref<string>("");
|
||||
const agency = ref<string>("");
|
||||
|
|
@ -13,6 +14,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
const listinsignia = ref<any>([]);
|
||||
const typeinsignia = ref<number | string>("all");
|
||||
let typeinsigniaOptions = ref<any>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const employeeClass = ref<string>("all");
|
||||
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
|
||||
|
||||
const typeReport = ref<string>("");
|
||||
const titleReport = ref<string>("");
|
||||
|
|
@ -23,8 +26,10 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
};
|
||||
|
||||
const fetchData = async (data: any) => {
|
||||
console.log(data);
|
||||
|
||||
if (data !== null) {
|
||||
rows.value = await data.map((e: any) => ({
|
||||
let datalist = await data.map((e: any) => ({
|
||||
id: e.id,
|
||||
citizenId: e.citizenId,
|
||||
profileId: e.profileId,
|
||||
|
|
@ -38,8 +43,10 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
insigniaLevel: e.level,
|
||||
dateSend: date2Thai(e.requestDate),
|
||||
requestNote: e.requestNote,
|
||||
employeeType: profileType(e.profileType),
|
||||
}));
|
||||
listinsignia.value = await rows.value;
|
||||
rows.value = await datalist
|
||||
listinsignia.value = await datalist;
|
||||
filtertypeInsignia();
|
||||
} else rows.value = [];
|
||||
};
|
||||
|
|
@ -81,6 +88,29 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
}
|
||||
}
|
||||
};
|
||||
const selectEmployeeClass = (employeeClass: string) => {
|
||||
if (employeeClass == "officer") {
|
||||
let list = listinsignia.value.filter((e: any) => e.employeeType === "ข้าราชการ กทม.สามัญ")
|
||||
rows.value = list
|
||||
} else if (employeeClass === "perm") {
|
||||
let list = listinsignia.value.filter((e: any) => e.employeeType === "ลูกจ้างประจำ")
|
||||
rows.value = list
|
||||
} else rows.value = listinsignia.value
|
||||
}
|
||||
const convertOcid = (oc: string) => {
|
||||
let ocdata = optionsTypeOc.value.find((e: any) => e.name === oc)
|
||||
if (ocdata) {
|
||||
return ocdata.id
|
||||
} else return ""
|
||||
}
|
||||
const profileType = (val: string) => {
|
||||
switch (val) {
|
||||
case "officer":
|
||||
return "ข้าราชการ กทม.สามัญ";
|
||||
case "employee":
|
||||
return "ลูกจ้างประจำ";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
optionsTypeOc,
|
||||
|
|
@ -93,7 +123,12 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
fetchOption,
|
||||
searchFilterTable,
|
||||
setTypeandTitle,
|
||||
convertOcid,
|
||||
typeReport,
|
||||
titleReport,
|
||||
selectEmployeeClass,
|
||||
employeeClass,
|
||||
employeeClassOps,
|
||||
isLock
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
field: "citizenId",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -358,6 +358,17 @@ const resetFilter = () => {
|
|||
filter.value = "";
|
||||
filterRef.value!.focus();
|
||||
};
|
||||
const pagination = ref({
|
||||
sortBy: "name",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const paging = ref<boolean>(true);
|
||||
const paginationLabel = (start: number, end: number, total: number) => {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -598,6 +609,8 @@ const resetFilter = () => {
|
|||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:body-cell="props">
|
||||
<q-td :props="props">
|
||||
|
|
|
|||
|
|
@ -416,8 +416,8 @@ const fecthExamRoundOption = async (commandCode: string) => {
|
|||
};
|
||||
|
||||
const submit = async () => {
|
||||
console.log(nameCommand.value);
|
||||
console.log(CommandOption.value);
|
||||
// console.log(nameCommand.value);
|
||||
// console.log(CommandOption.value);
|
||||
|
||||
let signBy = null;
|
||||
if (!nameCommand.value.length) {
|
||||
|
|
|
|||
|
|
@ -172,9 +172,9 @@ const statuscode = computed(() => {
|
|||
orderTypeCode.value === "c-pm-14" ||
|
||||
orderTypeCode.value === "c-pm-21"
|
||||
) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
const dialogDeleteData = async (id: string) => {
|
||||
dialogRemove($q, () => deleteData(id));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue