หน้ารายละเอียดตรง ยับยั้ง กับ อนุมัติให้ใส่เหตุผล,แก้ไขทะเบียนประวัติลูกจ้าง
This commit is contained in:
parent
be5f88cc42
commit
19ce584ef4
3 changed files with 564 additions and 181 deletions
|
|
@ -454,13 +454,40 @@
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog> -->
|
</q-dialog> -->
|
||||||
|
<q-dialog v-model="modal" persistent>
|
||||||
|
<q-card style="width: 800px">
|
||||||
|
<q-form ref="myFormConfirm">
|
||||||
|
<DialogHeader
|
||||||
|
:title="`${actionPass ? 'การอนุมัติการลาออก' : 'การยับยั้งการลาออก'}`"
|
||||||
|
:close="closeModal"
|
||||||
|
/>
|
||||||
|
<q-separator />
|
||||||
|
<q-card-section class="q-p-sm">
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||||
|
<q-input
|
||||||
|
hide-bottom-space
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
:rules="[(val) => !!val || 'กรุณากรอกเหตุผล']"
|
||||||
|
v-model="reasonReign"
|
||||||
|
:label="`${'กรอกเหตุผล'}`"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
|
<q-separator />
|
||||||
|
<DialogFooter :editvisible="true" :save="conditionPopup" />
|
||||||
|
</q-form>
|
||||||
|
</q-card>
|
||||||
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import { useQuasar, QForm } from "quasar";
|
import { useQuasar, QForm } from "quasar";
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
// import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||||
// import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRetirementDataStore } from "@/modules/06_retirement/store";
|
import { useRetirementDataStore } from "@/modules/06_retirement/store";
|
||||||
|
|
||||||
|
|
@ -487,6 +514,7 @@ const { statusText } = RetirementData;
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString());
|
const id = ref<string>(route.params.id.toString());
|
||||||
const myForm = ref<QForm | null>(null);
|
const myForm = ref<QForm | null>(null);
|
||||||
|
const myFormConfirm = ref<QForm | null>(null);
|
||||||
const edit = ref<boolean>(false);
|
const edit = ref<boolean>(false);
|
||||||
const dataDetail = ref<ResponseItems>({
|
const dataDetail = ref<ResponseItems>({
|
||||||
datetext: "",
|
datetext: "",
|
||||||
|
|
@ -522,6 +550,13 @@ const reason = ref<string>("");
|
||||||
const location = ref<string>("");
|
const location = ref<string>("");
|
||||||
const status = ref<string>("");
|
const status = ref<string>("");
|
||||||
|
|
||||||
|
const modal = ref<boolean>(false);
|
||||||
|
const actionPass = ref<boolean>(false);
|
||||||
|
const reasonReign = ref<string>("");
|
||||||
|
|
||||||
|
const closeModal = () => (modal.value = false);
|
||||||
|
const openModal = () => (modal.value = true);
|
||||||
|
|
||||||
// const modalPass = ref<boolean>(false);
|
// const modalPass = ref<boolean>(false);
|
||||||
// const modalPassNot = ref<boolean>(false);
|
// const modalPassNot = ref<boolean>(false);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
@ -558,39 +593,60 @@ const fetchData = async (id: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const popUp = (action: "pass" | "passNot") => {
|
const popUp = (action: "pass" | "passNot") => {
|
||||||
if (action === "pass") {
|
reasonReign.value = "";
|
||||||
$q.dialog({
|
actionPass.value = action === "pass";
|
||||||
title: "ยืนยันการอนุมัติการลาออก",
|
openModal();
|
||||||
message: "ต้องการยืนยันอนุมัติการลาออกนี้ใช่หรือไม่?",
|
// if (action === "pass") {
|
||||||
cancel: {
|
// $q.dialog({
|
||||||
flat: true,
|
// title: "ยืนยันการอนุมัติการลาออก",
|
||||||
color: "negative",
|
// message: "ต้องการยืนยันอนุมัติการลาออกนี้ใช่หรือไม่?",
|
||||||
},
|
// cancel: {
|
||||||
persistent: true,
|
// flat: true,
|
||||||
}).onOk(async () => {
|
// color: "negative",
|
||||||
confirmpopUp();
|
// },
|
||||||
});
|
// persistent: true,
|
||||||
} else if (action === "passNot") {
|
// }).onOk(async () => {
|
||||||
$q.dialog({
|
// confirmpopUp();
|
||||||
title: "ยืนยันการยับยั้งการลาออก",
|
// });
|
||||||
message: "ต้องการยืนยันการยับยั้งการลาออกนี้ใช่หรือไม่?",
|
// } else if (action === "passNot") {
|
||||||
cancel: {
|
// $q.dialog({
|
||||||
flat: true,
|
// title: "ยืนยันการยับยั้งการลาออก",
|
||||||
color: "negative",
|
// message: "ต้องการยืนยันการยับยั้งการลาออกนี้ใช่หรือไม่?",
|
||||||
},
|
// cancel: {
|
||||||
persistent: true,
|
// flat: true,
|
||||||
}).onOk(async () => {
|
// color: "negative",
|
||||||
rejectpopUp();
|
// },
|
||||||
|
// persistent: true,
|
||||||
|
// }).onOk(async () => {
|
||||||
|
// rejectpopUp();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
};
|
||||||
|
|
||||||
|
const conditionPopup = () => {
|
||||||
|
if (myFormConfirm.value !== null) {
|
||||||
|
myFormConfirm.value.validate().then(async (check) => {
|
||||||
|
if (check) {
|
||||||
|
if (actionPass.value) {
|
||||||
|
await confirmpopUp();
|
||||||
|
} else {
|
||||||
|
await rejectpopUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const confirmpopUp = async () => {
|
const confirmpopUp = async () => {
|
||||||
|
const body = {
|
||||||
|
reason: reasonReign.value,
|
||||||
|
};
|
||||||
await http
|
await http
|
||||||
.get(config.API.resignConfirm(id.value))
|
.put(config.API.resignConfirm(id.value), body)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("ยืนยัน");
|
console.log("ยืนยัน");
|
||||||
success($q, "บันทึกสำเร็จ");
|
success($q, "การอนุมัติสำเร็จ");
|
||||||
|
closeModal();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
@ -602,11 +658,14 @@ const confirmpopUp = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const rejectpopUp = async () => {
|
const rejectpopUp = async () => {
|
||||||
console.log("ยกเลิก");
|
const body = {
|
||||||
|
reason: reasonReign.value,
|
||||||
|
};
|
||||||
await http
|
await http
|
||||||
.get(config.API.resignReject(id.value))
|
.put(config.API.resignReject(id.value), body)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "บันทึกสำเร็จ");
|
success($q, "การยับยั้งสำเร็จ");
|
||||||
|
closeModal();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ interface FormRegistryEmployee {
|
||||||
draftOrganizationOrganization: String | null;
|
draftOrganizationOrganization: String | null;
|
||||||
newAgency: String | null;
|
newAgency: String | null;
|
||||||
currentAgency: String | null;
|
currentAgency: String | null;
|
||||||
|
status: String;
|
||||||
|
statustext: String;
|
||||||
}
|
}
|
||||||
interface ResponseEmployeeTemp {
|
interface ResponseEmployeeTemp {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -49,5 +51,6 @@ interface ResponseEmployeeTemp {
|
||||||
leaveDateOrder: Date | null;
|
leaveDateOrder: Date | null;
|
||||||
draftPositionEmployee: String | null;
|
draftPositionEmployee: String | null;
|
||||||
draftOrganizationOrganization: String | null;
|
draftOrganizationOrganization: String | null;
|
||||||
|
draftOrgEmployeeStatus: String;
|
||||||
}
|
}
|
||||||
export type { ResponseEmployeeTemp, FormRegistryEmployee };
|
export type { ResponseEmployeeTemp, FormRegistryEmployee };
|
||||||
|
|
|
||||||
|
|
@ -7,26 +7,64 @@
|
||||||
<q-btn flat round color="primary" @click="clickAdd" icon="mdi-plus">
|
<q-btn flat round color="primary" @click="clickAdd" icon="mdi-plus">
|
||||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn flat round color="primary" icon="mdi-account-arrow-right" @click="clickAddOrder" />
|
<q-btn
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
icon="mdi-account-arrow-right"
|
||||||
|
@click="clickAddOrder"
|
||||||
|
>
|
||||||
|
<q-tooltip>ส่งรายชื่อไปออกคำสั่ง</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="items-center" style="display: flex">
|
<div class="items-center" style="display: flex">
|
||||||
<!-- ค้นหาข้อความใน table -->
|
<!-- ค้นหาข้อความใน table -->
|
||||||
<q-input standout dense v-model="filter" ref="filterRef" outlined debounce="300" placeholder="ค้นหา"
|
<q-input
|
||||||
style="max-width: 200px" class="q-ml-sm">
|
standout
|
||||||
|
dense
|
||||||
|
v-model="filter"
|
||||||
|
ref="filterRef"
|
||||||
|
outlined
|
||||||
|
debounce="300"
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
style="max-width: 200px"
|
||||||
|
class="q-ml-sm"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="filter == ''" name="search" />
|
<q-icon v-if="filter == ''" name="search" />
|
||||||
<q-icon v-if="filter !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
<q-icon
|
||||||
|
v-if="filter !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="resetFilter"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
<!-- แสดงคอลัมน์ใน table -->
|
<!-- แสดงคอลัมน์ใน table -->
|
||||||
<q-select v-model="visibleColumnsEmployeeTemp" :display-value="$q.lang.table.columns" multiple outlined dense
|
<q-select
|
||||||
:options="columns" options-dense option-value="name" map-options emit-value style="min-width: 150px"
|
v-model="visibleColumnsEmployeeTemp"
|
||||||
class="gt-xs q-ml-sm" />
|
:display-value="$q.lang.table.columns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
:options="columns"
|
||||||
|
options-dense
|
||||||
|
option-value="name"
|
||||||
|
map-options
|
||||||
|
emit-value
|
||||||
|
style="min-width: 150px"
|
||||||
|
class="gt-xs q-ml-sm"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-pt-sm">
|
<div class="col-12 q-pt-sm">
|
||||||
<d-table :rows="rows" :columns="columns" :visible-columns="visibleColumnsEmployeeTemp" :filter="filter"
|
<d-table
|
||||||
row-key="id">
|
:rows="rows"
|
||||||
|
:columns="columns"
|
||||||
|
:visible-columns="visibleColumnsEmployeeTemp"
|
||||||
|
:filter="filter"
|
||||||
|
row-key="id"
|
||||||
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
|
@ -37,16 +75,32 @@
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td key="no" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="no"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="fullname" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="fullname"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.fullname }}
|
{{ props.row.fullname }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="newAgency" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
<div class="col-12" v-if="props.row.draftOrganizationOrganization == null &&
|
key="newAgency"
|
||||||
props.row.draftPositionEmployee == null
|
:props="props"
|
||||||
">
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="col-12"
|
||||||
|
v-if="
|
||||||
|
props.row.draftOrganizationOrganization == null &&
|
||||||
|
props.row.draftPositionEmployee == null
|
||||||
|
"
|
||||||
|
>
|
||||||
<div class="text-weight-medium">
|
<div class="text-weight-medium">
|
||||||
{{ "-" }}
|
{{ "-" }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -60,8 +114,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="currentAgency" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
<div class="col-12" v-if="props.row.oc == null && props.row.position == null">
|
key="currentAgency"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="col-12"
|
||||||
|
v-if="props.row.oc == null && props.row.position == null"
|
||||||
|
>
|
||||||
<div class="text-weight-medium">
|
<div class="text-weight-medium">
|
||||||
{{ "-" }}
|
{{ "-" }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -78,82 +139,182 @@
|
||||||
<!-- <q-td
|
<!-- <q-td
|
||||||
key="positionEmployeePosition"
|
key="positionEmployeePosition"
|
||||||
:props="props"
|
:props="props"
|
||||||
@click="redirectToPage(props.row.id)"
|
@click="redirectToPage(props.row.id,props.row.status)"
|
||||||
>
|
>
|
||||||
{{ props.row.positionEmployeePosition }}
|
{{ props.row.positionEmployeePosition }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td
|
<q-td
|
||||||
key="positionEmployeePositionSide"
|
key="positionEmployeePositionSide"
|
||||||
:props="props"
|
:props="props"
|
||||||
@click="redirectToPage(props.row.id)"
|
@click="redirectToPage(props.row.id,props.row.status)"
|
||||||
>
|
>
|
||||||
{{ props.row.positionEmployeePositionSide }}
|
{{ props.row.positionEmployeePositionSide }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td
|
<q-td
|
||||||
key="positionLine"
|
key="positionLine"
|
||||||
:props="props"
|
:props="props"
|
||||||
@click="redirectToPage(props.row.id)"
|
@click="redirectToPage(props.row.id,props.row.status)"
|
||||||
>
|
>
|
||||||
{{ props.row.positionLine }}
|
{{ props.row.positionLine }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td
|
<q-td
|
||||||
key="positionEmployeeGroup"
|
key="positionEmployeeGroup"
|
||||||
:props="props"
|
:props="props"
|
||||||
@click="redirectToPage(props.row.id)"
|
@click="redirectToPage(props.row.id,props.row.status)"
|
||||||
>
|
>
|
||||||
{{ props.row.positionEmployeeGroup }}
|
{{ props.row.positionEmployeeGroup }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="oc" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td key="oc" :props="props" @click="redirectToPage(props.row.id,props.row.status)">
|
||||||
{{ props.row.oc }}
|
{{ props.row.oc }}
|
||||||
</q-td> -->
|
</q-td> -->
|
||||||
<q-td key="amount" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="amount"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.amount }}
|
{{ props.row.amount }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="govAge" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="govAge"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.govAge }}
|
{{ props.row.govAge }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="dateAppoint" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="dateAppoint"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.dateAppoint }}
|
{{ props.row.dateAppoint }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="dateStart" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="dateStart"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.dateStart }}
|
{{ props.row.dateStart }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="salaryDate" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="salaryDate"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.salaryDate }}
|
{{ props.row.salaryDate }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="refSalary" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="refSalary"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.refSalary }}
|
{{ props.row.refSalary }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="age" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="age"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.age }}
|
{{ props.row.age }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="fullnameOld" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="fullnameOld"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.fullnameOld }}
|
{{ props.row.fullnameOld }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="createdAt" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="createdAt"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.createdAt }}
|
{{ props.row.createdAt }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="isLeave" :props="props" @click="redirectToPage(props.row.id)">
|
<q-td
|
||||||
|
key="isLeave"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.isLeave }}
|
{{ props.row.isLeave }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="leaveDateOrder" :props="props" @click="redirectToPage(props.row.id)">
|
|
||||||
|
<q-td
|
||||||
|
key="leaveDateOrder"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
{{ props.row.leaveDateOrder }}
|
{{ props.row.leaveDateOrder }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
<q-td
|
||||||
|
key="statustext"
|
||||||
|
:props="props"
|
||||||
|
@click="redirectToPage(props.row.id, props.row.status)"
|
||||||
|
>
|
||||||
|
{{ props.row.statustext }}
|
||||||
|
</q-td>
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
<q-btn icon="mdi-dots-vertical" size="12px" color="grey-7" flat round dense>
|
<q-btn
|
||||||
|
icon="mdi-dots-vertical"
|
||||||
|
size="12px"
|
||||||
|
color="grey-7"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
>
|
||||||
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
<q-menu transition-show="jump-down" transition-hide="jump-up">
|
||||||
<q-list dense style="min-width: 160px">
|
<q-list dense style="min-width: 160px">
|
||||||
<q-item clickable v-close-popup @click="editDetail(props.row)">
|
<q-item
|
||||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
clickable
|
||||||
<q-icon color="blue" size="xs" name="mdi-account-settings" />
|
v-close-popup
|
||||||
|
@click="editDetail(props.row)"
|
||||||
|
: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'
|
||||||
|
: 'blue'
|
||||||
|
"
|
||||||
|
size="xs"
|
||||||
|
name="mdi-account-settings"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>กำหนดตำแหน่ง</q-item-section>
|
<q-item-section>กำหนดตำแหน่ง</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-item clickable v-close-popup @click="clickDelete(props.row.id)">
|
<q-item
|
||||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
|
clickable
|
||||||
<q-icon color="red" size="xs" name="mdi-delete" />
|
v-close-popup
|
||||||
|
@click="clickDelete(props.row.id)"
|
||||||
|
: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'
|
||||||
|
: 'red-7'
|
||||||
|
"
|
||||||
|
size="xs"
|
||||||
|
name="mdi-delete"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section>ลบ</q-item-section>
|
<q-item-section>ลบ</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
@ -173,16 +334,34 @@
|
||||||
<DialogHeader tittle="กำหนดตำแหน่ง" :close="modalOpenClose" />
|
<DialogHeader tittle="กำหนดตำแหน่ง" :close="modalOpenClose" />
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section class="q-pa-sm">
|
<q-card-section class="q-pa-sm">
|
||||||
<d-table :rows="rowsPosition" :columns="columnsPosition" row-key="id" selection="single"
|
<d-table
|
||||||
v-model:selected="selectedPosition" :visible-columns="visibleColumnsPosition">
|
:rows="rowsPosition"
|
||||||
|
:columns="columnsPosition"
|
||||||
|
row-key="id"
|
||||||
|
selection="single"
|
||||||
|
v-model:selected="selectedPosition"
|
||||||
|
:visible-columns="visibleColumnsPosition"
|
||||||
|
>
|
||||||
<template v-slot:body-selection="scope">
|
<template v-slot:body-selection="scope">
|
||||||
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
|
<q-checkbox
|
||||||
|
keep-color
|
||||||
|
color="primary"
|
||||||
|
dense
|
||||||
|
v-model="scope.selected"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right">
|
||||||
<q-btn dense unelevated label="บันทึก" color="public" @click="checkSave" class="q-px-md"><!-- icon="mdi-content-save-outline"
|
<q-btn
|
||||||
|
dense
|
||||||
|
unelevated
|
||||||
|
label="บันทึก"
|
||||||
|
color="public"
|
||||||
|
@click="checkSave"
|
||||||
|
class="q-px-md"
|
||||||
|
><!-- icon="mdi-content-save-outline"
|
||||||
<q-tooltip>บันทึก</q-tooltip> -->
|
<q-tooltip>บันทึก</q-tooltip> -->
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
|
|
@ -192,14 +371,24 @@
|
||||||
<!-- dialog ส่งรายชื่อไปออกคำสั่ง -->
|
<!-- dialog ส่งรายชื่อไปออกคำสั่ง -->
|
||||||
<q-dialog v-model="modaladdOrder">
|
<q-dialog v-model="modaladdOrder">
|
||||||
<q-card style="width: 900px; max-width: 80vw">
|
<q-card style="width: 900px; max-width: 80vw">
|
||||||
<DialogHeader tittle="ส่งรายชื่อไปออกคำสั่ง" :close="clickCloseSendModal" />
|
<DialogHeader
|
||||||
|
tittle="ส่งรายชื่อไปออกคำสั่ง"
|
||||||
|
:close="clickCloseSendModal"
|
||||||
|
/>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section class="q-pt-none">
|
<q-card-section class="q-pt-none">
|
||||||
<div class="row justify-end">
|
<div class="row justify-end">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<q-toolbar style="padding: 0">
|
<q-toolbar style="padding: 0">
|
||||||
<q-input borderless outlined dense debounce="300" v-model="filter" placeholder="ค้นหา"
|
<q-input
|
||||||
style="width: 850px; max-width: auto">
|
borderless
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
debounce="300"
|
||||||
|
v-model="filter"
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
style="width: 850px; max-width: auto"
|
||||||
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -208,37 +397,80 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<d-table :rows="rowsOrder" :columns="columnsOrder" :visible-columns="visibleColumnsOrder" :filter="filter"
|
<d-table
|
||||||
row-key="id" selection="single" v-model:selected="selectedToOrder">
|
:rows="rowsOrder"
|
||||||
|
:columns="columnsOrder"
|
||||||
|
:visible-columns="visibleColumnsOrder"
|
||||||
|
:filter="filter"
|
||||||
|
row-key="id"
|
||||||
|
selection="single"
|
||||||
|
v-model:selected="selectedToOrder"
|
||||||
|
>
|
||||||
<template v-slot:body-selection="scope">
|
<template v-slot:body-selection="scope">
|
||||||
<q-checkbox keep-color color="primary" dense v-model="scope.selected" />
|
<q-checkbox
|
||||||
|
keep-color
|
||||||
|
color="primary"
|
||||||
|
dense
|
||||||
|
v-model="scope.selected"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td>
|
<q-td>
|
||||||
<q-checkbox keep-color color="primary" dense v-model="props.selected" />
|
<q-checkbox
|
||||||
|
keep-color
|
||||||
|
color="primary"
|
||||||
|
dense
|
||||||
|
v-model="props.selected"
|
||||||
|
/>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
<q-td key="no" :props="props">
|
<q-td key="no" :props="props">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="fullname" :props="props">
|
<q-td key="fullname" :props="props">
|
||||||
{{ props.row.fullname }}
|
{{ props.row.fullname }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="positionEmployeePosition" :props="props">
|
<q-td key="newAgency" :props="props">
|
||||||
{{ props.row.positionEmployeePosition }}
|
<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>
|
||||||
<q-td key="positionEmployeePositionSide" :props="props">
|
<q-td key="currentAgency" :props="props">
|
||||||
{{ props.row.positionEmployeePositionSide }}
|
<div
|
||||||
</q-td>
|
class="col-12"
|
||||||
<q-td key="positionLine" :props="props">
|
v-if="props.row.oc == null && props.row.position == null"
|
||||||
{{ props.row.positionLine }}
|
>
|
||||||
</q-td>
|
<div class="text-weight-medium">
|
||||||
<q-td key="positionEmployeeGroup" :props="props">
|
{{ "-" }}
|
||||||
{{ props.row.positionEmployeeGroup }}
|
</div>
|
||||||
</q-td>
|
</div>
|
||||||
<q-td key="oc" :props="props">
|
<div class="col-12" v-else>
|
||||||
{{ props.row.oc }}
|
<div class="text-weight-medium">
|
||||||
|
{{ props.row.oc ?? "-" }}
|
||||||
|
</div>
|
||||||
|
<div class="text-weight-light">
|
||||||
|
{{ props.row.position ?? "-" }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
<q-td key="amount" :props="props">
|
<q-td key="amount" :props="props">
|
||||||
{{ props.row.amount }}
|
{{ props.row.amount }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
@ -269,9 +501,13 @@
|
||||||
<q-td key="isLeave" :props="props">
|
<q-td key="isLeave" :props="props">
|
||||||
{{ props.row.isLeave }}
|
{{ props.row.isLeave }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
||||||
<q-td key="leaveDateOrder" :props="props">
|
<q-td key="leaveDateOrder" :props="props">
|
||||||
{{ props.row.leaveDateOrder }}
|
{{ props.row.leaveDateOrder }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
<q-td key="statustext" :props="props">
|
||||||
|
{{ props.row.statustext }}
|
||||||
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
@ -322,7 +558,7 @@ const {
|
||||||
dialogMessage,
|
dialogMessage,
|
||||||
dialogRemove,
|
dialogRemove,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
dialogMessageNotify
|
dialogMessageNotify,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const modaladdOrder = ref<boolean>(false);
|
const modaladdOrder = ref<boolean>(false);
|
||||||
|
|
@ -368,12 +604,13 @@ const visibleColumnsOrder = ref<String[]>([
|
||||||
"salaryDate",
|
"salaryDate",
|
||||||
"age",
|
"age",
|
||||||
"amount",
|
"amount",
|
||||||
"isLeave",
|
"statustext",
|
||||||
"leaveDateOrder",
|
"leaveDateOrder",
|
||||||
|
"newAgency",
|
||||||
|
"currentAgency",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const visibleColumnsEmployeeTemp = ref<String[]>([]);
|
const visibleColumnsEmployeeTemp = ref<String[]>([
|
||||||
visibleColumnsEmployeeTemp.value = [
|
|
||||||
"no",
|
"no",
|
||||||
"fullname",
|
"fullname",
|
||||||
"fullnameOld",
|
"fullnameOld",
|
||||||
|
|
@ -390,10 +627,12 @@ visibleColumnsEmployeeTemp.value = [
|
||||||
"salaryDate",
|
"salaryDate",
|
||||||
"age",
|
"age",
|
||||||
"amount",
|
"amount",
|
||||||
|
"statustext",
|
||||||
"leaveDateOrder",
|
"leaveDateOrder",
|
||||||
"newAgency",
|
"newAgency",
|
||||||
"currentAgency",
|
"currentAgency",
|
||||||
];
|
]);
|
||||||
|
|
||||||
// "isLeave",
|
// "isLeave",
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -645,6 +884,20 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
// sort: (a: string, b: string) =>
|
// sort: (a: string, b: string) =>
|
||||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
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",
|
||||||
|
}),
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
const rows = ref<FormRegistryEmployee[]>([]);
|
const rows = ref<FormRegistryEmployee[]>([]);
|
||||||
|
|
||||||
|
|
@ -788,13 +1041,12 @@ const columnsOrder = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px; min-width: 200px",
|
headerStyle: "font-size: 14px; min-width: 200px",
|
||||||
style: "font-size: 14px; ",
|
style: "font-size: 14px; ",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "positionEmployeePosition",
|
name: "newAgency",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ตำแหน่ง",
|
label: "หน่วยงานที่รับการบรรจุ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "positionEmployeePosition",
|
field: "newAgency",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -804,25 +1056,11 @@ const columnsOrder = ref<QTableProps["columns"]>([
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "positionEmployeePositionSide",
|
name: "currentAgency",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ด้านของตำแหน่ง",
|
label: "หน่วยงานปัจจุบัน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "positionEmployeePositionSide",
|
field: "currentAgency",
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, {
|
|
||||||
numeric: true,
|
|
||||||
sensitivity: "base",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "positionLine",
|
|
||||||
align: "left",
|
|
||||||
label: "สายงาน",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionLine",
|
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -832,34 +1070,77 @@ const columnsOrder = ref<QTableProps["columns"]>([
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
// {
|
||||||
name: "positionEmployeeGroup",
|
// name: "positionEmployeePosition",
|
||||||
align: "left",
|
// align: "left",
|
||||||
label: "กลุ่มงาน",
|
// label: "ตำแหน่ง",
|
||||||
sortable: true,
|
// sortable: true,
|
||||||
field: "positionEmployeeGroup",
|
// field: "positionEmployeePosition",
|
||||||
headerStyle: "font-size: 14px",
|
// headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
// style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
// sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, {
|
// a.localeCompare(b, undefined, {
|
||||||
numeric: true,
|
// numeric: true,
|
||||||
sensitivity: "base",
|
// sensitivity: "base",
|
||||||
}),
|
// }),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
name: "oc",
|
// name: "positionEmployeePositionSide",
|
||||||
align: "left",
|
// align: "left",
|
||||||
label: "สังกัด",
|
// label: "ด้านของตำแหน่ง",
|
||||||
sortable: true,
|
// sortable: true,
|
||||||
field: "oc",
|
// field: "positionEmployeePositionSide",
|
||||||
headerStyle: "font-size: 14px",
|
// headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
// style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
// sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, {
|
// a.localeCompare(b, undefined, {
|
||||||
numeric: true,
|
// numeric: true,
|
||||||
sensitivity: "base",
|
// sensitivity: "base",
|
||||||
}),
|
// }),
|
||||||
},
|
// },
|
||||||
|
// {
|
||||||
|
// name: "positionLine",
|
||||||
|
// align: "left",
|
||||||
|
// label: "สายงาน",
|
||||||
|
// sortable: true,
|
||||||
|
// field: "positionLine",
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// sort: (a: string, b: string) =>
|
||||||
|
// a.localeCompare(b, undefined, {
|
||||||
|
// numeric: true,
|
||||||
|
// sensitivity: "base",
|
||||||
|
// }),
|
||||||
|
// },
|
||||||
|
|
||||||
|
// {
|
||||||
|
// name: "positionEmployeeGroup",
|
||||||
|
// align: "left",
|
||||||
|
// label: "กลุ่มงาน",
|
||||||
|
// sortable: true,
|
||||||
|
// field: "positionEmployeeGroup",
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// sort: (a: string, b: string) =>
|
||||||
|
// a.localeCompare(b, undefined, {
|
||||||
|
// numeric: true,
|
||||||
|
// sensitivity: "base",
|
||||||
|
// }),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "oc",
|
||||||
|
// align: "left",
|
||||||
|
// label: "สังกัด",
|
||||||
|
// sortable: true,
|
||||||
|
// field: "oc",
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// sort: (a: string, b: string) =>
|
||||||
|
// a.localeCompare(b, undefined, {
|
||||||
|
// numeric: true,
|
||||||
|
// sensitivity: "base",
|
||||||
|
// }),
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
name: "amount",
|
name: "amount",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -964,17 +1245,17 @@ const columnsOrder = ref<QTableProps["columns"]>([
|
||||||
// sort: (a: string, b: string) =>
|
// sort: (a: string, b: string) =>
|
||||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: "isLeave",
|
// name: "isLeave",
|
||||||
align: "left",
|
// align: "left",
|
||||||
label: "สถานะ",
|
// label: "สถานะ",
|
||||||
sortable: true,
|
// sortable: true,
|
||||||
field: "isLeave",
|
// field: "isLeave",
|
||||||
headerStyle: "font-size: 14px",
|
// headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
// style: "font-size: 14px",
|
||||||
// sort: (a: string, b: string) =>
|
// // sort: (a: string, b: string) =>
|
||||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
// // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: "leaveDateOrder",
|
name: "leaveDateOrder",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -986,8 +1267,23 @@ const columnsOrder = ref<QTableProps["columns"]>([
|
||||||
// sort: (a: string, b: string) =>
|
// sort: (a: string, b: string) =>
|
||||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
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",
|
||||||
|
}),
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
const rowsOrder = ref<FormRegistryEmployee[]>([]);
|
const rowsOrder = ref<FormRegistryEmployee[]>([]);
|
||||||
|
const filters = ref<FormRegistryEmployee[]>([]);
|
||||||
const selected = ref([]);
|
const selected = ref([]);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await nodeTree();
|
await nodeTree();
|
||||||
|
|
@ -997,8 +1293,8 @@ const checkNull = (text: string) =>
|
||||||
text == null
|
text == null
|
||||||
? ""
|
? ""
|
||||||
: text == "00000000-0000-0000-0000-000000000000"
|
: text == "00000000-0000-0000-0000-000000000000"
|
||||||
? ""
|
? ""
|
||||||
: text;
|
: text;
|
||||||
|
|
||||||
const getPosition = async (id: string) => {
|
const getPosition = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -1079,23 +1375,24 @@ const getPosition = async (id: string) => {
|
||||||
|
|
||||||
const clickAddOrder = () => {
|
const clickAddOrder = () => {
|
||||||
modaladdOrder.value = true;
|
modaladdOrder.value = true;
|
||||||
const filteredRows = rowsOrder.value.filter(
|
const row = filters.value.filter(
|
||||||
(row) => row.draftPositionEmployee !== null
|
(r: FormRegistryEmployee) => r.status == "PENDING"
|
||||||
);
|
);
|
||||||
rowsOrder.value = filteredRows;
|
|
||||||
|
rowsOrder.value = row;
|
||||||
};
|
};
|
||||||
|
|
||||||
const clickCloseSendModal = () => {
|
const clickCloseSendModal = () => {
|
||||||
modaladdOrder.value = false;
|
modaladdOrder.value = false;
|
||||||
};
|
};
|
||||||
const checkSave = () => {
|
const checkSave = () => {
|
||||||
dialogConfirm($q, async () => await saveData())
|
dialogConfirm($q, async () => await saveData());
|
||||||
}
|
};
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
if (selectedPosition.value.length == 0) {
|
if (selectedPosition.value.length == 0) {
|
||||||
dialogMessageNotify(
|
dialogMessageNotify(
|
||||||
$q,
|
$q,
|
||||||
"ไม่สามารถบันทึกข้อมูลได้ กรุณาเลือกตำแหน่ง",
|
"ไม่สามารถบันทึกข้อมูลได้ กรุณาเลือกตำแหน่ง"
|
||||||
// "กรุณาเลือกตำแหน่ง",
|
// "กรุณาเลือกตำแหน่ง",
|
||||||
// "warning",
|
// "warning",
|
||||||
// undefined,
|
// undefined,
|
||||||
|
|
@ -1110,8 +1407,8 @@ const saveData = async () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const checkSaveOrder = () => {
|
const checkSaveOrder = () => {
|
||||||
dialogConfirm($q, () => SaveOrder())
|
dialogConfirm($q, () => SaveOrder());
|
||||||
}
|
};
|
||||||
const SaveOrder = async () => {
|
const SaveOrder = async () => {
|
||||||
// ส่งไปออกคำสั่ง
|
// ส่งไปออกคำสั่ง
|
||||||
let pId: string[] = [];
|
let pId: string[] = [];
|
||||||
|
|
@ -1194,8 +1491,10 @@ const clickAdd = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// ดูรายการแก้ไขรายชื่อ
|
// ดูรายการแก้ไขรายชื่อ
|
||||||
const redirectToPage = (id?: string) => {
|
const redirectToPage = (id?: string, status?: string) => {
|
||||||
router.push(`/registry-employee/edit/${id}`);
|
if (!(status == "REPORT" || status == "DONE")) {
|
||||||
|
router.push(`/registry-employee/edit/${id}`);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const editDetail = async (row: any) => {
|
const editDetail = async (row: any) => {
|
||||||
await getPosition(row.id);
|
await getPosition(row.id);
|
||||||
|
|
@ -1204,10 +1503,9 @@ const editDetail = async (row: any) => {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const clickDelete = (id: string) => {
|
const clickDelete = (id: string) => {
|
||||||
dialogRemove($q, async () => await deleteData(id))
|
dialogRemove($q, async () => await deleteData(id));
|
||||||
}
|
};
|
||||||
|
|
||||||
const deleteData = async (id: string) => {
|
const deleteData = async (id: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -1222,7 +1520,7 @@ const deleteData = async (id: string) => {
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const nodeTree = async () => {
|
const nodeTree = async () => {
|
||||||
|
|
@ -1266,10 +1564,12 @@ const showEmployeeTemp = async () => {
|
||||||
criterias: cirteria,
|
criterias: cirteria,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data = res.data.result;
|
const data = res.data.result;
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
|
filters.value = [];
|
||||||
|
let list: FormRegistryEmployee[] = [];
|
||||||
data.map((e: ResponseEmployeeTemp) => {
|
data.map((e: ResponseEmployeeTemp) => {
|
||||||
rows.value.push({
|
list.push({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
fullname: e.fullname,
|
fullname: e.fullname,
|
||||||
fullnameOld: e.fullnameOld,
|
fullnameOld: e.fullnameOld,
|
||||||
|
|
@ -1299,10 +1599,12 @@ const showEmployeeTemp = async () => {
|
||||||
currentAgency: "",
|
currentAgency: "",
|
||||||
draftPositionEmployee: e.draftPositionEmployee,
|
draftPositionEmployee: e.draftPositionEmployee,
|
||||||
draftOrganizationOrganization: e.draftOrganizationOrganization,
|
draftOrganizationOrganization: e.draftOrganizationOrganization,
|
||||||
|
status: e.draftOrgEmployeeStatus ?? "",
|
||||||
|
statustext: statusText(e.draftOrgEmployeeStatus ?? ""),
|
||||||
});
|
});
|
||||||
|
|
||||||
rowsOrder.value = rows.value.filter((e: any) => e.draftPositionEmployee !== null);
|
|
||||||
});
|
});
|
||||||
|
rows.value = list;
|
||||||
|
filters.value = list;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -1312,6 +1614,26 @@ const showEmployeeTemp = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const statusText = (val: String) => {
|
||||||
|
switch (val) {
|
||||||
|
case "WAITTING":
|
||||||
|
return "รอดำเนินการ";
|
||||||
|
case "PENDING":
|
||||||
|
return "เลือกตำแหน่งแล้ว";
|
||||||
|
case "APPROVE":
|
||||||
|
return "อนุมัติ";
|
||||||
|
case "REJECT":
|
||||||
|
return "ไม่อนุมัติ";
|
||||||
|
case "REPORT":
|
||||||
|
return "ส่งรายชื่อไปออกคำสั่ง";
|
||||||
|
case "DONE":
|
||||||
|
return "ออกคำสั่งเสร็จแล้ว";
|
||||||
|
|
||||||
|
default:
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// const showEmployeeTempOrder = async () => {
|
// const showEmployeeTempOrder = async () => {
|
||||||
// let cirteria = [];
|
// let cirteria = [];
|
||||||
|
|
||||||
|
|
@ -1380,6 +1702,5 @@ const showEmployeeTemp = async () => {
|
||||||
const onSelected = async (id: string) => {
|
const onSelected = async (id: string) => {
|
||||||
// await fetchPositionNumber(id);
|
// await fetchPositionNumber(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss"></style>
|
<style lang="scss"></style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue