Merge branch 'nice' into develop
# Conflicts: # src/modules/04_registryPerson/views/detailView.vue
This commit is contained in:
commit
44361da045
46 changed files with 1934 additions and 2231 deletions
|
|
@ -1,17 +1,19 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import {
|
||||
checkPermission,
|
||||
checkPermissionCreate,
|
||||
checkPermissionList,
|
||||
} from "@/utils/permissions";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import axios from "axios";
|
||||
|
||||
import genReport from "@/plugins/genreport";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
|
||||
/**
|
||||
* importType
|
||||
|
|
@ -25,16 +27,10 @@ import type { ResponseObject } from "@/modules/04_registryPerson/interface/respo
|
|||
/**
|
||||
* importComponents
|
||||
*/
|
||||
import CardNotPermission from "@/components/CardNotPermission.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import TabMain from "@/modules/04_registryPerson/components/detail/TabMain.vue";
|
||||
|
||||
/**
|
||||
* importStore
|
||||
*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
import CardNotPermission from "@/components/CardNotPermission.vue";
|
||||
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
|
|
@ -54,23 +50,22 @@ const {
|
|||
pathRegistryEmp,
|
||||
} = useCounterMixin();
|
||||
|
||||
const isPermission = ref<boolean | null>(null);
|
||||
const notPermissionMsg = ref<string>("");
|
||||
const isPermission = ref<boolean | null>(null); //สิทธิการเช้าถึงข้อมูล
|
||||
const notPermissionMsg = ref<string>(""); //ข้อตวามไม่มีสิทธิ
|
||||
const profileId = ref<string>(route.params.id.toString()); //id profile
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? "")); //ประเภทข้าราชการ
|
||||
|
||||
/** ถึงเเก่กรรม */
|
||||
const dialogPassaway = ref<boolean>(false);
|
||||
const placeDeathCertificate = ref("");
|
||||
const deathCertificateNo = ref("");
|
||||
const dateDeath = ref<Date>(new Date());
|
||||
const filePassaway = ref<any>(null);
|
||||
const reasonDeath = ref("");
|
||||
const dialogPassaway = ref<boolean>(false); //แสดงฟอร์มถึงเเก่กรรม
|
||||
const filePassaway = ref<any>(null); //แนบใบมรณบัตร
|
||||
const deathCertificateNo = ref(""); //เลขที่ใบมรณบัตร
|
||||
const dateDeath = ref<Date>(new Date()); //วันที่เสียชีวิต
|
||||
const placeDeathCertificate = ref(""); //สถานที่ออกใบมรณบัตร
|
||||
const reasonDeath = ref(""); //เหตุผลการเสียชีวิต
|
||||
|
||||
const dialogImage = ref<boolean>(false);
|
||||
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const formDetail = ref<ResponseObject>();
|
||||
const dialogImage = ref<boolean>(false); //แสดงเลือกรูปภาพ
|
||||
const formDetail = ref<ResponseObject>(); //ข้อมูลส่วนตัว
|
||||
//รายการเมนูออกคำสั่งข้าราชการ
|
||||
const itemsMenu = ref<DataOptionSys[]>([
|
||||
{
|
||||
id: "1",
|
||||
|
|
@ -103,7 +98,7 @@ const itemsMenu = ref<DataOptionSys[]>([
|
|||
system: "SYS_PLACEMENT_OTHER",
|
||||
},
|
||||
]);
|
||||
|
||||
//รายการเมนูออกคำสั่งลูกจ้าง
|
||||
const itemsMenuEmployee = ref<DataOptionSys[]>([
|
||||
{
|
||||
id: "1",
|
||||
|
|
@ -117,15 +112,14 @@ const itemsMenuEmployee = ref<DataOptionSys[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const uploadUrl = ref<string>("");
|
||||
const fileName = ref<string>("");
|
||||
const profilePicture = ref<string>("");
|
||||
const profileFile = ref();
|
||||
const uploadUrl = ref<string>(""); //URL อัปโหลดรูป
|
||||
const fileName = ref<string>(""); //ชื่อไฟล์รูป
|
||||
const profilePicture = ref<string>(""); //รูป
|
||||
const profileFile = ref(); //ไฟล์
|
||||
const input = document.createElement("input");
|
||||
const activeImage = ref<any | null>(null);
|
||||
const images = ref<any[]>([]);
|
||||
const imagesAlldata = ref<any[]>([]);
|
||||
|
||||
input.type = "file";
|
||||
input.accept = ".jpg,.png,.tif,.pic";
|
||||
|
||||
|
|
@ -143,6 +137,9 @@ function imageActive(n: any) {
|
|||
activeImage.value = n;
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันอัปโหลด
|
||||
*/
|
||||
function uploadImg() {
|
||||
http
|
||||
.post(config.API.orgProfileAvatarbyType(empType.value), {
|
||||
|
|
@ -159,6 +156,10 @@ function uploadImg() {
|
|||
.finally(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันสร้าง path อัปโหลไฟล์
|
||||
* @param path
|
||||
*/
|
||||
function uploadProfile(path: string) {
|
||||
http
|
||||
.post(config.API.fileByPath(path), {
|
||||
|
|
@ -182,6 +183,11 @@ function uploadProfile(path: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันอัปโหลด
|
||||
* @param uploadUrl path อัปโหลไฟล์
|
||||
* @param file ไฟล์
|
||||
*/
|
||||
function uploadFileURL(uploadUrl: string, file: any) {
|
||||
showLoader();
|
||||
axios
|
||||
|
|
@ -202,8 +208,11 @@ function uploadFileURL(uploadUrl: string, file: any) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรูปโปรไฟล์
|
||||
* @param id โปรไฟล์
|
||||
*/
|
||||
function fetchProfile(id: string) {
|
||||
// showLoader();
|
||||
http
|
||||
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, fileName.value))
|
||||
.then(async (res) => {
|
||||
|
|
@ -212,9 +221,6 @@ function fetchProfile(id: string) {
|
|||
.catch(() => {
|
||||
profilePicture.value = avatar;
|
||||
});
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
}
|
||||
|
||||
const reasonStatus = ref<boolean>(false);
|
||||
|
|
@ -254,6 +260,9 @@ const reasonOptions = ref<DataOption[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลส่วนต้ว
|
||||
*/
|
||||
async function fetchDataPersonal() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -301,6 +310,9 @@ async function fetchDataPersonal() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันดาว์นโหลดไฟล์ "ก.พ.7/ก.ก.1 หรื่อ ประวัติแบบย่อ
|
||||
*/
|
||||
async function onClickDownloadKp7(type: string) {
|
||||
showLoader();
|
||||
const url =
|
||||
|
|
@ -328,7 +340,7 @@ async function onClickDownloadKp7(type: string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* ช่วยราชการ
|
||||
* ฟังก์ชันออกคำสั่งช่วยราชการ
|
||||
*/
|
||||
function helpPost() {
|
||||
const formData = new FormData();
|
||||
|
|
@ -351,7 +363,7 @@ function helpPost() {
|
|||
}
|
||||
|
||||
/**
|
||||
* ส่งตัวกลับ
|
||||
* ฟังก์ชันออกคำสั่งส่งตัวกลับ
|
||||
*/
|
||||
function repatriationPost() {
|
||||
const formData = new FormData();
|
||||
|
|
@ -374,7 +386,7 @@ function repatriationPost() {
|
|||
}
|
||||
|
||||
/**
|
||||
* แต่งตังเลื่อน
|
||||
* ฟังก์ชันออกคำสั่งแต่งตังเลื่อน
|
||||
*/
|
||||
function appointPost() {
|
||||
const formData = new FormData();
|
||||
|
|
@ -397,14 +409,14 @@ function appointPost() {
|
|||
}
|
||||
|
||||
/**
|
||||
* ถึงเเก่กรรม
|
||||
* ฟังก์ชันออกคำสั่งถึงเเก่กรรม
|
||||
*/
|
||||
function clickPassaway() {
|
||||
dialogPassaway.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* ให้ออกจากราชการ
|
||||
* ฟังก์ชันออกคำสั่งให้ออกจากราชการ
|
||||
*/
|
||||
function outPost() {
|
||||
const formData = new FormData();
|
||||
|
|
@ -427,7 +439,7 @@ function outPost() {
|
|||
}
|
||||
|
||||
/**
|
||||
* อื่นๆ
|
||||
* ฟังก์ชันออกคำสั่งอื่นๆ
|
||||
*/
|
||||
function otherPost() {
|
||||
const formData = new FormData();
|
||||
|
|
@ -449,6 +461,9 @@ function otherPost() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันออกคำสั่งปรับระดับชั้นงาน - ย้าย
|
||||
*/
|
||||
function appointEmployeePost() {
|
||||
const formData = new FormData();
|
||||
formData.append("id", profileId.value);
|
||||
|
|
@ -469,12 +484,8 @@ function appointEmployeePost() {
|
|||
});
|
||||
}
|
||||
|
||||
function closePassaway() {
|
||||
dialogPassaway.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันบันทึกข้อมูลถึงแก่กรรม
|
||||
* ฟังก์ชันยืนยันบันทึกข้อมูลถึงแก่กรรม
|
||||
*/
|
||||
function clickSaveDeceased() {
|
||||
dialogConfirm($q, async () => {
|
||||
|
|
@ -502,7 +513,14 @@ function clickSaveDeceased() {
|
|||
}
|
||||
|
||||
/**
|
||||
* function เปืด popup เลือกรูปภาพ
|
||||
* ฟังก์ชันปืด popup ถึงแก่กรรม
|
||||
*/
|
||||
function closePassaway() {
|
||||
dialogPassaway.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันเปืด popup เลือกรูปภาพ
|
||||
*/
|
||||
function openDialogImg() {
|
||||
dialogImage.value = true;
|
||||
|
|
@ -510,7 +528,7 @@ function openDialogImg() {
|
|||
}
|
||||
|
||||
/**
|
||||
* function เรียกข้อมูลรูป
|
||||
* ฟังก์ชันเรียกข้อมูลรูป
|
||||
*/
|
||||
function getImage() {
|
||||
showLoader();
|
||||
|
|
@ -533,7 +551,7 @@ function getImage() {
|
|||
}
|
||||
|
||||
/**
|
||||
* function เรียกข้อมูลรูป
|
||||
* ฟังก์ชันเรียกข้อมูลรูป
|
||||
* @param dataList
|
||||
*/
|
||||
function getImg(dataList: any) {
|
||||
|
|
@ -554,7 +572,7 @@ function getImg(dataList: any) {
|
|||
}
|
||||
|
||||
/**
|
||||
* funciton ปิด Popup เลือกรูปภาพ
|
||||
* ฟังก์ชันปิด Popup เลือกรูปภาพ
|
||||
*/
|
||||
function closeImage() {
|
||||
dialogImage.value = false;
|
||||
|
|
@ -563,7 +581,7 @@ function closeImage() {
|
|||
}
|
||||
|
||||
/**
|
||||
* funciotn ยืนยันการลบรูป
|
||||
* ฟังก์ชันยืนยันการลบรูป
|
||||
* @param id รูปภาพ
|
||||
*/
|
||||
function deletePhoto(id: string) {
|
||||
|
|
@ -590,7 +608,7 @@ function deletePhoto(id: string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการเลือกรูป
|
||||
* ฟังก์ชันยืนยันการเลือกรูป
|
||||
*/
|
||||
function selectAvatarHistory() {
|
||||
if (activeImage.value == null) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,22 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, watch } from "vue";
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
import { useStructureTree } from "@/stores/structureTree";
|
||||
|
||||
/** importType*/
|
||||
import type {
|
||||
DataNodeData,
|
||||
QueryParams,
|
||||
} from "@/modules/04_registryPerson/interface/request/Main";
|
||||
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
||||
import type { DataStructureTree } from "@/interface/main";
|
||||
import type {
|
||||
DataPerson,
|
||||
DataType,
|
||||
|
|
@ -13,56 +24,33 @@ import type {
|
|||
|
||||
/** importComponents*/
|
||||
import TableView from "@/modules/04_registryPerson/components/TableView.vue";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useStructureTree } from "@/stores/structureTree";
|
||||
|
||||
const $q = useQuasar();
|
||||
const store = useRegistryNewDataStore();
|
||||
const { fetchStructureTree } = useStructureTree();
|
||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const route = useRoute();
|
||||
|
||||
const mode = ref<"table" | "card">("table");
|
||||
const filterMain = ref<string>("");
|
||||
const isShowFilter = ref<boolean>(true);
|
||||
const isShowBtnFilter = ref<boolean>(false);
|
||||
const mode = ref<"table" | "card">("table"); //การแสดงผล
|
||||
const empType = ref<string>("officer"); // officer / employee / perm
|
||||
const dataPersonMain = ref<DataPerson[]>([]); //ข้อมูลรายการที่ค้นหาข้อมูลทะเบียนประวัติ
|
||||
const maxPage = ref<number>(1); //จำนวนหน้า
|
||||
const total = ref<number>(0); //จำนวนข้อมูล
|
||||
const isShowBtnFilter = ref<boolean>(false);
|
||||
|
||||
// const searchType = ref<string>("fullName");
|
||||
const node = ref<any>([]);
|
||||
const expanded = ref<any>([]);
|
||||
const maxPage = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const selectNode = ref<boolean>(false);
|
||||
const filterMain = ref<string>(""); //หน่วยงาน/ส่วนราชการ
|
||||
const node = ref<DataStructureTree[]>([]); //รายการโครางสร้าง
|
||||
const expanded = ref<string[]>([]); //แสดงข้อมูลในโครงสร้าง
|
||||
|
||||
const dataPersonMain = ref<DataPerson[]>([]);
|
||||
const nodeData = reactive<any>({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
round: "",
|
||||
const selectNode = ref<boolean>(false); //แสดงโครงสร้าง
|
||||
|
||||
const nodeData = reactive<DataNodeData>({
|
||||
name: "เลือกหน่วยงาน/ส่วนราชการ",
|
||||
keyword: "",
|
||||
nodeId: null,
|
||||
node: null,
|
||||
});
|
||||
|
||||
// const conditionTotal = computed(() => {
|
||||
// let num: string = "";
|
||||
// if (store.formFilter.isProbation && store.formFilter.isShowRetire) {
|
||||
// num = "(2)";
|
||||
// } else if (store.formFilter.isProbation || store.formFilter.isShowRetire) {
|
||||
// num = "(1)";
|
||||
// } else "";
|
||||
|
||||
// return num;
|
||||
// });
|
||||
|
||||
/**
|
||||
* function เรียกข้อมูลตำแหน่งประเภท
|
||||
*/
|
||||
|
|
@ -91,26 +79,12 @@ function fetchOptionGroup() {
|
|||
});
|
||||
}
|
||||
|
||||
function fetchYearOption() {
|
||||
if (store.yearOps.length === 0) {
|
||||
const options = [];
|
||||
const year = new Date().getFullYear();
|
||||
|
||||
for (let i = year - 40; i <= year + 60; i++) {
|
||||
options.push({ id: i.toString(), name: (i + 543).toString() });
|
||||
}
|
||||
if (options) {
|
||||
store.yearOps.push(...options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch รายชื่อข้อมูลทะเบียนประวัติ
|
||||
*/
|
||||
function fetchDataPerson() {
|
||||
showLoader();
|
||||
let queryParams: any = {
|
||||
let queryParams: QueryParams = {
|
||||
page: store.formFilter.page,
|
||||
pageSize: store.formFilter.pageSize,
|
||||
};
|
||||
|
|
@ -182,7 +156,7 @@ function fetchDataPerson() {
|
|||
* @param items ข้อมูลคน
|
||||
*/
|
||||
function insertAvatar(items: DataPerson[]) {
|
||||
items.map((x: any, index: number) => {
|
||||
items.map((x: DataPerson, index: number) => {
|
||||
if (x.avatarName != null) {
|
||||
http
|
||||
.get(
|
||||
|
|
@ -209,30 +183,11 @@ function insertAvatar(items: DataPerson[]) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* funciotn แสดงตัวเลือกเพิ่มเติม
|
||||
*/
|
||||
// function onClickShowFilter() {
|
||||
// isShowFilter.value = !isShowFilter.value;
|
||||
// isShowBtnFilter.value = false;
|
||||
// if (isShowFilter.value) {
|
||||
// // fetchLevel();
|
||||
// fetchYearOption();
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* funciotn ค้นหาข้อมูล
|
||||
*/
|
||||
function onclickSearch() {
|
||||
isShowFilter.value = true;
|
||||
// isShowBtnFilter.value = false;
|
||||
store.formFilter.page = 1;
|
||||
if (isShowFilter.value) {
|
||||
fetchType();
|
||||
// fetchLevel();
|
||||
fetchYearOption();
|
||||
}
|
||||
store.formFilter.keyword =
|
||||
store.formFilter.keyword === null ? "" : store.formFilter.keyword;
|
||||
fetchDataPerson();
|
||||
|
|
@ -242,8 +197,8 @@ function onclickSearch() {
|
|||
* function เลือกประเภทข้าราชการ
|
||||
* @param item ประเภทข้าราชการ
|
||||
*/
|
||||
async function selectType() {
|
||||
empType.value = await (route.name == "registryNew" ? "officer" : "perm");
|
||||
function selectType() {
|
||||
empType.value = route.name == "registryNew" ? "officer" : "perm";
|
||||
|
||||
if (empType.value !== "officer") {
|
||||
store.formFilter.isShowRetire = null;
|
||||
|
|
@ -333,7 +288,10 @@ function clearSelect(t: string) {
|
|||
fetchDataPerson();
|
||||
}
|
||||
|
||||
const isLoad = ref<boolean>(false);
|
||||
const isLoad = ref<boolean>(false); //โหลดข้อมูลโครงสร้าง
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อโครงสร้าง
|
||||
*/
|
||||
async function fetchTree() {
|
||||
const data = await fetchStructureTree(route.meta.Key as string);
|
||||
if (data) {
|
||||
|
|
@ -344,6 +302,9 @@ async function fetchTree() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ค้นหาข้อมูลรายชื่อข้อมูลทะเบียนประวัติตามหน่วยงาน/ส่วนราชการ
|
||||
*/
|
||||
function sendNode() {
|
||||
nodeData.node = store.formFilter.node;
|
||||
nodeData.nodeId = store.formFilter.nodeId;
|
||||
|
|
@ -352,7 +313,13 @@ function sendNode() {
|
|||
fetchDataPerson();
|
||||
}
|
||||
|
||||
function updateSelectedTreeMain(data: any) {
|
||||
/**
|
||||
* ฟังก์ชันเลือกหน่วยงาน/ส่วนราชการ
|
||||
* @param data ข้อมูลหน่วยงาน/ส่วนราชการที่ต้องการค้นหาร
|
||||
*
|
||||
* เพื่อค้นหาข้อมูลตามหน่วยงาน/ส่วนราชการ
|
||||
*/
|
||||
function updateSelectedTreeMain(data: DataStructureTree) {
|
||||
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
|
||||
store.formFilter.node = null;
|
||||
store.formFilter.nodeId = null;
|
||||
|
|
@ -372,9 +339,11 @@ watch(selectNode, () => {
|
|||
isLoad.value && hideLoader();
|
||||
});
|
||||
|
||||
/**
|
||||
* hook เมื่อมีการเรียกใช้ Components
|
||||
*/
|
||||
onMounted(async () => {
|
||||
selectType();
|
||||
fetchTree();
|
||||
await Promise.all([selectType(), fetchTree()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -438,21 +407,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
<!-- <div v-if="isShowBtnFilter" class="col-12 row q-mt-sm">
|
||||
<q-btn
|
||||
flat
|
||||
label="ตัวเลือกเพิ่มเติม"
|
||||
icon-right="mdi-tune"
|
||||
@click="onClickShowFilter"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
></q-btn>
|
||||
</div> -->
|
||||
|
||||
<div
|
||||
v-if="isShowFilter"
|
||||
class="row q-mt-sm q-gutter-sm justify-center"
|
||||
>
|
||||
<div class="row q-mt-sm q-gutter-sm justify-center">
|
||||
<q-btn-dropdown
|
||||
flat
|
||||
rounded
|
||||
|
|
@ -589,40 +545,6 @@ onMounted(async () => {
|
|||
label="แสดงตำแหน่งทั้งหมด"
|
||||
@update:model-value="fetchDataPerson"
|
||||
/>
|
||||
|
||||
<!-- <q-btn-dropdown
|
||||
v-if="empType === 'officer'"
|
||||
flat
|
||||
dense
|
||||
rounded
|
||||
label-color="white"
|
||||
dropdown-icon="mdi-chevron-down"
|
||||
:label="`เงื่อนไขอื่นๆ ${conditionTotal}`"
|
||||
class="q-px-sm"
|
||||
>
|
||||
<q-list>
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section>
|
||||
<q-toggle
|
||||
v-model="store.formFilter.isProbation"
|
||||
color="primary"
|
||||
label="ทดลองปฏิบัติหน้าที่ราชการ"
|
||||
@update:model-value="fetchDataPerson"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section>
|
||||
<q-toggle
|
||||
v-model="store.formFilter.isShowRetire"
|
||||
color="primary"
|
||||
label="แสดงข้อมูลผู้พ้นจากราชการ"
|
||||
@update:model-value="fetchDataPerson"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown> -->
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
|
@ -655,16 +577,17 @@ onMounted(async () => {
|
|||
<q-separator />
|
||||
|
||||
<q-card-section>
|
||||
<!-- Components รายการข้อมูลทะเบียนประวัติ -->
|
||||
<TableView
|
||||
v-model:mode="mode"
|
||||
v-model:form-filter="store.formFilter"
|
||||
v-model:max-page="maxPage"
|
||||
:rows="dataPersonMain"
|
||||
v-model:formFilter="store.formFilter"
|
||||
v-model:maxPage="maxPage"
|
||||
:fetchData="fetchDataPerson"
|
||||
:fetchType="fetchType"
|
||||
:fetch-data="fetchDataPerson"
|
||||
:fetch-type="fetchType"
|
||||
:total="total"
|
||||
:empType="empType"
|
||||
:is-filter="isShowBtnFilter"
|
||||
:emp-type="empType"
|
||||
/>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
|
@ -1,9 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import { useRequestEditStore } from "@/modules/04_registryPerson/stores/RequestEdit";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/**
|
||||
* importType
|
||||
|
|
@ -13,18 +16,13 @@ import type {
|
|||
DataOption,
|
||||
Pagination,
|
||||
} from "@/modules/04_registryPerson/interface/index/Main";
|
||||
import type { DateRequest } from "@/modules/04_registryPerson/interface/response/Main";
|
||||
|
||||
/**
|
||||
* importComponents
|
||||
*/
|
||||
import DialogStatus from "@/modules/04_registryPerson/components/requestEdit/DialogStatus.vue";
|
||||
|
||||
/**
|
||||
* importStore
|
||||
*/
|
||||
import { useRequestEditStore } from "@/modules/04_registryPerson/stores/RequestEdit";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
|
|
@ -36,12 +34,11 @@ const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
|
|||
/**
|
||||
* Table
|
||||
*/
|
||||
const rows = ref<any[]>([]);
|
||||
const page = ref<number>(1);
|
||||
const pageSize = ref<number>(10);
|
||||
const rowsTotal = ref<number>(0);
|
||||
const maxPage = ref<number>(0);
|
||||
|
||||
const rows = ref<DateRequest[]>([]); //รายการข้อมูลคำร้องขอแก้ไขทะเบียนประวัติ
|
||||
const page = ref<number>(1); //หน้า
|
||||
const pageSize = ref<number>(10); //จำนวนต่อหน้า
|
||||
const rowsTotal = ref<number>(0); //จำนวนรายการ
|
||||
const maxPage = ref<number>(0); //จำนวนหน้า
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "lastUpdatedAt",
|
||||
|
|
@ -114,7 +111,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"lastUpdatedAt",
|
||||
|
||||
"fullname",
|
||||
"topic",
|
||||
"detail",
|
||||
|
|
@ -126,11 +122,11 @@ const visibleColumns = ref<string[]>([
|
|||
/**
|
||||
* ตัวแปร
|
||||
*/
|
||||
const status = ref<string>("PENDING");
|
||||
const keyword = ref<string>("");
|
||||
const statusOption = ref<DataOption[]>(store.optionStatus);
|
||||
const modalStatus = ref<boolean>(false);
|
||||
const requestId = ref<string>("");
|
||||
const status = ref<string>("PENDING"); //ค้นหาตามสถานะ
|
||||
const keyword = ref<string>(""); //คำค้นหา
|
||||
const statusOption = ref<DataOption[]>(store.optionStatus); //รายการสถานะ
|
||||
const modalStatus = ref<boolean>(false); //แก้ไขสถานะคำร้อง
|
||||
const requestId = ref<string>(""); //id รายการแก้ไข
|
||||
|
||||
/**
|
||||
* function fetch รายการคำร้องขอแก้ไขทะเบียนประวัติ
|
||||
|
|
@ -186,7 +182,7 @@ function filterOption(val: string, update: Function) {
|
|||
update(() => {
|
||||
status.value = val ? "" : status.value;
|
||||
statusOption.value = store.optionStatus.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
@ -262,6 +258,11 @@ function downloadUrl(id: string, fileName: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูการเปลี่ยนแปลงของ pageSize
|
||||
*
|
||||
* เมื่อมีการเปลี่ยนแปลงจำทำการ ดึงช้อมูลรายการคำร้องขอแก้ไขทะเบียนประวัติตามจำนวน pageSize
|
||||
*/
|
||||
watch(
|
||||
() => pageSize.value,
|
||||
() => {
|
||||
|
|
@ -420,8 +421,8 @@ onMounted(() => {
|
|||
|
||||
<DialogStatus
|
||||
v-model:modal="modalStatus"
|
||||
:fetchData="fetchListRequset"
|
||||
:requestId="requestId"
|
||||
:fetch-data="fetchListRequset"
|
||||
:request-id="requestId"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue