ฟิลเตอร์ระบบ บรรจุ
This commit is contained in:
parent
7ab17d378f
commit
992541eded
20 changed files with 674 additions and 488 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue