Merge branch 'develop' into dev-tee
This commit is contained in:
commit
c87d8079ec
23 changed files with 1443 additions and 694 deletions
|
|
@ -154,22 +154,43 @@
|
|||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-btn round flat color="blue" icon="mdi-file-document">
|
||||
<q-btn
|
||||
round
|
||||
flat
|
||||
color="blue"
|
||||
icon="mdi-file-document"
|
||||
v-if="profileType == 'officer' || profileType == 'employee'"
|
||||
>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-list dense style="min-width: 160px">
|
||||
<q-item clickable v-close-popup @click="helpPost">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="helpPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ช่วยราชการ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="repatriationPost">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="repatriationPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ส่งตัวกลับ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="appointPost">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="appointPost"
|
||||
v-if="profileType == 'officer' || profileType == 'employee'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>แต่งตั้ง-เลื่อน-ย้าย</q-item-section>
|
||||
|
|
@ -181,31 +202,56 @@
|
|||
<q-item-section>ย้าย</q-item-section>
|
||||
</q-item>
|
||||
<q-separator /> -->
|
||||
<q-item clickable v-close-popup @click="clickPassaway">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickPassaway"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ถึงแก่กรรม</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="outPost">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="outPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ให้ออกจากราชการ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="dischargePost">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="dischargePost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ปลดออกจากราชการ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="expulsionPost">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="expulsionPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>ไล่ออกจากราชการ</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item clickable v-close-popup @click="otherPost">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="otherPost"
|
||||
v-if="profileType == 'officer'"
|
||||
>
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
</q-item-section>
|
||||
<q-item-section>อื่นๆ</q-item-section>
|
||||
|
|
@ -823,7 +869,6 @@ const fetchData = async () => {
|
|||
.get(config.API.profileAvatarId(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
fullname.value = data.fullname;
|
||||
imageUrl.value = data.avatar;
|
||||
position.value = data.position;
|
||||
|
|
|
|||
|
|
@ -4,18 +4,22 @@ import type { QTableProps } from "quasar";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store"
|
||||
import Dialogbody from "@/modules/05_placement/components/AppointMent/Dialogbody.vue"
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import Dialogbody from "@/modules/05_placement/components/AppointMent/Dialogbody.vue";
|
||||
import DialogOrgTree from "@/modules/05_placement/components/AppointMent/AppointmentModal.vue";
|
||||
import type { listAppointType,resData,orgFilter } from "@/modules/05_placement/interface/response/AppointMent"
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main"
|
||||
import type {
|
||||
listAppointType,
|
||||
resData,
|
||||
orgFilter,
|
||||
} from "@/modules/05_placement/interface/response/AppointMent";
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const modal = ref<boolean>(false);
|
||||
const storeFn = useTransferDataStore();
|
||||
const { statusText } = storeFn
|
||||
const { statusText } = storeFn;
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const {
|
||||
showLoader,
|
||||
|
|
@ -167,15 +171,30 @@ const fecthlistappointment = async () => {
|
|||
status: statusText(e.status),
|
||||
createdAt: date2Thai(e.createdAt),
|
||||
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
|
||||
educationOld: e.educationOld,
|
||||
organizationPositionOld: e.organizationPositionOld,
|
||||
positionTypeOld: e.positionTypeOld,
|
||||
positionLevelOld: e.positionLevelOld,
|
||||
positionNumberOld: e.positionNumberOld,
|
||||
salary: e.salary,
|
||||
positionDate: e.positionDate,
|
||||
}));
|
||||
rows2.value = rows.value.filter(
|
||||
(e: orgFilter) =>
|
||||
e.orgName !== null &&
|
||||
e.status !== "ส่งรายชื่อไปออกคำสั่ง" &&
|
||||
e.status !== "ออกคำสั่งเสร็จแล้ว"
|
||||
e.status !== "ออกคำสั่งเสร็จแล้ว" &&
|
||||
e.educationOld &&
|
||||
e.organizationPositionOld &&
|
||||
e.positionTypeOld &&
|
||||
e.positionLevelOld &&
|
||||
e.positionNumberOld &&
|
||||
e.salary !== null &&
|
||||
e.positionDate
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -241,7 +260,6 @@ const nextPage = (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
fecthlistappointment();
|
||||
});
|
||||
|
|
@ -255,27 +273,65 @@ onMounted(() => {
|
|||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<div class="row col-12">
|
||||
<q-btn @click="popup()" size="14px" flat round color="add" icon="mdi-account-arrow-right">
|
||||
<q-btn
|
||||
@click="popup()"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งแต่งตั้ง-เลื่อน-ย้าย</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-space />
|
||||
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined
|
||||
debounce="300" placeholder="ค้นหา">
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select v-model="visibleColumns" 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="col-xs-12 col-sm-3 col-md-2 q-ml-sm" />
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
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="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="citizenId"
|
||||
:visible-columns="visibleColumns" v-model:pagination="pagination">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="citizenId"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -286,27 +342,60 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="no"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="citizenId" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="citizenId"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.citizenId }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="organizationName" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<div v-if="props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
">
|
||||
<q-td
|
||||
key="organizationName"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
<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.orgName !== null ? props.row.orgName : "-"
|
||||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.positionPath !== null ? props.row.positionPath : "-" }}
|
||||
{{ props.row.positionNumber !== null ? `(${props.row.positionNumber})` : "" }}
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -316,29 +405,73 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="birthday" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="birthday"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.birthday }}
|
||||
</q-td>
|
||||
<q-td key="createdAt" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="createdAt"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.createdAt }}
|
||||
</q-td>
|
||||
<q-td key="status" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="status"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.status }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn v-if="props.row.status !== 'ส่งรายชื่อไปออกคำสั่ง' &&
|
||||
props.row.status !== 'ออกคำสั่งแล้ว'
|
||||
" icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense>
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||
<q-btn
|
||||
v-if="
|
||||
props.row.status !== 'ส่งรายชื่อไปออกคำสั่ง' &&
|
||||
props.row.status !== 'ออกคำสั่งแล้ว'
|
||||
"
|
||||
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 clickable v-close-popup @click="openModalTree(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
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openModalTree(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-item clickable v-close-popup @click="clickDelete(props.row.personalId)">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickDelete(props.row.personalId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-icon color="red" size="xs" name="mdi-delete" />
|
||||
</q-item-section>
|
||||
|
|
@ -366,6 +499,11 @@ onMounted(() => {
|
|||
:nextPage="nextPage"
|
||||
:fecthlistappointment="fecthlistappointment"
|
||||
/>
|
||||
<DialogOrgTree v-model:modal="modalTree" :close="closeModalTree" :personal="personal" :personalId="personalId" />
|
||||
<DialogOrgTree
|
||||
v-model:modal="modalTree"
|
||||
:close="closeModalTree"
|
||||
:personal="personal"
|
||||
:personalId="personalId"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ function filterFnYear(val: string, update: any) {
|
|||
</template>
|
||||
</q-select>
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
class="col-xs-12 col-sm-3 col-md-3"
|
||||
v-model="examType"
|
||||
label="ประเภทการสอบ"
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed,watchEffect } from "vue";
|
||||
import { ref, computed, watchEffect } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -25,8 +25,8 @@ const props = defineProps({
|
|||
fecthlistOthet: Function,
|
||||
optionsType: Array,
|
||||
rows2: Array,
|
||||
filterKeyword2:String,
|
||||
type:String,
|
||||
filterKeyword2: String,
|
||||
type: String,
|
||||
});
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
|
|
@ -96,7 +96,6 @@ const emit = defineEmits([
|
|||
"update:filterKeyword2",
|
||||
"update:type",
|
||||
"update:selected",
|
||||
|
||||
]);
|
||||
const updateInput = (value: any) => {
|
||||
emit("update:filterKeyword2", value);
|
||||
|
|
@ -107,7 +106,7 @@ const updateInputType = (value: any) => {
|
|||
};
|
||||
//รีเซ็ตค่าในช่องค้นหา
|
||||
const Reset = () => {
|
||||
emit("update:filterKeyword2", "");
|
||||
emit("update:filterKeyword2", "");
|
||||
};
|
||||
//เปิด modal ยืนยัน
|
||||
const clickAddlist = () => {
|
||||
|
|
@ -117,7 +116,7 @@ const clickAddlist = () => {
|
|||
//อัพเดต ส่งไปออกคำสั่ง
|
||||
const addOther = async () => {
|
||||
let pId: string[] = [];
|
||||
let Type = props.type as string
|
||||
let Type = props.type as string;
|
||||
selected.value.forEach((e: any) => {
|
||||
pId.push(e.personalId);
|
||||
});
|
||||
|
|
@ -136,7 +135,7 @@ const addOther = async () => {
|
|||
.finally(() => {
|
||||
props.fecthlistOthet?.();
|
||||
selected.value = [];
|
||||
props.clickClose?.()
|
||||
props.clickClose?.();
|
||||
});
|
||||
};
|
||||
watchEffect(() => {
|
||||
|
|
@ -144,6 +143,23 @@ watchEffect(() => {
|
|||
selected.value = [];
|
||||
}
|
||||
});
|
||||
// filter OptionsType
|
||||
const OptionsTypeFn = ref<any>([]);
|
||||
function filterFnOptionsType(val: string, update: any) {
|
||||
if (val == "") {
|
||||
update(() => {
|
||||
OptionsTypeFn.value = props.optionsType;
|
||||
});
|
||||
} else {
|
||||
update(() => {
|
||||
if (props.optionsType) {
|
||||
OptionsTypeFn.value = props.optionsType.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -160,14 +176,23 @@ watchEffect(() => {
|
|||
dense
|
||||
:model-value="type"
|
||||
@update:model-value="updateInputType"
|
||||
:options="optionsType"
|
||||
:options="OptionsTypeFn"
|
||||
label="ประเภทคำสั่ง"
|
||||
style="width: 400px; max-width: auto"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
/>
|
||||
use-input
|
||||
@filter="filterFnOptionsType"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
|
|
@ -232,7 +257,6 @@ watchEffect(() => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
|
|
|
|||
|
|
@ -150,9 +150,19 @@ const fecthlistOthet = async () => {
|
|||
status: r.status ?? "-",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""}${r.firstname ?? ""} ${r.lastname ?? ""}`,
|
||||
amountOld: r.amountOld,
|
||||
positionDate: r.positionDate,
|
||||
}));
|
||||
rows2.value = rows.value.filter(
|
||||
(e: listMain) => e.status !== "REPORT" && e.status !== "DONE"
|
||||
(e: listMain) =>
|
||||
e.status !== "REPORT" &&
|
||||
e.status !== "DONE" &&
|
||||
e.organizationPositionOld &&
|
||||
e.positionTypeOld &&
|
||||
e.positionLevelOld &&
|
||||
e.positionNumberOld &&
|
||||
e.amountOld !== null &&
|
||||
e.positionDate
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -52,8 +52,15 @@ const popup = () => {
|
|||
(r.status == "WAITTING" ||
|
||||
r.status == "PENDING" ||
|
||||
r.status == "APPROVE") &&
|
||||
r.positionNumber != null
|
||||
r.positionNumber != null &&
|
||||
r.educationOld &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.amountOld !== null
|
||||
);
|
||||
|
||||
rows2.value = row;
|
||||
modal.value = true;
|
||||
};
|
||||
|
|
@ -147,27 +154,28 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
//save file
|
||||
//save file
|
||||
const SaveData = async () => {
|
||||
myForm.value.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
const formData = new FormData();
|
||||
formData.append("File", files.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receiveFile(personalId.value), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await clickCloseUpload();
|
||||
hideLoader();
|
||||
|
||||
});
|
||||
}})};
|
||||
const formData = new FormData();
|
||||
formData.append("File", files.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receiveFile(personalId.value), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await clickCloseUpload();
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const fecthlistRecevice = async () => {
|
||||
showLoader();
|
||||
|
|
@ -175,6 +183,7 @@ const fecthlistRecevice = async () => {
|
|||
.get(config.API.receiveData())
|
||||
.then((res: any) => {
|
||||
const response = res.data.result;
|
||||
|
||||
listRecevice.value = response;
|
||||
let list: ResponseRow[] = [];
|
||||
response.map((e: ResponseData) => {
|
||||
|
|
@ -194,12 +203,23 @@ const fecthlistRecevice = async () => {
|
|||
organizationShortName: e.organizationShortName,
|
||||
positionNumber: e.positionNumber,
|
||||
positionPath: e.positionPath,
|
||||
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth) &&
|
||||
e.dateOfBirth.toString() === "0001-01-01T00:00:00" ? "-" : date2Thai(e.dateOfBirth),
|
||||
birthday:
|
||||
e.dateOfBirth == null
|
||||
? "-"
|
||||
: date2Thai(e.dateOfBirth) &&
|
||||
e.dateOfBirth.toString() === "0001-01-01T00:00:00"
|
||||
? "-"
|
||||
: date2Thai(e.dateOfBirth),
|
||||
status: e.status,
|
||||
statusText: statusText(e.status ?? ""),
|
||||
createdAt: e.createdAt !== null ? new Date(e.createdAt) : null,
|
||||
dateText: e.createdAt !== null ? date2Thai(e.createdAt) : "-",
|
||||
educationOld: e.educationOld ?? "",
|
||||
organizationPositionOld: e.organizationPositionOld ?? "",
|
||||
positionTypeOld: e.positionTypeOld,
|
||||
positionLevelOld: e.positionLevelOld,
|
||||
positionNumberOld: e.positionNumberOld,
|
||||
amountOld: e.amountOld,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
@ -231,7 +251,7 @@ const clickClose = () => {
|
|||
// ปิดโมเดลอัปเดตไฟล์
|
||||
const clickCloseUpload = () => {
|
||||
modalupload.value = false;
|
||||
files.value = null
|
||||
files.value = null;
|
||||
};
|
||||
// ปิดโมเดลโครงสร้าง
|
||||
const openModalTree = (id: string) => {
|
||||
|
|
@ -292,26 +312,62 @@ onMounted(() => {
|
|||
<q-btn flat round color="primary" @click="add" icon="mdi-plus">
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn size="14px" flat round color="add" icon="mdi-account-arrow-right" @click="popup()" >
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
@click="popup()"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งรับโอน</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword"
|
||||
ref="filterRef" outlined debounce="300" placeholder="ค้นหา" >
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select v-model="visibleColumns" 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="col-xs-12 col-sm-3 col-md-2 q-ml-sm" />
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
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="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="fullname"
|
||||
:visible-columns="visibleColumns" >
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="fullname"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -322,25 +378,60 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="no"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="citizenId" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="citizenId"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.citizenId }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="organizationName" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<div v-if=" props.row.orgName !== null || props.row.positionPath !== null " >
|
||||
<q-td
|
||||
key="organizationName"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
<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.orgName !== null ? props.row.orgName : "-"
|
||||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.positionPath !== null ? props.row.positionPath : "-" }}
|
||||
{{ props.row.positionNumber !== null ? `(${props.row.positionNumber})` : "" }}
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -350,46 +441,119 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="birthday" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="birthday"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.birthday }}
|
||||
</q-td>
|
||||
<q-td key="dateText" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="dateText"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.dateText }}
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="statusText"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.statusText }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<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-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 clickable v-close-popup @click="openModalTree(props.row.personalId)"
|
||||
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " >
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm" >
|
||||
<q-icon :color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'primary' "
|
||||
size="xs" name="mdi-bookmark-outline" />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openModalTree(props.row.personalId)"
|
||||
:disable="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
:color="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'primary'
|
||||
"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section
|
||||
>เลือกหน่วยงานที่รับโอน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup
|
||||
@click="openUpload(props.row.personalId)" :disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' ">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm" >
|
||||
<q-icon size="xs" name="attach_file"
|
||||
:color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'blue' " />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openUpload(props.row.personalId)"
|
||||
:disable="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
size="xs"
|
||||
name="attach_file"
|
||||
:color="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'blue'
|
||||
"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>อัปโหลดเอกสาร</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="openDelete(props.row.personalId)"
|
||||
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " >
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm" >
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openDelete(props.row.personalId)"
|
||||
:disable="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-icon
|
||||
:color="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE' ? 'grey' : 'red' "
|
||||
props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'red'
|
||||
"
|
||||
size="xs"
|
||||
name="mdi-delete"
|
||||
/>
|
||||
|
|
@ -423,8 +587,18 @@ onMounted(() => {
|
|||
<q-card-section class="q-py-sm">
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file ref="myForm" outlined dense v-model="files" label="อัปโหลดเอกสาร" lazy-rules
|
||||
:rules="[(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน']" hide-bottom-space >
|
||||
<q-file
|
||||
ref="myForm"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
label="อัปโหลดเอกสาร"
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
||||
]"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
|
|
@ -435,7 +609,13 @@ onMounted(() => {
|
|||
<q-separator />
|
||||
<div class="row q-px-sm q-py-xs">
|
||||
<q-space />
|
||||
<q-btn flat round color="public" @click="SaveData()" icon="mdi-content-save-outline" >
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="SaveData()"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -155,9 +155,17 @@ const openModalOrder = () => {
|
|||
openModal();
|
||||
const row = rows.value.filter(
|
||||
(item: officerType) =>
|
||||
item.status == "WAITTING" ||
|
||||
item.status == "PENDING" ||
|
||||
item.status == "APPROVE"
|
||||
(item.status == "WAITTING" ||
|
||||
item.status == "PENDING" ||
|
||||
item.status == "APPROVE") &&
|
||||
item.organizationPositionOld &&
|
||||
item.positionTypeOld &&
|
||||
item.positionLevelOld &&
|
||||
item.positionNumberOld &&
|
||||
item.salary !== null &&
|
||||
item.organization &&
|
||||
item.date &&
|
||||
item.dateRepatriation
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
|
@ -187,6 +195,7 @@ const getData = async () => {
|
|||
positionNumberOld: item.positionNumberOld,
|
||||
organizationPositionOld: item.organizationPositionOld,
|
||||
isActive: item.isActive,
|
||||
dateRepatriation: item.dateRepatriation,
|
||||
}));
|
||||
})
|
||||
.catch((e) => {})
|
||||
|
|
@ -224,26 +233,63 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="row col-12">
|
||||
<q-btn flat round size="14px" color="add" icon="mdi-account-arrow-right" @click="openModalOrder" >
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
size="14px"
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
@click="openModalOrder"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งส่งตัวกลับ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef"
|
||||
outlined debounce="300" placeholder="ค้นหา" >
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" v-model="visibleColumns" 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" />
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
v-model="visibleColumns"
|
||||
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"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="id" :visible-columns="visibleColumns" >
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -252,45 +298,89 @@ onMounted(async () => {
|
|||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props" @click="openDetail(props.row.id)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="posNo" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="posNo"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.posNo }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="position"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
<q-td key="positionLevel" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="positionLevel"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.positionLevel }}
|
||||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="organizationPositionOld"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="organization"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="createdAt" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="createdAt"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.createdAt }}
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="statusText"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.statusText }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn icon="delete" size="14px" flat round dense
|
||||
:color="props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'red-7'"
|
||||
<q-btn
|
||||
icon="delete"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
:color="
|
||||
props.row.status == 'REPORT' || props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'red-7'
|
||||
"
|
||||
@click="clickDelete(props.row.fullname, props.row.id)"
|
||||
:disable="props.row.status == 'REPORT' || props.row.status == 'DONE'" >
|
||||
:disable="
|
||||
props.row.status == 'REPORT' || props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ const rows = ref<ResponseData[]>([]);
|
|||
const rows2 = ref<ResponseData[]>([]);
|
||||
const filters = ref<ResponseData[]>([]);
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
|
|
@ -135,20 +135,30 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => {
|
||||
modal.value = false
|
||||
filterKeyword2.value = ""
|
||||
modal.value = false;
|
||||
filterKeyword2.value = "";
|
||||
};
|
||||
|
||||
|
||||
// เปิดโมเดล
|
||||
const openModalOrder = () => {
|
||||
console.log(filters.value);
|
||||
|
||||
openModal();
|
||||
const row = filters.value.filter(
|
||||
(r: ResponseData) =>
|
||||
r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
|
||||
(r.status == "WAITTING" ||
|
||||
r.status == "PENDING" ||
|
||||
r.status == "APPROVE") &&
|
||||
r.createdAt &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevel &&
|
||||
r.posNo &&
|
||||
r.salary !== null &&
|
||||
r.organization &&
|
||||
r.createdAt
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -170,16 +170,20 @@ const openDetail = (id: string) => {
|
|||
};
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => {
|
||||
modal.value = false
|
||||
modal.value = false;
|
||||
filterKeyword2.value = "";
|
||||
};
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = rows.value.filter(
|
||||
(item: officerType) =>
|
||||
item.status == "WAITTING" ||
|
||||
item.status == "PENDING" ||
|
||||
item.status == "APPROVE"
|
||||
(item.status == "WAITTING" ||
|
||||
item.status == "PENDING" ||
|
||||
item.status == "APPROVE") &&
|
||||
item.organizationPositionOld &&
|
||||
item.organization &&
|
||||
item.dateStart &&
|
||||
item.dateEnd
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
|
@ -213,7 +217,7 @@ const getData = async () => {
|
|||
}));
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
|
@ -246,21 +250,53 @@ onMounted(async () => {
|
|||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<div class="row col-12">
|
||||
<q-btn @click="openModalOrder" size="14px" flat round color="add" icon="mdi-account-arrow-right" >
|
||||
<q-btn
|
||||
@click="openModalOrder"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งช่วยราชการ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef"
|
||||
outlined debounce="300" placeholder="ค้นหา" >
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select v-model="visibleColumns" 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="col-xs-12 col-sm-3 col-md-2 q-ml-sm" />
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
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="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
|
|
@ -291,42 +327,90 @@ onMounted(async () => {
|
|||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="posNo" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="posNo"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.posNo }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="position"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.position }}
|
||||
</q-td>
|
||||
<q-td key="positionLevel" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="positionLevel"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.positionLevel }}
|
||||
</q-td>
|
||||
<q-td key="organizationPositionOld" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="organizationPositionOld"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organizationPositionOld }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="organization" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="organization"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="dateStart" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="dateStart"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.dateStart }}
|
||||
</q-td>
|
||||
<q-td key="dateEnd" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="dateEnd"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.dateEnd }}
|
||||
</q-td>
|
||||
<q-td key="createdAt" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="createdAt"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.createdAt }}
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props" @click="openDetail(props.row.id)" >
|
||||
<q-td
|
||||
key="statusText"
|
||||
:props="props"
|
||||
@click="openDetail(props.row.id)"
|
||||
>
|
||||
{{ props.row.statusText }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn icon="delete" size="14px" flat round dense
|
||||
:color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'red-7' "
|
||||
<q-btn
|
||||
icon="delete"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
:color="
|
||||
props.row.status == 'REPORT' || props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'red-7'
|
||||
"
|
||||
@click="clickDelete(props.row.fullname, props.row.id)"
|
||||
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " >
|
||||
:disable="
|
||||
props.row.status == 'REPORT' || props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ function filterFn(val: string, update: any) {
|
|||
<div class="col-6">
|
||||
<div class="row">
|
||||
<q-select
|
||||
class="col-5 q-mr-sm"
|
||||
class="col-5 col-sm-3 col-md-8"
|
||||
v-model="fillter"
|
||||
label="สถานะ"
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -1,84 +1,105 @@
|
|||
interface listAppointType {
|
||||
personalId:string
|
||||
citizenId:number
|
||||
fullname:string
|
||||
organizationName:string
|
||||
orgName:string
|
||||
organizationShortName:string
|
||||
positionNumber:string
|
||||
positionPath:string
|
||||
status:string
|
||||
createdAt:string
|
||||
birthday:string
|
||||
personalId: string
|
||||
citizenId: number
|
||||
fullname: string
|
||||
organizationName: string
|
||||
orgName: string
|
||||
organizationShortName: string
|
||||
positionNumber: string
|
||||
positionPath: string
|
||||
status: string
|
||||
createdAt: string
|
||||
birthday: string
|
||||
educationOld: string
|
||||
organizationPositionOld: string
|
||||
positionTypeOld: string
|
||||
positionLevelOld: string
|
||||
positionNumberOld: string
|
||||
salary: number
|
||||
positionDate: Date
|
||||
}
|
||||
|
||||
interface resData {
|
||||
id:string
|
||||
citizenId:number
|
||||
prefix:string
|
||||
firstname:string
|
||||
lastname:string
|
||||
organizationName:string
|
||||
organizationShortName:string
|
||||
positionNumber:string
|
||||
positionPath:string
|
||||
status:string
|
||||
createdAt:Date
|
||||
dateOfBirth:Date
|
||||
id: string
|
||||
citizenId: number
|
||||
prefix: string
|
||||
firstname: string
|
||||
lastname: string
|
||||
organizationName: string
|
||||
organizationShortName: string
|
||||
positionNumber: string
|
||||
positionPath: string
|
||||
status: string
|
||||
createdAt: Date
|
||||
dateOfBirth: Date
|
||||
educationOld: string
|
||||
organizationPositionOld: string
|
||||
positionTypeOld: string
|
||||
positionLevelOld: string
|
||||
positionNumberOld: string
|
||||
salary: number
|
||||
positionDate: Date
|
||||
}
|
||||
interface orgFilter{
|
||||
orgName:string
|
||||
status:string
|
||||
interface orgFilter {
|
||||
orgName: string
|
||||
status: string
|
||||
educationOld: string
|
||||
organizationPositionOld: string
|
||||
positionTypeOld: string
|
||||
positionLevelOld: string
|
||||
positionNumberOld: string
|
||||
salary: number
|
||||
positionDate: Date
|
||||
}
|
||||
interface appointmentData{
|
||||
citizenId:string
|
||||
prefixId?:string
|
||||
firstname?:string
|
||||
lastname?:string
|
||||
interface appointmentData {
|
||||
citizenId: string
|
||||
prefixId?: string
|
||||
firstname?: string
|
||||
lastname?: string
|
||||
}
|
||||
|
||||
interface UserData {
|
||||
personalId: string;
|
||||
citizenId: string;
|
||||
fullname: string;
|
||||
organizationName: string ;
|
||||
orgName: string ;
|
||||
organizationShortName: string ;
|
||||
positionNumber: string ;
|
||||
positionPath: string;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
birthday: string;
|
||||
}
|
||||
personalId: string;
|
||||
citizenId: string;
|
||||
fullname: string;
|
||||
organizationName: string;
|
||||
orgName: string;
|
||||
organizationShortName: string;
|
||||
positionNumber: string;
|
||||
positionPath: string;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
birthday: string;
|
||||
}
|
||||
|
||||
interface ResponseData {
|
||||
data: {
|
||||
result: {
|
||||
citizenId: string
|
||||
profileId: string;
|
||||
prefix: string;
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
organizationPositionOld: string;
|
||||
positionLevelOld: string;
|
||||
positionTypeOld: string;
|
||||
status: string;
|
||||
educationOld: string;
|
||||
positionNumberOld: string;
|
||||
salary: number;
|
||||
reason: string;
|
||||
positionDate: Date;
|
||||
avatar: string;
|
||||
|
||||
interface ResponseData {
|
||||
data: {
|
||||
result: {
|
||||
citizenId:string
|
||||
profileId: string;
|
||||
prefix: string;
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
organizationPositionOld: string;
|
||||
positionLevelOld: string;
|
||||
positionTypeOld: string;
|
||||
status: string;
|
||||
educationOld: string;
|
||||
positionNumberOld: string;
|
||||
salary: number;
|
||||
reason: string;
|
||||
positionDate: Date;
|
||||
avatar: string;
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
export type {
|
||||
listAppointType,
|
||||
resData,
|
||||
orgFilter,
|
||||
appointmentData,
|
||||
UserData,
|
||||
ResponseData
|
||||
|
||||
listAppointType,
|
||||
resData,
|
||||
orgFilter,
|
||||
appointmentData,
|
||||
UserData,
|
||||
ResponseData
|
||||
|
||||
}
|
||||
|
|
@ -20,6 +20,8 @@ interface listMain {
|
|||
status: string;
|
||||
statustext: string;
|
||||
createdAt: Date;
|
||||
amountOld: number;
|
||||
positionDate: Date
|
||||
}
|
||||
//ข้อมูลจาก api
|
||||
interface listMainAPI {
|
||||
|
|
@ -44,6 +46,8 @@ interface listMainAPI {
|
|||
status: string;
|
||||
statustext: string;
|
||||
createdAt: Date;
|
||||
amountOld: number;
|
||||
positionDate: Date
|
||||
}
|
||||
|
||||
interface OtherdataInterface {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@ interface ResponseRow {
|
|||
statusText: string;
|
||||
createdAt: Date | null;
|
||||
dateText: string | null;
|
||||
educationOld: string
|
||||
organizationPositionOld: string
|
||||
positionTypeOld: string
|
||||
positionLevelOld: string
|
||||
positionNumberOld: string
|
||||
amountOld: number
|
||||
|
||||
}
|
||||
|
||||
interface ResponseData {
|
||||
|
|
@ -55,6 +62,7 @@ interface ResponseData {
|
|||
recruitDate: Date;
|
||||
salary: number;
|
||||
status: string;
|
||||
amountOld: number
|
||||
}
|
||||
|
||||
export type { ResponseTitle, ResponseData, ResponseRow };
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ interface officerType {
|
|||
isActive: boolean;
|
||||
dateEnd: string;
|
||||
dateStart: string;
|
||||
|
||||
|
||||
dateRepatriation: Date
|
||||
}
|
||||
interface ResponseData {
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ const openModalOrder = () => {
|
|||
openModal();
|
||||
const row = filters.value.filter(
|
||||
(r: ResponseItems) =>
|
||||
r.status == "PENDING" || r.status == "APPROVE" || r.status == "REJECT"
|
||||
r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -72,19 +72,17 @@ const columns = ref<QTableProps["columns"]>([
|
|||
// ข้อมูลตาราง (จำลอง)
|
||||
const currentYear = new Date().getFullYear();
|
||||
const rows = ref<resMain[]>([]);
|
||||
const yearOptions = ref<any[]>([]);
|
||||
const yearOptions = ref<any>([{ id: "", year: "ทั้งหมด" }]);
|
||||
|
||||
onMounted(() => {
|
||||
filteryear();
|
||||
onMounted(async () => {
|
||||
await fetchRetirement(type.value, currentYear);
|
||||
// await fetchRetirement(type.value, currentYear);
|
||||
});
|
||||
// หาปีปัจจุบัน
|
||||
const filteryear = () => {
|
||||
yearOptions.value = [{ id: currentYear, name: currentYear + 543 }];
|
||||
yearOptions.value.push({ id: currentYear, name: currentYear + 543 });
|
||||
// fiscalyear.value = yearOptions[0].id;
|
||||
|
||||
yearOptionsFilter.value = [{ id: currentYear, name: currentYear + 543 }];
|
||||
yearOptionsFilter.value.push({ id: currentYear, name: currentYear + 543 });
|
||||
// yearOptions.value.push({ id: currentYear, name: currentYear + 543 });
|
||||
// yearOptionsFilter.value = [{ id: currentYear, name: currentYear + 543 }];
|
||||
// yearOptionsFilter.value.push({ id: currentYear, name: currentYear + 543 });
|
||||
fetchRetirement(type.value, currentYear);
|
||||
};
|
||||
// ประกาศเกษียณอายุราชการ
|
||||
|
|
@ -98,7 +96,7 @@ const fetchRetirement = async (type: string, year: any) => {
|
|||
rows.value = data.map((items: any) => ({
|
||||
id: items.id,
|
||||
Date: date2Thai(items.createdAt),
|
||||
year: items.year,
|
||||
year: items.year + 543,
|
||||
retireNumber: items.round,
|
||||
total: items.total,
|
||||
round: items.round,
|
||||
|
|
@ -106,6 +104,19 @@ const fetchRetirement = async (type: string, year: any) => {
|
|||
json: items.json,
|
||||
document: items.document,
|
||||
}));
|
||||
let option: any[] = [];
|
||||
data.map((items: any) => {
|
||||
option.push({
|
||||
id: items.year,
|
||||
year: (items.year + 543).toString(),
|
||||
typeReport: typeReportChangeName(items.typeReport), // เปลี่ยนสถานะ
|
||||
});
|
||||
});
|
||||
yearOptions.value = [{ id: 0, year: "ทั้งหมด" }];
|
||||
yearOptions.value.push(...option);
|
||||
|
||||
yearOptionsFilter.value = yearOptions.value;
|
||||
|
||||
actionOption.value = rows.value;
|
||||
rows.value.sort((a, b) => a.round - b.round); // เรียงรอบมากไปน้อย
|
||||
checkststus(rows.value);
|
||||
|
|
@ -144,10 +155,10 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const filterSelector = (val: any, update: Function, year: any) => {
|
||||
const filterSelector = (val: any, update: Function) => {
|
||||
update(() => {
|
||||
yearOptions.value = yearOptionsFilter.value.filter(
|
||||
(v: any) => v.name.valueOf(val.toLowerCase()) > -1
|
||||
(v: any) => v.year.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
};
|
||||
|
|
@ -219,18 +230,28 @@ const typeReportChangeName = (val: string) => {
|
|||
map-options
|
||||
:options="yearOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
option-label="year"
|
||||
lazy-rules
|
||||
use-input
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn
|
||||
) "
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'yearOptions'
|
||||
) "
|
||||
/>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<!-- use-input -->
|
||||
<div>
|
||||
<popupAdd
|
||||
|
|
|
|||
|
|
@ -409,10 +409,17 @@ const downloadFile = (response: any, filename: string) => {
|
|||
};
|
||||
// เรียก file รายชื่อข้าราชการสามัญฯ
|
||||
const downloadFileexcel = async () => {
|
||||
const findInsigniaId = DataStore.dataInsigniaType.find(
|
||||
(e: any) => e.name == DataStore.typeinsignia
|
||||
);
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaDowanload(DataStore.requestId), {
|
||||
.put(config.API.insigniaDowanload(DataStore.requestId), {
|
||||
responseType: "blob",
|
||||
profileType:
|
||||
DataStore.employeeClass == "all" ? null : DataStore.employeeClass,
|
||||
InsigniaId: DataStore.typeinsignia == "all" ? null : findInsigniaId.id,
|
||||
})
|
||||
.then(async (res) => {
|
||||
await downloadFile(
|
||||
|
|
@ -656,33 +663,29 @@ const clickShowWarn = (
|
|||
const filterSelector = (val: any, update: Function, name: any) => {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
if (name === 'typeinsigniaOptions') {
|
||||
DataStore.typeinsignia = ''
|
||||
typeinsigniaOptions.value = DataStore.typeinsigniaOptions.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
else if(name === 'employeeClassOps'){
|
||||
DataStore.employeeClass = ''
|
||||
employeeClassOps.value = DataStore.employeeClassOps.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
else if(name === 'filterOrganizationOP'){
|
||||
if (name === "typeinsigniaOptions") {
|
||||
DataStore.typeinsignia = "";
|
||||
typeinsigniaOptions.value = DataStore.typeinsigniaOptions.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "employeeClassOps") {
|
||||
DataStore.employeeClass = "";
|
||||
employeeClassOps.value = DataStore.employeeClassOps.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "filterOrganizationOP") {
|
||||
filterOrganizationOP.value = organizationOptions.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const clearInsigniaFilters = (name: string) => {
|
||||
if (name === "typeinsigniaOptions") {
|
||||
DataStore.typeinsignia = "all";
|
||||
typeinsigniaOptions.value = DataStore.typeinsigniaOptions;
|
||||
} else if (name === 'employeeClassOps') {
|
||||
} else if (name === "employeeClassOps") {
|
||||
DataStore.employeeClass = "all";
|
||||
employeeClassOps.value = DataStore.employeeClassOps;
|
||||
}
|
||||
|
|
@ -694,7 +697,7 @@ const clearInsigniaFilters = (name: string) => {
|
|||
<div class="row col-12">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
class="col-4"
|
||||
class="col-4"
|
||||
v-if="roleDataStore.adminRole"
|
||||
v-model="organization"
|
||||
label="หน่วยงาน"
|
||||
|
|
@ -718,7 +721,7 @@ const clearInsigniaFilters = (name: string) => {
|
|||
) "
|
||||
/>
|
||||
<q-select
|
||||
class="col-1"
|
||||
class="col-1"
|
||||
v-model="DataStore.typeinsignia"
|
||||
label="ประเภทเครื่องราชฯ ที่ยืนขอ"
|
||||
dense
|
||||
|
|
@ -761,7 +764,7 @@ const clearInsigniaFilters = (name: string) => {
|
|||
</q-select>
|
||||
<div>
|
||||
<q-select
|
||||
class="col-2"
|
||||
class="col-2"
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ const modalPopupBackToEdit = ref<boolean>(false); //model แก้ไข
|
|||
onMounted(async () => {
|
||||
tab.value = DataStore.mainTab;
|
||||
await fecthlistRound();
|
||||
DataStore.dataInsigniaType.length === 0 && (await fecthInsignia());
|
||||
});
|
||||
|
||||
//เรียกรอบการเสนอขอพระราชทานเครื่อง
|
||||
|
|
@ -123,6 +124,18 @@ const fecthType = async () => {
|
|||
messageError($q, err);
|
||||
});
|
||||
};
|
||||
// เรียกประเภทเครื่องราช
|
||||
const fecthInsignia = async () => {
|
||||
await http
|
||||
.get(config.API.insignia)
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
DataStore.fetchInsigniaType(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
};
|
||||
|
||||
//เลือกรอบการแสดง
|
||||
const changround = async () => {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
{ id: '44', title: 'บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ' }
|
||||
])
|
||||
const mainTab = ref<string | undefined>("pending");
|
||||
const dataInsigniaType = ref<any>([])
|
||||
// เรียกราชชื่อการเสนอขอ
|
||||
const fetchData = async (data: any) => {
|
||||
if (data !== null) {
|
||||
|
|
@ -124,6 +125,10 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
rows.value = listinsignia.value;
|
||||
}
|
||||
};
|
||||
// ประเภทเครื่องราช
|
||||
function fetchInsigniaType(data: any) {
|
||||
dataInsigniaType.value = data
|
||||
}
|
||||
|
||||
// ประเภทลูกจ้าง
|
||||
const profileType = (val: string) => {
|
||||
|
|
@ -167,11 +172,13 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
employeeClass,
|
||||
employeeClassOps,
|
||||
fetchDataInsignia,
|
||||
fetchInsigniaType,
|
||||
isLock,
|
||||
requestId,
|
||||
roleUser,
|
||||
requestStatus,
|
||||
optionReport,
|
||||
convertStatus
|
||||
convertStatus,
|
||||
dataInsigniaType,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,403 +1,476 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import type { FormRegistryEmployee } from '../interface/request/Main';
|
||||
import { useQuasar, type QTableProps, QInput } from 'quasar';
|
||||
import { useCounterMixin } from '@/stores/mixin';
|
||||
import http from '@/plugins/http';
|
||||
import { ref, watch } from "vue";
|
||||
import type { FormRegistryEmployee } from "../interface/request/Main";
|
||||
import { useQuasar, type QTableProps, QInput } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
|
||||
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const {
|
||||
success,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
dialogMessageNotify,
|
||||
success,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
dialogMessageNotify,
|
||||
} = mixin; //ฟังก์ชันกลางที่ใช้ในหน้านี้
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
const props = defineProps({
|
||||
modal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
modal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
rows: {
|
||||
type: Object,
|
||||
default: [],
|
||||
},
|
||||
fetchNewList: {
|
||||
type: Function,
|
||||
default: () => {
|
||||
/* ฟังก์ชั่น get รายการข้อมูลในหน้าหลักใหม่ */
|
||||
},
|
||||
rows: {
|
||||
type: Object,
|
||||
default: []
|
||||
},
|
||||
fetchNewList: {
|
||||
type: Function,
|
||||
default: () => { /* ฟังก์ชั่น get รายการข้อมูลในหน้าหลักใหม่ */ }
|
||||
},
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
default: () => { /* ฟังก์ชั่นปิด dialog ส่งไปออกคำสั่ง */ }
|
||||
},
|
||||
closeDialog: {
|
||||
type: Function,
|
||||
default: () => {
|
||||
/* ฟังก์ชั่นปิด dialog ส่งไปออกคำสั่ง */
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const filter = ref<string>("");
|
||||
const filterRef = ref<QInput>();
|
||||
// visible columns ตารางใน dialog ส่งไปออกคำสั่ง
|
||||
const visibleColumnsOrder = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
"fullnameOld",
|
||||
"oc",
|
||||
"positionEmployeePosition",
|
||||
"positionEmployeePositionSide",
|
||||
"positionLine",
|
||||
"govAge",
|
||||
"positionEmployeeGroup",
|
||||
"dateAppoint",
|
||||
"refSalary",
|
||||
"dateStart",
|
||||
"createdAt",
|
||||
"salaryDate",
|
||||
"age",
|
||||
"amount",
|
||||
"statustext",
|
||||
"leaveDateOrder",
|
||||
"newAgency",
|
||||
"currentAgency",
|
||||
"no",
|
||||
"fullname",
|
||||
"fullnameOld",
|
||||
"oc",
|
||||
"positionEmployeePosition",
|
||||
"positionEmployeePositionSide",
|
||||
"positionLine",
|
||||
"govAge",
|
||||
"positionEmployeeGroup",
|
||||
"dateAppoint",
|
||||
"refSalary",
|
||||
"dateStart",
|
||||
"createdAt",
|
||||
"salaryDate",
|
||||
"age",
|
||||
"amount",
|
||||
"statustext",
|
||||
"leaveDateOrder",
|
||||
"newAgency",
|
||||
"currentAgency",
|
||||
]);
|
||||
|
||||
// คอลัมน์ในตาราง
|
||||
const columnsOrder = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "newAgency",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับการบรรจุ",
|
||||
sortable: true,
|
||||
field: "newAgency",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "currentAgency",
|
||||
align: "left",
|
||||
label: "หน่วยงานปัจจุบัน",
|
||||
sortable: true,
|
||||
field: "currentAgency",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "amount",
|
||||
align: "left",
|
||||
label: "ค่าจ้าง",
|
||||
sortable: true,
|
||||
field: "amount",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "govAge",
|
||||
align: "left",
|
||||
label: "อายุราชการ(ปี)",
|
||||
sortable: true,
|
||||
field: "govAge",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "dateAppoint",
|
||||
align: "left",
|
||||
label: "วันที่จ้าง",
|
||||
sortable: true,
|
||||
field: "dateAppoint",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "dateStart",
|
||||
align: "left",
|
||||
label: "วันที่เริ่มปฎิบัติราชการ",
|
||||
sortable: true,
|
||||
field: "dateStart",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "salaryDate",
|
||||
align: "left",
|
||||
label: "วันที่แต่งตั้ง",
|
||||
sortable: true,
|
||||
field: "salaryDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "refSalary",
|
||||
align: "left",
|
||||
label: "เอกสารอ้างอิง",
|
||||
sortable: true,
|
||||
field: "refSalary",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "age",
|
||||
align: "left",
|
||||
label: "อายุ",
|
||||
sortable: true,
|
||||
field: "age",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "fullnameOld",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล(เดิม)",
|
||||
sortable: true,
|
||||
field: "fullnameOld",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
label: "วันที่สร้าง",
|
||||
sortable: true,
|
||||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "leaveDateOrder",
|
||||
align: "left",
|
||||
label: "วันที่พ้นราชการ",
|
||||
sortable: true,
|
||||
field: "leaveDateOrder",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "statustext",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "statustext",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "newAgency",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับการบรรจุ",
|
||||
sortable: true,
|
||||
field: "newAgency",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "currentAgency",
|
||||
align: "left",
|
||||
label: "หน่วยงานปัจจุบัน",
|
||||
sortable: true,
|
||||
field: "currentAgency",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "amount",
|
||||
align: "left",
|
||||
label: "ค่าจ้าง",
|
||||
sortable: true,
|
||||
field: "amount",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "govAge",
|
||||
align: "left",
|
||||
label: "อายุราชการ(ปี)",
|
||||
sortable: true,
|
||||
field: "govAge",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "dateAppoint",
|
||||
align: "left",
|
||||
label: "วันที่จ้าง",
|
||||
sortable: true,
|
||||
field: "dateAppoint",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "dateStart",
|
||||
align: "left",
|
||||
label: "วันที่เริ่มปฎิบัติราชการ",
|
||||
sortable: true,
|
||||
field: "dateStart",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "salaryDate",
|
||||
align: "left",
|
||||
label: "วันที่แต่งตั้ง",
|
||||
sortable: true,
|
||||
field: "salaryDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "refSalary",
|
||||
align: "left",
|
||||
label: "เอกสารอ้างอิง",
|
||||
sortable: true,
|
||||
field: "refSalary",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "age",
|
||||
align: "left",
|
||||
label: "อายุ",
|
||||
sortable: true,
|
||||
field: "age",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "fullnameOld",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล(เดิม)",
|
||||
sortable: true,
|
||||
field: "fullnameOld",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
label: "วันที่สร้าง",
|
||||
sortable: true,
|
||||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "leaveDateOrder",
|
||||
align: "left",
|
||||
label: "วันที่พ้นราชการ",
|
||||
sortable: true,
|
||||
field: "leaveDateOrder",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "statustext",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "statustext",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
// checkbox เลือกคนไปออกคำสั่ง
|
||||
const selected = ref<any>([]);
|
||||
const save = () => {
|
||||
if (selected.value.length == 0) {
|
||||
dialogMessageNotify($q, "กรุณาเลือกคนออกคำสั่ง");
|
||||
} else dialogConfirm($q, () => sendToCommand());
|
||||
if (selected.value.length == 0) {
|
||||
dialogMessageNotify($q, "กรุณาเลือกคนออกคำสั่ง");
|
||||
} else dialogConfirm($q, () => sendToCommand());
|
||||
};
|
||||
|
||||
// post ส่งไปออกคำสั่ง
|
||||
const sendToCommand = async () => {
|
||||
let pId: string[] = [];
|
||||
selected.value.forEach((e: any) => {
|
||||
pId.push(e.id);
|
||||
let pId: string[] = [];
|
||||
selected.value.forEach((e: any) => {
|
||||
pId.push(e.id);
|
||||
});
|
||||
let data = {
|
||||
id: pId,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.organizationEmployeeSendOrder, data)
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
props.fetchNewList();
|
||||
props.closeDialog();
|
||||
selected.value = [];
|
||||
hideLoader();
|
||||
});
|
||||
let data = {
|
||||
id: pId,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.organizationEmployeeSendOrder, data)
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
props.fetchNewList()
|
||||
props.closeDialog()
|
||||
selected.value = [];
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// เลือกรายการเฉพาะคนที่มีสถานะ PENDING (เลือกตำแหน่งแล้ว)
|
||||
const rowsOrder = ref<FormRegistryEmployee[]>([]);
|
||||
const filterRowData = () => {
|
||||
rowsOrder.value = props.rows.filter(
|
||||
(r: FormRegistryEmployee) => r.status == "PENDING"
|
||||
);
|
||||
}
|
||||
rowsOrder.value = props.rows.filter(
|
||||
(r: FormRegistryEmployee) => r.status == "PENDING"
|
||||
);
|
||||
};
|
||||
|
||||
// เช็ค props modal ทำการ filter เมื่อคลิก icon ส่งไปออกคำสั่ง
|
||||
watch(props, () => {
|
||||
if (props.modal === true && props.rows) {
|
||||
filterRowData()
|
||||
}
|
||||
if (props.modal === true && props.rows) {
|
||||
filterRowData();
|
||||
visibleColumnsOrder.value = [
|
||||
"no",
|
||||
"fullname",
|
||||
"fullnameOld",
|
||||
"oc",
|
||||
"positionEmployeePosition",
|
||||
"positionEmployeePositionSide",
|
||||
"positionLine",
|
||||
"govAge",
|
||||
"positionEmployeeGroup",
|
||||
"dateAppoint",
|
||||
"refSalary",
|
||||
"dateStart",
|
||||
"createdAt",
|
||||
"salaryDate",
|
||||
"age",
|
||||
"amount",
|
||||
"statustext",
|
||||
"leaveDateOrder",
|
||||
"newAgency",
|
||||
"currentAgency",
|
||||
];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<DialogHeader tittle="ส่งรายชื่อไปออกคำสั่ง" :close="props.closeDialog" />
|
||||
<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="filter" ref="filterRef"
|
||||
placeholder="ค้นหา" style="width: 850px; max-width: auto">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<DialogHeader tittle="ส่งรายชื่อไปออกคำสั่ง" :close="props.closeDialog" />
|
||||
<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="filter"
|
||||
ref="filterRef"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumnsOrder"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columnsOrder"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:rows="rowsOrder"
|
||||
:columns="columnsOrder"
|
||||
:visible-columns="visibleColumnsOrder"
|
||||
:filter="filter"
|
||||
row-key="id"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="newAgency" :props="props">
|
||||
<div
|
||||
class="col-12"
|
||||
v-if="
|
||||
props.row.draftOrganizationOrganization == null &&
|
||||
props.row.draftPositionEmployee == null
|
||||
"
|
||||
>
|
||||
<div class="text-weight-medium">
|
||||
{{ "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" v-else>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.draftOrganizationOrganization ?? "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.draftPositionEmployee ?? "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="currentAgency" :props="props">
|
||||
<div
|
||||
class="col-12"
|
||||
v-if="props.row.oc == null && props.row.position == null"
|
||||
>
|
||||
<div class="text-weight-medium">
|
||||
{{ "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" v-else>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.oc ?? "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.position ?? "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
<d-table :rows="rowsOrder" :columns="columnsOrder" :visible-columns="visibleColumnsOrder" :filter="filter"
|
||||
row-key="id" selection="multiple" v-model:selected="selected">
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox keep-color color="primary" dense v-model="props.selected" />
|
||||
</q-td>
|
||||
<q-td key="amount" :props="props">
|
||||
{{ props.row.amount }}
|
||||
</q-td>
|
||||
<q-td key="govAge" :props="props">
|
||||
{{ props.row.govAge }}
|
||||
</q-td>
|
||||
<q-td key="dateAppoint" :props="props">
|
||||
{{ props.row.dateAppoint }}
|
||||
</q-td>
|
||||
<q-td key="dateStart" :props="props">
|
||||
{{ props.row.dateStart }}
|
||||
</q-td>
|
||||
<q-td key="salaryDate" :props="props">
|
||||
{{ props.row.salaryDate }}
|
||||
</q-td>
|
||||
<q-td key="refSalary" :props="props">
|
||||
{{ props.row.refSalary }}
|
||||
</q-td>
|
||||
<q-td key="age" :props="props">
|
||||
{{ props.row.age }}
|
||||
</q-td>
|
||||
<q-td key="fullnameOld" :props="props">
|
||||
{{ props.row.fullnameOld }}
|
||||
</q-td>
|
||||
<q-td key="createdAt" :props="props">
|
||||
{{ props.row.createdAt }}
|
||||
</q-td>
|
||||
<q-td key="isLeave" :props="props">
|
||||
{{ props.row.isLeave }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="newAgency" :props="props">
|
||||
<div class="col-12" v-if="props.row.draftOrganizationOrganization == null &&
|
||||
props.row.draftPositionEmployee == null
|
||||
">
|
||||
<div class="text-weight-medium">
|
||||
{{ "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" v-else>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.draftOrganizationOrganization ?? "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.draftPositionEmployee ?? "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="currentAgency" :props="props">
|
||||
<div class="col-12" v-if="props.row.oc == null && props.row.position == null">
|
||||
<div class="text-weight-medium">
|
||||
{{ "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" v-else>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.oc ?? "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.position ?? "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="leaveDateOrder" :props="props">
|
||||
{{ props.row.leaveDateOrder }}
|
||||
</q-td>
|
||||
<q-td key="statustext" :props="props">
|
||||
{{ props.row.statustext }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
|
||||
<q-td key="amount" :props="props">
|
||||
{{ props.row.amount }}
|
||||
</q-td>
|
||||
<q-td key="govAge" :props="props">
|
||||
{{ props.row.govAge }}
|
||||
</q-td>
|
||||
<q-td key="dateAppoint" :props="props">
|
||||
{{ props.row.dateAppoint }}
|
||||
</q-td>
|
||||
<q-td key="dateStart" :props="props">
|
||||
{{ props.row.dateStart }}
|
||||
</q-td>
|
||||
<q-td key="salaryDate" :props="props">
|
||||
{{ props.row.salaryDate }}
|
||||
</q-td>
|
||||
<q-td key="refSalary" :props="props">
|
||||
{{ props.row.refSalary }}
|
||||
</q-td>
|
||||
<q-td key="age" :props="props">
|
||||
{{ props.row.age }}
|
||||
</q-td>
|
||||
<q-td key="fullnameOld" :props="props">
|
||||
{{ props.row.fullnameOld }}
|
||||
</q-td>
|
||||
<q-td key="createdAt" :props="props">
|
||||
{{ props.row.createdAt }}
|
||||
</q-td>
|
||||
<q-td key="isLeave" :props="props">
|
||||
{{ props.row.isLeave }}
|
||||
</q-td>
|
||||
|
||||
<q-td key="leaveDateOrder" :props="props">
|
||||
{{ props.row.leaveDateOrder }}
|
||||
</q-td>
|
||||
<q-td key="statustext" :props="props">
|
||||
{{ props.row.statustext }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn label="ส่งไปออกคำสั่ง" @click="save" color="public" />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn label="ส่งไปออกคำสั่ง" @click="save" color="public" />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ const deleteData = async (id: string) => {
|
|||
// **** เริ่มในส่วนของการเลือกตำแหน่ง ***//
|
||||
const rowsPosition = ref<any>([]); // รายการข้อมูลในตารางกำหนดตำแหน่ง
|
||||
const filters = ref<FormRegistryEmployee[]>([]);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterKeyword2 = ref<any>("");
|
||||
const modal = ref<boolean>(false); // เปิด-ปิด dialod กำหนดตำแหน่ง
|
||||
const selectedPosition = ref<any>([]); // เก็บตำแหน่งที่เลือก
|
||||
|
||||
|
|
@ -970,7 +970,7 @@ const showEmployeeTemp = async () => {
|
|||
dense
|
||||
ref="filterRef"
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
v-model="filterKeyword2"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -45,13 +45,19 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
|||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
(item) => item.orderTypeValue === filter_1
|
||||
);
|
||||
} else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear === null) {
|
||||
} else if (
|
||||
filter_1 !== "" &&
|
||||
filter_2 !== "ทั้งหมด" &&
|
||||
filterYear === null
|
||||
) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
(item) => item.orderTypeValue === filter_1 && item.OrderStatus === filter_2
|
||||
(item) =>
|
||||
item.orderTypeValue === filter_1 && item.OrderStatus === filter_2
|
||||
);
|
||||
} else if (filter_1 !== "" && filter_2 === "ทั้งหมด" && filterYear !== 0) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
(item) => item.orderTypeValue === filter_1 && item.fiscalYear === filterYear
|
||||
(item) =>
|
||||
item.orderTypeValue === filter_1 && item.fiscalYear === filterYear
|
||||
);
|
||||
} else if (filter_1 === "" && filter_2 !== "ทั้งหมด" && filterYear === 0) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
|
|
@ -61,27 +67,32 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
|||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
(item) => item.fiscalYear === filterYear
|
||||
);
|
||||
} else if (filter_1 === "" && filter_2 !== "ทั้งหมด" && filterYear !== null) {
|
||||
} else if (
|
||||
filter_1 === "" &&
|
||||
filter_2 !== "ทั้งหมด" &&
|
||||
filterYear !== null
|
||||
) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
(item) =>
|
||||
item.OrderStatus === filter_2 && item.fiscalYear === filterYear
|
||||
);
|
||||
} else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear === 0) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
(item) => item.OrderStatus === filter_2 && item.orderTypeValue === filter_1
|
||||
(item) =>
|
||||
item.OrderStatus === filter_2 && item.orderTypeValue === filter_1
|
||||
);
|
||||
} else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear !== null) {
|
||||
} else if (
|
||||
filter_1 !== "" &&
|
||||
filter_2 !== "ทั้งหมด" &&
|
||||
filterYear !== null
|
||||
) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value.filter(
|
||||
(item) =>
|
||||
item.orderTypeValue === filter_1 &&
|
||||
item.OrderStatus === filter_2 &&
|
||||
item.fiscalYear === filterYear
|
||||
);
|
||||
} else if (
|
||||
filter_1 == "" &&
|
||||
filter_2 == "ทั้งหมด" &&
|
||||
filterYear !== null
|
||||
) {
|
||||
} else if (filter_1 == "" && filter_2 == "ทั้งหมด" && filterYear !== null) {
|
||||
DataMainUpdateOrder.value = DataMainOrigOrder.value;
|
||||
}
|
||||
};
|
||||
|
|
@ -144,6 +155,6 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
|
|||
DataUpdateOrder,
|
||||
DataMainYearSetOrder,
|
||||
DataMainOrder,
|
||||
nameOrderFilter
|
||||
nameOrderFilter,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,15 +18,6 @@ const mixin = useCounterMixin();
|
|||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
const DataStore = useOrderPlacementDataStore();
|
||||
|
||||
const OpsFilterYear = ref<any>({
|
||||
fiscalyearOP: [],
|
||||
});
|
||||
const OpsFilterOrderType = ref<any>({
|
||||
OrderTypeOption: [],
|
||||
});
|
||||
const OpsFilterOrderStatus = ref<any>({
|
||||
OrderStatusOption: [],
|
||||
});
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: 1,
|
||||
|
|
@ -153,16 +144,6 @@ const OriginalDataFetch = async () => {
|
|||
OrderType: e.orderTypeName,
|
||||
orderTypeValue: e.orderTypeValue,
|
||||
}));
|
||||
// OpsFilterYear.value.fiscalYear = res.data.result.map((e: any) => ({
|
||||
// fiscalYear: Number(e.fiscalYear),
|
||||
// }));
|
||||
OpsFilterOrderStatus.value.OrderStatus = res.data.result.map(
|
||||
(e: any) => ({
|
||||
OrderStatus: e.orderStatusName,
|
||||
})
|
||||
);
|
||||
console.log(fiscalyear.value);
|
||||
console.log(OrderStatus.value);
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -199,22 +180,26 @@ const redirectToPage = (id?: string, status?: string) => {
|
|||
const clickAdd = () => {
|
||||
router.push({ name: "OrderAdd" });
|
||||
};
|
||||
const Ops = ref<any>({
|
||||
fiscalyearOP: [],
|
||||
});
|
||||
|
||||
// รายการข้อมูลปีงบประมาณ
|
||||
const fiscalyear = ref<number | null>(0);
|
||||
const fiscalyearOP = ref<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const fiscalyearOP = ref<any>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const fiscalyearFilter1 = ref<any>([]);
|
||||
const fiscalYearFilter = async () => {
|
||||
await http.get(config.API.yearOptionsOrder()).then((res) => {
|
||||
const response = res.data.result;
|
||||
fiscalyearOP.value = [{ id: 0, name: "ทั้งหมด" }];
|
||||
fiscalyearOP.value.push(...response);
|
||||
response.map((r: any) => {
|
||||
fiscalyearOP.value.push({ id: r.id, name: r.name.toString() });
|
||||
});
|
||||
|
||||
fiscalyearFilter1.value = [{ id: 0, name: "ทั้งหมด" }];
|
||||
fiscalyearFilter1.value.push(...response);
|
||||
response.map((r: any) => {
|
||||
fiscalyearFilter1.value.push({
|
||||
id: r.id,
|
||||
name: r.name.toString(),
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -300,7 +285,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
case "fiscalyearOP":
|
||||
update(() => {
|
||||
fiscalyearOP.value = fiscalyearFilter1.value.filter(
|
||||
(v: any) => v.name.valueOf(val) > -1
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
|
|
@ -347,6 +332,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
use-input
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
|
|
@ -356,7 +342,13 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'fiscalyearOP'
|
||||
) "
|
||||
/>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<!-- use-input -->
|
||||
<div>
|
||||
<q-btn
|
||||
|
|
@ -433,7 +425,15 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'OrderTypeOption'
|
||||
) "
|
||||
/>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
|
|
@ -456,7 +456,15 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'OrderStatusOption'
|
||||
) "
|
||||
/>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-space />
|
||||
<div><PopupHistory :OrderTypeOption="OrderTypeOption" /></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue