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

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"