ออกคำสั่ง === fix filter

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-02 17:02:54 +07:00
parent 8ede2c6d09
commit 810115eb41
13 changed files with 227 additions and 2517 deletions

View file

@ -76,7 +76,6 @@ function onSubmit() {
*/
function filterSelector(val: string, update: Function) {
update(() => {
commandType.value = val ? "" : commandType.value;
commandOp.value = listCommand.value.filter(
(v: any) => v.name.indexOf(val) > -1
);
@ -90,6 +89,7 @@ function filterSelector(val: string, update: Function) {
function onClose() {
modal.value = false;
commandNo.value = "";
commandType.value = "";
commandYear.value = new Date().getFullYear();
}
@ -129,10 +129,12 @@ watch(modal, () => {
option-value="id"
lazy-rules
use-input
hide-selected
fill-input
hide-bottom-space
outlined
:rules="[(val:string) => !!val || `${'กรุณาเลือกประเภทคำสั่ง'}`]"
@filter="(inputValue:any,
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn) "
>
<template v-slot:no-option>

View file

@ -35,72 +35,6 @@ const props = defineProps({
fetchList: { type: Function, required: true },
});
const columns = ref<QTableProps["columns"]>([
{
name: "commandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: false,
field: "commandNo",
format(val, row) {
return val ? `${val}/${row.commandYear + 543}` : "-";
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "issue",
align: "left",
label: "ชื่อคำสั่ง",
sortable: true,
field: "issue",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "commandAffectDate",
align: "left",
label: "วันที่ลงนาม",
sortable: false,
field: "commandAffectDate",
format(val) {
return val ? date2Thai(val) : "-";
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "commandExcecuteDate",
align: "left",
label: "วันที่คำสั่งมีผล",
sortable: false,
field: "commandExcecuteDate",
format(val) {
return val ? date2Thai(val) : "-";
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "createdFullName",
align: "left",
label: "ผู้สร้าง",
sortable: false,
field: "createdFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "assignFullName",
align: "left",
label: "ผู้ลงนาม",
sortable: false,
field: "assignFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const modalCopy = ref<boolean>(false);
const isCheckPageSize = ref<boolean>(false);
const commandId = ref<string>("");
@ -208,7 +142,8 @@ onMounted(() => {
<template>
<d-table
ref="table"
:columns="columns"
:columns="store.columns"
:visible-columns="store.visibleColumns"
:rows="store.rows"
row-key="id"
flat