เพิ่ม select สถานภาพ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-01 09:14:38 +07:00
parent 287ef3c598
commit cf8bdb7ce0
6 changed files with 90 additions and 16 deletions

View file

@ -283,6 +283,19 @@ const selectorInsignia = async () => {
? dataCopy.filter((x: any) => x.requestInsigniaId == DataStore.insignia) ? dataCopy.filter((x: any) => x.requestInsigniaId == DataStore.insignia)
: dataCopy; : dataCopy;
}; };
const selectEmployeeClass = async (employeeClass: string) => {
if (employeeClass == "officer") {
let list = DataStore.listInsignia.filter(
(e: any) => e.employeeType === "ข้าราชการ กทม.สามัญ"
);
rows.value = list;
} else if (employeeClass === "perm") {
let list = DataStore.listInsignia.filter(
(e: any) => e.employeeType === "ลูกจ้างประจำ"
);
rows.value = list;
} else rows.value = DataStore.listInsignia;
};
const yearRound = ref<number>(); const yearRound = ref<number>();
const selectorRound = async (round: number) => { const selectorRound = async (round: number) => {
@ -403,6 +416,27 @@ const resetFilter = () => {
@update:model-value="selectorInsignia" @update:model-value="selectorInsignia"
/> />
</div> </div>
<div>
<q-select
v-model="DataStore.employeeClass"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'สถานภาพ'}`"
emit-value
map-options
option-label="name"
:options="DataStore.employeeClassOps"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
@update:model-value="
selectEmployeeClass(DataStore.employeeClass)
"
/>
</div>
<div> <div>
<q-btn <q-btn

View file

@ -27,16 +27,26 @@ const nextPage = (type: string, title: string) => {
</q-item-section> </q-item-section>
</q-item> </q-item>
<!-- <q-item to="/insignia/report/report-01" dense class="hover-green"> <q-item
clickable
@click="
nextPage(
'45',
'บัญชีรายชื่อข้าราชการผู้ขอพระราชทานเครื่องราชอิสริยาภรณ์'
)
"
dense
class="hover-green"
>
<q-item-section avatar> <q-item-section avatar>
<q-icon color="primary" name="mdi-file" size="xs" /> <q-icon color="primary" name="mdi-file" size="xs" />
</q-item-section> </q-item-section>
<q-item-section class="text-dark"> <q-item-section class="text-dark">
รายงานผลการจายใบกำก ญชรายชอขาราชการผขอพระราชทานเครองราชอสรยาภรณ
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item to="/insignia/report/report-01" dense class="hover-green"> <!-- <q-item to="/insignia/report/report-01" dense class="hover-green">
<q-item-section avatar> <q-item-section avatar>
<q-icon color="primary" name="mdi-file" size="xs" /> <q-icon color="primary" name="mdi-file" size="xs" />
</q-item-section> </q-item-section>

View file

@ -240,17 +240,16 @@ const downloadReport = async (
</q-btn> </q-btn>
<q-btn <q-btn
unelevated unelevated
icon="mdi-eye" icon="mdi-refresh"
color="primary" color="primary"
label="แสดงรายงาน"
@click="conditionDocument('show')" @click="conditionDocument('show')"
outline
/> />
<q-btn <q-btn
unelevated unelevated
color="blue" color="blue"
icon="mdi-fullscreen" icon="mdi-fullscreen"
@click="dialog = true" @click="dialog = true"
dense
/> />
</div> </div>
</q-toolbar> </q-toolbar>

View file

@ -13,6 +13,8 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
const insigniaType = ref<any>() const insigniaType = ref<any>()
const rows = ref<any>([]) const rows = ref<any>([])
const listInsignia = ref<any>([]) const listInsignia = ref<any>([])
const employeeClass = ref<string>("all");
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
const fetchDataInsignia = async (data: any) => { const fetchDataInsignia = async (data: any) => {
insignia.value = '' insignia.value = ''
@ -67,12 +69,6 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
return "บันทึกลง ก.พ. 7 แล้ว"; return "บันทึกลง ก.พ. 7 แล้ว";
} }
} }
const selectInsignia = () => {
console.log(insignia.value);
rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value)
}
const profileType = (val: string) => { const profileType = (val: string) => {
switch (val) { switch (val) {
case "officer": case "officer":
@ -81,16 +77,16 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
return "ลูกจ้างประจำ"; return "ลูกจ้างประจำ";
} }
} }
return { return {
rows, rows,
listInsignia, listInsignia,
insignia, insignia,
insigniaOp, insigniaOp,
insigniaType, insigniaType,
employeeClass,
employeeClassOps,
fetchDatainsigniaType, fetchDatainsigniaType,
fetchDataInsignia, fetchDataInsignia,
selectInsignia,
profileType, profileType,
fetchlistinsignia, fetchlistinsignia,
}; };

View file

@ -15,6 +15,8 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
const insigniaType = ref<any>() const insigniaType = ref<any>()
const invoiceType = ref<string>('all') const invoiceType = ref<string>('all')
const invoiceTypeop = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" }, { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" }]) const invoiceTypeop = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" }, { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" }])
const employeeClass = ref<string>("all");
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
const rows = ref<any>([]) const rows = ref<any>([])
const listInsignia = ref<any>([]) const listInsignia = ref<any>([])
@ -67,6 +69,15 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
rows.value = list rows.value = list
} else rows.value = listInsignia.value } else rows.value = listInsignia.value
} }
const selectEmployeeClass = (employeeClass: string) => {
if (employeeClass == "officer") {
let list = listInsignia.value.filter((e: any) => e.employeeType === "ข้าราชการ กทม.สามัญ")
rows.value = list
} else if (employeeClass === "perm") {
let list = listInsignia.value.filter((e: any) => e.employeeType === "ลูกจ้างประจำ")
rows.value = list
} else rows.value = listInsignia.value
}
const status = (val: string) => { const status = (val: string) => {
switch (val) { switch (val) {
case "PENDING": case "PENDING":
@ -95,11 +106,14 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
insigniaType, insigniaType,
invoiceType, invoiceType,
invoiceTypeop, invoiceTypeop,
employeeClass,
employeeClassOps,
fetchDatainsignia, fetchDatainsignia,
fetchDatainsigniaType, fetchDatainsigniaType,
status, status,
profileType, profileType,
fetchlistinsignia, fetchlistinsignia,
selectInvoice, selectInvoice,
selectEmployeeClass,
}; };
}); });

View file

@ -515,6 +515,27 @@ const resetFilter = () => {
" "
/> />
</div> </div>
<div>
<q-select
v-model="DataStore.employeeClass"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'สถานภาพ'}`"
emit-value
map-options
option-label="name"
:options="DataStore.employeeClassOps"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
@update:model-value="
DataStore.selectEmployeeClass(DataStore.employeeClass)
"
/>
</div>
<div> <div>
<q-btn <q-btn