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