ปรับ code เครื่องราช ==> จัดการคำขอ
This commit is contained in:
parent
01430c06a1
commit
7bc71cf93f
5 changed files with 222 additions and 98 deletions
|
|
@ -3,7 +3,6 @@ import { onMounted, ref, computed, reactive, watch } from "vue";
|
||||||
import { useQuasar, QForm } from "quasar";
|
import { useQuasar, QForm } from "quasar";
|
||||||
|
|
||||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||||
import { useroleUserDataStore } from "@/stores/roleUser";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -11,8 +10,17 @@ import config from "@/app.config";
|
||||||
|
|
||||||
/** import Type*/
|
/** import Type*/
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
|
import type {
|
||||||
|
OptionData,
|
||||||
|
Pagination,
|
||||||
|
DataProfileOtherSystem,
|
||||||
|
DataManageList,
|
||||||
|
} from "@/modules/07_insignia/interface/index/Main";
|
||||||
import type { CheckboxData } from "@/modules/07_insignia/interface/request/Main";
|
import type { CheckboxData } from "@/modules/07_insignia/interface/request/Main";
|
||||||
|
import type {
|
||||||
|
ResponseProfile,
|
||||||
|
ResponseInsigniaType,
|
||||||
|
} from "@/modules/07_insignia/interface/response/Main";
|
||||||
|
|
||||||
/** import components*/
|
/** import components*/
|
||||||
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
||||||
|
|
@ -25,7 +33,6 @@ import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||||
const myForm = ref<QForm>();
|
const myForm = ref<QForm>();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
const roleDataStore = useroleUserDataStore();
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const {
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
|
|
@ -249,8 +256,8 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const rows2 = ref<any[]>([]); //รายชื่อข้าราชการตามหน่วยงานที่จะเพิ่ม
|
const rows2 = ref<DataProfileOtherSystem[]>([]); //รายชื่อข้าราชการตามหน่วยงานที่จะเพิ่ม
|
||||||
const person = ref<any>([]);
|
const person = ref<DataManageList>();
|
||||||
|
|
||||||
/** เช็คสถานนะแสดงปุ่มเพิ่ม*/
|
/** เช็คสถานนะแสดงปุ่มเพิ่ม*/
|
||||||
const checkStatus = computed(() => {
|
const checkStatus = computed(() => {
|
||||||
|
|
@ -277,11 +284,9 @@ function changtypeOc() {
|
||||||
|
|
||||||
/** function เพิ่มรายชื่อ*/
|
/** function เพิ่มรายชื่อ*/
|
||||||
async function clickmodalAdd() {
|
async function clickmodalAdd() {
|
||||||
await clearForm();
|
clearForm();
|
||||||
let ocId = DataStore.typeOc ? DataStore.typeOc : DataStore.agency;
|
|
||||||
// showLoader();
|
|
||||||
await fecthInsignia();
|
await fecthInsignia();
|
||||||
await fecthlistperson(ocId);
|
await fecthlistperson();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCloseModalAdd() {
|
function onCloseModalAdd() {
|
||||||
|
|
@ -296,7 +301,7 @@ const formFilter = reactive({
|
||||||
searchField: "citizenId",
|
searchField: "citizenId",
|
||||||
searchKeyword: "",
|
searchKeyword: "",
|
||||||
});
|
});
|
||||||
const filterOption = ref<any[]>([
|
const filterOption = ref<OptionData[]>([
|
||||||
{
|
{
|
||||||
id: "citizenId",
|
id: "citizenId",
|
||||||
name: "เลขประจำตัวประชาชน",
|
name: "เลขประจำตัวประชาชน",
|
||||||
|
|
@ -311,14 +316,14 @@ const filterOption = ref<any[]>([
|
||||||
* function เรียกรายชื่อข้าราชการตามหน่วยงานที่จะเพิ่ม
|
* function เรียกรายชื่อข้าราชการตามหน่วยงานที่จะเพิ่ม
|
||||||
* @param id หน่วยงาน
|
* @param id หน่วยงาน
|
||||||
*/
|
*/
|
||||||
async function fecthlistperson(id: string = "") {
|
async function fecthlistperson() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.registryNewOtherSystem(""), { params: formFilter })
|
.get(config.API.registryNewOtherSystem(""), { params: formFilter })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||||
total.value = res.data.result.total;
|
total.value = res.data.result.total;
|
||||||
let data = res.data.result.data.map((e: any) => ({
|
let data = res.data.result.data.map((e: ResponseProfile) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
rootId: e.rootId,
|
rootId: e.rootId,
|
||||||
citizenId: e.citizenId,
|
citizenId: e.citizenId,
|
||||||
|
|
@ -340,19 +345,11 @@ async function fecthlistperson(id: string = "") {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** update ค่า เเถวข้อมูล */
|
/** update ค่า เเถวข้อมูล */
|
||||||
function updatePageSize(newPagination: any) {
|
function updatePageSize(newPagination: Pagination) {
|
||||||
formFilter.page = 1;
|
formFilter.page = 1;
|
||||||
formFilter.pageSize = newPagination.rowsPerPage;
|
formFilter.pageSize = newPagination.rowsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** เช็คเเถวข้อมูลว่ามีการเปลี่ยนแปลงไหม */
|
|
||||||
watch(
|
|
||||||
() => formFilter.pageSize,
|
|
||||||
() => {
|
|
||||||
fecthlistperson();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/** function ยืนยันการเพิ่มรายชื่อ*/
|
/** function ยืนยันการเพิ่มรายชื่อ*/
|
||||||
async function clickAdd() {
|
async function clickAdd() {
|
||||||
dataPerson.id
|
dataPerson.id
|
||||||
|
|
@ -408,7 +405,7 @@ async function addlistperson(id: string) {
|
||||||
* function openPopup แก้ไขเครื่องราชฯ
|
* function openPopup แก้ไขเครื่องราชฯ
|
||||||
* @param props รายละเอียด
|
* @param props รายละเอียด
|
||||||
*/
|
*/
|
||||||
async function clickmodalEdit(props: any) {
|
async function clickmodalEdit(props: DataManageList) {
|
||||||
insignia.value = props.insigniaSend;
|
insignia.value = props.insigniaSend;
|
||||||
person.value = props;
|
person.value = props;
|
||||||
modalEdit.value = true;
|
modalEdit.value = true;
|
||||||
|
|
@ -433,7 +430,7 @@ async function downloadFile(response: any, filename: string) {
|
||||||
/** function เรียก file รายชื่อข้าราชการสามัญฯ*/
|
/** function เรียก file รายชื่อข้าราชการสามัญฯ*/
|
||||||
async function downloadFileexcel() {
|
async function downloadFileexcel() {
|
||||||
const findInsigniaId = DataStore.dataInsigniaType.find(
|
const findInsigniaId = DataStore.dataInsigniaType.find(
|
||||||
(e: any) => e.name == DataStore.typeinsignia
|
(e: ResponseInsigniaType) => e.name == DataStore.typeinsignia
|
||||||
);
|
);
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -442,7 +439,12 @@ async function downloadFileexcel() {
|
||||||
{
|
{
|
||||||
profileType:
|
profileType:
|
||||||
DataStore.employeeClass == "all" ? null : DataStore.employeeClass,
|
DataStore.employeeClass == "all" ? null : DataStore.employeeClass,
|
||||||
InsigniaId: DataStore.typeinsignia == "all" ? null : findInsigniaId.id,
|
InsigniaId:
|
||||||
|
DataStore.typeinsignia == "all"
|
||||||
|
? null
|
||||||
|
: findInsigniaId
|
||||||
|
? findInsigniaId.id
|
||||||
|
: "",
|
||||||
},
|
},
|
||||||
{ responseType: "blob" }
|
{ responseType: "blob" }
|
||||||
)
|
)
|
||||||
|
|
@ -460,47 +462,39 @@ async function downloadFileexcel() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** function ยืนยันการแก้ไขเครื่องราช*/
|
/** function ยืนยันการแก้ไขเครื่องราช แก้ไขเครื่องราช API*/
|
||||||
async function clickSave() {
|
async function clickSave() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
await listEdit(person.value.id);
|
showLoader();
|
||||||
|
let data = {
|
||||||
|
insigniaId: insignia.value,
|
||||||
|
};
|
||||||
|
await http
|
||||||
|
.put(config.API.insigniaEdit(person.value ? person.value.id : ""), data)
|
||||||
|
.then(async () => {
|
||||||
|
await props?.fecthInsigniaByOc?.(
|
||||||
|
props.roundId,
|
||||||
|
organization.value,
|
||||||
|
"officer",
|
||||||
|
props.tab
|
||||||
|
);
|
||||||
|
success($q, "แก้ไขเครื่องราชฯ ที่ยื่นขอสำเร็จ");
|
||||||
|
modalEdit.value = false;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
"ยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอ",
|
"ยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอ",
|
||||||
"ต้องการยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอนี้หรือไม่ ?"
|
"ต้องการยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอนี้หรือไม่ ?"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* function แก้ไขเครื่องราช API
|
|
||||||
* @param profileId
|
|
||||||
*/
|
|
||||||
async function listEdit(profileId: string) {
|
|
||||||
showLoader();
|
|
||||||
let data: any = {
|
|
||||||
insigniaId: insignia.value,
|
|
||||||
};
|
|
||||||
await http
|
|
||||||
.put(config.API.insigniaEdit(profileId), data)
|
|
||||||
.then(async () => {
|
|
||||||
await props?.fecthInsigniaByOc?.(
|
|
||||||
props.roundId,
|
|
||||||
organization.value,
|
|
||||||
"officer",
|
|
||||||
props.tab
|
|
||||||
);
|
|
||||||
success($q, "แก้ไขเครื่องราชฯ ที่ยื่นขอสำเร็จ");
|
|
||||||
modalEdit.value = false;
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
messageError($q, err);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function openPopup ไม่ยืนขอ
|
* function openPopup ไม่ยืนขอ
|
||||||
* @param id profileId
|
* @param id profileId
|
||||||
|
|
@ -650,7 +644,7 @@ async function fecthInsignia() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.insigniaOrg)
|
.get(config.API.insigniaOrg)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const listtype = res.data.result.map((e: any) => ({
|
const listtype = res.data.result.map((e: ResponseInsigniaType) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
name: e.name + `(${e.shortName})`,
|
name: e.name + `(${e.shortName})`,
|
||||||
}));
|
}));
|
||||||
|
|
@ -787,6 +781,22 @@ function clearInsigniaFilters(name: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => DataStore.typeOc,
|
||||||
|
async () => {
|
||||||
|
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||||
|
organization.value = await DataStore.typeOc;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/** เช็คเเถวข้อมูลว่ามีการเปลี่ยนแปลงไหม */
|
||||||
|
watch(
|
||||||
|
() => formFilter.pageSize,
|
||||||
|
() => {
|
||||||
|
fecthlistperson();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
/** Hook*/
|
/** Hook*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||||
|
|
@ -804,14 +814,6 @@ onMounted(async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
|
||||||
() => DataStore.typeOc,
|
|
||||||
async () => {
|
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
|
||||||
organization.value = await DataStore.typeOc;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,43 @@ interface DataRecord {
|
||||||
orgReturnInsignia: string;
|
orgReturnInsignia: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface DataProfileOtherSystem {
|
||||||
|
citizenId: string;
|
||||||
|
fullname: string;
|
||||||
|
id: string;
|
||||||
|
level: string;
|
||||||
|
organizationOrganization: string;
|
||||||
|
position: string;
|
||||||
|
rootId: string;
|
||||||
|
}
|
||||||
|
interface Pagination {
|
||||||
|
rowsPerPage: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DataManageList {
|
||||||
|
citizenId: string;
|
||||||
|
dateSend: null | string | Date;
|
||||||
|
employeeType: string | null;
|
||||||
|
id: string;
|
||||||
|
insigniaCheck: string;
|
||||||
|
insigniaLevel: string;
|
||||||
|
insigniaSend: string;
|
||||||
|
insigniaType: string;
|
||||||
|
isApprove: boolean;
|
||||||
|
level: string;
|
||||||
|
markDiscipline: boolean;
|
||||||
|
markLeave: boolean;
|
||||||
|
markRate: boolean;
|
||||||
|
name: string;
|
||||||
|
position: string;
|
||||||
|
profileId: string;
|
||||||
|
reason: string;
|
||||||
|
requestNote: string;
|
||||||
|
salary: string;
|
||||||
|
salary2: string;
|
||||||
|
statusMark: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
OptionData,
|
OptionData,
|
||||||
OptionDataYear,
|
OptionDataYear,
|
||||||
|
|
@ -148,4 +185,7 @@ export type {
|
||||||
DataAllocate,
|
DataAllocate,
|
||||||
DataRecord,
|
DataRecord,
|
||||||
DataInsignia,
|
DataInsignia,
|
||||||
|
DataProfileOtherSystem,
|
||||||
|
Pagination,
|
||||||
|
DataManageList,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,68 @@ interface ResponseRecordLists {
|
||||||
volumeNo: string;
|
volumeNo: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ResponseProfile {
|
||||||
|
avatar: string;
|
||||||
|
avatarName: string;
|
||||||
|
citizenId: string;
|
||||||
|
firstName: string;
|
||||||
|
id: string;
|
||||||
|
lastName: string;
|
||||||
|
org: string;
|
||||||
|
orgRevisionId: string;
|
||||||
|
orgRootShortName: string;
|
||||||
|
posExecutive: string;
|
||||||
|
posLevel: string;
|
||||||
|
posLevelId: string;
|
||||||
|
posNo: string;
|
||||||
|
posType: string;
|
||||||
|
posTypeId: string;
|
||||||
|
position: string;
|
||||||
|
prefix: string;
|
||||||
|
rank: string;
|
||||||
|
root: string;
|
||||||
|
rootId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ResponseManageList {
|
||||||
|
citizenId: string;
|
||||||
|
docs: string;
|
||||||
|
fullName: string;
|
||||||
|
id: string;
|
||||||
|
isApprove: boolean;
|
||||||
|
lastInsignia: string;
|
||||||
|
level: string;
|
||||||
|
markDiscipline: boolean;
|
||||||
|
markLeave: boolean;
|
||||||
|
markRate: boolean;
|
||||||
|
posNo: string;
|
||||||
|
position: string;
|
||||||
|
profileId: string;
|
||||||
|
profileType: string;
|
||||||
|
rank: string;
|
||||||
|
reason: string;
|
||||||
|
requestDate: Date | string;
|
||||||
|
requestInsignia: string;
|
||||||
|
requestInsigniaShortName: string;
|
||||||
|
requestNote: string;
|
||||||
|
salary: string;
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ResponseDataInsignia {
|
||||||
|
document: string;
|
||||||
|
isLock: boolean;
|
||||||
|
name: string;
|
||||||
|
organizationName: string;
|
||||||
|
periodId: string;
|
||||||
|
requestId: string;
|
||||||
|
requestNote: string;
|
||||||
|
requestStatus: string;
|
||||||
|
round: number;
|
||||||
|
year: number;
|
||||||
|
items: ResponseManageList[];
|
||||||
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
ResponseObject,
|
ResponseObject,
|
||||||
ResponsePeriod,
|
ResponsePeriod,
|
||||||
|
|
@ -99,4 +161,7 @@ export type {
|
||||||
ResponseAllocate,
|
ResponseAllocate,
|
||||||
ResponseInsigniaType,
|
ResponseInsigniaType,
|
||||||
ResponseRecordLists,
|
ResponseRecordLists,
|
||||||
|
ResponseProfile,
|
||||||
|
ResponseManageList,
|
||||||
|
ResponseDataInsignia,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,17 @@ import { defineStore } from "pinia";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
/**import Type */
|
/**import Type */
|
||||||
import type { OptionReport } from "@/modules/07_insignia/interface/index/Main";
|
import type {
|
||||||
|
OptionReport,
|
||||||
|
OptionData,
|
||||||
|
DataManageList,
|
||||||
|
OptionRound,
|
||||||
|
} from "@/modules/07_insignia/interface/index/Main";
|
||||||
|
import type {
|
||||||
|
ResponseManageList,
|
||||||
|
ResponseInsigniaType,
|
||||||
|
ResponseDataInsignia,
|
||||||
|
} from "@/modules/07_insignia/interface/response/Main";
|
||||||
|
|
||||||
/**import Stores */
|
/**import Stores */
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -12,20 +22,22 @@ const { date2Thai } = mixin;
|
||||||
|
|
||||||
export const useInsigniaDataStore = defineStore("insignia", () => {
|
export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
const roundId = ref<string>("");
|
const roundId = ref<string>("");
|
||||||
const optionRound = ref<any>([]);
|
const optionRound = ref<OptionRound[]>([]);
|
||||||
const isLock = ref<boolean>(false);
|
const isLock = ref<boolean>(false);
|
||||||
const roleUser = ref<string>("");
|
const roleUser = ref<string>("");
|
||||||
const requestId = ref<string>("");
|
const requestId = ref<string>("");
|
||||||
const requestStatus = ref<string>("");
|
const requestStatus = ref<string>("");
|
||||||
const optionsTypeOc = ref<any>([]);
|
const optionsTypeOc = ref<OptionData[]>([]);
|
||||||
const typeOc = ref<string>("");
|
const typeOc = ref<string>("");
|
||||||
const agency = ref<string>("");
|
const agency = ref<string>("");
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<DataManageList[]>([]);
|
||||||
const listinsignia = ref<any>([]);
|
const listinsignia = ref<DataManageList[]>([]);
|
||||||
const typeinsignia = ref<string>("all");
|
const typeinsignia = ref<string>("all");
|
||||||
const typeinsigniaOptions = ref<any>([{ id: "all", name: "ทั้งหมด" }]);
|
const typeinsigniaOptions = ref<OptionData[]>([
|
||||||
|
{ id: "all", name: "ทั้งหมด" },
|
||||||
|
]);
|
||||||
const employeeClass = ref<string>("all");
|
const employeeClass = ref<string>("all");
|
||||||
const employeeClassOps = ref<any>([
|
const employeeClassOps = ref<OptionData[]>([
|
||||||
{ name: "ทั้งหมด", id: "all" },
|
{ name: "ทั้งหมด", id: "all" },
|
||||||
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" },
|
||||||
{ name: "ลูกจ้างประจำ", id: "perm" },
|
{ name: "ลูกจ้างประจำ", id: "perm" },
|
||||||
|
|
@ -45,15 +57,15 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
{ id: "44", title: "บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ" },
|
{ id: "44", title: "บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ" },
|
||||||
]);
|
]);
|
||||||
const mainTab = ref<string | undefined>("pending");
|
const mainTab = ref<string | undefined>("pending");
|
||||||
const dataInsigniaType = ref<any>([]);
|
const dataInsigniaType = ref<ResponseInsigniaType[]>([]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Funtioin เรียกข้อมูลรายชื่อข้าราชการสามัญ
|
* Funtioin เรียกข้อมูลรายชื่อข้าราชการสามัญ
|
||||||
* @param data ข้อมูลรายชื่อข้าราชการสามัญ
|
* @param data ข้อมูลรายชื่อข้าราชการสามัญ
|
||||||
*/
|
*/
|
||||||
async function fetchData(data: any) {
|
async function fetchData(data: ResponseManageList[]) {
|
||||||
if (data !== null) {
|
if (data !== null) {
|
||||||
let datalist = await data.map((e: any) => ({
|
let datalist = data.map((e: ResponseManageList) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
citizenId: e.citizenId,
|
citizenId: e.citizenId,
|
||||||
profileId: e.profileId,
|
profileId: e.profileId,
|
||||||
|
|
@ -65,7 +77,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
insigniaType: e.lastInsignia
|
insigniaType: e.lastInsignia
|
||||||
? `${e.lastInsignia} (${
|
? `${e.lastInsignia} (${
|
||||||
dataInsigniaType.value.find(
|
dataInsigniaType.value.find(
|
||||||
(item: any) => item.name === e.lastInsignia
|
(item: ResponseInsigniaType) => item.name === e.lastInsignia
|
||||||
)?.shortName || ""
|
)?.shortName || ""
|
||||||
})`
|
})`
|
||||||
: "-",
|
: "-",
|
||||||
|
|
@ -73,15 +85,19 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
insigniaSend: e.requestInsignia
|
insigniaSend: e.requestInsignia
|
||||||
? `${e.requestInsignia} (${
|
? `${e.requestInsignia} (${
|
||||||
dataInsigniaType.value.find(
|
dataInsigniaType.value.find(
|
||||||
(item: any) => item.name === e.requestInsignia
|
(item: ResponseInsigniaType) => item.name === e.requestInsignia
|
||||||
)?.shortName || ""
|
)?.shortName || ""
|
||||||
})`
|
})`
|
||||||
: "",
|
: "",
|
||||||
insigniaLevel: e.level,
|
insigniaLevel: e.level ? e.level : "",
|
||||||
dateSend: date2Thai(e.requestDate),
|
dateSend: e.requestDate
|
||||||
requestNote: e.requestNote,
|
? typeof e.requestDate === "string"
|
||||||
employeeType: profileType(e.profileType),
|
? e.requestDate
|
||||||
reason: e.reason,
|
: e.requestDate.toISOString()
|
||||||
|
: null,
|
||||||
|
requestNote: e.requestNote ? e.requestNote : "",
|
||||||
|
employeeType: profileType(e.profileType) || null,
|
||||||
|
reason: e.reason ? e.reason : "",
|
||||||
markDiscipline: e.markDiscipline,
|
markDiscipline: e.markDiscipline,
|
||||||
markLeave: e.markLeave,
|
markLeave: e.markLeave,
|
||||||
markRate: e.markRate,
|
markRate: e.markRate,
|
||||||
|
|
@ -97,7 +113,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
for (let j = 0; j < item.length; j++) {
|
for (let j = 0; j < item.length; j++) {
|
||||||
const data = item[j];
|
const data = item[j];
|
||||||
const filteredData = dataInsigniaType.value.find(
|
const filteredData = dataInsigniaType.value.find(
|
||||||
(item: any) => item.name === data.insigniaType
|
(item: ResponseInsigniaType) => item.name === data.insigniaType
|
||||||
);
|
);
|
||||||
if (filteredData) {
|
if (filteredData) {
|
||||||
data.insigniaType = `${data.insigniaType} (${filteredData.shortName})`;
|
data.insigniaType = `${data.insigniaType} (${filteredData.shortName})`;
|
||||||
|
|
@ -106,8 +122,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.value = await datalist;
|
rows.value = datalist;
|
||||||
listinsignia.value = await item;
|
listinsignia.value = item;
|
||||||
searchDataTable(typeinsignia.value, employeeClass.value);
|
searchDataTable(typeinsignia.value, employeeClass.value);
|
||||||
filtertypeInsignia();
|
filtertypeInsignia();
|
||||||
} else rows.value = [];
|
} else rows.value = [];
|
||||||
|
|
@ -117,7 +133,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
* function เรียกข้อมูลรอบการเสนอขอ
|
* function เรียกข้อมูลรอบการเสนอขอ
|
||||||
* @param data ข้อมูลราบการเสนอขอ
|
* @param data ข้อมูลราบการเสนอขอ
|
||||||
*/
|
*/
|
||||||
async function fetchDataInsignia(data: any) {
|
async function fetchDataInsignia(data: ResponseDataInsignia) {
|
||||||
isLock.value = data.isLock; // สถานะล็อกข้อมูล
|
isLock.value = data.isLock; // สถานะล็อกข้อมูล
|
||||||
requestId.value = data.requestId;
|
requestId.value = data.requestId;
|
||||||
requestStatus.value = data.requestStatus; // สถานะของรอบการเสนอขอ
|
requestStatus.value = data.requestStatus; // สถานะของรอบการเสนอขอ
|
||||||
|
|
@ -127,15 +143,15 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
* funntoin หา option หน่วยงสานทั้งหมด
|
* funntoin หา option หน่วยงสานทั้งหมด
|
||||||
* @param op
|
* @param op
|
||||||
*/
|
*/
|
||||||
async function fetchOption(op: any) {
|
async function fetchOption(op: OptionData[]) {
|
||||||
const aId = agency.value ?? "00000000-0000-0000-0000-000000000000";
|
const aId = agency.value ?? "00000000-0000-0000-0000-000000000000";
|
||||||
const hasID = op.find((e: any) => e.id === agency.value);
|
const hasID = op.find((e: OptionData) => e.id === agency.value);
|
||||||
|
|
||||||
if (aId !== "00000000-0000-0000-0000-000000000000" && hasID) {
|
if (aId !== "00000000-0000-0000-0000-000000000000" && hasID) {
|
||||||
typeOc.value = agency.value;
|
typeOc.value = agency.value;
|
||||||
optionsTypeOc.value = op;
|
optionsTypeOc.value = op;
|
||||||
} else {
|
} else {
|
||||||
(optionsTypeOc.value = op), (typeOc.value = op[0].id);
|
(optionsTypeOc.value = op), (typeOc.value = op[0].id.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,17 +163,19 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
if (listinsignia.value.length !== 0) {
|
if (listinsignia.value.length !== 0) {
|
||||||
// หาประเภทเครื่องราชที่ขอที่ชื่อซ้ำกัน
|
// หาประเภทเครื่องราชที่ขอที่ชื่อซ้ำกัน
|
||||||
const double_name = [
|
const double_name = [
|
||||||
...new Set(listinsignia.value.map((item: any) => item.insigniaCheck)),
|
...new Set(
|
||||||
|
listinsignia.value.map((item: DataManageList) => item.insigniaCheck)
|
||||||
|
),
|
||||||
];
|
];
|
||||||
typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
||||||
for (let i = 1; i <= double_name.length; i++) {
|
for (let i = 1; i <= double_name.length; i++) {
|
||||||
const type = double_name[i - 1];
|
const type = double_name[i - 1];
|
||||||
const filterShortName = dataInsigniaType.value.find(
|
const filterShortName = dataInsigniaType.value.find(
|
||||||
(item: any) => item.name === type
|
(item: ResponseInsigniaType) => item.name === type
|
||||||
);
|
);
|
||||||
const listtype = {
|
const listtype = {
|
||||||
id: type,
|
id: type ? type.toString() : "",
|
||||||
name: `${type} (${filterShortName.shortName})`,
|
name: `${type} (${filterShortName ? filterShortName.shortName : ""})`,
|
||||||
};
|
};
|
||||||
typeinsigniaOptions.value.push(listtype);
|
typeinsigniaOptions.value.push(listtype);
|
||||||
}
|
}
|
||||||
|
|
@ -174,17 +192,17 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
employeeClass.value = employeeClasstype;
|
employeeClass.value = employeeClasstype;
|
||||||
if (type !== "all" && employeeClasstype !== "all") {
|
if (type !== "all" && employeeClasstype !== "all") {
|
||||||
rows.value = listinsignia.value.filter(
|
rows.value = listinsignia.value.filter(
|
||||||
(e: any) =>
|
(e: DataManageList) =>
|
||||||
e.insigniaCheck === type &&
|
e.insigniaCheck === type &&
|
||||||
e.employeeType === profileType(employeeClasstype)
|
e.employeeType === profileType(employeeClasstype)
|
||||||
);
|
);
|
||||||
} else if (type !== "all" && employeeClasstype === "all") {
|
} else if (type !== "all" && employeeClasstype === "all") {
|
||||||
rows.value = listinsignia.value.filter(
|
rows.value = listinsignia.value.filter(
|
||||||
(e: any) => e.insigniaCheck === type
|
(e: DataManageList) => e.insigniaCheck === type
|
||||||
);
|
);
|
||||||
} else if (type === "all" && employeeClasstype !== "all") {
|
} else if (type === "all" && employeeClasstype !== "all") {
|
||||||
rows.value = listinsignia.value.filter(
|
rows.value = listinsignia.value.filter(
|
||||||
(e: any) => e.employeeType === profileType(employeeClasstype)
|
(e: DataManageList) => e.employeeType === profileType(employeeClasstype)
|
||||||
);
|
);
|
||||||
} else if (type === "all" && employeeClasstype === "all") {
|
} else if (type === "all" && employeeClasstype === "all") {
|
||||||
rows.value = listinsignia.value;
|
rows.value = listinsignia.value;
|
||||||
|
|
@ -195,7 +213,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
* function เรียกประเภทเครื่องราช
|
* function เรียกประเภทเครื่องราช
|
||||||
* @param data ประเภทเครื่องราชทั้งหมด
|
* @param data ประเภทเครื่องราชทั้งหมด
|
||||||
*/
|
*/
|
||||||
function fetchInsigniaType(data: any) {
|
function fetchInsigniaType(data: ResponseInsigniaType[]) {
|
||||||
dataInsigniaType.value = data;
|
dataInsigniaType.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; //หม
|
||||||
/**use */
|
/**use */
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const roleDataStore = useroleUserDataStore();
|
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
||||||
|
|
@ -77,7 +76,7 @@ async function fecthlistRound() {
|
||||||
|
|
||||||
//มีรอบการเสนอขอพระราชทานเครื่องแสดง UI
|
//มีรอบการเสนอขอพระราชทานเครื่องแสดง UI
|
||||||
if (optionRound.value.length !== 0) {
|
if (optionRound.value.length !== 0) {
|
||||||
// DataStore.optionRound = optionRound.value;
|
DataStore.optionRound = optionRound.value;
|
||||||
// const lastValue = optionRound.value[0];
|
// const lastValue = optionRound.value[0];
|
||||||
// await fetchListOrg(lastValue.period_revision);
|
// await fetchListOrg(lastValue.period_revision);
|
||||||
// await fecthAgency(lastValue.period_revision);
|
// await fecthAgency(lastValue.period_revision);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue