diff --git a/src/modules/08_registryEmployee/components/DialogSelectPos.vue b/src/modules/08_registryEmployee/components/DialogSelectPos.vue index 34cecdf7e..92b88294c 100644 --- a/src/modules/08_registryEmployee/components/DialogSelectPos.vue +++ b/src/modules/08_registryEmployee/components/DialogSelectPos.vue @@ -29,6 +29,7 @@ const { messageError, dialogMessageNotify, dialogConfirm, + onSearchDataTable, } = useCounterMixin(); const route = useRoute(); @@ -197,6 +198,8 @@ const visibleColumns = ref([ /** Position*/ const positionNo = ref([]); //รายการตำแหน่ง +const positionNoMain = ref([]); //รายการตำแหน่ง + const positionId = ref(""); //id ตำแหน่ง const seletcId = ref(""); // id ที่ตเ้องการ const selectedPos = ref([]); //ตำแหน่ง ที่ต้องการ @@ -278,6 +281,7 @@ async function fetchDataTable(id: string, level: number = 0) { } }); positionNo.value = dataMain; + positionNoMain.value = dataMain; }) .catch((err) => { messageError($q, err); @@ -416,6 +420,14 @@ async function onClickSelectPos(id: string) { } } +function serchDataTable() { + positionNo.value = onSearchDataTable( + filters.value, + positionNoMain.value, + columns.value ? columns.value : [] + ); +} + /** callback function เมื่อมีการเปิด popup*/ watch( () => modal.value, @@ -489,12 +501,7 @@ onBeforeMount(async () => { label="ค้นหา" > { default-expand-all :nodes="lazy" node-key="orgTreeId" - label-key="orgTreeName" + label-key="labelName" :filter="filterTree.trim()" no-results-label="ไม่พบข้อมูลที่ค้นหา" no-nodes-label="ไม่มีข้อมูล" @@ -566,7 +573,7 @@ onBeforeMount(async () => {
-
+
{
-
+
{ dense v-model="filters" label="ค้นหา" + @keydown.enter.pervent="serchDataTable" > - -
diff --git a/src/modules/08_registryEmployee/components/DialogSendOrder.vue b/src/modules/08_registryEmployee/components/DialogSendOrder.vue index 7942bc4c6..de1374645 100644 --- a/src/modules/08_registryEmployee/components/DialogSendOrder.vue +++ b/src/modules/08_registryEmployee/components/DialogSendOrder.vue @@ -17,7 +17,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom const $q = useQuasar(); const { - success, + onSearchDataTable, messageError, showLoader, hideLoader, @@ -38,6 +38,7 @@ const props = defineProps({ const filter = ref(""); //ค้นหารายชื่อไปออกคำสั่ง const rows = ref([]); //รายชื่อไปออกคำสั่ง +const rowsMain = ref([]); //รายชื่อไปออกคำสั่ง const selected = ref([]); //รายชื่อที่เลือกไปออกคำสั่ง const columns = ref([ { @@ -63,7 +64,10 @@ const columns = ref([ align: "left", label: "ชื่อ-นามสกุล", sortable: true, - field: (row) => `${row.prefix}${row.firstName} ${row.lastName}`, + field: "fullname", + format(val, row) { + return `${row.prefix}${row.firstName} ${row.lastName}`; + }, headerStyle: "font-size: 14px; min-width: 200px", style: "font-size: 14px; ", }, @@ -147,7 +151,10 @@ const columns = ref([ align: "left", label: "สถานะ", sortable: true, - field: (row) => statusText(row.draftOrgEmployeeStatus), + field: "statustext", + format(val, row) { + return statusText(row.draftOrgEmployeeStatus); + }, headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -195,6 +202,8 @@ function fetchList() { ...e, profileId: e.id, })); + + rowsMain.value = rows.value; }) .catch((err) => { messageError($q, err); @@ -209,6 +218,14 @@ function closeDialog() { modal.value = false; } +function serchDataTable() { + rows.value = onSearchDataTable( + filter.value, + rowsMain.value, + columns.value ? columns.value : [] + ); +} + /** * ทำเมื่อ modal เป็น true * ทำการเรียก fetchList เพื่อข้อมูลราชชื่อส่งออกคำสั่ง @@ -235,10 +252,10 @@ watch( borderless outlined dense - debounce="300" v-model="filter" ref="filterRef" placeholder="ค้นหา" + @keydown.enter.pervent="serchDataTable" style="max-width: auto" >