diff --git a/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue b/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue index 853eae634..20810d344 100644 --- a/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue +++ b/src/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue @@ -45,6 +45,7 @@ const props = defineProps({ const posTypeOp = ref([]); const posNameOp = ref([]); +const posNameOpMain = ref([]); const groupOldOp = ref([]); const posLevelOp = ref([]); const posNameListOp = ref([]); @@ -205,7 +206,7 @@ function getPosName() { .then((res) => { const dataOp = res.data.result; posNameListOp.value = res.data.result; - posNameOp.value = [ + posNameOpMain.value = [ ...new Map( dataOp.map((i: DataListOptions) => [i.posDictName, i]) ).values(), @@ -230,7 +231,7 @@ function getPosNameEdit() { .then((res) => { const dataOp = res.data.result; posNameListOp.value = res.data.result; - posNameOp.value = [ + posNameOpMain.value = [ ...new Map( dataOp.map((i: DataListOptions) => [i.posDictName, i]) ).values(), @@ -325,6 +326,20 @@ watch( } } ); + +/** + * function ต้นหาข้อมูลของ Option + * @param val ค่าที่ต้องการฟิลเตอร์ + * @param update อัพเดทค่า + * @param refData ดาต้าที่ต้องการฟิลเตอร์ + */ + function filterOption(val: any, update: Function) { + update(() => { + posNameOp.value = posNameOpMain.value.filter( + (v: any) => v.name.indexOf(val) > -1 + ); + }); +}