ฟิลเตอร์วินัย ออกคำสั่ง
This commit is contained in:
parent
68e241693a
commit
5528e68bc1
6 changed files with 272 additions and 38 deletions
|
|
@ -157,6 +157,12 @@ const dateEndInputStyle = computed(() => {
|
|||
return isInNext7Days ? "input-alert" : "";
|
||||
}
|
||||
});
|
||||
|
||||
const option = ref<any[]>(mainStore.statusResultOptions);
|
||||
const optionOrganization = ref<any[]>(organizationOption.value);
|
||||
const optionFaultLevel = ref<any[]>(investigateDis.optionsfaultLevel);
|
||||
const optionCauseText = ref<any[]>(investigateDis.causeTextOptions);
|
||||
|
||||
/** เปิด dialog */
|
||||
function popup() {
|
||||
modal.value = true;
|
||||
|
|
@ -679,13 +685,12 @@ function deletePerson(id: string) {
|
|||
}
|
||||
|
||||
|
||||
const option = ref<any[]>(mainStore.statusResultOptions);
|
||||
/**
|
||||
* function ค้นหาข้อมูลใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
*/
|
||||
function filterOptionFn(val: string, update: Function) {
|
||||
function filterOptionFn(val: string, update: Function) {
|
||||
update(() => {
|
||||
option.value = mainStore.statusResultOptions.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
|
|
@ -693,6 +698,48 @@ const option = ref<any[]>(mainStore.statusResultOptions);
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* function ค้นหาข้อมูลใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
*/
|
||||
function filterOptionFnOrganization(val: string, update: Function) {
|
||||
update(() => {
|
||||
optionOrganization.value = organizationOption.value.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* function ค้นหาข้อมูลใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
*/
|
||||
function filterOptionFnFaultLevel(val: string, update: Function) {
|
||||
update(() => {
|
||||
optionFaultLevel.value = investigateDis.optionsfaultLevel.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* function ค้นหาข้อมูลใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
*/
|
||||
function filterOptionFnCauseText(val: string, update: Function) {
|
||||
update(() => {
|
||||
optionCauseText.value = investigateDis.causeTextOptions.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
mainStore.rowsAdd = [];
|
||||
|
|
@ -772,10 +819,19 @@ onMounted(async () => {
|
|||
option-value="id"
|
||||
map-options
|
||||
v-model="organization"
|
||||
:options="organizationOption"
|
||||
:options="optionOrganization"
|
||||
label="หน่วยงานที่ถูกร้องเรียน"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
use-input
|
||||
@filter="filterOptionFnOrganization"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-4"
|
||||
|
|
@ -1565,13 +1621,21 @@ onMounted(async () => {
|
|||
emit-value
|
||||
map-options
|
||||
hide-bottom-space
|
||||
:options="investigateDis.optionsfaultLevel"
|
||||
:options="optionFaultLevel"
|
||||
label="ระดับโทษความผิด"
|
||||
group-label="group"
|
||||
group-values="options"
|
||||
clearable
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
use-input
|
||||
@filter="filterOptionFnFaultLevel"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div
|
||||
|
|
@ -1721,13 +1785,14 @@ onMounted(async () => {
|
|||
dense
|
||||
ref="disciplinaryCauseTextRef"
|
||||
v-model="formData.disciplinaryCauseText"
|
||||
:options="investigateDis.causeTextOptions"
|
||||
:options="optionCauseText"
|
||||
label="ร้ายแรง/ไม่ร้ายแรง"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@filter="filterOptionFnCauseText"
|
||||
clearable
|
||||
@update:model-value="changeFormData()"
|
||||
><template v-slot:no-option>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue