fix(03): br id select

This commit is contained in:
puriphatt 2024-07-30 10:42:24 +00:00
parent c6f2dc216d
commit 75a8e43a22
2 changed files with 21 additions and 13 deletions

View file

@ -1,8 +1,9 @@
<script setup lang="ts">
import { QSelect } from 'quasar';
import { getRole } from 'src/services/keycloak';
import { CustomerBranch } from 'src/stores/customer/types';
import { selectFilterOptionRefMod } from 'src/stores/utils';
import { ref } from 'vue';
import { onMounted, ref, watch } from 'vue';
const personName = defineModel<string>('personName');
const customerName = defineModel<string>('customerName');
@ -16,6 +17,7 @@ const taxNo = defineModel<string | null | undefined>('taxNo');
const employerID = defineModel<string>('employerID');
const slash = ref<string>('-');
// employee
const customerBranch = defineModel<{
id: string;
@ -44,12 +46,22 @@ defineEmits<{
(e: 'filterOwnerBranch', val: string, update: void): void;
}>();
const branchOptions = ref<Record<string, unknown>[]>([]);
const branchFilter = selectFilterOptionRefMod(
optionsBranch,
branchOptions,
'name',
watch(
() => optionsBranch.value,
() => {
branchFilter = selectFilterOptionRefMod(
optionsBranch,
branchOptions,
'name',
);
},
);
const branchOptions = ref<Record<string, unknown>[]>([]);
let branchFilter: (
value: string,
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
) => void;
</script>
<template>

View file

@ -2133,7 +2133,8 @@ watch(isMainPage, () => {
round
flat
@click.stop="
() => {
async () => {
await fetchListOfOptionBranch();
const { branch, ...payload } = props.row;
currentCustomer = payload;
@ -2928,19 +2929,14 @@ watch(isMainPage, () => {
"
@viewDetail="
async (v, i) => {
await fetchListOfOptionBranch();
currentBranchId = v.id;
statusToggle = v.status === 'INACTIVE' ? false : true;
currentBranch = {
name: v.name,
code: v.code,
};
if (currentCustomer) assignFormData(currentCustomer.id, v, i);
await fetchListOfOptionBranch();
infoDrawerBranch = true;
}
"