แก้ไขเมนูทะเบียนประวัติ

This commit is contained in:
Warunee Tamkoo 2024-08-09 11:45:58 +07:00
parent 00e74f9e77
commit f0a6b8d71e
14 changed files with 50 additions and 28 deletions

View file

@ -253,7 +253,9 @@ function filterFn(val: string, update: Function) {
*/
function clickRedirect(id: string) {
const url =
employeeClass.value === "officer" ? "registry-person" : "registry-employee";
employeeClass.value === "officer"
? "registry-officer"
: "registry-employee";
router.push(`${url}/${id}`);
}

View file

@ -193,7 +193,7 @@ function onClickHistory() {
*/
function onClickViewDetail(id: string) {
if (empType.value === "officer") {
router.push(`/registry-person/${id}`);
router.push(`/registry-officer/${id}`);
} else {
router.push(`/registry-employee/${id}`);
}
@ -203,7 +203,7 @@ function onClickViewDetail(id: string) {
* function redirect ไปหนารายการคำรองขอแกไขขอม
*/
function redirectToPagePetition() {
router.push(`/registry-person/request-edit`);
router.push(`/registry-officer/request-edit`);
}
watch(

View file

@ -7,19 +7,29 @@ const requestEdit = () =>
export default [
{
path: "/registry-person",
path: "/registry-officer",
name: "registryNew",
component: listPage,
meta: {
Auth: true,
Key: "SYS_REGISTRY",
Key: "SYS_REGISTRY_OFFICER",
Role: "STAFF",
},
},
{
path: "/registry-person/:id",
path: "/registry-officer/:id",
name: "registryNewByid",
component: detailPage,
meta: {
Auth: true,
Key: "SYS_REGISTRY_OFFICER",
Role: "STAFF",
},
},
{
path: "/registry-employee",
name: "registryEmployeeList",
component: listPage,
meta: {
Auth: true,
Key: "SYS_REGISTRY",
@ -37,12 +47,12 @@ export default [
},
},
{
path: "/registry-person/request-edit",
path: "/registry-officer/request-edit",
name: "registryNewRequestEdit",
component: requestEdit,
meta: {
Auth: true,
Key: "SYS_REGISTRY",
Key: "SYS_REGISTRY_OFFICER",
Role: "STAFF",
},
},

View file

@ -19,10 +19,12 @@ import avatar from "@/assets/avatar_user.jpg";
/** importStore*/
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
const $q = useQuasar();
const store = useRegistryNewDataStore();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const route = useRoute();
const mode = ref<"table" | "card">("table");
@ -72,6 +74,7 @@ function fetchType() {
http
.get(config.API.orgPosType)
.then((res) => {
console.log("this fetchType", res.data.result);
store.fetchType(res.data.result);
})
.catch((err) => {
@ -86,6 +89,8 @@ function fetchOptionGroup() {
http
.get(config.API.orgEmployeeType)
.then((res) => {
console.log("this fetchOptionGroup===>", res.data.result);
store.fetchType(res.data.result);
})
.catch((err) => {
@ -206,7 +211,6 @@ function onClickShowFilter() {
isShowFilter.value = !isShowFilter.value;
isShowBtnFilter.value = false;
if (isShowFilter.value) {
fetchType();
// fetchLevel();
fetchYearOption();
}
@ -232,14 +236,16 @@ function onclickSearch() {
* function เลอกประเภทขาราชการ
* @param item ประเภทขาราชการ
*/
function selectType(item: DataOption) {
labelOption.type = item.name;
empType.value = item.id;
async function selectType() {
// labelOption.type = item.name;
empType.value = await (route.name == "registryNew" ? "officer" : "perm");
formFilter.page = 1;
console.log("empType===>", empType.value);
labelOption.posType = "ทั้งหมด";
labelOption.posLevel = "ทั้งหมด";
if (item.id !== "officer") {
if (empType.value !== "officer") {
formFilter.isShowRetire = null;
formFilter.isProbation = null;
fetchOptionGroup();
@ -294,14 +300,18 @@ function clearSelect(t: string) {
}
onMounted(async () => {
fetchDataPerson();
selectType();
});
</script>
<template>
<q-card class="q-mt-md">
<q-card-section class="card-img q-pb-lg">
<div class="text-h5 text-center q-py-md text-weight-medium">
นหาขอมลทะเบยนประว
{{
empType === "officer" ? "ข้าราชการ กทม. สามัญ" : "ลูกจ้างประจำ กทม."
}}
</div>
<div class="row justify-center">
<div
@ -370,7 +380,7 @@ onMounted(async () => {
class="row q-mt-sm q-gutter-sm justify-center"
v-if="isShowFilter"
>
<q-btn-dropdown
<!-- <q-btn-dropdown
flat
rounded
dense
@ -396,7 +406,7 @@ onMounted(async () => {
</q-list>
</q-btn-dropdown>
<q-separator inset vertical class="lineFil" />
<q-separator inset vertical class="lineFil" /> -->
<q-btn-dropdown
rounded

View file

@ -697,7 +697,7 @@ async function fecthInsignia() {
* @param id profileId
*/
function nextPage(id: string) {
router.push(`/registry-person/${id}`);
router.push(`/registry-officer/${id}`);
}
/** ค้นหาข้อมุล table*/

View file

@ -172,7 +172,7 @@ function changtypeOc() {
* @param id profileId
*/
function nextPage(id: string) {
router.push(`/registry-person/${id}`);
router.push(`/registry-officer/${id}`);
}
/** filter table*/

View file

@ -172,7 +172,7 @@ async function changtypeOc() {
* @param id profileId
*/
function nextPage(id: string) {
router.push(`/registry-person/${id}`);
router.push(`/registry-officer/${id}`);
}
/** ข้อมูล Table*/

View file

@ -348,7 +348,7 @@ const addData = async () => {
// back
const clickBack = () => {
router.push("/registry-employee");
router.push("/registry-temp");
};
</script>

View file

@ -18,7 +18,7 @@ const DetailView = defineAsyncComponent(
export default [
{
path: "/registry-employee",
path: "/registry-temp",
name: "registry-employee",
component: Main,
meta: {
@ -28,7 +28,7 @@ export default [
},
},
{
path: "/registry-employee/:id",
path: "/registry-temp/:id",
name: "registry-employeeId",
component: DetailView,
meta: {

View file

@ -1,6 +1,6 @@
import { defineStore } from "pinia";
export const useRegistryEmp = defineStore("registry-employee", () => {
export const useRegistryEmp = defineStore("registryEmployeeTemp", () => {
/**
* function
* @param birthDate

View file

@ -251,7 +251,7 @@ function onClickDelete(id: string) {
}
function redirectToPageDetail(id: string) {
router.push(`/registry-employee/${id}`);
router.push(`/registry-temp/${id}`);
}
/** เพิ่มข้อมูลลูกจ้างชั่วคราว*/

View file

@ -275,13 +275,13 @@ const resetFilter = () => {
//
const clickAdd = () => {
router.push(`/registry-employee/add`);
router.push(`/registry-temp/add`);
};
//
const redirectToPage = (id?: string, status?: string) => {
if (!(status == "REPORT" || status == "DONE")) {
router.push(`/registry-employee/edit/${id}`);
router.push(`/registry-temp/edit/${id}`);
}
};

View file

@ -79,7 +79,7 @@ function fetchProfile(id: string, avatarName: string) {
* function rediract ไปทะเบยนประว
*/
function redirecToRegistry() {
router.push(`/registry-person${props.employeeClass}/${profileId.value}`);
router.push(`/registry-officer${props.employeeClass}/${profileId.value}`);
modal.value = false;
}