Merge branch 'develop' into devTee
This commit is contained in:
commit
911bed1148
34 changed files with 690 additions and 680 deletions
|
|
@ -133,10 +133,9 @@ function saveSelectEdit() {
|
|||
};
|
||||
await http
|
||||
.put(url, body)
|
||||
.then(() => {
|
||||
success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||
|
||||
props.getData?.();
|
||||
.then(async () => {
|
||||
await props.getData?.();
|
||||
await success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||
close();
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -192,10 +191,12 @@ function onSubmitSelectEdit() {
|
|||
|
||||
await http
|
||||
.post(url, body)
|
||||
.then(() => {
|
||||
success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||
|
||||
props.emitSearch?.(formPositionSelect.positionName, "positionName");
|
||||
.then(async () => {
|
||||
await props.emitSearch?.(
|
||||
formPositionSelect.positionName,
|
||||
"positionName"
|
||||
);
|
||||
await success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||
close();
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -241,7 +242,12 @@ function inputEdit(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกประเภทตำแหน่ง
|
||||
* @param val id ประเภทตำแหน่ง
|
||||
*/
|
||||
function updateSelectType(val: string) {
|
||||
// หาระดับตำแหน่ง
|
||||
const listLevel = dataLevel.value.find((e: any) => e.id === val);
|
||||
levelOpsMain.value = listLevel.posLevels.map((e: OptionLevel) => ({
|
||||
id: e.id,
|
||||
|
|
@ -257,8 +263,7 @@ function close() {
|
|||
}
|
||||
|
||||
async function fetchType() {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.orgPosType)
|
||||
.then((res) => {
|
||||
dataLevel.value = res.data.result;
|
||||
|
|
@ -270,16 +275,12 @@ async function fetchType() {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** function เรียกรายการตำแหน่งทางการบริหาร */
|
||||
async function fetchExecutive() {
|
||||
showLoader();
|
||||
await http
|
||||
function fetchExecutive() {
|
||||
http
|
||||
.get(config.API.orgPosExecutive)
|
||||
.then((res) => {
|
||||
executiveOpsMain.value = res.data.result.map((e: OptionExecutive) => ({
|
||||
|
|
@ -290,9 +291,6 @@ async function fetchExecutive() {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -300,8 +298,9 @@ watch(
|
|||
() => modal.value,
|
||||
async () => {
|
||||
if (modal.value === true) {
|
||||
await fetchType();
|
||||
await fetchExecutive();
|
||||
showLoader();
|
||||
await Promise.all([fetchType(), fetchExecutive()]);
|
||||
hideLoader();
|
||||
if (props.data) {
|
||||
const dataList = props.data;
|
||||
|
||||
|
|
|
|||
|
|
@ -149,13 +149,14 @@ function onSubmit() {
|
|||
formData.responsibility != null ? formData.responsibility : "",
|
||||
};
|
||||
|
||||
//เพิ่มข้อมูล
|
||||
if (actionType.value === "ADD") {
|
||||
await http
|
||||
.post(config.API.createOrgLevel(type.toLocaleLowerCase()), body)
|
||||
.then(() => {
|
||||
props.fetchDataTree(store.draftId);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeClear();
|
||||
.then(async () => {
|
||||
await props.fetchDataTree(store.draftId);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await closeClear();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -164,6 +165,7 @@ function onSubmit() {
|
|||
hideLoader();
|
||||
});
|
||||
} else {
|
||||
// แก่้ไขข้อมูล
|
||||
props.dataNode &&
|
||||
(await http
|
||||
.put(
|
||||
|
|
@ -173,32 +175,35 @@ function onSubmit() {
|
|||
),
|
||||
body
|
||||
)
|
||||
.then(() => {
|
||||
props.fetchDataTree(store.draftId);
|
||||
props.edit?.(
|
||||
.then(async () => {
|
||||
await props.fetchDataTree(store.draftId);
|
||||
await props.edit?.(
|
||||
props.dataNode?.orgTreeId,
|
||||
type,
|
||||
body,
|
||||
props.dataNode?.orgRootCode
|
||||
);
|
||||
closeClear();
|
||||
props.fetchDataTable(
|
||||
await props.fetchDataTable(
|
||||
props?.dataNode?.orgTreeId,
|
||||
props?.dataNode?.orgLevel,
|
||||
false
|
||||
);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await closeClear();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(async () => {
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เช็ต formdata กลับไปค่าว่าง และปิด popup
|
||||
*/
|
||||
function closeClear() {
|
||||
formData.orgName = "";
|
||||
formData.orgShortName = "";
|
||||
|
|
@ -211,14 +216,14 @@ function closeClear() {
|
|||
props.close?.();
|
||||
}
|
||||
|
||||
/**
|
||||
* callback function ทำงานเมื่อมีการเปิด popup
|
||||
*/
|
||||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
if (props.modal === true) {
|
||||
if (actionType.value === "ADD") {
|
||||
// console.log(props.dataNode);
|
||||
// console.log(level.value);
|
||||
|
||||
if (props.dataNode) {
|
||||
formData.orgCode =
|
||||
props?.dataNode?.orgLevel !== 0
|
||||
|
|
@ -261,6 +266,9 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* title ของ popup
|
||||
*/
|
||||
const tittleName = computed(() => {
|
||||
let name = "";
|
||||
if (actionType.value === "ADD") {
|
||||
|
|
@ -272,6 +280,11 @@ const tittleName = computed(() => {
|
|||
return name;
|
||||
});
|
||||
|
||||
/**
|
||||
* function เลือกระดับของส่วนราชการ
|
||||
* @param val
|
||||
* @param status
|
||||
*/
|
||||
function selectOrgLevele(val: string, status: boolean = true) {
|
||||
formData.orgLevelSub = status ? "" : formData.orgLevelSub;
|
||||
switch (val) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -27,7 +26,7 @@ import type { FilterMaster } from "@/modules/02_organization/interface/request/o
|
|||
* importComponents
|
||||
*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogAddPosition from "@/modules/02_organization/components/DialogAddPosition.vue";
|
||||
import DialogAddPosition from "@/modules/02_organization/components/DialogAddPosition.vue"; //เพิ่มข้อมูลตำแหน่ง
|
||||
|
||||
/**
|
||||
* importStore
|
||||
|
|
@ -224,6 +223,10 @@ const visibleColumns = ref<string[]>([
|
|||
"positionArea",
|
||||
]);
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลอัตรากำลัง
|
||||
* @param id อัตรากำลัง
|
||||
*/
|
||||
async function fetchPosition(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -249,7 +252,7 @@ async function fetchPosition(id: string) {
|
|||
const dataLevel = ref<any>();
|
||||
/** function เรียกรายการประเภทตำแหน่ง */
|
||||
async function fetchType() {
|
||||
showLoader();
|
||||
// showLoader();
|
||||
await http
|
||||
.get(config.API.orgPosType)
|
||||
.then((res) => {
|
||||
|
|
@ -264,13 +267,13 @@ async function fetchType() {
|
|||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
// hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** function เรียกรายการตำแหน่งทางการบริหาร */
|
||||
async function fetchExecutive() {
|
||||
showLoader();
|
||||
// showLoader();
|
||||
await http
|
||||
.get(config.API.orgPosExecutive)
|
||||
.then((res) => {
|
||||
|
|
@ -284,7 +287,7 @@ async function fetchExecutive() {
|
|||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
// hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +339,6 @@ function onSubmit() {
|
|||
orgChild3Id: props.orgLevel === 3 ? props.treeId : null,
|
||||
orgChild4Id: props.orgLevel === 4 ? props.treeId : null,
|
||||
positions: positionsData,
|
||||
// succession: succession.value,
|
||||
};
|
||||
|
||||
showLoader();
|
||||
|
|
@ -435,10 +437,11 @@ function inputEdit(val: boolean) {
|
|||
|
||||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
async () => {
|
||||
if (props.modal === true) {
|
||||
fetchType();
|
||||
fetchExecutive();
|
||||
props.actionType === "ADD" && showLoader();
|
||||
await Promise.all([fetchType(), fetchExecutive()]);
|
||||
props.actionType === "ADD" && hideLoader();
|
||||
|
||||
if (props.actionType === "ADD") {
|
||||
rowsPositionSelect.value = [];
|
||||
|
|
@ -474,30 +477,41 @@ async function addPosition(data: RowDetailPositions) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function ลบข้อมูลอัตรากำลัง
|
||||
* @param id ข้อมูลอัตรากำลัง
|
||||
*/
|
||||
function deleteData(id: string) {
|
||||
const dataRow = rows.value;
|
||||
const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||
rows.value = updatedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ลบตำแหน่ง
|
||||
* @param id ตำแหน่ง
|
||||
*/
|
||||
function deletePos(id: string) {
|
||||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.orgPosPositionById(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await searchInput();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
searchInput();
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียร์ formData
|
||||
*/
|
||||
async function clearFormPositionSelect() {
|
||||
isDisValidate.value = await true;
|
||||
formPositionSelect.positionId = "";
|
||||
|
|
@ -514,9 +528,12 @@ async function clearFormPositionSelect() {
|
|||
}, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด popup
|
||||
*/
|
||||
function close() {
|
||||
props.close?.();
|
||||
clearFormPositionSelect();
|
||||
props.close?.();
|
||||
isPosition.value = false;
|
||||
}
|
||||
|
||||
|
|
@ -648,8 +665,7 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
|||
<q-btn
|
||||
flat
|
||||
dense
|
||||
icon="mdi-delete"
|
||||
class="q-pa-none q-ml-xs"
|
||||
icon="delete"
|
||||
color="red"
|
||||
@click="deleteData(props.row.id)"
|
||||
>
|
||||
|
|
@ -821,11 +837,14 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
|||
<q-btn
|
||||
flat
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
color="secondary"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
round
|
||||
>
|
||||
<q-menu anchor="bottom middle" self="top middle">
|
||||
<q-menu
|
||||
transition-show="jump-down"
|
||||
transition-hide="jump-up"
|
||||
>
|
||||
<q-list
|
||||
dense
|
||||
v-for="(item, index) in listMenu"
|
||||
|
|
@ -842,11 +861,14 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
|||
: deletePos(props.row.id)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-item-section
|
||||
avatar
|
||||
style="min-width: 0px"
|
||||
>
|
||||
<q-icon
|
||||
:color="item.color"
|
||||
:name="item.icon"
|
||||
size="sm"
|
||||
size="xs"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{
|
||||
|
|
@ -910,6 +932,8 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
|||
</form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- เพิ่มข้อมูลตำแหน่ง -->
|
||||
<DialogAddPosition
|
||||
v-model:modalAdd="modalAdd"
|
||||
:emitSearch="emitSearch"
|
||||
|
|
|
|||
|
|
@ -128,10 +128,10 @@ function onClickMovePos() {
|
|||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgPosMove, body)
|
||||
.then(() => {
|
||||
props.fetchDataTree?.(store.draftId);
|
||||
.then(async () => {
|
||||
await props.fetchDataTree?.(store.draftId);
|
||||
await success($q, "ย้ายตำแหน่งสำเร็จ");
|
||||
modal.value = false;
|
||||
success($q, "ย้ายตำแหน่งสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -112,21 +112,21 @@ function onSubmit() {
|
|||
showLoader();
|
||||
http
|
||||
.post(config.API.createOrganization, formData)
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
await props.fetchActive();
|
||||
status.value = true;
|
||||
store.typeOrganizational = "draft";
|
||||
store.draftId = res.data.result.id;
|
||||
store.statusView = "list";
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
props.fetchActive();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(async () => {
|
||||
modal.value = await false;
|
||||
await close();
|
||||
await hideLoader();
|
||||
.finally(() => {
|
||||
modal.value = false;
|
||||
hideLoader();
|
||||
close();
|
||||
});
|
||||
},
|
||||
"ยืนยันการเพิ่มโครงสร้าง",
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ async function fetchTree() {
|
|||
await http
|
||||
.get(config.API.orgByid(id))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
nodeTree.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -164,7 +163,6 @@ function onClickConfirm() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
console.log(props.rowId, selectedPos.value[0].id);
|
||||
const body: Inherit = {
|
||||
draftPositionId: props.rowId,
|
||||
publishPositionId: selectedPos.value[0].id,
|
||||
|
|
|
|||
|
|
@ -297,15 +297,15 @@ async function onClickEdit(node: OrgTree) {
|
|||
* @param id ID โครงสร้าง
|
||||
* @param rootId RootID
|
||||
*/
|
||||
async function onClickDel(type: number, id: string, rootId: string) {
|
||||
function onClickDel(type: number, id: string, rootId: string) {
|
||||
const level = store.checkLevel(type);
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.orgLevelByid(level.toLocaleLowerCase(), id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
deleteUpdate(rootId, id);
|
||||
.then(async () => {
|
||||
await deleteUpdate(rootId, id);
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -321,7 +321,7 @@ async function onClickDel(type: number, id: string, rootId: string) {
|
|||
* @param id ID โครงสร้าง
|
||||
* @param level ระดับโครงสร้าง
|
||||
*/
|
||||
async function onClickSort(id: string, level: number) {
|
||||
function onClickSort(id: string, level: number) {
|
||||
type.value = level;
|
||||
modalSortAgency.value = true;
|
||||
if (id) {
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ import type {
|
|||
import type { DataPosition } from "@/modules/02_organization/interface/index/organizational";
|
||||
|
||||
/** importComponents*/
|
||||
import DialogFormPosotion from "@/modules/02_organization/components/DialogFormPosition.vue";
|
||||
import DialogPositionDetail from "@/modules/02_organization/components/DialogPositionDetail.vue";
|
||||
import DialogSort from "@/modules/02_organization/components/DialogSortPosition.vue";
|
||||
import DialogMovePos from "@/modules/02_organization/components/DialogMovePos.vue";
|
||||
import DialogHistoryPos from "@/modules/02_organization/components/DialogHistoryPos.vue";
|
||||
import DialogSelectPerson from "@/modules/02_organization/components/DialogSelectPerson.vue";
|
||||
import DialogSuccession from "@/modules/02_organization/components/DialogSuccession.vue";
|
||||
import DialogFormPosotion from "@/modules/02_organization/components/DialogFormPosition.vue"; //อัตรากำลัง
|
||||
import DialogPositionDetail from "@/modules/02_organization/components/DialogPositionDetail.vue"; //รายละเอียดตำแหน่ง
|
||||
import DialogSort from "@/modules/02_organization/components/DialogSortPosition.vue"; // จัดลำดับ
|
||||
import DialogMovePos from "@/modules/02_organization/components/DialogMovePos.vue"; // ย้ายตำแหน่ง
|
||||
import DialogHistoryPos from "@/modules/02_organization/components/DialogHistoryPos.vue"; // ประวัติตำแหน่ง
|
||||
import DialogSelectPerson from "@/modules/02_organization/components/DialogSelectPerson.vue"; // เลือกคนครอง
|
||||
import DialogSuccession from "@/modules/02_organization/components/DialogSuccession.vue"; // สืบทอดตำแหน่ง
|
||||
|
||||
/** importStore*/
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
|
|
@ -291,10 +291,17 @@ function onClickDelete(id: string) {
|
|||
showLoader();
|
||||
await http
|
||||
.delete(config.API.orgPosMasterById(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
|
||||
getSummary();
|
||||
.then(async () => {
|
||||
await Promise.all([
|
||||
props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
reqMaster.value.type,
|
||||
false
|
||||
),
|
||||
getSummary(),
|
||||
]);
|
||||
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -357,14 +364,16 @@ function removePerson(id: string) {
|
|||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgDeleteProfile(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
reqMaster.value.type,
|
||||
false
|
||||
);
|
||||
getSummary();
|
||||
.then(async () => {
|
||||
await Promise.all([
|
||||
props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
reqMaster.value.type,
|
||||
false
|
||||
),
|
||||
getSummary(),
|
||||
]);
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -571,7 +580,7 @@ watch(
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" >
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="store.typeOrganizational === 'draft'"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch, onMounted } from "vue";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -11,7 +11,6 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -72,126 +71,14 @@ const workDateRef = ref<object | null>(null);
|
|||
const reasonSameDateRef = ref<object | null>(null);
|
||||
|
||||
const visibleColumnsHistory = ref<String[]>([
|
||||
// "oc",
|
||||
// "position",
|
||||
// "positionPathSide",
|
||||
// "posNo",
|
||||
// "positionLine",
|
||||
// "positionType",
|
||||
// "positionLevel",
|
||||
// "positionExecutive",
|
||||
// "positionExecutiveSide",
|
||||
"dateAppoint",
|
||||
"dateStart",
|
||||
// "retireDate",
|
||||
// "govAge",
|
||||
// "govAgeAbsent",
|
||||
// "govAgePlus",
|
||||
"reasonSameDate",
|
||||
"lastUpdateFullName",
|
||||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
const columnsHistory = ref<QTableProps["columns"]>([
|
||||
// {
|
||||
// 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: "positionPathSide",
|
||||
// align: "left",
|
||||
// label: "ตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "positionPathSide",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "position",
|
||||
// align: "left",
|
||||
// label: "ด้าน/สาขา",
|
||||
// sortable: true,
|
||||
// field: "position",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "posNo",
|
||||
// align: "left",
|
||||
// label: "ตำแหน่งเลขที่",
|
||||
// sortable: true,
|
||||
// field: "posNo",
|
||||
// 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",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "positionType",
|
||||
// align: "left",
|
||||
// label: "ประเภท",
|
||||
// sortable: true,
|
||||
// field: "positionType",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "positionLevel",
|
||||
// align: "left",
|
||||
// label: "ระดับ",
|
||||
// sortable: true,
|
||||
// field: "positionLevel",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "positionExecutive",
|
||||
// align: "left",
|
||||
// label: "ตำแหน่งทางการบริหาร",
|
||||
// sortable: true,
|
||||
// field: "positionExecutive",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "positionExecutiveSide",
|
||||
// align: "left",
|
||||
// label: "ด้านทางการบริหาร",
|
||||
// sortable: true,
|
||||
// field: "positionExecutiveSide",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
{
|
||||
name: "dateAppoint",
|
||||
align: "left",
|
||||
|
|
@ -216,51 +103,6 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
// {
|
||||
// name: "retireDate",
|
||||
// align: "left",
|
||||
// label: "วันเกษียณอายุ",
|
||||
// sortable: true,
|
||||
// field: "retireDate",
|
||||
// format: (v) => date2Thai(v),
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "govAge",
|
||||
// align: "left",
|
||||
// label: "อายุราชการ",
|
||||
// sortable: true,
|
||||
// field: "govAge",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "govAgeAbsent",
|
||||
// align: "left",
|
||||
// label: "ขาดราชการ",
|
||||
// sortable: true,
|
||||
// field: "govAgeAbsent",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
// {
|
||||
// name: "govAgePlus",
|
||||
// align: "left",
|
||||
// label: "อายุราชการเกื้อกูล",
|
||||
// sortable: true,
|
||||
// field: "govAgePlus",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
{
|
||||
name: "reasonSameDate",
|
||||
align: "left",
|
||||
|
|
@ -297,7 +139,9 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** เปิด dialog */
|
||||
/**
|
||||
* เปิด dialog *
|
||||
*/
|
||||
function openDialogEdit() {
|
||||
modalEdit.value = true;
|
||||
containDate.value = formMain.containDate ? formMain.containDate : null;
|
||||
|
|
@ -307,12 +151,18 @@ function openDialogEdit() {
|
|||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิด dialog ประวัติแก้ไขข้อมูลราชการ
|
||||
*/
|
||||
function openDialogHistory() {
|
||||
modalHistory.value = true;
|
||||
filterKeyword.value = "";
|
||||
getDataHistory();
|
||||
}
|
||||
/** ปิด dialog */
|
||||
|
||||
/**
|
||||
* ปิด dialog
|
||||
*/
|
||||
function closeDialog() {
|
||||
modalEdit.value = false;
|
||||
containDate.value = null;
|
||||
|
|
@ -320,6 +170,9 @@ function closeDialog() {
|
|||
reasonSameDate.value = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูลราชการ
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
|
|
@ -336,9 +189,9 @@ function onSubmit() {
|
|||
: reasonSameDate.value,
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
getData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -350,7 +203,9 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลราชการ */
|
||||
/**
|
||||
* ดึงข้อมูลราชการ
|
||||
*/
|
||||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -384,7 +239,9 @@ function getData() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลประวัติ */
|
||||
/**
|
||||
* ดึงข้อมูลประวัติ
|
||||
*/
|
||||
function getDataHistory() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -852,7 +709,7 @@ onMounted(() => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ const {
|
|||
messageError,
|
||||
success,
|
||||
pathRegistryEmp,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const profileId = ref<string>(
|
||||
|
|
@ -60,14 +59,10 @@ const formFilter = reactive<FormFilter>({
|
|||
isShowRetire: false,
|
||||
isProbation: false,
|
||||
});
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const pagination = ref({
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"level",
|
||||
"detail",
|
||||
|
|
@ -199,6 +194,12 @@ const OpsFilter = ref<any>({
|
|||
],
|
||||
});
|
||||
|
||||
/**
|
||||
* function ค้นหา คำใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
* @param refData type select
|
||||
*/
|
||||
function filterSelector(val: string, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "levelOptions":
|
||||
|
|
@ -213,7 +214,9 @@ function filterSelector(val: string, update: Function, refData: string) {
|
|||
}
|
||||
}
|
||||
|
||||
/** ปิด dialog */
|
||||
/**
|
||||
* ปิด dialog ข้อมูลวินัย
|
||||
*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
edit.value = false;
|
||||
|
|
@ -225,15 +228,21 @@ function closeDialog() {
|
|||
disciplineData.refCommandDate = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิด dialog ข้อมูลวินัย
|
||||
*/
|
||||
function openDialogAdd() {
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
async function fetchData(id: string) {
|
||||
/**
|
||||
* function fetch ข้อมูลรายการวินัย
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewDisciplineByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -244,7 +253,11 @@ async function fetchData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function addData() {
|
||||
/**
|
||||
* funciton เพิ่มช้อมูลวินัย
|
||||
*/
|
||||
function addData() {
|
||||
showLoader();
|
||||
const body = {
|
||||
date: disciplineData.date,
|
||||
level: disciplineData.level,
|
||||
|
|
@ -256,11 +269,12 @@ async function addData() {
|
|||
empType.value !== "" ? disciplineData.profileId : undefined,
|
||||
refCommandDate: disciplineData.refCommandDate,
|
||||
};
|
||||
await http
|
||||
http
|
||||
.post(config.API.profileNewDiscipline(empType.value), body)
|
||||
.then(() => {
|
||||
fetchData(profileId.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(profileId.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -270,8 +284,12 @@ async function addData() {
|
|||
});
|
||||
}
|
||||
|
||||
async function editData(idData: string) {
|
||||
await http
|
||||
/**
|
||||
* funciton บันทึกแก่ไขช้อมูลวินัย
|
||||
*/
|
||||
function editData(idData: string) {
|
||||
showLoader();
|
||||
http
|
||||
.patch(
|
||||
config.API.profileNewDisciplineByDisciplineId(idData, empType.value),
|
||||
{
|
||||
|
|
@ -279,9 +297,10 @@ async function editData(idData: string) {
|
|||
profileId: undefined,
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
fetchData(profileId.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(profileId.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -291,22 +310,6 @@ async function editData(idData: string) {
|
|||
});
|
||||
}
|
||||
|
||||
// function deleteData(idData: string) {
|
||||
// dialogRemove($q, () =>
|
||||
// http
|
||||
// .delete(config.API.profileNewDisciplineByDisciplineId(idData))
|
||||
// .then(() => {
|
||||
// fetchData(profileId.value);
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// })
|
||||
// );
|
||||
// }
|
||||
/**
|
||||
* กดเลือกข้อมูลที่จะแก้ไข
|
||||
* @param props ค่า props ใน row ที่เลือก
|
||||
|
|
@ -323,25 +326,31 @@ function openDialogEdit(props: RequestItemsObject) {
|
|||
disciplineData.refCommandDate = props.refCommandDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ดูประวัติการแ้ไขรายการวินัย
|
||||
* @param idOrder
|
||||
*/
|
||||
function openDialogHistory(idOrder: string) {
|
||||
modalHistory.value = true;
|
||||
id.value = idOrder;
|
||||
}
|
||||
|
||||
async function onSubmit() {
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
() => {
|
||||
edit.value ? editData(id.value) : addData();
|
||||
closeDialog();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(profileId.value);
|
||||
onMounted(() => {
|
||||
fetchData(profileId.value);
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@ import { useRoute } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type {
|
||||
RequestItemsObject,
|
||||
FormFilter,
|
||||
} from "@/modules/04_registryPerson/interface/index/discipline";
|
||||
import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/index/discipline";
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const id = defineModel<string>("id", { required: true });
|
||||
|
|
@ -23,23 +20,9 @@ const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
|||
mixin;
|
||||
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const filterKeyword = ref<string>("");
|
||||
const rows = ref<RequestItemsObject[]>([]); //select data history
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
keyword: "",
|
||||
type: "",
|
||||
posType: "",
|
||||
posLevel: "",
|
||||
retireYear: "",
|
||||
rangeYear: { min: 0, max: 60 },
|
||||
isShowRetire: false,
|
||||
isProbation: false,
|
||||
});
|
||||
|
||||
const historyPagination = ref({
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
|
|
@ -150,6 +133,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/**
|
||||
* fetch ข้อมูลประวัติการแก่ไขข้อมูลวินัย
|
||||
*/
|
||||
function getHistory() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -262,14 +248,7 @@ watch(modal, (status) => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{
|
||||
(formFilter.page - 1) * formFilter.pageSize +
|
||||
props.rowIndex +
|
||||
1
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
<div>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import type {
|
||||
DetailData,
|
||||
FormFilter,
|
||||
DataOptionLeave,
|
||||
DataOption,
|
||||
ResponseTotalObject,
|
||||
MyObjectRef,
|
||||
} from "@/modules/04_registryPerson/interface/index/leave";
|
||||
|
||||
import DialogHistory from "@/modules/04_registryPerson/components/detail/GovernmentInformation/03_LeaveHistory.vue";
|
||||
|
|
@ -48,21 +46,8 @@ const pagination = ref({
|
|||
});
|
||||
const mode = ref<string>("table");
|
||||
const filterKeyword = ref<string>("");
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
const rows = ref<DetailData[]>([]);
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
keyword: "",
|
||||
type: "",
|
||||
posType: "",
|
||||
posLevel: "",
|
||||
retireYear: "",
|
||||
rangeYear: { min: 0, max: 60 },
|
||||
isShowRetire: false,
|
||||
isProbation: false,
|
||||
});
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const edit = ref<boolean>(false);
|
||||
|
|
@ -114,19 +99,6 @@ const clickEditRowType = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const typeLeaveRef = ref<object | null>(null);
|
||||
const dateRangeRef = ref<object | null>(null);
|
||||
const numLeaveRef = ref<object | null>(null);
|
||||
const statLeaveRef = ref<object | null>(null);
|
||||
const reasonRef = ref<object | null>(null);
|
||||
const objectRef: MyObjectRef = {
|
||||
typeLeave: typeLeaveRef,
|
||||
dateRange: dateRangeRef,
|
||||
numLeave: numLeaveRef,
|
||||
statLeave: statLeaveRef,
|
||||
reason: reasonRef,
|
||||
};
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"typeLeave",
|
||||
|
|
@ -205,6 +177,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/**
|
||||
* function เปิด dialog ข้อมูลการลา
|
||||
*/
|
||||
function openDialogAdd() {
|
||||
modal.value = true;
|
||||
edit.value = false;
|
||||
|
|
@ -255,6 +230,9 @@ function clickTotal() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เปิด dialog แก้ไขข้อมูลการลา
|
||||
*/
|
||||
function openDialogEdit(props: DetailData) {
|
||||
edit.value = true;
|
||||
modal.value = true;
|
||||
|
|
@ -286,11 +264,12 @@ function openDialogEdit(props: DetailData) {
|
|||
}
|
||||
}
|
||||
|
||||
/** ปิด dialog */
|
||||
/**
|
||||
* ปิด dialog ข้อมูลการลา
|
||||
*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
edit.value = false;
|
||||
|
||||
id.value = "";
|
||||
typeLeave.value = "";
|
||||
statLeave.value = "";
|
||||
|
|
@ -300,6 +279,12 @@ function closeDialog() {
|
|||
numUsedLeave.value = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหา คำใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
* @param filtername type select
|
||||
*/
|
||||
function filterSelector(val: any, update: Function, filtername: string) {
|
||||
switch (filtername) {
|
||||
case "typeLeaveOption":
|
||||
|
|
@ -345,27 +330,17 @@ function openDialogHistory(idOrder: string) {
|
|||
id.value = idOrder;
|
||||
}
|
||||
|
||||
/** validate check*/
|
||||
function validateForm() {
|
||||
const hasError = [];
|
||||
for (const key in objectRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(objectRef, key)) {
|
||||
const property = objectRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
}
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
if (edit.value == false) {
|
||||
saveData();
|
||||
} else {
|
||||
editData();
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
dialogConfirm($q, async () => {
|
||||
if (edit.value == false) {
|
||||
saveData();
|
||||
} else {
|
||||
editData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -373,7 +348,6 @@ function validateForm() {
|
|||
*/
|
||||
function saveData() {
|
||||
showLoader();
|
||||
|
||||
http
|
||||
.post(config.API.profileNewLeave(empType.value), {
|
||||
leaveTypeId: typeLeave.value.id,
|
||||
|
|
@ -387,15 +361,16 @@ function saveData() {
|
|||
profileId: empType.value === "" ? profileId.value : undefined,
|
||||
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
getData();
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -415,18 +390,22 @@ const editData = async () => {
|
|||
status: statLeave.value,
|
||||
reason: reason.value,
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลรายการวินัย
|
||||
*/
|
||||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -594,9 +573,7 @@ onMounted(() => {
|
|||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{
|
||||
(formFilter.page - 1) * formFilter.pageSize + props.rowIndex + 1
|
||||
}}
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateLeave'">
|
||||
{{
|
||||
|
|
@ -684,7 +661,7 @@ onMounted(() => {
|
|||
<!-- dialog add edit -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card>
|
||||
<form @submit.prevent="validateForm">
|
||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||
<DialogHeader
|
||||
:tittle="edit ? 'แก้ไขข้อมูลการลา' : 'เพิ่มข้อมูลการลา'"
|
||||
:close="closeDialog"
|
||||
|
|
@ -814,7 +791,7 @@ onMounted(() => {
|
|||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</form>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
|
|
|
|||
|
|
@ -146,6 +146,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลประวัติการแก้ไขการลา
|
||||
*/
|
||||
function getHistory() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -172,7 +176,7 @@ function getHistory() {
|
|||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -192,6 +196,10 @@ function dateThaiRange(val: [Date, Date]) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function convertStatus
|
||||
* @param val
|
||||
*/
|
||||
function statusLeave(val: string) {
|
||||
switch (val) {
|
||||
case "waitting":
|
||||
|
|
|
|||
|
|
@ -42,11 +42,6 @@ const modalHistory = ref<boolean>(false);
|
|||
|
||||
const id = ref<string>("");
|
||||
|
||||
const dateStartRef = ref<object | null>(null);
|
||||
const dateEndRef = ref<object | null>(null);
|
||||
const detailRef = ref<object | null>(null);
|
||||
const referenceRef = ref<object | null>(null);
|
||||
|
||||
const dutyData = reactive<RequestItemsObject>({
|
||||
profileId: profileId.value,
|
||||
dateStart: new Date(),
|
||||
|
|
@ -78,9 +73,6 @@ const formFilter = reactive<FormFilter>({
|
|||
isProbation: false,
|
||||
});
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"dateStart",
|
||||
"dateEnd",
|
||||
|
|
@ -201,10 +193,12 @@ function closeDialog() {
|
|||
dutyData.refCommandDate = null;
|
||||
}
|
||||
|
||||
/** fetch ข้อมูล */
|
||||
async function fetchData(id: string) {
|
||||
/**
|
||||
* fetch ข้อมูลรายการพิเศษ
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewDutyByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = res.data.result;
|
||||
|
|
@ -217,9 +211,11 @@ async function fetchData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/** เพิ่มข้อมูล */
|
||||
|
||||
async function addData() {
|
||||
/**
|
||||
* functoin บันทึกการเพิ่มข้อมูล
|
||||
*/
|
||||
function addData() {
|
||||
showLoader();
|
||||
const body = {
|
||||
profileId: empType.value === "" ? profileId.value : undefined,
|
||||
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
|
||||
|
|
@ -230,11 +226,12 @@ async function addData() {
|
|||
refCommandNo: dutyData.refCommandNo,
|
||||
refCommandDate: dutyData.refCommandDate,
|
||||
};
|
||||
await http
|
||||
http
|
||||
.post(config.API.profileNewDuty(empType.value), body)
|
||||
.then(() => {
|
||||
fetchData(profileId.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(profileId.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -244,17 +241,20 @@ async function addData() {
|
|||
});
|
||||
}
|
||||
|
||||
/** แก้ไขข้อมูล */
|
||||
|
||||
async function editData(idData: string) {
|
||||
await http
|
||||
/**
|
||||
* functoin บันทึกการแก้ไขข้อมูล
|
||||
*/
|
||||
function editData(idData: string) {
|
||||
showLoader();
|
||||
http
|
||||
.patch(config.API.profileNewDutyByDutyId(idData, empType.value), {
|
||||
...dutyData,
|
||||
profileId: undefined,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(profileId.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(profileId.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -264,41 +264,22 @@ async function editData(idData: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/** ลบข้อมูล */
|
||||
|
||||
// function deleteData(idData: string) {
|
||||
// dialogRemove($q, () =>
|
||||
// http
|
||||
// .delete(config.API.profileNewDutyByDutyId(idData))
|
||||
// .then(() => {
|
||||
// fetchData(profileId.value);
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// })
|
||||
// );
|
||||
// }
|
||||
|
||||
/** กด Submit */
|
||||
|
||||
async function onSubmit() {
|
||||
/**
|
||||
* ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
() => {
|
||||
edit.value ? editData(id.value) : addData();
|
||||
closeDialog();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(profileId.value);
|
||||
onMounted(() => {
|
||||
fetchData(profileId.value);
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -547,6 +528,7 @@ onMounted(async () => {
|
|||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:max-date="dutyData.dateEnd"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
|
|||
|
|
@ -24,22 +24,8 @@ const { showLoader, hideLoader, messageError, date2Thai, pathRegistryEmp } =
|
|||
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const filterKeyword = ref<string>("");
|
||||
const rows = ref<ResponseObject[]>([]); //select data history
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
keyword: "",
|
||||
type: "",
|
||||
posType: "",
|
||||
posLevel: "",
|
||||
retireYear: "",
|
||||
rangeYear: { min: 0, max: 60 },
|
||||
isShowRetire: false,
|
||||
isProbation: false,
|
||||
});
|
||||
|
||||
const historyPagination = ref({
|
||||
page: 1,
|
||||
|
|
@ -149,6 +135,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลประวติการแก้ไขข้อมูล
|
||||
*/
|
||||
function getHistory() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -264,14 +254,7 @@ watch(modal, (status) => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{
|
||||
(formFilter.page - 1) * formFilter.pageSize +
|
||||
props.rowIndex +
|
||||
1
|
||||
}}
|
||||
</div>
|
||||
<div v-else class="table_ellipsis">
|
||||
<div class="table_ellipsis">
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -345,10 +345,10 @@ function onSubmit() {
|
|||
route.name === "registry-employeeId" ? "TEMP" : undefined,
|
||||
})
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await props.fetchDataPersonal?.();
|
||||
await getData();
|
||||
modal.value = false;
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ async function uploadProfile(id: string) {
|
|||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async function uploadFileURL(uploadUrl: string, file: any) {
|
||||
|
|
@ -576,16 +576,7 @@ watch(
|
|||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<!-- <q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="mdi-history"
|
||||
color="deep-purple"
|
||||
@click="() => (fetchHistoryData(props.row.id), (historyDialog = true))"
|
||||
>
|
||||
<q-tooltip>ดูประวัติการเปลี่ยนชื่อ-นามสกุล</q-tooltip>
|
||||
</q-btn> -->
|
||||
|
||||
<q-space />
|
||||
<q-input
|
||||
dense
|
||||
|
|
@ -632,15 +623,21 @@ watch(
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="(col, index) in props.cols" :key="col.name">
|
||||
<div class="table_ellipsis">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="green"
|
||||
|
|
@ -652,27 +649,6 @@ watch(
|
|||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- <q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
clickable
|
||||
@click="
|
||||
() => {
|
||||
editForm(props.row);
|
||||
}
|
||||
"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn> -->
|
||||
</q-td>
|
||||
<q-td v-for="(col, index) in props.cols" :key="col.name">
|
||||
<div class="table_ellipsis">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
@ -706,24 +682,6 @@ watch(
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <q-select
|
||||
class="inputgreen"
|
||||
outlined
|
||||
v-model="changeNameData.status"
|
||||
:options="statusOption"
|
||||
label="สถานะการเปลี่ยนชื่อ"
|
||||
use-input
|
||||
hide-bottom-space
|
||||
input-debounce="0"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกสถานะการเปลี่ยนชื่อ'}`,
|
||||
]"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'statusOptions'
|
||||
) "
|
||||
dense
|
||||
/> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-gutter-sm q-mb-md">
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ const profileId = ref<string>(
|
|||
);
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
const rowsHistory = ref<ResponseObject[]>([]);
|
||||
|
|
@ -375,9 +373,9 @@ async function editData() {
|
|||
...formData,
|
||||
id: undefined,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
fetchAll();
|
||||
.then(async (res) => {
|
||||
await fetchAll();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -169,6 +169,9 @@ const fromData = reactive({
|
|||
statusMarital: "",
|
||||
});
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลบิดา
|
||||
*/
|
||||
function fetchDataFather() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -194,6 +197,10 @@ function fetchDataFather() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลมารดา
|
||||
*/
|
||||
function fetchDataMother() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -218,6 +225,10 @@ function fetchDataMother() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลคู่สมรส
|
||||
*/
|
||||
function fetchDataCouple() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -244,6 +255,10 @@ function fetchDataCouple() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลบุตร
|
||||
*/
|
||||
function fetchDataChildren() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -263,6 +278,10 @@ function fetchDataChildren() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function บันทึกข้อมูล
|
||||
* @param type ประเภทของข้อมูล
|
||||
*/
|
||||
function onSubmit(type: string) {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
|
|
@ -288,14 +307,14 @@ function onSubmit(type: string) {
|
|||
const method = isEdit.value && type === "children" ? "patch" : "post";
|
||||
try {
|
||||
await http[method](url, formBody);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
type === "father"
|
||||
? fetchDataFather()
|
||||
? await fetchDataFather()
|
||||
: type === "mother"
|
||||
? fetchDataMother()
|
||||
? await fetchDataMother()
|
||||
: type === "couple"
|
||||
? fetchDataCouple()
|
||||
: fetchDataChildren();
|
||||
? await fetchDataCouple()
|
||||
: await fetchDataChildren();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
} catch (e) {
|
||||
messageError($q, e);
|
||||
|
|
@ -305,9 +324,13 @@ function onSubmit(type: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด popup
|
||||
*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
modalHistory.value = false;
|
||||
// เคลียร์ formData
|
||||
fromData.isLive = 1;
|
||||
fromData.citizenId = "";
|
||||
fromData.prefix = "";
|
||||
|
|
@ -318,6 +341,12 @@ function closeDialog() {
|
|||
fromData.statusMarital = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* function แก้ไขข้อมูล
|
||||
* @param type ประเภทของบุคคล
|
||||
* @param isStatusEdit สถานะแก่้ไข
|
||||
* @param data ข้อมูลเดิม
|
||||
*/
|
||||
function onOpenDialogForm(
|
||||
type: string,
|
||||
isStatusEdit: boolean = false,
|
||||
|
|
@ -326,11 +355,9 @@ function onOpenDialogForm(
|
|||
modal.value = true;
|
||||
typeForm.value = type;
|
||||
isEdit.value = isStatusEdit;
|
||||
console.log(data);
|
||||
|
||||
if (type === "father") {
|
||||
titleForm.value = "บิดา";
|
||||
console.log(fatherData);
|
||||
|
||||
fromData.isLive =
|
||||
fatherData.isLive === null ? 1 : fatherData.isLive ? 1 : 0;
|
||||
|
|
@ -351,9 +378,11 @@ function onOpenDialogForm(
|
|||
fromData.job = motherData.job;
|
||||
} else if (type === "couple") {
|
||||
titleForm.value = "คู่สมรส";
|
||||
|
||||
fromData.isLive = 1;
|
||||
} else if (type === "children") {
|
||||
titleForm.value = "บุตร";
|
||||
|
||||
if (isStatusEdit) {
|
||||
childernId.value = data.id;
|
||||
fromData.isLive =
|
||||
|
|
@ -367,6 +396,11 @@ function onOpenDialogForm(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function ดูประวัติการแก้ไขข้อมูล
|
||||
* @param type ประเภทของบุคคล
|
||||
* @param id
|
||||
*/
|
||||
function onOpenDialogHistory(type: string, id: string = "") {
|
||||
modalHistory.value = true;
|
||||
typeForm.value = type;
|
||||
|
|
@ -374,6 +408,9 @@ function onOpenDialogHistory(type: string, id: string = "") {
|
|||
fetchHistory(historyId, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลความสัมพันธ์
|
||||
*/
|
||||
function fetchDataRelationship() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -393,14 +430,24 @@ function fetchDataRelationship() {
|
|||
});
|
||||
}
|
||||
|
||||
const filterSelectorRelation = (val: any, update: Function) => {
|
||||
/**
|
||||
* function ค้นหาข้อมูลใน select
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
*/
|
||||
function filterSelectorRelation(val: any, update: Function) {
|
||||
update(() => {
|
||||
optionRelationship.value = optionRelationshipMain.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลประวัติการแก้ไขข้อมูล
|
||||
* @param id
|
||||
* @param type
|
||||
*/
|
||||
function fetchHistory(id: string, type: string) {
|
||||
hideLoader();
|
||||
http
|
||||
|
|
@ -426,11 +473,13 @@ function fetchHistory(id: string, type: string) {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDataFather();
|
||||
fetchDataMother();
|
||||
fetchDataCouple();
|
||||
fetchDataChildren();
|
||||
fetchDataRelationship();
|
||||
Promise.all([
|
||||
fetchDataFather(),
|
||||
fetchDataMother(),
|
||||
fetchDataCouple(),
|
||||
fetchDataChildren(),
|
||||
fetchDataRelationship(),
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -495,18 +495,26 @@ const historyVisibleColumns = ref<string[]>([
|
|||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
async function onSubmit() {
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
() => {
|
||||
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||
closeDialog();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหา คำใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
* @param refData type select
|
||||
*/
|
||||
function filterSelector(val: string, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "educationOption":
|
||||
|
|
@ -528,6 +536,9 @@ function filterSelector(val: string, update: Function, refData: string) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียร์ formData
|
||||
*/
|
||||
function clearForm() {
|
||||
isDate.value = "false";
|
||||
educationData.educationLevel = "";
|
||||
|
|
@ -549,6 +560,10 @@ function clearForm() {
|
|||
educationData.note = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* function แก้ไขข้อมูลประวัติการศึกษา
|
||||
* @param row ข้อมูลประวัติการศึกษา
|
||||
*/
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
|
|
@ -579,19 +594,30 @@ function editForm(row: any) {
|
|||
dialog.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด popup มูลประวัติการศึกษา
|
||||
*/
|
||||
function closeDialog() {
|
||||
clearForm();
|
||||
dialog.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* funcitob ปิด popup ประวัติการศึกษา
|
||||
*/
|
||||
function closeHistoryDialog() {
|
||||
historyDialog.value = false;
|
||||
}
|
||||
|
||||
async function fetchData(id: string) {
|
||||
/**
|
||||
* function fetch ข้อมูลประวัตืการศึกษา
|
||||
* @param id บุคคล
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewEducationByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -602,9 +628,11 @@ async function fetchData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function fetchEducationLevel() {
|
||||
showLoader();
|
||||
await http
|
||||
/**
|
||||
* function fetch ข้อมูลระดับการศึกษา
|
||||
*/
|
||||
function fetchEducationLevel() {
|
||||
http
|
||||
.get(config.API.orgEducationLevel)
|
||||
.then(async (res) => {
|
||||
res.data.result.map((r: any) => {
|
||||
|
|
@ -617,15 +645,16 @@ async function fetchEducationLevel() {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchHistoryData(id: string) {
|
||||
/**
|
||||
* function fetch ประวัติการแก้ไขประวัติการศึกษา
|
||||
* @param id ประวัติการศึกษา
|
||||
*/
|
||||
function fetchHistoryData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewEducationHisByEducationId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
historyRows.value = res.data.result;
|
||||
|
|
@ -638,8 +667,12 @@ async function fetchHistoryData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function addData() {
|
||||
await http
|
||||
/**
|
||||
* function เพิ่มข้อมูลประวัติการศึกษา
|
||||
*/
|
||||
function addData() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.profileNewEducation(empType.value), {
|
||||
...educationData,
|
||||
startYear: undefined,
|
||||
|
|
@ -648,9 +681,10 @@ async function addData() {
|
|||
profileId: empType.value === "" ? id.value : undefined,
|
||||
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -660,9 +694,12 @@ async function addData() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function บันทึกการแก้ไขข้อมูล
|
||||
* @param idData ประวัติการศึกษา
|
||||
*/
|
||||
function editData(idData: string) {
|
||||
console.log(educationData);
|
||||
|
||||
showLoader();
|
||||
http
|
||||
.patch(config.API.profileNewEducationByEducationId(idData, empType.value), {
|
||||
...educationData,
|
||||
|
|
@ -673,9 +710,10 @@ function editData(idData: string) {
|
|||
durationYear:
|
||||
educationData.durationYear === "" ? null : educationData.durationYear,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -685,23 +723,6 @@ function editData(idData: string) {
|
|||
});
|
||||
}
|
||||
|
||||
// function deleteData(idData: string) {
|
||||
// dialogRemove($q, () =>
|
||||
// http
|
||||
// .delete(config.API.profileNewEducationByEducationId(idData))
|
||||
// .then(() => {
|
||||
// fetchData(id.value);
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// })
|
||||
// );
|
||||
// }
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(id.value);
|
||||
fetchEducationLevel();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ const mixin = useCounterMixin();
|
|||
const $q = useQuasar();
|
||||
const mode = ref<string>("table");
|
||||
const {
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
|
|
@ -189,6 +188,7 @@ const historyVisibleColumns = ref<string[]>([
|
|||
"lastUpdateFullName",
|
||||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
function closeDialog() {
|
||||
dialog.value = false;
|
||||
}
|
||||
|
|
@ -197,18 +197,23 @@ function closeHistoryDialog() {
|
|||
historyDialog.value = false;
|
||||
}
|
||||
|
||||
async function onSubmit() {
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
() => {
|
||||
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||
closeDialog();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียร์ formData
|
||||
*/
|
||||
function clearForm() {
|
||||
specialSkill.detail = "";
|
||||
specialSkill.field = "";
|
||||
|
|
@ -216,6 +221,10 @@ function clearForm() {
|
|||
specialSkill.remark = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* function
|
||||
* @param row ข้อมูลความสามารถพิเศษ
|
||||
*/
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
|
|
@ -226,11 +235,14 @@ function editForm(row: any) {
|
|||
dialog.value = true;
|
||||
}
|
||||
|
||||
async function fetchData(id: string) {
|
||||
/**
|
||||
* function fetch ข้อมูลความสามรรถพิเศษ
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewAbilityByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -241,11 +253,15 @@ async function fetchData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function fetchHistoryData(id: string) {
|
||||
/**
|
||||
* function fetch ประวัติการแก้ไขความสามรรถพิเศษ
|
||||
* @param id ความสามรรถพิเศษ
|
||||
*/
|
||||
function fetchHistoryData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewAbilityHisByAbilityId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
historyRows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -256,8 +272,12 @@ async function fetchHistoryData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function addData() {
|
||||
await http
|
||||
/**
|
||||
* function เพิ่มข้อมูลความสามรรถพิเศษ
|
||||
*/
|
||||
function addData() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.profileNewAbility(empType.value), {
|
||||
...specialSkill,
|
||||
dateStart: null,
|
||||
|
|
@ -265,9 +285,10 @@ async function addData() {
|
|||
profileId: empType.value === "" ? id.value : undefined,
|
||||
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -277,17 +298,23 @@ async function addData() {
|
|||
});
|
||||
}
|
||||
|
||||
async function editData(idData: string) {
|
||||
await http
|
||||
/**
|
||||
* function บันทึกการแก้ไขข้อมูล
|
||||
* @param idData ความสามรรถพิเศษ
|
||||
*/
|
||||
function editData(idData: string) {
|
||||
showLoader();
|
||||
http
|
||||
.patch(config.API.profileNewAbilityByAbilityId(idData, empType.value), {
|
||||
...specialSkill,
|
||||
dateStart: null,
|
||||
dateEnd: null,
|
||||
profileId: undefined,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -297,25 +324,8 @@ async function editData(idData: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function deleteData(idData: string) {
|
||||
dialogRemove($q, () =>
|
||||
http
|
||||
.delete(config.API.profileNewAbilityByAbilityId(idData, empType.value))
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(id.value);
|
||||
onMounted(() => {
|
||||
fetchData(id.value);
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ const statusOptionMain = ref<DataOption[]>(
|
|||
);
|
||||
const statusOption = ref<DataOption[]>(statusOptionMain.value);
|
||||
|
||||
/**
|
||||
* function บันทึกรายการคำร้อง
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
|
|
@ -64,6 +67,9 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด popup
|
||||
*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
formData.status = "";
|
||||
|
|
@ -77,6 +83,11 @@ function classInput(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหาคำใน select สถานะคำร้อง
|
||||
* @param val คำค้น
|
||||
* @param update Function
|
||||
*/
|
||||
function filterOption(val: string, update: Function) {
|
||||
update(() => {
|
||||
statusOption.value = statusOptionMain.value.filter(
|
||||
|
|
@ -85,6 +96,9 @@ function filterOption(val: string, update: Function) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลคำร้องแก้ไข
|
||||
*/
|
||||
function fetchDataRequest() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@ interface DataOption2 {
|
|||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface DataOptionSys {
|
||||
id: string;
|
||||
name: string;
|
||||
system: string;
|
||||
}
|
||||
interface DataOptionInsignia {
|
||||
id: string;
|
||||
name: string;
|
||||
|
|
@ -55,4 +59,5 @@ export type {
|
|||
InformationOps,
|
||||
AddressOps,
|
||||
InsigniaOps,
|
||||
DataOptionSys,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionCreate,
|
||||
checkPermissionList,
|
||||
} from "@/utils/permissions";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -9,7 +13,10 @@ import axios from "axios";
|
|||
/**
|
||||
* importType
|
||||
*/
|
||||
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
||||
import type {
|
||||
DataOption,
|
||||
DataOptionSys,
|
||||
} from "@/modules/04_registryPerson/interface/index/Main";
|
||||
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
|
||||
|
||||
/**
|
||||
|
|
@ -57,41 +64,49 @@ const profileId = ref<string>(route.params.id.toString());
|
|||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const formDetail = ref<ResponseObject>();
|
||||
const itemsMenu = ref<DataOption[]>([
|
||||
const itemsMenu = ref<DataOptionSys[]>([
|
||||
{
|
||||
id: "1",
|
||||
name: "ช่วยราชการ",
|
||||
system: "SYS_TEMPDUTY",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "ส่งตัวกลับ",
|
||||
system: "SYS_TEMPDUTY2",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
name: "แต่งตั้ง-เลื่อน-ย้าย",
|
||||
system: "SYS_PROMOTION_OFFICER",
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
name: "ถึงแก่กรรม",
|
||||
system: "SYS_PASSAWAY",
|
||||
},
|
||||
{
|
||||
id: "5",
|
||||
name: "ให้ออกจากราชการ",
|
||||
system: "SYS_DISMISS",
|
||||
},
|
||||
{
|
||||
id: "6",
|
||||
name: "อื่นๆ",
|
||||
system: "SYS_PLACEMENT_OTHER",
|
||||
},
|
||||
]);
|
||||
|
||||
const itemsMenuEmployee = ref<DataOption[]>([
|
||||
const itemsMenuEmployee = ref<DataOptionSys[]>([
|
||||
{
|
||||
id: "1",
|
||||
name: "ปรับระดับชั้นงาน - ย้าย",
|
||||
system: "SYS_PROMOTION_EMP",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "ถึงแก่กรรม",
|
||||
system: "SYS_PASSAWAY",
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -573,9 +588,9 @@ function selectAvatarHistory() {
|
|||
http
|
||||
.get(config.API.orgProfileAvatar + `/select/${profileId.value}/${data.id}`)
|
||||
.then(async () => {
|
||||
closeImage();
|
||||
await fetchDataPersonal();
|
||||
await fetchProfile(profileId.value);
|
||||
closeImage();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -634,7 +649,20 @@ onMounted(async () => {
|
|||
}}
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<!-- list menu ของข้าราชการฯ -->
|
||||
<q-btn-dropdown
|
||||
v-if="
|
||||
empType === '' &&
|
||||
checkPermissionList([
|
||||
'SYS_TEMPDUTY',
|
||||
'SYS_TEMPDUTY2',
|
||||
'SYS_PROMOTION_OFFICER',
|
||||
'SYS_PASSAWAY',
|
||||
'SYS_DISMISS',
|
||||
'SYS_PLACEMENT_OTHER',
|
||||
])
|
||||
"
|
||||
size="md"
|
||||
rounded
|
||||
unelevated
|
||||
|
|
@ -643,12 +671,9 @@ onMounted(async () => {
|
|||
icon="mdi-home-export-outline"
|
||||
dropdown-icon="mdi-chevron-down"
|
||||
>
|
||||
<q-list
|
||||
v-if="empType === ''"
|
||||
v-for="(item, index) in itemsMenu"
|
||||
:key="index"
|
||||
>
|
||||
<q-list v-for="(item, index) in itemsMenu" :key="index">
|
||||
<q-item
|
||||
v-if="checkPermissionCreate(item.system)"
|
||||
clickable
|
||||
@click="
|
||||
item.name == 'ช่วยราชการ'
|
||||
|
|
@ -670,8 +695,25 @@ onMounted(async () => {
|
|||
<q-item-section>{{ item.name }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list v-else v-for="(item, index) in itemsMenuEmployee" :key="item.id">
|
||||
</q-btn-dropdown>
|
||||
|
||||
<!-- list menu ของลูกจ้างประจำ -->
|
||||
<q-btn-dropdown
|
||||
v-if="
|
||||
empType === '-employee' &&
|
||||
checkPermissionList(['SYS_PROMOTION_EMP', 'SYS_PASSAWAY'])
|
||||
"
|
||||
size="md"
|
||||
rounded
|
||||
unelevated
|
||||
color="grey-4"
|
||||
text-color="red"
|
||||
icon="mdi-home-export-outline"
|
||||
dropdown-icon="mdi-chevron-down"
|
||||
>
|
||||
<q-list v-for="item in itemsMenuEmployee" :key="item.id">
|
||||
<q-item
|
||||
v-if="checkPermissionCreate(item.system)"
|
||||
clickable
|
||||
@click="
|
||||
item.name == 'ปรับระดับชั้นงาน - ย้าย'
|
||||
|
|
@ -942,19 +984,6 @@ onMounted(async () => {
|
|||
:src="n.downloadUrl"
|
||||
:class="imageClass(n)"
|
||||
>
|
||||
<!-- <div
|
||||
class="absolute-top bg-transparent cursor-pointer text-right"
|
||||
style="padding: 5px"
|
||||
>
|
||||
<q-btn
|
||||
icon="delete"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="deletePhoto"
|
||||
style="color: #ff8080"
|
||||
/>
|
||||
</div> -->
|
||||
<div
|
||||
class="absolute-bottom col-12 cursor-pointer flex justify-between items-center"
|
||||
style="padding: 5px"
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@ const statusOption = ref<DataOption[]>(store.optionStatus);
|
|||
const modalStatus = ref<boolean>(false);
|
||||
const requestId = ref<string>("");
|
||||
|
||||
/**
|
||||
* function fetch รายการคำร้องขอแก้ไขทะเบียนประวัติ
|
||||
*/
|
||||
function fetchListRequset() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -157,16 +160,28 @@ function fetchListRequset() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกสถานะคำร้อง
|
||||
*/
|
||||
function updateStatusValue() {
|
||||
page.value = 1;
|
||||
// fetch รายการคำร้องขอแก้ไขทะเบียนประวัติ
|
||||
fetchListRequset();
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียร์ สถานะคำร้อง
|
||||
*/
|
||||
function clearStatus() {
|
||||
status.value = "";
|
||||
statusOption.value = store.optionStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหาคำใน select สถานะคำร้อง
|
||||
* @param val คำค้น
|
||||
* @param update Function
|
||||
*/
|
||||
function filterOption(val: string, update: Function) {
|
||||
update(() => {
|
||||
status.value = val ? "" : status.value;
|
||||
|
|
@ -176,11 +191,19 @@ function filterOption(val: string, update: Function) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* funciton แก่ไขคำร้อง
|
||||
* @param id รายการคำร้อง
|
||||
*/
|
||||
function onclickEdit(id: string) {
|
||||
modalStatus.value = true;
|
||||
requestId.value = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกแถวต่อหน้า
|
||||
* @param newPagination
|
||||
*/
|
||||
function updatePageSizePagination(newPagination: Pagination) {
|
||||
page.value = 1;
|
||||
pageSize.value = newPagination.rowsPerPage;
|
||||
|
|
@ -200,9 +223,9 @@ function onDownloadFile(id: string) {
|
|||
id
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
if (res.data.length !== 0) {
|
||||
downloadUrl(id, res.data[0].fileName);
|
||||
await downloadUrl(id, res.data[0].fileName);
|
||||
} else {
|
||||
hideLoader();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,9 +223,13 @@ function onSubmit() {
|
|||
? config.API.orgPosMasterEmp
|
||||
: config.API.orgPosMasterByIdEmp(props.rowId);
|
||||
await http[props.actionType === "ADD" ? "post" : "put"](url, body);
|
||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
props.getSummary?.();
|
||||
props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
|
||||
await props.getSummary?.();
|
||||
await props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
reqMaster.value.type,
|
||||
false
|
||||
);
|
||||
await success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
close();
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
|
|
@ -296,9 +300,9 @@ function deletePos(id: string) {
|
|||
showLoader();
|
||||
http
|
||||
.delete(config.API.orgEmployeePosById(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
searchInput();
|
||||
.then(async () => {
|
||||
await searchInput();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -629,11 +633,14 @@ watch(
|
|||
<q-btn
|
||||
flat
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
class="q-pa-none q-ml-xs"
|
||||
color="grey-13"
|
||||
color="secondary"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
round
|
||||
>
|
||||
<q-menu anchor="bottom middle" self="top middle">
|
||||
<q-menu
|
||||
transition-show="jump-down"
|
||||
transition-hide="jump-up"
|
||||
>
|
||||
<q-list
|
||||
dense
|
||||
v-for="(item, index) in listMenu"
|
||||
|
|
@ -650,11 +657,14 @@ watch(
|
|||
: deletePos(props.row.id)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-item-section
|
||||
avatar
|
||||
style="min-width: 0px"
|
||||
>
|
||||
<q-icon
|
||||
:color="item.color"
|
||||
:name="item.icon"
|
||||
size="sm"
|
||||
size="xs"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{
|
||||
|
|
|
|||
|
|
@ -123,10 +123,10 @@ function onClickMovePos() {
|
|||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgPosMoveEmp, body)
|
||||
.then(() => {
|
||||
props.fetchDataTree?.(store.activeId);
|
||||
.then(async () => {
|
||||
await props.fetchDataTree?.(store.activeId);
|
||||
await success($q, "ย้ายตำแหน่งสำเร็จ");
|
||||
modal.value = false;
|
||||
success($q, "ย้ายตำแหน่งสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
/**
|
||||
* importType
|
||||
*/
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -279,10 +279,10 @@ function onSubmit() {
|
|||
showLoader();
|
||||
http
|
||||
.post(config.API.orgProfileEmp, body)
|
||||
.then(() => {
|
||||
props.fetchDataTable?.(store.treeId, store.level, false);
|
||||
props.getSummary();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await props.fetchDataTable?.(store.treeId, store.level, false);
|
||||
await props.getSummary();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -193,10 +193,14 @@ function onClickDelete(id: string) {
|
|||
showLoader();
|
||||
await http
|
||||
.delete(config.API.orgPosMasterByIdEmp(id))
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
await props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
reqMaster.value.type,
|
||||
false
|
||||
);
|
||||
await getSummary();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
|
||||
getSummary();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -262,14 +266,14 @@ function removePerson(id: string) {
|
|||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgDeleteProfileEmp(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
props.fetchDataTable?.(
|
||||
.then(async () => {
|
||||
await props.fetchDataTable?.(
|
||||
reqMaster.value.id,
|
||||
reqMaster.value.type,
|
||||
false
|
||||
);
|
||||
getSummary();
|
||||
await getSummary();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -67,8 +67,13 @@ function fetchOrganization(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกตำแหน่งที่จะให่รักษาการ
|
||||
* @param data ข้อมูลตำแหน่ง
|
||||
*/
|
||||
async function updateSelected(data: PosMaster) {
|
||||
posmasterId.value = data.posmasterId;
|
||||
// เรียกใช้ function fetch รายชื่อ ,fetch รายชื่อรักษาการ
|
||||
await Promise.all([fetchPosMaster(), fetchListAct()]);
|
||||
}
|
||||
|
||||
|
|
@ -165,6 +170,10 @@ function fetchPosMaster() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function แสดงตำแหน่งทั้งหมด
|
||||
* @param val แสดงตำแหน่งทั้งหมด
|
||||
*/
|
||||
function updateIsAll(val: boolean) {
|
||||
isAll.value = val;
|
||||
fetchPosMaster();
|
||||
|
|
@ -241,6 +250,7 @@ function onDelete(id: string) {
|
|||
http
|
||||
.delete(config.API.orgPosAct + `/${id}`)
|
||||
.then(async () => {
|
||||
// เรียกใช้ function fetch รายชื่อ ,fetch รายชื่อรักษาการ
|
||||
await Promise.all([fetchPosMaster(), fetchListAct()]);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue