fix(03): br id select
This commit is contained in:
parent
c6f2dc216d
commit
75a8e43a22
2 changed files with 21 additions and 13 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { QSelect } from 'quasar';
|
||||||
import { getRole } from 'src/services/keycloak';
|
import { getRole } from 'src/services/keycloak';
|
||||||
import { CustomerBranch } from 'src/stores/customer/types';
|
import { CustomerBranch } from 'src/stores/customer/types';
|
||||||
import { selectFilterOptionRefMod } from 'src/stores/utils';
|
import { selectFilterOptionRefMod } from 'src/stores/utils';
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
|
|
||||||
const personName = defineModel<string>('personName');
|
const personName = defineModel<string>('personName');
|
||||||
const customerName = defineModel<string>('customerName');
|
const customerName = defineModel<string>('customerName');
|
||||||
|
|
@ -16,6 +17,7 @@ const taxNo = defineModel<string | null | undefined>('taxNo');
|
||||||
|
|
||||||
const employerID = defineModel<string>('employerID');
|
const employerID = defineModel<string>('employerID');
|
||||||
const slash = ref<string>('-');
|
const slash = ref<string>('-');
|
||||||
|
|
||||||
// employee
|
// employee
|
||||||
const customerBranch = defineModel<{
|
const customerBranch = defineModel<{
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -44,12 +46,22 @@ defineEmits<{
|
||||||
(e: 'filterOwnerBranch', val: string, update: void): void;
|
(e: 'filterOwnerBranch', val: string, update: void): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const branchOptions = ref<Record<string, unknown>[]>([]);
|
watch(
|
||||||
const branchFilter = selectFilterOptionRefMod(
|
() => optionsBranch.value,
|
||||||
optionsBranch,
|
() => {
|
||||||
branchOptions,
|
branchFilter = selectFilterOptionRefMod(
|
||||||
'name',
|
optionsBranch,
|
||||||
|
branchOptions,
|
||||||
|
'name',
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const branchOptions = ref<Record<string, unknown>[]>([]);
|
||||||
|
let branchFilter: (
|
||||||
|
value: string,
|
||||||
|
update: (callbackFn: () => void, afterFn?: (ref: QSelect) => void) => void,
|
||||||
|
) => void;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -2133,7 +2133,8 @@ watch(isMainPage, () => {
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
@click.stop="
|
@click.stop="
|
||||||
() => {
|
async () => {
|
||||||
|
await fetchListOfOptionBranch();
|
||||||
const { branch, ...payload } = props.row;
|
const { branch, ...payload } = props.row;
|
||||||
currentCustomer = payload;
|
currentCustomer = payload;
|
||||||
|
|
||||||
|
|
@ -2928,19 +2929,14 @@ watch(isMainPage, () => {
|
||||||
"
|
"
|
||||||
@viewDetail="
|
@viewDetail="
|
||||||
async (v, i) => {
|
async (v, i) => {
|
||||||
|
await fetchListOfOptionBranch();
|
||||||
currentBranchId = v.id;
|
currentBranchId = v.id;
|
||||||
|
|
||||||
statusToggle = v.status === 'INACTIVE' ? false : true;
|
statusToggle = v.status === 'INACTIVE' ? false : true;
|
||||||
|
|
||||||
currentBranch = {
|
currentBranch = {
|
||||||
name: v.name,
|
name: v.name,
|
||||||
code: v.code,
|
code: v.code,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (currentCustomer) assignFormData(currentCustomer.id, v, i);
|
if (currentCustomer) assignFormData(currentCustomer.id, v, i);
|
||||||
|
|
||||||
await fetchListOfOptionBranch();
|
|
||||||
|
|
||||||
infoDrawerBranch = true;
|
infoDrawerBranch = true;
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue