This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-10 13:21:59 +07:00
parent 927a81ff75
commit 9e633b83b7
6 changed files with 55 additions and 9 deletions

View file

@ -155,11 +155,19 @@ function getPosType() {
.get(config.API.salaryEmployeePosType())
.then((res) => {
const data = res.data.result;
posTypeOp.value = data.map((item: PosType) => ({
const option = [
{
id: "",
name: "ทั้งหมด",
},
];
const test = data.map((item: PosType) => ({
id: item.id,
name: item.posTypeName,
}));
option.push(...test);
posTypeOp.value = option;
})
.catch((e) => {
messageError($q, e);

View file

@ -194,7 +194,7 @@ const fiscalYearFilter = async () => {
};
//
const OrderType = ref<string>("");
const OrderType = ref<string | null>("");
const OrderTypeFilter1 = ref<DataOption1[]>([]);
const OrderTypeOption = ref<DataOption1[]>([{ id: "", name: "ทั้งหมด" }]);
@ -238,7 +238,9 @@ async function OrderTypeFilter() {
/** ฟังชั่นฟิลเตอร์ตามค่า ประเภท สถานะ ปี */
async function searchFilterTable() {
stroe.filterListOrder(OrderType.value, OrderStatus.value, fiscalyear.value);
if (OrderType.value) {
stroe.filterListOrder(OrderType.value, OrderStatus.value, fiscalyear.value);
}
}
/** fucnction หาสถานะทั่งหมด*/
@ -273,6 +275,7 @@ function filterSelector(val: string, update: Function, refData: string) {
switch (refData) {
case "fiscalyearOP":
update(() => {
fiscalyear.value = null;
fiscalyearOP.value = fiscalyearFilter1.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
@ -280,6 +283,7 @@ function filterSelector(val: string, update: Function, refData: string) {
break;
case "OrderTypeOption":
update(() => {
OrderType.value = null;
OrderTypeOption.value = OrderTypeFilter1.value.filter(
(v: DataOption1) => v.name.indexOf(val) > -1
);
@ -287,6 +291,7 @@ function filterSelector(val: string, update: Function, refData: string) {
break;
case "OrderStatusOption":
update(() => {
OrderStatus.value = "";
OrderStatusOption.value = OrderStatusFilter1.value.filter(
(v: DataOption1) => v.name.indexOf(val) > -1
);
@ -364,8 +369,17 @@ onMounted(async () => {
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
<template v-if="fiscalyear !== 0" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(fiscalyearOP = fiscalyearFilter1), (fiscalyear = 0)
"
class="cursor-pointer"
/>
</template>
</q-select>
<!-- use-input -->
<div>
<q-btn
size="12px"
@ -449,6 +463,15 @@ onMounted(async () => {
</q-item-section>
</q-item>
</template>
<template v-if="OrderType !== ''" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(OrderTypeOption = OrderTypeFilter1), (OrderType = '')
"
class="cursor-pointer"
/>
</template>
</q-select>
</div>
<div class="col-xs-12 col-sm-3 col-md-3">
@ -480,6 +503,16 @@ onMounted(async () => {
</q-item-section>
</q-item>
</template>
<template v-if="OrderStatus !== 'ทั้งหมด'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(OrderStatusOption = OrderStatusFilter1),
(OrderStatus = 'ทั้งหมด')
"
class="cursor-pointer"
/>
</template>
</q-select>
</div>
<q-space />

View file

@ -447,7 +447,9 @@ onMounted(() => {
<template v-if="agencyFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="agencyFilter = 'ALL'"
@click.stop.prevent="
(agencyOptions = agencyOptionsMain), (agencyFilter = 'ALL')
"
class="cursor-pointer"
/> </template
></q-select>

View file

@ -427,6 +427,7 @@ onMounted(() => {
class="q-ml-xs"
v-model="agencyFilter"
label="หน่วยงาน"
lazy-rules
dense
outlined
emit-value
@ -451,7 +452,9 @@ onMounted(() => {
<template v-if="agencyFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="agencyFilter = 'ALL'"
@click.stop.prevent="
(agencyOptions = agencyOptionsMain), (agencyFilter = 'ALL')
"
class="cursor-pointer"
/>
</template>

View file

@ -272,7 +272,7 @@ onMounted(async () => {
<q-input
dense
outlined
:model-value="year === 0 ? null : Number(year) + 543"
:model-value="year === 0 ? 'ทั้งหมด' : Number(year) + 543"
:label="`${'ปีงบประมาณ'}`"
>
<template v-if="year" v-slot:append>

View file

@ -137,7 +137,7 @@ function onAnnounce() {
await porps.fetchData();
await success($q, "ประกาศผลสำเร็จ");
selected.value = [];
}, 1000);
}, 1500);
})
.catch((err) => {
messageError($q, err);