ลูกจ้างประจำ
This commit is contained in:
parent
119a1b47e4
commit
c7bbe78fc7
7 changed files with 118 additions and 34 deletions
|
|
@ -123,11 +123,13 @@ export default {
|
|||
* รายการคำร้องขอแก้ไขทะเบียนประวัติ
|
||||
*/
|
||||
requestEdit: `${orgProfile}/edit/`,
|
||||
requestEditByType:(type:string)=> `${orgProfile}${type}/edit/`,
|
||||
|
||||
/**
|
||||
* ข้อมูลการพัฒนารายบุคคล IDP
|
||||
*/
|
||||
requestDevelopmentEdit: `${orgProfile}/development-request/`,
|
||||
requestDevelopmentEditByType:(type:string)=> `${orgProfile}${type}/development-request/`,
|
||||
|
||||
/**
|
||||
* รายการเมนู
|
||||
|
|
|
|||
|
|
@ -186,7 +186,12 @@ function onClickViewDetail(id: string) {
|
|||
|
||||
/** function redirect ไปหน้ารายการคำร้องขอแก้ไขข้อมูล*/
|
||||
function redirectToPagePetition() {
|
||||
router.push(`/registry-officer/request-edit`);
|
||||
|
||||
if (empType.value === "officer") {
|
||||
router.push(`/registry-officer/request-edit`);
|
||||
} else {
|
||||
router.push(`/registry-employee/request-edit`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -205,7 +210,7 @@ watch(
|
|||
<div class="col-12 row q-pb-sm q-col-gutter-sm items-center">
|
||||
<div class="row q-gutter-sm">
|
||||
<q-btn
|
||||
v-if="empType === 'officer' && checkPermission($route)?.attrIsUpdate"
|
||||
v-if="empType === 'officer' || empType === 'perm' && checkPermission($route)?.attrIsUpdate"
|
||||
color="primary"
|
||||
label="รายการคำร้องขอแก้ไข"
|
||||
@click="redirectToPagePetition()"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
|
|||
|
||||
import { useRequestEditStore } from "@/modules/04_registryPerson/stores/RequestEdit";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
||||
|
|
@ -22,9 +22,11 @@ import DialogStatus from "@/modules/04_registryPerson/components/requestEdit/Dia
|
|||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useRequestEditStore();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
|
||||
|
||||
const routerName = ref<string>(route.name as string);
|
||||
//Table
|
||||
const idCard = ref<string>("");
|
||||
const profileId = ref<string>("");
|
||||
|
|
@ -125,14 +127,19 @@ const requestId = ref<string>(""); //id รายการแก้ไข
|
|||
function fetchListRequset() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.requestEdit + `admin`, {
|
||||
params: {
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
status: status.value,
|
||||
keyword: keyword.value,
|
||||
},
|
||||
})
|
||||
.get(
|
||||
config.API.requestEditByType(
|
||||
routerName.value == "registryNewRequestEditEMP" ? "-employee" : ""
|
||||
) + `admin`,
|
||||
{
|
||||
params: {
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
status: status.value,
|
||||
keyword: keyword.value,
|
||||
},
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
maxPage.value = Math.ceil(data.total / pageSize.value);
|
||||
|
|
@ -181,7 +188,11 @@ function filterOption(val: string, update: Function) {
|
|||
function onclickEdit(data: Request) {
|
||||
requestId.value = data.id;
|
||||
store.profileId = data.profileId;
|
||||
router.push(`/registry-officer/request-edit/personal/${data.id}`);
|
||||
if (routerName.value === "registryNewRequestEditEMP") {
|
||||
router.push(`/registry-employee/request-edit/personal/${data.id}`);
|
||||
} else {
|
||||
router.push(`/registry-officer/request-edit/personal/${data.id}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -17,9 +17,10 @@ import type { DataListsIDP } from "@/modules/04_registryPerson/interface/respons
|
|||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useRequestEditStore();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
|
||||
|
||||
const routerName = ref<string>(route.name as string);
|
||||
//ตัวแปร
|
||||
const status = ref<string>("PENDING"); //ค้นหาตามสถานะ
|
||||
const keyword = ref<string>(""); //คำค้นหา
|
||||
|
|
@ -143,14 +144,19 @@ const visibleColumns = ref<string[]>([
|
|||
async function fetchData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.requestDevelopmentEdit + `admin`, {
|
||||
params: {
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
status: status.value ? status.value : "",
|
||||
keyword: keyword.value,
|
||||
},
|
||||
})
|
||||
.get(
|
||||
config.API.requestDevelopmentEditByType(
|
||||
routerName.value == "registryNewRequestEditEMP" ? "-employee" : ""
|
||||
) + `admin`,
|
||||
{
|
||||
params: {
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
status: status.value ? status.value : "",
|
||||
keyword: keyword.value,
|
||||
},
|
||||
}
|
||||
)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
maxPage.value = Math.ceil(data.total / pageSize.value);
|
||||
|
|
@ -206,7 +212,11 @@ function updatePageSizePagination(newPagination: Pagination) {
|
|||
* @param id รายการคำร้อง
|
||||
*/
|
||||
function onclickEdit(id: string) {
|
||||
router.push(`/registry-officer/request-edit-page/${id}`);
|
||||
if (routerName.value === "registryNewRequestEditEMP") {
|
||||
router.push(`/registry-employee/request-edit-page/${id}`);
|
||||
} else {
|
||||
router.push(`/registry-officer/request-edit-page/${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import DialogUpdateCouple from "@/modules/04_registryPerson/components/Dialog/06
|
|||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const routerName = ref<string>(route.name as string);
|
||||
const store = useRequestEditStore();
|
||||
const {
|
||||
dialogConfirm,
|
||||
|
|
@ -72,7 +73,13 @@ const isCheckData = computed(() => {
|
|||
async function fetchDataRequest() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.requestEdit + `${requestId.value}`)
|
||||
.get(
|
||||
config.API.requestEditByType(
|
||||
routerName.value == "registryNewRequestEditEMP/personal"
|
||||
? "-employee"
|
||||
: ""
|
||||
) + `${requestId.value}`
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
dataRequest.value = data;
|
||||
|
|
@ -100,10 +107,17 @@ function onSubmit() {
|
|||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.patch(config.API.requestEdit + `${requestId.value}`, {
|
||||
status: formData.status,
|
||||
remark: formData.remark,
|
||||
})
|
||||
.patch(
|
||||
config.API.requestEditByType(
|
||||
routerName.value == "registryNewRequestEditEMP/personal"
|
||||
? "-employee"
|
||||
: ""
|
||||
) + `${requestId.value}`,
|
||||
{
|
||||
status: formData.status,
|
||||
remark: formData.remark,
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
await fetchDataRequest();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
@ -234,7 +248,7 @@ onMounted(async () => {
|
|||
|
||||
<template>
|
||||
<div class="q-gutter-sm q-pa-sm">
|
||||
<div class="toptitle text-dark row items-center q-py-xs ">
|
||||
<div class="toptitle text-dark row items-center q-py-xs">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import Workflow from "@/components/Workflow/Main.vue";
|
|||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const routerName = ref<string>(route.name as string);
|
||||
const store = useRequestEditStore();
|
||||
const {
|
||||
dialogConfirm,
|
||||
|
|
@ -152,7 +153,11 @@ const statusOption = ref<DataOption[]>(statusOptionMain.value); //ตัวเ
|
|||
async function fetchDataByid(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.requestDevelopmentEdit + `admin/${id}`)
|
||||
.get(
|
||||
config.API.requestDevelopmentEditByType(
|
||||
routerName.value == "registryNewRequestEditPageEMP" ? "-employee" : ""
|
||||
) + `admin/${id}`
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formData.topic = data.name;
|
||||
|
|
@ -203,10 +208,15 @@ function onSubmit() {
|
|||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.patch(config.API.requestDevelopmentEdit + `admin/${requestId.value}`, {
|
||||
status: formData.status,
|
||||
reason: formData.reason,
|
||||
})
|
||||
.patch(
|
||||
config.API.requestDevelopmentEditByType(
|
||||
routerName.value == "registryNewRequestEditPageEMP" ? "-employee" : ""
|
||||
) + `admin/${requestId.value}`,
|
||||
{
|
||||
status: formData.status,
|
||||
reason: formData.reason,
|
||||
}
|
||||
)
|
||||
.then(async () => {
|
||||
await fetchDataByid(requestId.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -66,6 +66,17 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/registry-employee/request-edit",
|
||||
name: "registryNewRequestEditEMP",
|
||||
component: requestEdit,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_REGISTRY_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: "/registry-officer/request-edit-page/:id",
|
||||
name: "registryNewRequestEditPage",
|
||||
|
|
@ -76,6 +87,17 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/registry-employee/request-edit-page/:id",
|
||||
name: "registryNewRequestEditPageEMP",
|
||||
component: requestEditPage,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_REGISTRY_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: "/registry-officer/request-edit/personal/:id",
|
||||
name: "registryNewRequestEdit/personal",
|
||||
|
|
@ -86,4 +108,14 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/registry-employee/request-edit/personal/:id",
|
||||
name: "registryNewRequestEditEMP/personal",
|
||||
component: Page01_Detail,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_REGISTRY_EMP",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue