เพิ่ม filter typeOrder
This commit is contained in:
parent
04ce570654
commit
c22e028890
1 changed files with 24 additions and 0 deletions
|
|
@ -112,6 +112,10 @@ const conclusionFireNo = ref<string>("");
|
|||
const conclusionFireDate = ref<Date>(new Date());
|
||||
const conclusionFireResolution = ref<string>("");
|
||||
|
||||
const typeOrderFilter = ref<any>({
|
||||
typeOrderOption: [],
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
if (orderId) {
|
||||
fecthTypeOption("hasData");
|
||||
|
|
@ -149,6 +153,13 @@ const fecthTypeOption = async (actions: string) => {
|
|||
commandCode: e.commandCode,
|
||||
fullname: e.commandCode + " " + e.name,
|
||||
}));
|
||||
typeOrderFilter.value = res.data.result.map((e: OrederResult) => ({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
category: e.category,
|
||||
commandCode: e.commandCode,
|
||||
fullname: e.commandCode + " " + e.name,
|
||||
}));
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -598,6 +609,14 @@ const clickSavelist = () => {
|
|||
} else dialogMessageNotify($q, "โปรดเลือกรายชื่อ");
|
||||
};
|
||||
|
||||
const filterSelector = (val: any, update: Function, fullname: any) => {
|
||||
update(() => {
|
||||
typeOrderOption.value = typeOrderFilter.value.filter(
|
||||
(v: any) => v.fullname.toLowerCase().indexOf(val.toLowerCase()) > -1
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
* @param val ข้อมูล input สำหรับแก้ไขหรือไม่
|
||||
|
|
@ -631,6 +650,9 @@ const getClass = (val: boolean) => {
|
|||
use-input
|
||||
input-debounce="0"
|
||||
@update:model-value="selectCMP(typeOrder)"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'typeOrderOption'
|
||||
) "
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
|
|
@ -819,6 +841,8 @@ const getClass = (val: boolean) => {
|
|||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
{{ typeOrder }}
|
||||
{{ typeOrder.commandCode }}
|
||||
<div class="col-12 q-mb-md" v-if="typeOrder.commandCode">
|
||||
<q-separator />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue