เพิ่ม ลูกจ้าง
This commit is contained in:
parent
1ad01d8886
commit
4ae899a2c7
8 changed files with 3036 additions and 1 deletions
|
|
@ -0,0 +1,285 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watchEffect, computed } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
|
||||
import type { PropType } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
|
||||
/** use */
|
||||
const $q = useQuasar();
|
||||
const stroe = useRetirementDataStore();
|
||||
const { statusText } = stroe;
|
||||
const selected = ref<ResponseItems[]>([]);
|
||||
const dataMapToSend = computed(() => {
|
||||
return selected.value.map((i: any) => ({
|
||||
id: i.id,
|
||||
profileId: i.profileId,
|
||||
prefix: i.prefix,
|
||||
firstName: i.firstName,
|
||||
lastName: i.lastName,
|
||||
citizenId: i.citizenId,
|
||||
remarkVertical: i.reason,
|
||||
remarkHorizontal: i.remarkHorizontal,
|
||||
}));
|
||||
});
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, date2Thai } = mixin;
|
||||
|
||||
/** props*/
|
||||
const props = defineProps({
|
||||
modal: { type: Boolean, requreid: true },
|
||||
closeModal: { type: Function, requreid: true },
|
||||
fecthList: { type: Function, requreid: true },
|
||||
rows: { type: Array as PropType<ResponseItems[]>, requreid: true },
|
||||
filterKeyword2: { type: String, requreid: true },
|
||||
mainTabs: { type: String, requreid: true },
|
||||
});
|
||||
|
||||
//Table
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: (row) => props?.rows!.indexOf(row) + 1,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "location",
|
||||
align: "left",
|
||||
label: "สถานที่ยื่นขอลาออกจากราชการ",
|
||||
sortable: true,
|
||||
field: "location",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "กลุ่มงาน",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
let name = "";
|
||||
if (row.positionTypeOld && row.positionLevelOld) {
|
||||
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
|
||||
} else if (row.positionTypeOld) {
|
||||
name = `${row.positionTypeOld}`;
|
||||
} else if (row.positionLevelOld) {
|
||||
name = `(${row.positionLevelOld})`;
|
||||
} else name = "-";
|
||||
return name;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "positionNumberOld",
|
||||
align: "left",
|
||||
label: "เลขที่",
|
||||
sortable: true,
|
||||
field: "positionNumberOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organizationPositionOld",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง/สังกัดเดิม",
|
||||
sortable: true,
|
||||
field: "organizationPositionOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "datetext",
|
||||
align: "left",
|
||||
label: "วันที่ยื่น",
|
||||
sortable: true,
|
||||
field: (row) => date2Thai(new Date(row.createdAt)),
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sortOrder: "da",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: (row) => statusText(row.status),
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"location",
|
||||
"positionLevel",
|
||||
"positionNumberOld",
|
||||
"organizationPositionOld",
|
||||
"datetext",
|
||||
"status",
|
||||
]);
|
||||
|
||||
const modalCommand = ref<boolean>(false);
|
||||
|
||||
/** popup ยืนยันส่งัว */
|
||||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
props.closeModal?.();
|
||||
modalCommand.value = true;
|
||||
},
|
||||
"ยืนยันส่งไปออกคำสั่ง",
|
||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
|
||||
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
|
||||
function updateInput(value: any) {
|
||||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
/** รีเซ็ตค่าในช่องค้นหา */
|
||||
function Reset() {
|
||||
emit("update:filterKeyword2", "");
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
if (props.modal === true) {
|
||||
selected.value = [];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader tittle="ส่งไปออกคำสั่งลาออก" :close="closeModal" />
|
||||
<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"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
/>
|
||||
</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"
|
||||
style="min-width: 140px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword2"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
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 v-for="col in props.cols" :key="col.id">
|
||||
<div
|
||||
:class="
|
||||
col.name === 'organizationPositionOld' ||
|
||||
col.name === 'organization'
|
||||
? 'table_ellipsis2'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ col.value ? col.value : "" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="saveOrder"
|
||||
:disable="selected.length === 0"
|
||||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="props.mainTabs === '1' ? 'C-PM-17' : 'C-PM-41'"
|
||||
:persons="dataMapToSend"
|
||||
/>
|
||||
</template>
|
||||
38
src/modules/06_retirement/components/resignEMP/Main.vue
Normal file
38
src/modules/06_retirement/components/resignEMP/Main.vue
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<script setup lang="ts">
|
||||
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
||||
|
||||
import Table from "@/modules/06_retirement/components/resignEMP/Table.vue";
|
||||
|
||||
const stroe = useDataStore();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">รายการลาออกลูกจ้าง</div>
|
||||
<div>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-tabs
|
||||
v-model="stroe.mainTabsEMP"
|
||||
dense
|
||||
align="left"
|
||||
inline-label
|
||||
class="rounded-borders"
|
||||
indicator-color="primary"
|
||||
active-bg-color="teal-1"
|
||||
active-class="text-primary"
|
||||
>
|
||||
<q-tab name="1" label="ขอลาออก" />
|
||||
<q-tab name="2" label="ขอยกเลิกลาออก" />
|
||||
</q-tabs>
|
||||
<q-separator />
|
||||
<div>
|
||||
<q-tab-panels v-model="stroe.mainTabsEMP" animated>
|
||||
<q-tab-panel name="1"> <Table /> </q-tab-panel>
|
||||
|
||||
<q-tab-panel name="2"> <Table /> </q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
1434
src/modules/06_retirement/components/resignEMP/ResignByid.vue
Normal file
1434
src/modules/06_retirement/components/resignEMP/ResignByid.vue
Normal file
File diff suppressed because it is too large
Load diff
813
src/modules/06_retirement/components/resignEMP/ResignReject.vue
Normal file
813
src/modules/06_retirement/components/resignEMP/ResignReject.vue
Normal file
|
|
@ -0,0 +1,813 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import axios from "axios";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import type {
|
||||
TypeFile,
|
||||
rowFile,
|
||||
FileList,
|
||||
} from "@/modules/06_retirement/interface/response/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
||||
|
||||
/** Use */
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailReject");
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
messageError,
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
/** ตัวแปร */
|
||||
const roleUser = ref<string>("");
|
||||
const dataProfile = ref<DataProfile>();
|
||||
|
||||
const id = ref<string>(route.params.id.toString());
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const edit = ref<boolean>(false);
|
||||
const dataDetail = ref<any>({
|
||||
datetext: "",
|
||||
activeDate: new Date(),
|
||||
createdAt: new Date(),
|
||||
firstName: "",
|
||||
id: "",
|
||||
isActive: true,
|
||||
lastName: "",
|
||||
location: "",
|
||||
organizationPositionOld: "",
|
||||
positionLevelOld: "",
|
||||
positionNumberOld: "",
|
||||
positionTypeOld: "",
|
||||
prefix: "",
|
||||
profileId: "",
|
||||
reason: "",
|
||||
salary: 0,
|
||||
sendDate: new Date(),
|
||||
status: "",
|
||||
statustext: "",
|
||||
fullname: "",
|
||||
});
|
||||
|
||||
const workflowRef = ref<any>(null);
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
const salary = ref<number>(0);
|
||||
const date = ref<Date | null>(null);
|
||||
const dateLeave = ref<Date | null>(null);
|
||||
const reason = ref<string>("");
|
||||
const location = ref<string>("");
|
||||
const status = ref<string>("");
|
||||
const remarkHorizontal = ref<string>("");
|
||||
const modal = ref<boolean>(false);
|
||||
const actionPass = ref<boolean>(false);
|
||||
const reasonReign = ref<string>("");
|
||||
const dateBreak = ref<Date | null>(null);
|
||||
|
||||
const isCheckData = computed(() => {
|
||||
if (
|
||||
organizationPositionOld.value !== "" &&
|
||||
positionTypeOld.value !== "" &&
|
||||
positionLevelOld.value !== "" &&
|
||||
posNo.value !== "" &&
|
||||
salary.value !== 0 &&
|
||||
date.value !== null &&
|
||||
dataDetail.value.commanderReject !== null &&
|
||||
dataDetail.value.oligarchReject !== null
|
||||
) {
|
||||
return true;
|
||||
} else return false;
|
||||
});
|
||||
|
||||
/**เปิด-ปิด modal */
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
function openModal() {
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
const isNoDebt = ref<boolean>(false);
|
||||
const isNoBurden = ref<boolean>(false);
|
||||
const isDiscipline = ref<boolean>(false);
|
||||
|
||||
function diffDate() {
|
||||
if (date.value !== null && dateLeave.value !== null) {
|
||||
const time = dateLeave.value.getTime() - date.value.getTime();
|
||||
//วันที่ขอลาออกจากราชการ - วันที่ยื่นขอลาออกจากราชการ
|
||||
const day = time / (1000 * 3600 * 24);
|
||||
if (day < 30) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** นำข้อมูลมาจาก API*/
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listResignEMP() + `/cancel/${id}`)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
dataProfile.value = data as DataProfile;
|
||||
dataDetail.value = data;
|
||||
|
||||
organizationPositionOld.value = data.organizationPositionOld ?? "";
|
||||
positionTypeOld.value = data.positionTypeOld ?? "";
|
||||
positionLevelOld.value = data.positionLevelOld ?? "";
|
||||
posNo.value = data.positionNumberOld ?? "";
|
||||
salary.value = data.salary ? data.salary : 0;
|
||||
date.value = data.sendDate ? new Date(data.sendDate) : null;
|
||||
dateLeave.value = data.activeDate ? new Date(data.activeDate) : null;
|
||||
reason.value = data.reason ?? "";
|
||||
location.value = data.location ?? "";
|
||||
status.value = data.status ?? "";
|
||||
remarkHorizontal.value = data.remarkHorizontal ?? "-";
|
||||
isNoDebt.value = data.isNoDebt;
|
||||
isNoBurden.value = data.isNoBurden;
|
||||
isDiscipline.value = data.isDiscipline;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**Pop up */
|
||||
function popUp(action: "pass" | "passNot", type: string) {
|
||||
reasonReign.value = "";
|
||||
dateBreak.value = null;
|
||||
actionPass.value = action === "pass";
|
||||
roleUser.value = type;
|
||||
openModal();
|
||||
}
|
||||
|
||||
//เงื่อนไขpop up
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
const body = {
|
||||
reason: reasonReign.value,
|
||||
reject: !actionPass.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.resignRejectEMP(`${roleUser.value}-cancel`, id.value), body)
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
closeModal();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* กดยกเลิก
|
||||
*/
|
||||
async function clickCancel() {
|
||||
await fetchData(id.value);
|
||||
edit.value = false;
|
||||
myForm.value?.resetValidation();
|
||||
}
|
||||
|
||||
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||
function onSubmitAttached() {
|
||||
dialogConfirm($q, () => {
|
||||
const formData = new FormData();
|
||||
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
|
||||
const activeDate =
|
||||
dateLeave.value !== null ? new Date(dateLeave.value).toUTCString() : "";
|
||||
formData.append("Location", location.value);
|
||||
formData.append("SendDate", send);
|
||||
formData.append("ActiveDate", activeDate);
|
||||
formData.append("Reason", reason.value);
|
||||
formData.append("OrganizationPositionOld", organizationPositionOld.value);
|
||||
formData.append("PositionTypeOld", positionTypeOld.value);
|
||||
formData.append("PositionLevelOld", positionLevelOld.value);
|
||||
formData.append("PositionNumberOld", posNo.value);
|
||||
formData.append("AmountOld", salary.value.toString());
|
||||
formData.append("remarkHorizontal", remarkHorizontal.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.listResignEMP() + `/update-cancel/${id.value}`, formData)
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Function เพิ่ม Class เวลา Edit
|
||||
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
||||
*/
|
||||
function getClass(val: boolean) {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
}
|
||||
|
||||
/** แปลง StatusOrder */
|
||||
function statusOrder(val: boolean) {
|
||||
switch (val) {
|
||||
case true:
|
||||
return "ยับยั้ง";
|
||||
case false:
|
||||
return "อนุญาต";
|
||||
}
|
||||
}
|
||||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
await fetchData(id.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="q-gutter-sm q-pa-sm">
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.push('/retirement/resign-employee')"
|
||||
/>
|
||||
รายละเอียดการยกเลิกลาออกของ{{
|
||||
dataDetail.firstName + " " + dataDetail.lastName
|
||||
}}
|
||||
</div>
|
||||
|
||||
<CardProfile :type="'employee'" :data="dataProfile as DataProfile" />
|
||||
|
||||
<!-- ข้อมูลการลาออก -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||
<!-- <q-space />
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
||||
(roleUser === 'commander' &&
|
||||
dataDetail.commanderReject === null &&
|
||||
dataDetail.officerReject !== null) ||
|
||||
(roleUser === 'oligarch' &&
|
||||
dataDetail.oligarchReject === null &&
|
||||
dataDetail.commanderReject !== null &&
|
||||
dataDetail.officerReject !== null)
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot')"
|
||||
/>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 col-sm-3 row items-start">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สถานที่ยื่นขอลาออกจากราชการ</div>
|
||||
<div class="col-12 text-detail">{{ dataDetail.location }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-start">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">วันที่ยื่นขอลาออกจากราชการ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ date2Thai(dataDetail.sendDate) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-start">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">เหตุผลที่ลาออกจากราชการ</div>
|
||||
<div class="col-12 text-detail">{{ dataDetail.reason }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-start">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">วันที่ขอลาออกจากราชการ</div>
|
||||
<div
|
||||
:class="
|
||||
diffDate()
|
||||
? 'col-12 text-detail text-red text-bold'
|
||||
: 'col-12 text-detail'
|
||||
"
|
||||
>
|
||||
{{ date2Thai(dataDetail.activeDate) }}
|
||||
</div>
|
||||
<div
|
||||
:class="
|
||||
diffDate()
|
||||
? 'col-12 text-detail text-red text-bold'
|
||||
: 'col-12 text-detail'
|
||||
"
|
||||
>
|
||||
{{ diffDate() ? "(ยื่นขอลาออกน้อยกว่า 30 วัน)" : "" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ผลการพิจารณาของผู้บังคับบัญชา -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ผลการพิจารณาของผู้บังคับบัญชา
|
||||
</div>
|
||||
<q-space />
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
workflowRef?.permission.isUpdate &&
|
||||
dataDetail.commanderReject === null
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass', 'commander')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot', 'commander')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">สถานะ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.commanderReject !== null
|
||||
? statusOrder(dataDetail.commanderReject)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.commanderRejectDate !== null
|
||||
? date2Thai(dataDetail.commanderRejectDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.commanderReject
|
||||
? dataDetail.commanderApproveReason
|
||||
: dataDetail.commanderApproveReason
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- ผลการพิจารณาของผู้มีอำนาจ -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
ผลการพิจารณาของผู้มีอำนาจ
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<div
|
||||
class="q-gutter-x-sm"
|
||||
v-if="
|
||||
workflowRef?.permission.isUpdate &&
|
||||
dataDetail.oligarchReject === null
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="check"
|
||||
class="q-px-sm"
|
||||
label="อนุญาต"
|
||||
@click="popUp('pass', 'oligarch')"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
icon-right="close"
|
||||
class="q-px-sm"
|
||||
label="ยับยั้ง"
|
||||
@click="popUp('passNot', 'oligarch')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">สถานะ</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchReject !== null
|
||||
? statusOrder(dataDetail.oligarchReject)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 row items-start">
|
||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchRejectDate !== null
|
||||
? date2Thai(dataDetail.oligarchRejectDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-xs-12 row items-start">
|
||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{
|
||||
dataDetail.oligarchReject
|
||||
? dataDetail.oligarchApproveReason
|
||||
: dataDetail.oligarchApproveReason
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<q-form
|
||||
ref="myForm"
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="onSubmitAttached"
|
||||
>
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
||||
</div>
|
||||
<q-space />
|
||||
<!-- && workflowRef?.permission.isUpdate -->
|
||||
<div v-if="!checkRoutePermisson">
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
v-if="!(status == 'REPORT' || status == 'DONE')"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
type="submit"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="clickCancel"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-12 row items-center">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="organizationPositionOld"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัดเดิม'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่ง/สังกัดเดิม'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-4 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionTypeOld"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่งประเภท'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-4 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionLevelOld"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ระดับตำแหน่ง'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-4 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="posNo"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เลขที่'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
v-model="salary"
|
||||
:outlined="edit"
|
||||
dense
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
lazy-rules
|
||||
:class="getClass(edit)"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="location"
|
||||
:rules="[
|
||||
(val:string) => !!val || `${'กรุณากรอกสถานที่ยื่นขอลาออกจากราชการ'}`,
|
||||
]"
|
||||
hide-bottom-space
|
||||
:label="`${'สถานที่ยื่นขอลาออกจากราชการ'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="date"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="!edit"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
:borderless="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[
|
||||
(val:string) =>
|
||||
!!val || `${'กรุณาเลือก วันที่ยื่นขอลาออกจากราชการ'}`,
|
||||
]"
|
||||
hide-bottom-space
|
||||
:label="`${' วันที่ยื่นขอลาออกจากราชการ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
:style="
|
||||
edit
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="reason"
|
||||
:rules="[
|
||||
(val:string) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`,
|
||||
]"
|
||||
hide-bottom-space
|
||||
:label="`${'เหตุผลที่ลาออกจากราชการ (หมายเหตุแนวตั้ง)'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="remarkHorizontal"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกหมายเหตุแนวนอน '}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'หมายเหตุแนวนอน '}`"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
<!-- <WorkFlow
|
||||
ref="workflowRef"
|
||||
v-model:is-check-data="isCheckData"
|
||||
:id="id"
|
||||
sys-name="RETIREMENT_CANCEL"
|
||||
/> -->
|
||||
</div>
|
||||
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<DialogHeader
|
||||
:tittle="`${
|
||||
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ยับยั้งยกเลิกการลาออก'
|
||||
}`"
|
||||
:close="closeModal"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm q-gutter-md">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
hide-bottom-space
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
:rules="[(val:string) => !!val || 'กรุณากรอกความคิดเห็น/เหตุผล']"
|
||||
v-model="reasonReign"
|
||||
:label="`${'กรอกความคิดเห็น/เหตุผล'}`"
|
||||
type="textarea"
|
||||
class="inputgreen"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
<!-- <DialogFooter :editvisible="true" :save="conditionPopup" /> -->
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
border-radius: 5px;
|
||||
height: 70px;
|
||||
}
|
||||
.text-top {
|
||||
color: gray;
|
||||
font-weight: 400;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
.text-detail {
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
385
src/modules/06_retirement/components/resignEMP/Table.vue
Normal file
385
src/modules/06_retirement/components/resignEMP/Table.vue
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
import DialogSendToCommand from "@/modules/06_retirement/components/resignEMP/DialogSendToCommand.vue";
|
||||
|
||||
/** use */
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const stroe = useRetirementDataStore();
|
||||
const stroeResign = useDataStore();
|
||||
const { statusText } = stroe;
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
|
||||
|
||||
/** Table */
|
||||
const rows = ref<ResponseItems[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: (row) => rows.value.indexOf(row) + 1,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "location",
|
||||
align: "left",
|
||||
label: "สถานที่ยื่นขอลาออกจากราชการ",
|
||||
sortable: true,
|
||||
field: "location",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "กลุ่มงาน",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
let name = "";
|
||||
if (row.positionTypeOld && row.positionLevelOld) {
|
||||
name = `${row.positionTypeOld} (${row.positionLevelOld})`;
|
||||
} else if (row.positionTypeOld) {
|
||||
name = `${row.positionTypeOld}`;
|
||||
} else if (row.positionLevelOld) {
|
||||
name = `(${row.positionLevelOld})`;
|
||||
} else name = "-";
|
||||
return name;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "positionNumberOld",
|
||||
align: "left",
|
||||
label: "เลขที่",
|
||||
sortable: true,
|
||||
field: "positionNumberOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organizationPositionOld",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง/สังกัดเดิม",
|
||||
sortable: true,
|
||||
field: "organizationPositionOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "datetext",
|
||||
align: "left",
|
||||
label: "วันที่ยื่น",
|
||||
sortable: true,
|
||||
field: (row) => date2Thai(new Date(row.createdAt)),
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sortOrder: "da",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: (row) => statusText(row.status),
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"location",
|
||||
"positionLevel",
|
||||
"positionNumberOld",
|
||||
"organizationPositionOld",
|
||||
"datetext",
|
||||
"status",
|
||||
]);
|
||||
const rowsSendToCommand = ref<ResponseItems[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterKeyword = ref<string>("");
|
||||
|
||||
const status = ref<string>("");
|
||||
const optionStatus = ref<any[]>([]);
|
||||
|
||||
/**Setting pagination */
|
||||
const pagination = ref({
|
||||
sortBy: "datetext",
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/** ฟังก์ชันปิด Popup*/
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
filterKeyword2.value = "";
|
||||
}
|
||||
|
||||
/** */
|
||||
async function openModalOrder() {
|
||||
const pathAPI =
|
||||
stroeResign.mainTabs === "1"
|
||||
? `${config.API.listResign()}?type=APPROVE`
|
||||
: `${config.API.listResign()}/cancel?type=APPROVE`;
|
||||
showLoader();
|
||||
await http
|
||||
.get(pathAPI)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
const row = await data.filter(
|
||||
(r: ResponseItems) =>
|
||||
(r.status == "REJECT" || r.status == "APPROVE") &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.location &&
|
||||
r.sendDate
|
||||
);
|
||||
rowsSendToCommand.value = row;
|
||||
modal.value = true;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** รายการลาออก*/
|
||||
async function fecthlist() {
|
||||
const pathAPI =
|
||||
stroeResign.mainTabs === "1"
|
||||
? `${config.API.listResignEMP()}?type=${status.value}`
|
||||
: `${config.API.listResignEMP()}/cancel?type=${status.value}`;
|
||||
showLoader();
|
||||
await http
|
||||
.get(pathAPI)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
rows.value = data;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันต้นหาข้อมูลของ Option ขอสถานะ
|
||||
* @param val ค่าที่ต้องการฟิลเตอร์
|
||||
* @param update อัพเดทค่า
|
||||
*/
|
||||
function filterOption(val: string, update: Function) {
|
||||
update(() => {
|
||||
status.value = val ? "" : stroeResign.formQurey.status;
|
||||
optionStatus.value = stroeResign.optionStatus.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function onRedirectToDetail(type: string, id: string) {
|
||||
const test = stroeResign.mainTabsEMP === "1" ? "" : "-reject";
|
||||
router.push(`/retirement/${type}${test}/${id}`);
|
||||
}
|
||||
|
||||
/**Hook */
|
||||
onMounted(async () => {
|
||||
status.value = stroeResign.formQurey.status;
|
||||
optionStatus.value = stroeResign.optionStatusEMP;
|
||||
await fecthlist();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-card>
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="row col-12">
|
||||
<div class="row q-gutter-sm">
|
||||
<q-select
|
||||
v-model="status"
|
||||
:label="`${'สถานะ'}`"
|
||||
option-label="name"
|
||||
:options="optionStatus"
|
||||
option-value="value"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
outlined
|
||||
use-input
|
||||
@update:model-value="
|
||||
(stroeResign.formQurey.status = status), fecthlist()
|
||||
"
|
||||
@filter="(inputValue:string,doneFn:Function) => filterOption(inputValue, doneFn) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
@click="openModalOrder"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งลาออก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="row q-gutter-sm">
|
||||
<q-input
|
||||
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="filterKeyword = ''"
|
||||
/>
|
||||
</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"
|
||||
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width></q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="info"
|
||||
icon="mdi-eye"
|
||||
@click.pervent="
|
||||
onRedirectToDetail('resign-employee-detail', props.row.id)
|
||||
"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
@click.pervent="onRedirectToDetail('resign-employee', props.row.id)"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div
|
||||
:class="
|
||||
col.name === 'organizationPositionOld' ||
|
||||
col.name === 'organization'
|
||||
? 'table_ellipsis2'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ col.value ? col.value : "" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<DialogSendToCommand
|
||||
v-model:modal="modal"
|
||||
v-model:filter-keyword2="filterKeyword2"
|
||||
:close-modal="closeModal"
|
||||
:rows="rowsSendToCommand"
|
||||
:fecth-list="fecthlist"
|
||||
:main-tabs="stroeResign.mainTabsEMP"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
@ -31,10 +31,17 @@ const detaildeceasedByid = () =>
|
|||
/** รายการลาออก */
|
||||
const resign = () =>
|
||||
import("@/modules/06_retirement/components/resign/Main.vue");
|
||||
const resign_EMP = () =>
|
||||
import("@/modules/06_retirement/components/resignEMP/Main.vue");
|
||||
|
||||
const resignByid = () =>
|
||||
import("@/modules/06_retirement/components/resign/ResignByid.vue");
|
||||
const resignByidEMP = () =>
|
||||
import("@/modules/06_retirement/components/resignEMP/ResignByid.vue");
|
||||
const resignReject = () =>
|
||||
import("@/modules/06_retirement/components/resign/ResignReject.vue");
|
||||
const resignRejectEMP = () =>
|
||||
import("@/modules/06_retirement/components/resignEMP/ResignReject.vue");
|
||||
|
||||
export default [
|
||||
{
|
||||
|
|
@ -128,6 +135,16 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/resign-employee",
|
||||
name: "resignEmployee",
|
||||
component: resign_EMP,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RESIGN_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/resign/:id",
|
||||
name: "resignbyid",
|
||||
|
|
@ -148,6 +165,31 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
path: "/retirement/resign-employee/:id",
|
||||
name: "resignbyidEMP",
|
||||
component: resignByidEMP,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RESIGN_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/resign-employee-detail/:id",
|
||||
name: "resignDetailbyidEMP",
|
||||
component: resignByidEMP,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RESIGN_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
path: "/retirement/resign-reject/:id",
|
||||
name: "resignReject",
|
||||
|
|
@ -169,6 +211,27 @@ export default [
|
|||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: "/retirement/resign-employee-reject/:id",
|
||||
name: "resignRejectEMP",
|
||||
component: resignRejectEMP,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RESIGN_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/resign-employee-detail-reject/:id",
|
||||
name: "resignDetailrejectEMP",
|
||||
component: resignRejectEMP,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_RESIGN_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: "/retirement/deceased",
|
||||
name: "deceased",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { ref, computed, reactive, watch } from "vue";
|
|||
|
||||
export const useDataStore = defineStore("resign", () => {
|
||||
const mainTabs = ref<string>("1");
|
||||
const mainTabsEMP = ref<string>("1");
|
||||
const baseOptionStatus = ref<any[]>([
|
||||
{
|
||||
name: "รอดำเนินการ",
|
||||
|
|
@ -62,10 +63,18 @@ export const useDataStore = defineStore("resign", () => {
|
|||
(option) => option.group === mainTabs.value
|
||||
);
|
||||
});
|
||||
const optionStatusEMP = computed(() => {
|
||||
return baseOptionStatus.value.filter(
|
||||
(option) => option.group === mainTabsEMP.value
|
||||
);
|
||||
});
|
||||
|
||||
watch(mainTabs, (val) => {
|
||||
formQurey.status = "WAITTING";
|
||||
});
|
||||
watch(mainTabsEMP, (val) => {
|
||||
formQurey.status = "WAITTING";
|
||||
});
|
||||
|
||||
return { mainTabs, formQurey, optionStatus };
|
||||
return { mainTabs, mainTabsEMP, formQurey, optionStatus, optionStatusEMP };
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue