เพิ่ม clear

This commit is contained in:
STW_TTTY\stwtt 2024-03-27 13:44:39 +07:00
parent 55ee7f6b12
commit fbe84894ea

View file

@ -5,7 +5,10 @@ import type {
ListData, ListData,
ResponseData, ResponseData,
} from "@/modules/13_salary/interface/index/EmployeeChart"; } from "@/modules/13_salary/interface/index/EmployeeChart";
import type { NewPagination,DataOption } from "@/modules/13_salary/interface/index/Main"; import type {
NewPagination,
DataOption,
} from "@/modules/13_salary/interface/index/Main";
import DialogFormCriteria from "@/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue"; import DialogFormCriteria from "@/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue";
/** importType*/ /** importType*/
@ -17,7 +20,7 @@ import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
const posTypeOp = ref<DataOption[]>([]) const posTypeOp = ref<DataOption[]>([]);
const posType = ref<string>(""); const posType = ref<string>("");
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
const $q = useQuasar(); const $q = useQuasar();
@ -167,7 +170,6 @@ function getData() {
`/?page=${formFilter.page}&pageSize=${formFilter.pageSize}&keyword=${formFilter.keyword}&posTypeId=${posType.value}` `/?page=${formFilter.page}&pageSize=${formFilter.pageSize}&keyword=${formFilter.keyword}&posTypeId=${posType.value}`
) )
.then((res) => { .then((res) => {
const data = res.data.result.data; const data = res.data.result.data;
const total = res.data.result.total; const total = res.data.result.total;
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize); maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
@ -229,25 +231,25 @@ watch(
); );
/** ดึงข้อมูลกลุ่มงาน */ /** ดึงข้อมูลกลุ่มงาน */
function getPosType(){ function getPosType() {
http http
.get(config.API.salaryEmployeePosType()) .get(config.API.salaryEmployeePosType())
.then((res)=>{ .then((res) => {
const data = res.data.result const data = res.data.result;
posTypeOp.value = data.map((item:any)=>({ posTypeOp.value = data.map((item: any) => ({
id:item.id, id: item.id,
name:item.posTypeName name: item.posTypeName,
})) }));
}).catch((e)=>{ })
messageError($q,e) .catch((e) => {
}).finally(()=>{ messageError($q, e);
})
}) .finally(() => {});
} }
onMounted(() => { onMounted(() => {
getData(); getData();
getPosType() getPosType();
}); });
</script> </script>
@ -265,7 +267,15 @@ onMounted(() => {
emit-value emit-value
map-options map-options
@update:model-value="getData" @update:model-value="getData"
/> >
<template v-if="posType" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="posType = '';getData()"
class="cursor-pointer"
/>
</template>
</q-select>
</div> </div>
<q-btn flat round dense icon="add" @click="() => (modalForm = true)"> <q-btn flat round dense icon="add" @click="() => (modalForm = true)">
<q-tooltip>เพ </q-tooltip> <q-tooltip>เพ </q-tooltip>