แก้ไขเมนูทะเบียนประวัติ
This commit is contained in:
parent
00e74f9e77
commit
f0a6b8d71e
14 changed files with 50 additions and 28 deletions
|
|
@ -155,7 +155,7 @@ async function fetchProfileGov(id: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirecToRegistry() {
|
function redirecToRegistry() {
|
||||||
router.push(`/registry-person${empType.value}/${props.id}`);
|
router.push(`/registry-officer${empType.value}/${props.id}`);
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,9 @@ function filterFn(val: string, update: Function) {
|
||||||
*/
|
*/
|
||||||
function clickRedirect(id: string) {
|
function clickRedirect(id: string) {
|
||||||
const url =
|
const url =
|
||||||
employeeClass.value === "officer" ? "registry-person" : "registry-employee";
|
employeeClass.value === "officer"
|
||||||
|
? "registry-officer"
|
||||||
|
: "registry-employee";
|
||||||
router.push(`${url}/${id}`);
|
router.push(`${url}/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ function onClickHistory() {
|
||||||
*/
|
*/
|
||||||
function onClickViewDetail(id: string) {
|
function onClickViewDetail(id: string) {
|
||||||
if (empType.value === "officer") {
|
if (empType.value === "officer") {
|
||||||
router.push(`/registry-person/${id}`);
|
router.push(`/registry-officer/${id}`);
|
||||||
} else {
|
} else {
|
||||||
router.push(`/registry-employee/${id}`);
|
router.push(`/registry-employee/${id}`);
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +203,7 @@ function onClickViewDetail(id: string) {
|
||||||
* function redirect ไปหน้ารายการคำร้องขอแก้ไขข้อมูล
|
* function redirect ไปหน้ารายการคำร้องขอแก้ไขข้อมูล
|
||||||
*/
|
*/
|
||||||
function redirectToPagePetition() {
|
function redirectToPagePetition() {
|
||||||
router.push(`/registry-person/request-edit`);
|
router.push(`/registry-officer/request-edit`);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|
|
||||||
|
|
@ -7,19 +7,29 @@ const requestEdit = () =>
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
path: "/registry-person",
|
path: "/registry-officer",
|
||||||
name: "registryNew",
|
name: "registryNew",
|
||||||
component: listPage,
|
component: listPage,
|
||||||
meta: {
|
meta: {
|
||||||
Auth: true,
|
Auth: true,
|
||||||
Key: "SYS_REGISTRY",
|
Key: "SYS_REGISTRY_OFFICER",
|
||||||
Role: "STAFF",
|
Role: "STAFF",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/registry-person/:id",
|
path: "/registry-officer/:id",
|
||||||
name: "registryNewByid",
|
name: "registryNewByid",
|
||||||
component: detailPage,
|
component: detailPage,
|
||||||
|
meta: {
|
||||||
|
Auth: true,
|
||||||
|
Key: "SYS_REGISTRY_OFFICER",
|
||||||
|
Role: "STAFF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/registry-employee",
|
||||||
|
name: "registryEmployeeList",
|
||||||
|
component: listPage,
|
||||||
meta: {
|
meta: {
|
||||||
Auth: true,
|
Auth: true,
|
||||||
Key: "SYS_REGISTRY",
|
Key: "SYS_REGISTRY",
|
||||||
|
|
@ -37,12 +47,12 @@ export default [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/registry-person/request-edit",
|
path: "/registry-officer/request-edit",
|
||||||
name: "registryNewRequestEdit",
|
name: "registryNewRequestEdit",
|
||||||
component: requestEdit,
|
component: requestEdit,
|
||||||
meta: {
|
meta: {
|
||||||
Auth: true,
|
Auth: true,
|
||||||
Key: "SYS_REGISTRY",
|
Key: "SYS_REGISTRY_OFFICER",
|
||||||
Role: "STAFF",
|
Role: "STAFF",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,12 @@ import avatar from "@/assets/avatar_user.jpg";
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = useRegistryNewDataStore();
|
const store = useRegistryNewDataStore();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const mode = ref<"table" | "card">("table");
|
const mode = ref<"table" | "card">("table");
|
||||||
|
|
||||||
|
|
@ -72,6 +74,7 @@ function fetchType() {
|
||||||
http
|
http
|
||||||
.get(config.API.orgPosType)
|
.get(config.API.orgPosType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log("this fetchType", res.data.result);
|
||||||
store.fetchType(res.data.result);
|
store.fetchType(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -86,6 +89,8 @@ function fetchOptionGroup() {
|
||||||
http
|
http
|
||||||
.get(config.API.orgEmployeeType)
|
.get(config.API.orgEmployeeType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
console.log("this fetchOptionGroup===>", res.data.result);
|
||||||
|
|
||||||
store.fetchType(res.data.result);
|
store.fetchType(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -206,7 +211,6 @@ function onClickShowFilter() {
|
||||||
isShowFilter.value = !isShowFilter.value;
|
isShowFilter.value = !isShowFilter.value;
|
||||||
isShowBtnFilter.value = false;
|
isShowBtnFilter.value = false;
|
||||||
if (isShowFilter.value) {
|
if (isShowFilter.value) {
|
||||||
fetchType();
|
|
||||||
// fetchLevel();
|
// fetchLevel();
|
||||||
fetchYearOption();
|
fetchYearOption();
|
||||||
}
|
}
|
||||||
|
|
@ -232,14 +236,16 @@ function onclickSearch() {
|
||||||
* function เลือกประเภทข้าราชการ
|
* function เลือกประเภทข้าราชการ
|
||||||
* @param item ประเภทข้าราชการ
|
* @param item ประเภทข้าราชการ
|
||||||
*/
|
*/
|
||||||
function selectType(item: DataOption) {
|
async function selectType() {
|
||||||
labelOption.type = item.name;
|
// labelOption.type = item.name;
|
||||||
empType.value = item.id;
|
empType.value = await (route.name == "registryNew" ? "officer" : "perm");
|
||||||
formFilter.page = 1;
|
formFilter.page = 1;
|
||||||
|
|
||||||
|
console.log("empType===>", empType.value);
|
||||||
|
|
||||||
labelOption.posType = "ทั้งหมด";
|
labelOption.posType = "ทั้งหมด";
|
||||||
labelOption.posLevel = "ทั้งหมด";
|
labelOption.posLevel = "ทั้งหมด";
|
||||||
if (item.id !== "officer") {
|
if (empType.value !== "officer") {
|
||||||
formFilter.isShowRetire = null;
|
formFilter.isShowRetire = null;
|
||||||
formFilter.isProbation = null;
|
formFilter.isProbation = null;
|
||||||
fetchOptionGroup();
|
fetchOptionGroup();
|
||||||
|
|
@ -294,14 +300,18 @@ function clearSelect(t: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
fetchDataPerson();
|
selectType();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-card class="q-mt-md">
|
<q-card class="q-mt-md">
|
||||||
<q-card-section class="card-img q-pb-lg">
|
<q-card-section class="card-img q-pb-lg">
|
||||||
<div class="text-h5 text-center q-py-md text-weight-medium">
|
<div class="text-h5 text-center q-py-md text-weight-medium">
|
||||||
ค้นหาข้อมูลทะเบียนประวัติ
|
ค้นหาข้อมูลทะเบียนประวัติ
|
||||||
|
{{
|
||||||
|
empType === "officer" ? "ข้าราชการ กทม. สามัญ" : "ลูกจ้างประจำ กทม."
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-center">
|
<div class="row justify-center">
|
||||||
<div
|
<div
|
||||||
|
|
@ -370,7 +380,7 @@ onMounted(async () => {
|
||||||
class="row q-mt-sm q-gutter-sm justify-center"
|
class="row q-mt-sm q-gutter-sm justify-center"
|
||||||
v-if="isShowFilter"
|
v-if="isShowFilter"
|
||||||
>
|
>
|
||||||
<q-btn-dropdown
|
<!-- <q-btn-dropdown
|
||||||
flat
|
flat
|
||||||
rounded
|
rounded
|
||||||
dense
|
dense
|
||||||
|
|
@ -396,7 +406,7 @@ onMounted(async () => {
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-btn-dropdown>
|
</q-btn-dropdown>
|
||||||
|
|
||||||
<q-separator inset vertical class="lineFil" />
|
<q-separator inset vertical class="lineFil" /> -->
|
||||||
|
|
||||||
<q-btn-dropdown
|
<q-btn-dropdown
|
||||||
rounded
|
rounded
|
||||||
|
|
|
||||||
|
|
@ -697,7 +697,7 @@ async function fecthInsignia() {
|
||||||
* @param id profileId
|
* @param id profileId
|
||||||
*/
|
*/
|
||||||
function nextPage(id: string) {
|
function nextPage(id: string) {
|
||||||
router.push(`/registry-person/${id}`);
|
router.push(`/registry-officer/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ค้นหาข้อมุล table*/
|
/** ค้นหาข้อมุล table*/
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ function changtypeOc() {
|
||||||
* @param id profileId
|
* @param id profileId
|
||||||
*/
|
*/
|
||||||
function nextPage(id: string) {
|
function nextPage(id: string) {
|
||||||
router.push(`/registry-person/${id}`);
|
router.push(`/registry-officer/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** filter table*/
|
/** filter table*/
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ async function changtypeOc() {
|
||||||
* @param id profileId
|
* @param id profileId
|
||||||
*/
|
*/
|
||||||
function nextPage(id: string) {
|
function nextPage(id: string) {
|
||||||
router.push(`/registry-person/${id}`);
|
router.push(`/registry-officer/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ข้อมูล Table*/
|
/** ข้อมูล Table*/
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ const addData = async () => {
|
||||||
|
|
||||||
// ปุ่ม back
|
// ปุ่ม back
|
||||||
const clickBack = () => {
|
const clickBack = () => {
|
||||||
router.push("/registry-employee");
|
router.push("/registry-temp");
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ const DetailView = defineAsyncComponent(
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
path: "/registry-employee",
|
path: "/registry-temp",
|
||||||
name: "registry-employee",
|
name: "registry-employee",
|
||||||
component: Main,
|
component: Main,
|
||||||
meta: {
|
meta: {
|
||||||
|
|
@ -28,7 +28,7 @@ export default [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/registry-employee/:id",
|
path: "/registry-temp/:id",
|
||||||
name: "registry-employeeId",
|
name: "registry-employeeId",
|
||||||
component: DetailView,
|
component: DetailView,
|
||||||
meta: {
|
meta: {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
|
|
||||||
export const useRegistryEmp = defineStore("registry-employee", () => {
|
export const useRegistryEmp = defineStore("registryEmployeeTemp", () => {
|
||||||
/**
|
/**
|
||||||
* function คำนวณหาอายุ
|
* function คำนวณหาอายุ
|
||||||
* @param birthDate วันเกิด
|
* @param birthDate วันเกิด
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,7 @@ function onClickDelete(id: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirectToPageDetail(id: string) {
|
function redirectToPageDetail(id: string) {
|
||||||
router.push(`/registry-employee/${id}`);
|
router.push(`/registry-temp/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** เพิ่มข้อมูลลูกจ้างชั่วคราว*/
|
/** เพิ่มข้อมูลลูกจ้างชั่วคราว*/
|
||||||
|
|
|
||||||
|
|
@ -275,13 +275,13 @@ const resetFilter = () => {
|
||||||
|
|
||||||
// เพิ่มข้อมูลลูกจ้าง
|
// เพิ่มข้อมูลลูกจ้าง
|
||||||
const clickAdd = () => {
|
const clickAdd = () => {
|
||||||
router.push(`/registry-employee/add`);
|
router.push(`/registry-temp/add`);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ดูรายการแก้ไขรายชื่อ
|
// ดูรายการแก้ไขรายชื่อ
|
||||||
const redirectToPage = (id?: string, status?: string) => {
|
const redirectToPage = (id?: string, status?: string) => {
|
||||||
if (!(status == "REPORT" || status == "DONE")) {
|
if (!(status == "REPORT" || status == "DONE")) {
|
||||||
router.push(`/registry-employee/edit/${id}`);
|
router.push(`/registry-temp/edit/${id}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ function fetchProfile(id: string, avatarName: string) {
|
||||||
* function rediract ไปทะเบียนประวัติ
|
* function rediract ไปทะเบียนประวัติ
|
||||||
*/
|
*/
|
||||||
function redirecToRegistry() {
|
function redirecToRegistry() {
|
||||||
router.push(`/registry-person${props.employeeClass}/${profileId.value}`);
|
router.push(`/registry-officer${props.employeeClass}/${profileId.value}`);
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue