Merge branch 'nice' into develop
This commit is contained in:
commit
63ec4c8353
9 changed files with 86 additions and 134 deletions
|
|
@ -15,6 +15,8 @@ export default {
|
|||
orgByid: (id: string) => `${organization}/${id}`,
|
||||
orgByIdSystem: (id: string, sys: string) =>
|
||||
`${organization}/system/${id}/${sys}`,
|
||||
orgByIdSystemRoot: (id: string, sys: string) =>
|
||||
`${organization}/system-root/${id}/${sys}`,
|
||||
createOrganization: `${organization}/draft`,
|
||||
createOrgLevel: (type: string) => `${organization}/${type}`,
|
||||
orgLevelByid: (type: string, id: string) => `${organization}/${type}/${id}`,
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ const employeeClassOps = ref<OptionData[]>(DataStore.employeeClassOps); //ปร
|
|||
const dialogWarn = ref<boolean>(false);
|
||||
const checkboxData = ref<CheckboxData[]>([]);
|
||||
|
||||
const organizationOptions = ref<OptionData[]>([{ id: "1", name: "ทั้งหมด" }]);
|
||||
const filterOrganizationOP = ref<OptionData[]>([]);
|
||||
|
||||
/** หัวตาราง*/
|
||||
|
|
@ -768,7 +767,7 @@ function filterSelector(val: string, update: Function, name: string) {
|
|||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "filterOrganizationOP") {
|
||||
filterOrganizationOP.value = organizationOptions.value.filter(
|
||||
filterOrganizationOP.value = DataStore.optionsTypeOc.filter(
|
||||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
|
|
@ -791,8 +790,10 @@ function clearInsigniaFilters(name: string) {
|
|||
|
||||
/** Hook*/
|
||||
onMounted(async () => {
|
||||
organizationOptions.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
console.log(DataStore.optionsTypeOc);
|
||||
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = DataStore.typeOc;
|
||||
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
|
|
@ -805,7 +806,6 @@ onMounted(async () => {
|
|||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
}
|
||||
filterOrganizationOP.value = organizationOptions.value;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ function filterSelector(val: string, update: Function, name: string) {
|
|||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "filterOrganizationOP") {
|
||||
filterOrganizationOP.value = organizationOptions.value.filter(
|
||||
filterOrganizationOP.value = DataStore.optionsTypeOc.filter(
|
||||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@ function clearInsigniaFilters(name: string) {
|
|||
|
||||
/*** Hook*/
|
||||
onMounted(async () => {
|
||||
organizationOptions.value = await DataStore.optionsTypeOc;
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
|
|
@ -272,7 +272,6 @@ onMounted(async () => {
|
|||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
}
|
||||
filterOrganizationOP.value = organizationOptions.value;
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ function filterSelector(val: string, update: Function, name: string) {
|
|||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "filterOrganizationOP") {
|
||||
filterOrganizationOP.value = organizationOptions.value.filter(
|
||||
filterOrganizationOP.value = DataStore.optionsTypeOc.filter(
|
||||
(v: OptionData) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@ function clearInsigniaFilters(name: string) {
|
|||
|
||||
/** Hook*/
|
||||
onMounted(async () => {
|
||||
organizationOptions.value = DataStore.optionsTypeOc;
|
||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||
organization.value = await DataStore.typeOc;
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
|
|
@ -272,9 +272,9 @@ onMounted(async () => {
|
|||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
}
|
||||
filterOrganizationOP.value = organizationOptions.value;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12">
|
||||
|
|
@ -528,6 +528,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogInformation
|
||||
:modal="dialogNote"
|
||||
:title="noteTitle"
|
||||
|
|
|
|||
|
|
@ -85,42 +85,36 @@ onMounted(async () => {
|
|||
DataStore.mainTab = props.tab;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="col-12 row q-pa-md">
|
||||
<div class="row col-12">
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="name"
|
||||
dense
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
class="custom-header-table"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td key="no" style="width: 50px" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="orgName" style="width: 300px" :props="props">
|
||||
{{ props.row.orgName }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="name"
|
||||
dense
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">{{
|
||||
col.name == "no" ? props.rowIndex + 1 : col.value
|
||||
}}</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ interface OptionRound {
|
|||
id: string;
|
||||
year: number;
|
||||
name: string;
|
||||
period_revision: string;
|
||||
}
|
||||
interface DataStat {
|
||||
allUserUser: number;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ interface ResponsePeriod {
|
|||
period_start: string;
|
||||
period_status: string;
|
||||
period_year: number;
|
||||
period_revision: string;
|
||||
}
|
||||
|
||||
interface ResponseNoSend {
|
||||
|
|
@ -44,4 +45,10 @@ interface ResponseAllocate {
|
|||
total: number;
|
||||
}
|
||||
|
||||
export type { ResponseObject, ResponsePeriod, ResponseNoSend, ResponseRound ,ResponseAllocate};
|
||||
export type {
|
||||
ResponseObject,
|
||||
ResponsePeriod,
|
||||
ResponseNoSend,
|
||||
ResponseRound,
|
||||
ResponseAllocate,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
* funntoin หา option หน่วยงสานทั้งหมด
|
||||
* @param op
|
||||
*/
|
||||
function fetchOption(op: any) {
|
||||
async function fetchOption(op: any) {
|
||||
const aId = agency.value ?? "00000000-0000-0000-0000-000000000000";
|
||||
const hasID = op.find((e: any) => e.id === agency.value);
|
||||
|
||||
|
|
|
|||
|
|
@ -72,21 +72,24 @@ async function fecthlistRound() {
|
|||
id: e.period_id,
|
||||
year: e.period_year,
|
||||
name: e.period_name,
|
||||
period_revision: e.period_revision,
|
||||
}));
|
||||
|
||||
//มีรอบการเสนอขอพระราชทานเครื่องแสดง UI
|
||||
if (optionRound.value.length !== 0) {
|
||||
DataStore.optionRound = optionRound.value;
|
||||
const lastValue = optionRound.value[0];
|
||||
await fetchListOrg(lastValue.period_revision);
|
||||
await fecthAgency(lastValue.period_revision);
|
||||
if (DataStore.roundId) {
|
||||
round.value = DataStore.roundId; // รอบการเสนอให้ใช้รอบที่เลือก
|
||||
} else {
|
||||
round.value = lastValue.id.toString(); // รอบการเสนอให้ใช้รอบล่าสุด
|
||||
}
|
||||
await fecthStat(round.value);
|
||||
DataStore.roundId = round.value;
|
||||
roundName.value = lastValue.name;
|
||||
loadview.value = true;
|
||||
await fecthStat(round.value);
|
||||
} else {
|
||||
hideLoader();
|
||||
}
|
||||
|
|
@ -111,35 +114,25 @@ async function fecthStat(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch โครองสร้างปัจจุบัน
|
||||
*/
|
||||
function fetchActiveId() {
|
||||
http
|
||||
.get(config.API.activeOrganization)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
fetchListOrg(data.activeId);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลโครองสร้างปัจจุบัน
|
||||
* @param id โครงสร้างปัจจุบัน
|
||||
*/
|
||||
async function fetchListOrg(id: string) {
|
||||
await http
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.get(config.API.orgByIdSystemRoot(id, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: DataStructureTree) => ({
|
||||
id: item.orgTreeId,
|
||||
name: item.orgName,
|
||||
}));
|
||||
optiontypeOc.value = data;
|
||||
DataStore.fetchOption(optiontypeOc.value); //ค่าของหน่วยงานทั้งหมดไว้ที่ DataStore
|
||||
const data = res.data.result;
|
||||
if (data.length !== 0) {
|
||||
optiontypeOc.value = await res.data.result.map(
|
||||
(item: DataStructureTree) => ({
|
||||
id: item.orgTreeId,
|
||||
name: item.orgName,
|
||||
})
|
||||
);
|
||||
|
||||
await DataStore.fetchOption(optiontypeOc.value); //ค่าของหน่วยงานทั้งหมดไว้ที่ DataStore
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -149,9 +142,13 @@ async function fetchListOrg(id: string) {
|
|||
/**
|
||||
* funcion เช็คหน่วยงาน
|
||||
*/
|
||||
async function fecthAgency() {
|
||||
async function fecthAgency(id: string) {
|
||||
await http
|
||||
.get(config.API.keycloakPosition())
|
||||
.get(config.API.keycloakPosition(), {
|
||||
params: {
|
||||
revisionId: id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
DataStore.agency = res.data.result.rootId;
|
||||
DataStore.typeOc = DataStore.agency;
|
||||
|
|
@ -183,19 +180,23 @@ async function fecthInsignia() {
|
|||
*/
|
||||
async function changround() {
|
||||
DataStore.roundId = round.value;
|
||||
fecthStat(round.value); //เรียกดู Stat รอบที่เลือก
|
||||
var organization =
|
||||
DataStore.agency != null //ถ้ามี agency เรียกข้อมูลตาม agency ถ้าไม่มีเรียนตาม Oc ที่เลือก
|
||||
? DataStore.agency
|
||||
: DataStore.typeOc;
|
||||
await fecthInsigniaByOc(round.value, organization, "officer", tab.value); // เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
// get round name
|
||||
const roundFilter = optionRound.value.find((x: any) => round.value === x.id);
|
||||
await fecthStat(round.value); //เรียกดู Stat รอบที่เลือก
|
||||
const roundFilter = optionRound.value.find(
|
||||
(x: OptionRound) => x.id === round.value
|
||||
);
|
||||
if (roundFilter) {
|
||||
await fetchListOrg(roundFilter?.period_revision);
|
||||
await fecthAgency(roundFilter?.period_revision);
|
||||
roundName.value = `รอบการเสนอขอพระราชทานเครื่องราชฯ ปี ${
|
||||
roundFilter.year + 543
|
||||
}`;
|
||||
}
|
||||
await fecthInsigniaByOc(round.value, organization, "officer", tab.value); // เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -431,13 +432,7 @@ async function uploadFile(event: any) {
|
|||
*/
|
||||
onMounted(async () => {
|
||||
tab.value = DataStore.mainTab ?? "";
|
||||
await Promise.all([
|
||||
fecthlistRound(),
|
||||
fecthInsignia(),
|
||||
fecthInsignia(),
|
||||
fetchActiveId(),
|
||||
fecthAgency(),
|
||||
]);
|
||||
await Promise.all([fecthlistRound(), fecthInsignia(), fecthInsignia()]);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -536,7 +531,7 @@ onMounted(async () => {
|
|||
</q-banner>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
|
||||
<q-tabs
|
||||
v-model="tab"
|
||||
dense
|
||||
|
|
@ -597,7 +592,7 @@ onMounted(async () => {
|
|||
<tab4 :tab="tab" :round-id="round" />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</div>
|
||||
|
||||
|
||||
<q-toolbar class="q-py-md text-right">
|
||||
<q-file
|
||||
|
|
@ -731,51 +726,4 @@ onMounted(async () => {
|
|||
border: 1px solid #ffa800;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.filter-card {
|
||||
background-color: #f1f1f1b0;
|
||||
}
|
||||
|
||||
.toggle-expired-account {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 150%;
|
||||
color: #35373c;
|
||||
}
|
||||
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
|
||||
.custom-header-table {
|
||||
max-height: 64vh;
|
||||
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue