Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-09-01 09:44:02 +07:00
commit a86743308f
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;
};
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 selectorRound = async (round: number) => {
@ -403,6 +416,27 @@ const resetFilter = () => {
@update:model-value="selectorInsignia"
/>
</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>
<q-btn

View file

@ -27,16 +27,26 @@ const nextPage = (type: string, title: string) => {
</q-item-section>
</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-icon color="primary" name="mdi-file" size="xs" />
</q-item-section>
<q-item-section class="text-dark">
รายงานผลการจายใบกำก
ญชรายชอขาราชการผขอพระราชทานเครองราชอสรยาภรณ
</q-item-section>
</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-icon color="primary" name="mdi-file" size="xs" />
</q-item-section>

View file

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

View file

@ -13,6 +13,8 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
const insigniaType = ref<any>()
const rows = 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) => {
insignia.value = ''
@ -24,7 +26,7 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
const fetchDatainsigniaType = async (data: any) => {
insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
}
const fetchlistinsignia = async (data: any) => {
rows.value = [];
let list = await data.map((e: any) => ({
@ -49,7 +51,7 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
returnOrganization: e.returnOrganization,
returnDate: e.returnDate !== null ? date2Thai(e.returnDate) : '-',
returnReason: e.returnReason !== null ? e.returnReason : '-',
}));
}));
rows.value = list
listInsignia.value = list
// selectInvoice(invoiceType.value)
@ -67,12 +69,6 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
return "บันทึกลง ก.พ. 7 แล้ว";
}
}
const selectInsignia = () => {
console.log(insignia.value);
rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value)
}
const profileType = (val: string) => {
switch (val) {
case "officer":
@ -81,16 +77,16 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
return "ลูกจ้างประจำ";
}
}
return {
rows,
listInsignia,
insignia,
insigniaOp,
insigniaType,
employeeClass,
employeeClassOps,
fetchDatainsigniaType,
fetchDataInsignia,
selectInsignia,
profileType,
fetchlistinsignia,
};

View file

@ -15,6 +15,8 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
const insigniaType = ref<any>()
const invoiceType = ref<string>('all')
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 listInsignia = ref<any>([])
@ -67,6 +69,15 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
rows.value = list
} 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) => {
switch (val) {
case "PENDING":
@ -95,11 +106,14 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
insigniaType,
invoiceType,
invoiceTypeop,
employeeClass,
employeeClassOps,
fetchDatainsignia,
fetchDatainsigniaType,
status,
profileType,
fetchlistinsignia,
selectInvoice,
selectEmployeeClass,
};
});

View file

@ -515,6 +515,27 @@ const resetFilter = () => {
"
/>
</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>
<q-btn