ฟิลเตอร์ระบบ บรรจุ

This commit is contained in:
setthawutttty 2024-12-04 13:47:44 +07:00
parent 7ab17d378f
commit 992541eded
20 changed files with 674 additions and 488 deletions

View file

@ -15,7 +15,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
const $q = useQuasar();
const storeCommand = useCommandMainStore();
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai } = mixin;
const { dialogConfirm, date2Thai,onSearchDataTable } = mixin;
const props = defineProps({
Modal: Boolean,
@ -23,8 +23,6 @@ const props = defineProps({
fetchData: Function,
nextPage: Function,
optionsType: Array,
rows2: Array as PropType<PersonData[]>,
filterKeyword2: String,
type: String,
});
const emit = defineEmits([
@ -33,7 +31,10 @@ const emit = defineEmits([
"update:selected",
]);
const rows = ref<PersonData[]>([]); //
const filterKeyword2 = defineModel<string>('filterKeyword2',{required:true})
const rows = defineModel<PersonData[]>('rows',{required:true})
const rowsData = defineModel<PersonData[]>('rowsData',{required:true})
const selected = ref<PersonData[]>([]); //
const dataMapToSend = computed(() => {
return selected.value.map((i: any) => ({
@ -92,6 +93,11 @@ const columns2 = ref<QTableProps["columns"]>([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val, row) => {
return row.firstName
? `${row.prefix}${row.firstName} ${row.lastName}`
: "-";
},
},
{
name: "organizationName",
@ -154,7 +160,7 @@ function clickAddlist() {
/** ฟังก์ชันเลือกประเภทคำสั่ง */
function filterSelectOrder() {
const data = props.rows2 ? props.rows2 : [];
const data = rowsData.value ? rowsData.value : [];
selected.value = [];
rows.value = data.filter((v: PersonData) => {
switch (commandType.value) {
@ -183,6 +189,14 @@ function filterSelector(val: string, update: Function) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword2.value,
rowsData.value,
columns2.value ? columns2.value : []
);
}
/**
* เม props.modal เป true
*
@ -192,7 +206,7 @@ watch(
() => props.Modal,
async () => {
if (props.Modal === true) {
rows.value = props.rows2 ? props.rows2 : [];
rows.value = rowsData.value ? rowsData.value : [];
selected.value = [];
commandType.value = "";
const data = await storeCommand.getCommandTypes();
@ -247,9 +261,9 @@ watch(
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
v-model="filterKeyword2"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -275,7 +289,6 @@ watch(
<d-table
:columns="columns2"
:rows="rows"
:filter="filterKeyword2"
row-key="profileId"
flat
:visible-columns="visibleColumns2"
@ -308,15 +321,6 @@ watch(
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'fullname'">
{{
props.row.firstName
? `${props.row.prefix ?? ""}${
props.row.firstName ?? ""
} ${props.row.lastName ?? ""}`
: "-"
}}
</div>
<!-- <div v-else-if="col.name == 'status'">
{{ props.row.status ? statusText(props.row.status) : "-" }}

View file

@ -19,11 +19,7 @@ const $q = useQuasar();
const storeFn = useTransferDataStore();
const storeCommand = useCommandMainStore();
const { statusText } = storeFn;
const {
dialogConfirm,
date2Thai,
} = useCounterMixin();
const { dialogConfirm, onSearchDataTable, date2Thai } = useCounterMixin();
/**
* props
@ -34,8 +30,6 @@ const props = defineProps({
fetchData: Function,
nextPage: Function,
optionsType: Array,
rows2: Array as PropType<PersonData[]>,
filterKeyword2: String,
type: String,
});
const emit = defineEmits([
@ -44,10 +38,14 @@ const emit = defineEmits([
"update:selected",
]);
const filterKeyword2 = defineModel<string>("filterKeyword2", {
required: true,
});
const rows = defineModel<PersonData[]>("rows", { required: true });
const rowsData = defineModel<PersonData[]>("rowsData", { required: true });
/**
* table
*/
const rows = ref<PersonData[]>([]); //
const selected = ref<PersonData[]>([]); //
const dataMapToSend = computed(() => {
return selected.value.map((i: any) => ({
@ -96,6 +94,11 @@ const columns2 = ref<QTableProps["columns"]>([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (val, row) => {
return row.firstName
? `${row.prefix}${row.firstName} ${row.lastName}`
: "-";
},
},
{
name: "organizationName",
@ -170,7 +173,7 @@ function sendToCommand() {
/** ฟังก์ชันเลือกประเภทคำสั่ง */
function filterSelectOrder() {
const data = props.rows2 ? props.rows2 : [];
const data = rowsData.value;
selected.value = [];
rows.value = data.filter((v: PersonData) => {
switch (commandType.value) {
@ -202,6 +205,14 @@ function filterSelector(val: string, update: Function) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword2.value,
rowsData.value,
columns2.value ? columns2.value : []
);
}
/**
* เม props.modal เป true
* กำหนดให selected เปนคาวาง
@ -210,9 +221,6 @@ watch(
() => props.Modal,
async () => {
if (props.Modal === true) {
rows.value = props.rows2 ? props.rows2 : [];
console.log(rows.value);
selected.value = [];
commandType.value = "";
const data = await storeCommand.getCommandTypes();
@ -267,9 +275,9 @@ watch(
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
v-model="filterKeyword2"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -295,7 +303,6 @@ watch(
<d-table
:columns="columns2"
:rows="rows"
:filter="filterKeyword2"
row-key="profileId"
flat
:visible-columns="visibleColumns2"
@ -329,15 +336,6 @@ watch(
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'fullname'">
{{
props.row.firstName
? `${props.row.prefix ?? ""}${
props.row.firstName ?? ""
} ${props.row.lastName ?? ""}`
: "-"
}}
</div>
<div v-else-if="col.name == 'status'">
{{

View file

@ -16,7 +16,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
/** use*/
const $q = useQuasar();
const { statusText } = useTransferDataStore();
const { dialogConfirm, findOrgNameOld, findPosMasterNoOld, date2Thai } =
const { dialogConfirm, findOrgNameOld, findPosMasterNoOld, date2Thai,onSearchDataTable } =
useCounterMixin();
/** props*/
@ -24,9 +24,12 @@ const props = defineProps({
Modal: Boolean,
closeModal: Function,
getData: Function,
rows2: Array,
filterKeyword2: String,
});
const rows2 = defineModel<any[]>('rows2',{required:true})
const rows2Data = defineModel<any[]>('rows2Data',{required:true})
const filterKeyword2 = defineModel<string>('filterKeyword2',{required:true})
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
/** Table*/
@ -214,6 +217,14 @@ watch(
}
}
);
function onSearch() {
rows2.value= onSearchDataTable(
filterKeyword2.value,
rows2Data.value,
columns2.value? columns2.value: []
);
}
</script>
<template>
@ -230,9 +241,9 @@ watch(
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
v-model="filterKeyword2"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append> <q-icon name="search" /> </template>
</q-input>
@ -256,7 +267,6 @@ watch(
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
class="custom-header-table"
:visible-columns="visibleColumns2"

View file

@ -18,7 +18,7 @@ const $q = useQuasar();
const storeCommand = useCommandMainStore();
const storeFn = useTransferDataStore();
const { statusText } = storeFn;
const { dialogConfirm, date2Thai } = useCounterMixin();
const { dialogConfirm, date2Thai, onSearchDataTable } = useCounterMixin();
/**
* props
@ -29,8 +29,6 @@ const props = defineProps({
resetFilter: Function,
fecthlistOthet: Function,
optionsType: Array,
rows2: Array as PropType<listMain[]>,
filterKeyword2: String,
type: String,
});
const emit = defineEmits([
@ -39,8 +37,12 @@ const emit = defineEmits([
"update:selected",
]);
const filterKeyword2 = defineModel<string>("filterKeyword2", {
required: true,
});
const rows = defineModel<listMain[]>("rows", { required: true });
const rowsData = defineModel<listMain[]>("rowsData", { required: true });
//Table
const rows = ref<listMain[]>([]); //
const selected = ref<listMain[]>([]); //
const dataMapToSend = computed(() => {
return selected.value.map((i: any) => ({
@ -174,6 +176,14 @@ function filterSelector(val: string, update: Function) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword2.value,
rowsData.value,
columns2.value ? columns2.value : []
);
}
/**
* เม props.modal เป tru
* กำหนดให selected เปนคาวาง
@ -182,7 +192,7 @@ watch(
() => props.Modal,
async () => {
if (props.Modal === true) {
rows.value = props.rows2 ? props.rows2 : [];
rows.value = rowsData.value ? rowsData.value : [];
selected.value = [];
commandType.value = "";
const data = await storeCommand.getCommandTypes();
@ -239,9 +249,9 @@ watch(
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
v-model="filterKeyword2"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -266,8 +276,7 @@ watch(
<div class="col-12">
<d-table
:columns="columns2"
:rows="props.rows2"
:filter="filterKeyword2"
:rows="rows"
row-key="profileId"
flat
:visible-columns="visibleColumns2"

View file

@ -21,7 +21,7 @@ const mixin = useCounterMixin();
const route = useRoute();
const DataStore = usePlacementDataStore();
const storeCommand = useCommandMainStore();
const { dialogConfirm, dateText } = mixin;
const { dialogConfirm, dateText,onSearchDataTable } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
/** props */
@ -32,6 +32,7 @@ const props = defineProps({
const examId = route.params.examId;
const rows = ref<any[]>([]);
const rowsData = ref<any[]>([]);
const commandType = ref<string>("");
const commandOp = ref<ListCommand[]>([]);
const listCommand = ref<ListCommand[]>([]); //
@ -175,6 +176,7 @@ function filterSelectOrder() {
const data = props.rows ? props.rows : [];
selected.value = [];
rows.value = data;
rowsData.value = data;
}
/** ปิด Modal และล้างค่าที่เลือก */
@ -182,6 +184,16 @@ function closeModal() {
modal.value = false;
commandType.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* เม props.modal เป true
* กำหนดให selected เปนคาวางและกำหนด filter ประเภทตำแหนงตามประเภทการสอบ
@ -191,6 +203,7 @@ watch(
async () => {
if (modal.value === true) {
rows.value = props.rows ? props.rows : [];
rowsData.value = props.rows ? props.rows : [];
selected.value = [];
commandType.value = "";
filter.value = "";
@ -259,6 +272,7 @@ watch(
v-model="filter"
placeholder="ค้นหา"
style="width: 200px; max-width: auto"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -289,7 +303,6 @@ watch(
<d-table
:columns="columns"
:rows="rows"
:filter="filter"
row-key="personalId"
:visible-columns="visibleColumns"
selection="multiple"

View file

@ -36,6 +36,7 @@ const {
success,
dialogConfirm,
date2Thai,
onSearchDataTable
} = mixin;
/** รับค่ามาจากหน้าหลัก */
@ -63,6 +64,7 @@ const filter = ref<string>("");
const Name = ref<string>();
const rowsAll = ref<any>([]);
const rows = ref<any[]>([]);
const rowsData = ref<any[]>([]);
const rowsAwait = ref<any[]>([]);
const rowsFilter = ref<any>([]);
const rowsOrder = ref<any[]>([]);
@ -828,6 +830,14 @@ function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsAwait.value,
columns.value ? columns.value : []
);
}
onMounted(async () => {
await getWorkFlow();
await getTable();
@ -840,7 +850,6 @@ onMounted(async () => {
:contain-status="containStatus"
:rows="rows"
:columns="columns"
:filter="filter"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
@ -849,6 +858,7 @@ onMounted(async () => {
@update-modaladdlist="handleModalAddListUpdate"
@update-modaladdSendPerson="openModalOrder"
@update-new-Rows="onUpdateNewRows"
:onSearch="onSearch"
:history="true"
:boss="true"
:saveNoDraft="true"

View file

@ -77,6 +77,10 @@ const props = defineProps({
type: Function,
default: () => console.log("not function"),
},
onSearch: {
type: Function,
default: () => console.log("not function"),
},
edit: {
type: Function,
default: () => console.log("not function"),
@ -238,6 +242,7 @@ function onUpdateNewRows() {
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />

View file

@ -29,8 +29,13 @@ const dataMapToSend = computed(() => {
}));
});
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai } = mixin;
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
const rows = defineModel<any[]>("rows", { required: true });
const rowsData = defineModel<any[]>("rowsData", { required: true });
const filterKeyword2 = defineModel<string>("filterKeyword2", {
required: true,
});
/**
* props
*/
@ -39,8 +44,6 @@ const props = defineProps({
clickClose: Function,
fecthlistRecevice: Function,
nextPage: Function,
rows2: Array,
filterKeyword2: String,
});
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
@ -158,6 +161,14 @@ function onReset() {
emit("update:filterKeyword2", "");
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword2.value,
rowsData.value,
columns2.value ? columns2.value : []
);
}
/**
* เม props.modal เป true
* กำหนดให selected เปนคาวาง
@ -186,6 +197,7 @@ watchEffect(() => {
:model-value="filterKeyword2"
@update:model-value="updateInput"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -216,8 +228,7 @@ watchEffect(() => {
<div class="col-12">
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
:rows="rows"
row-key="id"
flat
:visible-columns="visibleColumns2"

View file

@ -16,17 +16,21 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
const $q = useQuasar();
const { statusText } = useTransferDataStore();
const mixin = useCounterMixin();
const { dialogConfirm, findPosMasterNoOld, date2Thai } = mixin;
const { dialogConfirm, findPosMasterNoOld, date2Thai, onSearchDataTable } =
mixin;
/** props*/
const props = defineProps({
Modal: Boolean,
closeModal: Function,
getData: Function,
rows2: Array,
filterKeyword2: String,
});
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const rows = defineModel<any[]>("rows", { required: true });
const rowsData = defineModel<any[]>("rowsData", { required: true });
const filterKeyword2 = defineModel<string>("filterKeyword2", {
required: true,
});
//table
const selected = ref<officerType[]>([]);
@ -167,17 +171,12 @@ function saveOrder() {
);
}
/**
* ปเดทค filter
* @param value คำคนหา
*/
function updateInput(value: string | number | null) {
emit("update:filterKeyword2", value);
}
/** รีเซ็ตค่าในช่องค้นหา*/
function Reset() {
emit("update:filterKeyword2", "");
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword2.value,
rowsData.value,
columns2.value ? columns2.value : []
);
}
watch(
@ -203,9 +202,9 @@ watch(
outlined
dense
debounce="300"
:model-value="filterKeyword2"
@update:model-value="updateInput"
v-model="filterKeyword2"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -229,8 +228,7 @@ watch(
<div class="col-12">
<d-table
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
:rows="rows"
row-key="id"
class="custom-header-table"
:visible-columns="visibleColumns2"

View file

@ -14,16 +14,17 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
const $q = useQuasar();
const mixin = useCounterMixin();
const { statusText } = useTransferDataStore();
const { dialogConfirm, date2Thai } = mixin;
const { dialogConfirm, date2Thai,onSearchDataTable } = mixin;
const modal = defineModel<boolean>("modal", { required: true });
/** props */
const props = defineProps({
closeModal: Function,
fetchData: Function,
rows: Array,
});
const rows = defineModel<any[]>('rows',{required:true})
const rowsData = defineModel<any[]>('rowsData',{required:true})
const modalCommand = ref<boolean>(false); //- modal
//Table
const selected = ref<ResponseData[]>([]); //
@ -140,6 +141,14 @@ function saveOrder() {
);
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns2.value ? columns2.value : []
);
}
/**
* เม props.modal เป true
* กำหนดให selected เปนคาวาง
@ -170,6 +179,7 @@ watch(
debounce="300"
v-model="filter"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -201,7 +211,6 @@ watch(
<d-table
:columns="columns2"
:rows="rows"
:filter="filter"
row-key="id"
:visible-columns="visibleColumns2"
selection="multiple"

View file

@ -17,7 +17,7 @@ import config from "@/app.config";
const DataStore = usePlacementDataStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { showLoader, hideLoader, messageError, date2Thai,onSearchDataTable } = mixin;
const searchYear = ref();
const yearOptions = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
@ -26,6 +26,7 @@ const yearOptionsFn = ref<any>([]);
/**ข้อมูลตาราง (จำลอง)*/
const rows = ref<QTableProps["rows"]>([]);
const rowsData = ref<any[]>([]);
/** ค้นหาในตาราง */
const filterKeyword = ref<string>("");
@ -164,7 +165,8 @@ async function fetchPlacementData(val: number) {
const data = await res.data.result;
dataPlacement.value = data;
DataStore.DataMainOrig = dataPlacement.value;
rows.value = DataStore.DataMainOrig.map((e: any) => ({
const listData =
DataStore.DataMainOrig.map((e: any) => ({
id: e.id,
examRound: e.examRound,
examOrder: e.examOrder,
@ -176,6 +178,8 @@ async function fetchPlacementData(val: number) {
fiscalYear: e.fiscalYear,
numberOfCandidates: e.numberOfCandidates,
}));
rows.value = listData
rowsData.value = listData
filterKeyword.value = "";
examTime.value = "ทั้งหมด";
examType.value = "ทั้งหมด";
@ -374,6 +378,14 @@ function paginationLabel(start: number, end: number, total: number) {
else return start + "-" + end + " ใน " + total;
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* เรยกใชงช เมอเรมหนาน
*/
@ -428,6 +440,7 @@ onMounted(async () => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -540,7 +553,6 @@ onMounted(async () => {
ref="table"
:rows="rows"
:columns="columns"
:filter="filterKeyword"
row-key="id"
flat
bordered

View file

@ -27,6 +27,7 @@ const dataTransfer = ref<ResponseData[]>([]); //ช่อมูลรายก
const rows = ref<ResponseData[]>([]); //
const filterMain = ref<string>(""); //
const rowsOrder = ref<ResponseData[]>([]); //
const rowsOrderData = ref<ResponseData[]>([]); //
const filterOrder = ref<string>(""); //
const columns = ref<QTableProps["columns"]>([
{
@ -154,6 +155,7 @@ function openModalOrder() {
r.date
);
rowsOrder.value = row;
rowsOrderData.value = row;
modal.value = true;
}
@ -328,7 +330,8 @@ const filterAndApply = () => {
v-model:filter-order="filterOrder"
:fetch-data="fetchData"
:close-modal="closeModal"
:rows="rowsOrder"
v-model:rows="rowsOrder"
v-model:rowsData="rowsOrderData"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -31,6 +31,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = mixin;
const dataRecevice = ref<ResponseData[]>([]); //
@ -52,7 +53,9 @@ const type = ref<string | null>(null);
//Table
const rows = ref<ResponseRow[]>([]); //
const rowsData = ref<ResponseRow[]>([]); //
const rows2 = ref<ResponseRow[]>([]); //
const rows2Data = ref<ResponseRow[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -157,6 +160,7 @@ async function fecthlistRecevice() {
const data = await res.data.result;
dataRecevice.value = data;
rows.value = data;
rowsData.value = data;
filters.value = data;
})
.catch((e) => {
@ -227,7 +231,6 @@ function openModalTree(id: string, data: any) {
dataRows.value = data;
modalTree.value = true;
type.value = null;
dataRows.value = data;
posType.value = data.posTypeOldId;
posLevel.value = data.posLevelOldId;
position.value = data.positionOld;
@ -292,6 +295,7 @@ function openModalOrder() {
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -328,6 +332,15 @@ async function onSave(data: any) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -372,6 +385,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -403,7 +417,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -610,7 +623,8 @@ onMounted(() => {
v-model:modal="modal"
v-model:filter-keyword2="filterKeyword2"
:click-close="clickClose"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
:fecthlist-recevice="fecthlistRecevice"
:next-page="nextPage"
/>

View file

@ -34,6 +34,7 @@ const {
dialogRemove,
findOrgNameOld,
findPosMasterNoOld,
onSearchDataTable
} = mixin;
/**
@ -44,7 +45,9 @@ const modal = ref<boolean>(false); //แสดง popup ส่งไปออก
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const rows = ref<officerType[]>([]); //
const rowsData = ref<officerType[]>([]); //
const rows2 = ref<officerType[]>([]); //
const rows2Data = ref<officerType[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -192,6 +195,7 @@ async function getData() {
.then(async (res) => {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -246,6 +250,7 @@ function openModalOrder() {
item.dateEnd
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -265,6 +270,14 @@ function resetFilter() {
filterKeyword2.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -300,6 +313,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -326,7 +340,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -406,7 +419,8 @@ onMounted(() => {
v-model:filter-keyword2="filterKeyword2"
:get-data="getData"
:close-modal="closeModal"
:rows2="rows2"
v-model:rows2="rows2"
v-model:rows2Data="rows2Data"
/>
</template>
<style scoped lang="scss"></style>

View file

@ -27,6 +27,7 @@ const {
success,
dialogRemove,
findPosMasterNoOld,
onSearchDataTable
} = useCounterMixin();
const modal = ref<boolean>(false); //
@ -35,7 +36,9 @@ const modal = ref<boolean>(false); // ส่งไปออกคำสั่
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const rows = ref<officerType[]>([]); //
const rowsData = ref<officerType[]>([]); //
const rows2 = ref<officerType[]>([]); //
const rows2Data = ref<officerType[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -157,6 +160,7 @@ async function getData() {
.then(async (res) => {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -206,6 +210,7 @@ function openModalOrder() {
);
rows2.value = row;
rows2Data.value = row;
modal.value = true;
}
@ -225,6 +230,14 @@ function resetFilter() {
filterKeyword2.value = "";
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/**
* ทำงานเมอมการเรยกใช Components
*/
@ -260,6 +273,7 @@ onMounted(async () => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -285,7 +299,6 @@ onMounted(async () => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
>
@ -362,7 +375,8 @@ onMounted(async () => {
v-model:filter-keyword2="filterKeyword2"
:get-data="getData"
:close-modal="closeModal"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
/>
</template>

View file

@ -30,6 +30,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = useCounterMixin();
const modal = ref<boolean>(false); // popup
@ -48,7 +49,9 @@ const type = ref<string>("");
//table
const rows = ref<PersonData[]>([]); //--
const rowsData = ref<PersonData[]>([]); //--
const rows2 = ref<PersonData[]>([]); //
const rows2Data = ref<PersonData[]>([]); //
const filterKeyword = ref<string>(""); //--
const filterKeyword2 = ref<string>(""); //
const columns = ref<QTableProps["columns"]>([
@ -167,8 +170,10 @@ async function fecthlistappointment() {
let response = res.data.result;
listRecevice.value = response;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData =
rows.value.filter(
(e: any) =>
e.root !== null &&
e.status !== "REPORT" &&
@ -180,6 +185,8 @@ async function fecthlistappointment() {
e.positionNumberOld &&
e.positionDate
);
rows2.value = listData
rows2Data.value = listData
})
.catch((e) => {
messageError($q, e);
@ -277,6 +284,14 @@ function clickClose() {
modal.value = false;
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
/** ทำงานเมื่อมีการเรียกใช้ Components*/
onMounted(() => {
fecthlistappointment();
@ -313,6 +328,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -339,7 +355,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="citizenId"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -553,7 +568,8 @@ onMounted(() => {
:options-type="optionsType"
:next-page="nextPage"
:fetch-data="fecthlistappointment"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
/>
<DialogOrgSelect

View file

@ -29,6 +29,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable
} = mixin;
const personalId = ref<string>("");
@ -47,7 +48,9 @@ const type = ref<string>("");
// Table
const rows = ref<PersonData[]>([]); //
const rowsData = ref<PersonData[]>([]); //
const rows2 = ref<PersonData[]>([]); //
const rows2Data = ref<PersonData[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -168,9 +171,11 @@ async function fecthlistappointment() {
let response = await res.data.result;
listRecevice.value = response;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData =
rows.value.filter(
(e: any) =>
e.root !== null &&
e.status !== "REPORT" &&
@ -182,6 +187,8 @@ async function fecthlistappointment() {
e.positionNumberOld &&
e.positionDate
);
rows2.value = listData
rows2Data.value = listData
})
.catch((e) => {
messageError($q, e);
@ -288,6 +295,14 @@ function onSave(data: any) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(() => {
fecthlistappointment();
});
@ -323,6 +338,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -349,7 +365,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="citizenId"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -534,7 +549,8 @@ onMounted(() => {
:options-type="optionsType"
:next-page="nextPage"
:fetch-data="fecthlistappointment"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
/>
<DialogOrgSelectEmployee

View file

@ -28,6 +28,7 @@ const {
messageError,
date2Thai,
dialogRemove,
onSearchDataTable,
} = useCounterMixin();
const modal = ref<boolean>(false);
@ -36,7 +37,9 @@ const modal = ref<boolean>(false);
* Table
*/
const rows = ref<listMain[]>([]); //
const rowsData = ref<listMain[]>([]); //
const rows2 = ref<listMain[]>([]); //
const rows2Data = ref<listMain[]>([]); //
const filterKeyword = ref<string>(""); //
const filterKeyword2 = ref<string>(""); //
const visibleColumns = ref<string[]>([
@ -138,8 +141,9 @@ async function fecthlistOthet() {
.then((res) => {
let response = res.data.result;
rows.value = response;
rowsData.value = response;
//
rows2.value = rows.value.filter(
const listData = rows.value.filter(
(e: listMain) =>
e.status !== "REPORT" &&
e.status !== "DONE" &&
@ -150,6 +154,8 @@ async function fecthlistOthet() {
e.positionDate &&
e.leaveDate !== null
);
rows2.value = listData;
rows2Data.value = listData;
})
.catch((e) => {
messageError($q, e);
@ -206,6 +212,14 @@ function nextPage(id: string) {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(() => {
fecthlistOthet();
});
@ -237,6 +251,7 @@ onMounted(() => {
outlined
debounce="300"
placeholder="ค้นหา"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon name="search" />
@ -262,7 +277,6 @@ onMounted(() => {
<d-table
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="id"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
@ -338,7 +352,8 @@ onMounted(() => {
v-model:Modal="modal"
v-model:filter-keyword2="filterKeyword2"
:click-close="clickClose"
:rows2="rows2"
v-model:rows="rows2"
v-model:rowsData="rows2Data"
:fecthlistOthet="fecthlistOthet"
/>
</template>