comment code retirement

This commit is contained in:
AnandaTon 2023-11-17 14:21:53 +07:00
parent 45fc4848ac
commit 45ef9649e1
15 changed files with 295 additions and 64 deletions

View file

@ -1,4 +1,5 @@
<script setup lang="ts">
/** props*/
const props = defineProps({
editvisible: Boolean,
modalEdit: Boolean,
@ -32,6 +33,8 @@ const edit = async () => {
updateEdit(!props.editvisible);
props.edit();
};
/* บันทึกข้อมูล**/
const checkSave = () => {
props.validate();
props.save();

View file

@ -1,4 +1,5 @@
<script setup lang="ts">
/** props*/
const props = defineProps({
title: String,
close: {
@ -6,6 +7,10 @@ const props = defineProps({
default: () => console.log("not function"),
},
});
/**
* งก close
*/
const close = async () => {
props.close();
};

View file

@ -11,11 +11,12 @@ import http from "@/plugins/http";
import config from "@/app.config";
import type { ResponseData } from "@/modules/06_retirement/interface/response/expulsion";
/** use */
const $q = useQuasar();
const router = useRouter();
const modal = ref<boolean>(false);
const mixin = useCounterMixin();
const retirementStore = useRetirementDataStore();
const {
date2Thai,
messageError,
@ -26,7 +27,7 @@ const {
} = mixin;
const { statusText } = retirementStore;
const modal = ref<boolean>(false);
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<string[]>([
"no",
"fullname",
@ -46,6 +47,7 @@ const resetFilter = () => {
filterRef.value.focus();
};
/** คอลัมน์ */
const rows = ref<ResponseData[]>([]);
const rows2 = ref<ResponseData[]>([]);
const filters = ref<ResponseData[]>([]);
@ -115,10 +117,14 @@ const columns = ref<QTableProps["columns"]>([
},
]);
/** HOOK */
onMounted(async () => {
await getData();
});
/**
* งก modal
*/
const openModalOrder = () => {
openModal();
const row = filters.value.filter(
@ -136,7 +142,12 @@ const openModalOrder = () => {
);
rows2.value = row;
};
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
/**
* นำขอมลมาจาก API
*/
const getData = async () => {
showLoader();
await http
@ -179,6 +190,10 @@ const getData = async () => {
});
};
/**
* ลบขอม
* @param id ไอดอม
*/
const clickDelete = async (id: string) => {
dialogRemove(
$q,
@ -189,7 +204,7 @@ const clickDelete = async (id: string) => {
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`
);
};
//API
const deleteData = async (id: string) => {
await http
.delete(config.API.expulsionByid(id))
@ -205,8 +220,7 @@ const deleteData = async (id: string) => {
});
};
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
/** Setting Pagination */
const pagination = ref({
sortBy: "createdAt",
descending: true,

View file

@ -4,19 +4,18 @@ import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
/**Import Type */
import type { QForm } from "quasar";
import type { ResponseDataDetail } from "@/modules/06_retirement/interface/response/expulsion";
/** Use */
const $q = useQuasar();
const route = useRoute();
const router = useRouter();
const mixin = useCounterMixin();
const dataId = route.params.id.toString();
const {
date2Thai,
@ -27,10 +26,10 @@ const {
dialogConfirm,
} = mixin;
/**ตัวแปร */
const myForm = ref<QForm | null>(null);
const roleAdmin = ref<boolean>(false);
const edit = ref<boolean>(false);
const organizationPositionOld = ref<string>("");
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
@ -40,6 +39,7 @@ const organization = ref<string>("");
const date = ref<Date | null>(null);
const reason = ref<string>("");
/**Setค่าตัวแปร */
const responseData = ref<ResponseDataDetail>({
personId: "",
avataPath: "",
@ -57,6 +57,7 @@ const responseData = ref<ResponseDataDetail>({
fullname: "",
});
/**Hook */
onMounted(async () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
@ -64,6 +65,9 @@ onMounted(async () => {
await getData();
});
/**
* นำขอมลมาจาก API
*/
const getData = async () => {
showLoader();
await http
@ -108,11 +112,15 @@ const getData = async () => {
});
};
/**ฟังก์ชั่นcancel */
const clickCancel = async () => {
await getData();
edit.value = false;
};
/**
* Functionบนท
*/
const conditionSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
@ -129,7 +137,7 @@ const conditionSave = async () => {
});
}
};
//Save Api
const saveData = async () => {
const body = {
organization: organization.value,
@ -157,6 +165,10 @@ const saveData = async () => {
});
};
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,

View file

@ -6,12 +6,14 @@ import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
/** Use */
const $q = useQuasar(); // noti quasar
const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin;
const route = useRoute();
const retireld_params = route.params.id;
/** props*/
const props = defineProps({
retireld: String,
profileId: String,
@ -27,6 +29,7 @@ const retireld = ref<any>();
const type = ref<any>();
const filter = ref<string>("");
/** คอลัมน์ */
const columns = ref<any["columns"]>([
{
name: "index",
@ -78,6 +81,7 @@ watch(modal, () => {
fecthlistRetire();
}
});
// fecth profile
const fecthlistRetire = async () => {
showLoader();
@ -93,6 +97,7 @@ const fecthlistRetire = async () => {
messageError($q, e);
});
};
//
const findlist = async (id: string) => {
let data = [{}];
@ -154,6 +159,9 @@ const updateListData = (retireld: string, pId: string) => {
props.UpdateListId(retireld, pId);
};
/**
* Setiting Pagination
*/
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "fullname",

View file

@ -10,6 +10,7 @@ import config from "@/app.config";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
/** Use */
const route = useRoute();
const router = useRouter();
const $q = useQuasar();
@ -26,6 +27,7 @@ const {
} = mixin;
const myForm = ref<QForm | null>(null);
/** ตัวแปร */
const retireld_params = route.params.retirementId;
const modalNote = ref<boolean>(false);
const note = ref<string>("");
@ -37,7 +39,14 @@ const statusUpload = ref<boolean>();
const modalEdit = ref<boolean>(false);
const textReport = ref<string>("");
const employeeType = ref<string>("OFFICER");
const action = ref<string>("");
const fileUpload = ref<any>(null);
const round = ref<number>();
const typeReport = ref<string>("");
const statusReport = ref<boolean>();
const dataProfile = ref<Object>([]);
/** คอลัมน์ที่แสดง */
const columns = ref<any["columns"]>([]);
const rows = ref<any>([]);
const visibleColumns = ref<string[]>([
@ -55,22 +64,20 @@ const visibleColumns = ref<string[]>([
"bureau",
]);
const action = ref<string>("");
const fileUpload = ref<any>(null);
/** Hook */
onMounted(() => {
retireld.value = retireld_params.toString();
fecthlistprofile(retireld.value);
});
/**
* งกนป Dialog
*/
const closeDialog = () => {
modalNote.value = false;
modalUpload.value = false;
};
const round = ref<number>();
const typeReport = ref<string>("");
const statusReport = ref<boolean>();
const dataProfile = ref<Object>([]);
// fecthlist
const fecthlistprofile = async (id: string) => {
showLoader();
@ -121,6 +128,7 @@ const fecthlistprofile = async (id: string) => {
messageError($q, e);
})
.finally(() => {
//
columns.value = [
{
name: "order",
@ -243,6 +251,7 @@ const fecthCheck = async (id: string) => {
messageError($q, err);
});
};
// DelProfile
const clickDelete = () => {
dialogRemove(
@ -269,6 +278,7 @@ const clickDelete = () => {
"ต้องการลบข้อมูลนี้ใช่หรือไม่ ?"
);
};
//
const saveNote = () => {
dialogConfirm(
@ -296,19 +306,23 @@ const saveNote = () => {
);
};
// ListId
const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId;
fecthlistprofile(retireld);
};
//
const backHistory = () => {
window.history.back();
};
const visibleNote = computed(() => {
if (note.value === "" || note.value === undefined) {
return true;
}
});
//
const modalUpload = ref<boolean>(false);
const signDate = ref<Date | null>(null);
@ -352,6 +366,7 @@ const uploadFile = async (event: any, signDate: any) => {
});
}
};
// downloadAttachment
const downloadAttachment = async (type: string, id: string) => {
showLoader();
@ -369,6 +384,7 @@ const downloadAttachment = async (type: string, id: string) => {
hideLoader();
});
};
// downloadFile
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
@ -379,6 +395,7 @@ const downloadFile = (response: any, filename: string) => {
link.click();
document.body.removeChild(link);
};
//
const saveEdiitReport = (reason: string) => {
const formdata = new FormData();
@ -403,15 +420,18 @@ const saveEdiitReport = (reason: string) => {
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
};
// popup
const openmodalEditReport = () => {
modalEdit.value = true;
};
// popup
const closemodalEditReport = () => {
modalEdit.value = false;
};
/** Setting Pagination */
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",

View file

@ -6,11 +6,13 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
/** Use */
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm, messageError } = mixin;
const router = useRouter();
/** Prop */
const props = defineProps({
type: {
type: String,
@ -63,6 +65,7 @@ const clickAdd = () => {
}
}
};
//
const clickSelect = async (action: string) => {
dialogConfirm(
@ -81,6 +84,7 @@ const clickSelect = async (action: string) => {
"ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่ ?"
);
};
// API
const cerateRetirement = async (data: object) => {
await http

View file

@ -6,11 +6,14 @@ import { useCounterMixin } from "@/stores/mixin";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
/** Use */
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success, date2Thai } = mixin;
/** คอลัมน์ */
const rows = ref<any>([]);
const columns = ref<QTableProps["columns"]>([
{
@ -88,6 +91,8 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<string[]>([
"no",
"prefix",
@ -99,9 +104,13 @@ const visibleColumns = ref<string[]>([
"oc",
"createdAt",
]);
/**Hook */
onMounted(() => {
fectListDecased();
});
/**เรียกข้อมูลจาก APi */
const fectListDecased = async () => {
showLoader();
await http
@ -134,6 +143,8 @@ const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
/** Setting Pagination */
const nextPage = (id: string) => {
router.push("/deceased/" + id);
};

View file

@ -1,7 +1,6 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import type { QInput, QForm } from "quasar";
@ -9,15 +8,28 @@ import type { treeTab } from "@/modules/05_placement/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type {
requestSendNoti,
DataCopyOrder,
ResponseOrganiz,
} from "@/modules/06_retirement/interface/response/Deceased";
import { useRouter, useRoute } from "vue-router";
/** Use */
const router = useRouter();
const route = useRoute();
const $q = useQuasar();
const mixin = useCounterMixin(); //
const {
dialogRemove,
messageError,
showLoader,
hideLoader,
success,
dialogConfirm,
} = mixin;
/** props*/
const props = defineProps({
next: {
type: Function,
@ -31,24 +43,25 @@ const props = defineProps({
const profileId = ref<string>(route.params.id.toString());
const next = () => props.next();
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { dialogRemove, messageError, showLoader, hideLoader, success,dialogConfirm } = mixin;
/**ตัวแปร */
const myForm = ref<QForm | null>(null);
const filterRef = ref<QInput>();
const filter = ref<string>("");
const modal = ref<boolean>(false);
const search = ref<string>("");
const expanded = ref<string[]>([]);
const selected = ref<string>("");
const nodesTree = ref<treeTab[]>([]);
const selectedModal = ref<ResponseOrganiz[]>([]);
const filterModal = ref<string>("");
const rows = ref<DataCopyOrder[]>([]);
const editRows = ref<DataCopyOrder[]>([]);
/** คอลัมน์Modal ที่แสดง */
const visibleColumnsModal = ref<String[]>(["no", "idCard", "name", "position"]);
/** คอลัมน์Modal */
const rowsModal = ref<ResponseOrganiz[]>([]);
const columnsModal = ref<QTableProps["columns"]>([
{
name: "no",
@ -88,13 +101,13 @@ const columnsModal = ref<QTableProps["columns"]>([
},
]);
const rowsModal = ref<ResponseOrganiz[]>([]);
/** selcet OPtion */
const optionSelect = ref<any>([
{ id: 1, name: "อีเมล" },
{ id: 2, name: "กล่องข้อความ" },
]);
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<String[]>([
"no",
"idCard",
@ -103,6 +116,8 @@ const visibleColumns = ref<String[]>([
"unit",
"send",
]);
/** คอลัมน์ */
const columns = ref<QTableProps["columns"]>([
{ name: "no", align: "left", label: "ลำดับ", field: "no", sortable: true },
{
@ -152,14 +167,15 @@ const columns = ref<QTableProps["columns"]>([
},
]);
const rows = ref<DataCopyOrder[]>([]);
const editRows = ref<DataCopyOrder[]>([]);
/** Hook */
onMounted(async () => {
await getData();
});
/**
* งขอม list จาก api
* @param id id ของขอม
*/
const listModal = async (id: string) => {
showLoader();
await http
@ -189,6 +205,7 @@ const listModal = async (id: string) => {
});
};
/** เรียกข้อมูลจาก api */
const getData = async () => {
showLoader();
await http
@ -235,6 +252,9 @@ const getData = async () => {
});
};
/**
*งก Save
*/
const saveData = async () => {
showLoader();
const persons = selectedModal.value.map((item) => ({
@ -260,6 +280,10 @@ const resetFilter = () => {
filterRef.value!.focus();
};
/**
* class ดรปแบบแสดงระหวางขอมลทแกไขหรอแสดงเฉยๆ
* @param val อม input สำหรบแกไขหรอไม
*/
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
@ -267,10 +291,14 @@ const getClass = (val: boolean) => {
};
};
/** Close Modal */
const clickClose = async () => {
modal.value = false;
};
/**
* กดปมเพมดานบน table
*/
const clickAdd = async () => {
await nodeTree();
selected.value = "";
@ -282,10 +310,16 @@ const clickAdd = async () => {
}
};
/**
* ลบขอม
*/
const clickDelete = (id: string) => {
dialogRemove($q, () => deleteData(id));
};
/**
* โหลดโครงสราง tree
*/
const nodeTree = async () => {
showLoader();
await http
@ -305,10 +339,12 @@ const nodeTree = async () => {
});
};
//
const onSelected = async (id: string) => {
await listModal(id);
};
/**ลบข้อมูล */
const deleteData = async (id: string) => {
await http
.delete(config.API.detailByidDeceased(id))
@ -323,16 +359,24 @@ const deleteData = async (id: string) => {
});
};
/**
* Save อม
*/
const saveDataCopyOrder = async () => {
if (myForm.value !== null) {
myForm.value.validate().then(async (result: boolean) => {
if (result) {
dialogConfirm($q,() => fetchSaveCopyOrder(),'ยืนยันการส่งหนังสือเวียน','ต้องการยืนยันการส่งหนังสือเวียนหรือไม่')
dialogConfirm(
$q,
() => fetchSaveCopyOrder(),
"ยืนยันการส่งหนังสือเวียน",
"ต้องการยืนยันการส่งหนังสือเวียนหรือไม่"
);
}
});
}
};
// Save
const fetchSaveCopyOrder = async () => {
let list: requestSendNoti[] = [];
rows.value.map((r: DataCopyOrder) => {
@ -343,7 +387,6 @@ const fetchSaveCopyOrder = async () => {
isSendNotification: true,
});
});
showLoader();
await http
.put(config.API.notiDeceased(profileId.value), { Persons: list })
@ -359,7 +402,6 @@ const fetchSaveCopyOrder = async () => {
getData();
});
};
const updateData = (row: DataCopyOrder) => {
editRows.value.push(row);
};

View file

@ -6,6 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
/**use*/
const $q = useQuasar();
const router = useRouter();
const route = useRoute();
@ -15,6 +16,7 @@ const fullName = ref<string>("");
const profileId = ref<string>(route.params.id.toString());
const detail = ref<any>([]);
/** Hook */
onMounted(() => {
fectdata();
});
@ -63,6 +65,10 @@ const downloadFile = (response: any, filename: string) => {
document.body.removeChild(link);
};
/**
* งก ดาวโหลด
* @param type typeของรายละเอยด
*/
const fileDownload = async (type: string) => {
showLoader();
await http

View file

@ -8,6 +8,7 @@ import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogH
import http from "@/plugins/http";
import config from "@/app.config";
/** use */
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
@ -15,6 +16,7 @@ const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
/** คอลัมน์ */
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
@ -107,6 +109,8 @@ const columns2 = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
/** คอลัมน์ที่แสดง */
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
@ -118,6 +122,7 @@ const visibleColumns2 = ref<string[]>([
"statustext",
]);
/** props*/
const props = defineProps({
modal: Boolean,
closeModal: Function,
@ -132,6 +137,9 @@ const resetFilter = () => {
filterRef.value.focus();
};
/**
* งกนการ Selected Data
*/
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;

View file

@ -10,6 +10,7 @@ import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
/** use */
const RetirementData = useRetirementDataStore();
const { statusText } = RetirementData;
const $q = useQuasar(); // noti quasar
@ -17,6 +18,7 @@ const router = useRouter();
const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
/** คอลัมน์ */
const rows = ref<ResponseItems[]>([]);
const columns = ref<QTableProps["columns"]>([
{
@ -120,6 +122,8 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<string[]>([
"no",
"prefix",
@ -148,12 +152,13 @@ const closeModal = () => {
modal.value = false;
filterKeyword2.value = "";
};
//reset filter
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
// Modal
const openModalOrder = async () => {
openModal();
const row = await filters.value.filter(
@ -170,6 +175,7 @@ const openModalOrder = async () => {
rows2.value = row;
};
/**Hook */
onMounted(async () => {
await fecthlist();
});
@ -219,6 +225,8 @@ const fecthlist = async () => {
hideLoader();
});
};
/**Setting pagination */
const pagination = ref({
sortBy: "datetext",
descending: true,
@ -234,28 +242,66 @@ const pagination = ref({
<div class="row col-12">
<div class="row col-12 q-col-gutter-sm">
<div>
<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>
</div>
<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-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"
/>
</div>
<div class="col-12 q-pt-sm">
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="id" :visible-columns="visibleColumns"
v-model:pagination="pagination">
<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 v-for="col in props.cols" :key="col.name" :props="props">
@ -264,7 +310,11 @@ const pagination = ref({
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer" @click="router.push(`/retirement/resign/${props.row.id}`)">
<q-tr
:props="props"
class="cursor-pointer"
@click="router.push(`/retirement/resign/${props.row.id}`)"
>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
@ -303,7 +353,12 @@ const pagination = ref({
</div>
</q-card>
<DialogSendToCommand v-model:modal="modal" :closeModal="closeModal" :rows2="rows2"
v-model:filterKeyword2="filterKeyword2" :fecthlistRecevice="fecthlist" />
<DialogSendToCommand
v-model:modal="modal"
:closeModal="closeModal"
:rows2="rows2"
v-model:filterKeyword2="filterKeyword2"
:fecthlistRecevice="fecthlist"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -6,20 +6,22 @@ import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogF
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
import type { TypeFile, rowFile } from "@/modules/06_retirement/interface/response/Main";
import type {
TypeFile,
rowFile,
} from "@/modules/06_retirement/interface/response/Main";
import type { QTableProps } from "quasar";
/** Use */
const $q = useQuasar();
const route = useRoute();
const router = useRouter();
const mixin = useCounterMixin();
const RetirementData = useRetirementDataStore();
const {
messageError,
date2Thai,
@ -31,6 +33,7 @@ const {
} = mixin;
const { statusText } = RetirementData;
/** ตัวแปร */
const roleUser = ref<string>("");
const id = ref<string>(route.params.id.toString());
const myForm = ref<QForm | null>(null);
@ -58,7 +61,6 @@ const dataDetail = ref<any>({
statustext: "",
fullname: "",
});
const organizationPositionOld = ref<string>("");
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
@ -70,12 +72,12 @@ 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 rows = ref<TypeFile[]>([]);
const columns = ref<QTableProps["columns"]>([
{
@ -107,9 +109,11 @@ const columns = ref<QTableProps["columns"]>([
},
]);
/**เปิด-ปิด modal */
const closeModal = () => (modal.value = false);
const openModal = () => (modal.value = true);
/** Hook */
onMounted(async () => {
fetchData(id.value);
if (keycloak.tokenParsed !== undefined) {
@ -139,6 +143,9 @@ const diffDate = () => {
return false;
};
/**
* นำขอมลมาจาก API
*/
const fetchData = async (id: string) => {
showLoader();
await http
@ -187,13 +194,14 @@ const fetchData = async (id: string) => {
// document.body.removeChild(link);
// };
/**Pop up */
const popUp = (action: "pass" | "passNot") => {
reasonReign.value = "";
dateBreak.value = null;
actionPass.value = action === "pass";
openModal();
};
//pop up
const conditionPopup = () => {
if (myFormConfirm.value !== null) {
myFormConfirm.value.validate().then(async (check) => {
@ -208,6 +216,7 @@ const conditionPopup = () => {
}
};
//pop up
const confirmpopUp = async () => {
dialogConfirm(
$q,
@ -233,6 +242,7 @@ const confirmpopUp = async () => {
);
};
//pop up
const rejectpopUp = async () => {
dialogConfirm(
$q,
@ -258,15 +268,26 @@ const rejectpopUp = async () => {
"ต้องการยืนยันการยับยั้งนี้หรือไม่ ?"
);
};
/**
* ไปยงขอม
* @param id ไอดอม
*/
const redirectToRegistry = (id: string) => {
router.push(`/registry/${id}`);
};
/**
* กดยกเล
*/
const clickCancel = async () => {
await fetchData(id.value);
edit.value = false;
};
/**
* Functionบนท
*/
const conditionSave = () => {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
@ -285,7 +306,7 @@ const conditionSave = () => {
});
}
};
//Save Api
const saveData = async () => {
const formData = new FormData();
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
@ -317,12 +338,18 @@ const saveData = async () => {
});
};
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
/** แปลง StatusOrder */
const statusOrder = (val: boolean) => {
switch (val) {
case true:
@ -335,12 +362,12 @@ const statusOrder = (val: boolean) => {
//
const rowsFileDownload = ref<rowFile[]>([
{
fileName:
"แบบฟอร์มหนังสือขอลาออกจากราชการ",
fileName: "แบบฟอร์มหนังสือขอลาออกจากราชการ",
pathName: "",
}
},
]);
//
const fileDownload = async (type: string, fileName: string) => {
showLoader();
await http
@ -358,6 +385,7 @@ const fileDownload = async (type: string, fileName: string) => {
});
};
//
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;

View file

@ -8,6 +8,7 @@ import { useOrderPlacementDataStore } from "@/modules/05_placement/store";
import router from "@/router";
import { useQuasar } from "quasar";
/** Use */
const $q = useQuasar(); // noti quasar
const DataStore = useOrderPlacementDataStore();
const pagination = ref({
@ -16,7 +17,6 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
const mixin = useCounterMixin();
const { dateText } = mixin;
@ -25,6 +25,7 @@ const textDate = (value: Date) => {
return dateText(value);
};
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<string[]>([
"Order",
"OrderType",
@ -263,6 +264,7 @@ const rows = ref<FormOrderPlacementMainData[]>([
let OriginalData = ref<FormOrderPlacementMainData[]>([]);
let UpdataData = ref<FormOrderPlacementMainData[]>([]);
/**Hook */
onMounted(async () => {
await OriginalDataFetch();
fiscalYearFilter();
@ -271,6 +273,9 @@ onMounted(async () => {
OrderTypeFilter();
});
/**
* งคาขอมลจาก store
*/
const OriginalDataFetch = async () => {
await DataStore.DataMainOrder(rows.value);
OriginalData.value = await DataStore.DataMainOrigOrder;
@ -282,6 +287,10 @@ const redirectToPage = (id?: number) => {
router.push(`/placement/order/detail`);
};
/**
* function delete
* @param id id delete
*/
const clickDelete = (id: string) => {
$q.dialog({
title: "ยืนยันการลบข้อมูล",
@ -297,6 +306,7 @@ const clickDelete = (id: string) => {
.onDismiss(() => {});
};
//route OrderplacementDetail
const clickAdd = () => {
router.push({ name: "OrderplacementDetail" });
};
@ -320,6 +330,9 @@ const fiscalYearFilter = async () => {
}
};
/**
* เลอกประเภทคำส
*/
const OrderType = ref<string>("");
const OrderTypeOption = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
const addedOrderTypeValues: string[] = [];
@ -335,6 +348,10 @@ const OrderTypeFilter = async () => {
}
}
};
/**
* เลอกStatus คำส
*/
const OrderStatus = ref<string>("");
const OrderStatusOption = reactive<DataOption[]>([{ id: 1, name: "ทั้งหมด" }]);
const addedOrderStatusValues: string[] = [];
@ -366,9 +383,7 @@ const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
const attrs = ref<any>(useAttrs());
const searchFilterTable = async () => {
await DataStore.DataUpdateOrder(
OrderType.value,
@ -378,6 +393,7 @@ const searchFilterTable = async () => {
UpdataData.value = DataStore.DataMainUpdateOrder;
};
/**Setting pagination */
const paging = ref<boolean>(true);
const paginationLabel = (start: string, end: string, total: string) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;

View file

@ -7,7 +7,6 @@ import { useCounterMixin } from "@/stores/mixin";
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
import { useLeavelistDataStoreTest } from "@/modules/09_leave/stores/ListLeave";
import DialogReason from "@/components/Dialogs/PopupReason.vue";
import DialogReason1 from "@/components/Dialogs/PopupReason.vue";
const APIDATA = useLeavelistDataStoreTest();
/** importType */