fix: wrong id
This commit is contained in:
parent
b2617a924f
commit
bd676cc711
2 changed files with 19 additions and 5 deletions
|
|
@ -62,7 +62,6 @@ const prop = withDefaults(
|
|||
defineProps<{
|
||||
color?: 'purple' | 'green';
|
||||
|
||||
customerId: string;
|
||||
customerType: CustomerType;
|
||||
}>(),
|
||||
{
|
||||
|
|
@ -70,6 +69,8 @@ const prop = withDefaults(
|
|||
},
|
||||
);
|
||||
|
||||
const customerId = defineModel<string>('customerId', { required: true });
|
||||
|
||||
defineEmits<{
|
||||
(e: 'back'): void;
|
||||
(e: 'viewDetail', branch: CustomerBranch, index: number): void;
|
||||
|
|
@ -136,8 +137,10 @@ const branchFieldSelected = ref<
|
|||
>(fieldDisplay.value);
|
||||
|
||||
async function fetchList() {
|
||||
if (!customerId.value) return;
|
||||
|
||||
const result = await fetchListCustomeBranch({
|
||||
customerId: prop.customerId,
|
||||
customerId: customerId.value,
|
||||
query: !!inputSearch.value ? inputSearch.value : undefined,
|
||||
page: currentPageBranch.value,
|
||||
pageSize: pageSizeBranch.value,
|
||||
|
|
@ -165,7 +168,7 @@ onMounted(async () => {
|
|||
await fetchList();
|
||||
});
|
||||
|
||||
watch([inputSearch, currentStatus], async () => {
|
||||
watch([customerId, inputSearch, currentStatus], async () => {
|
||||
await fetchList();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -227,7 +230,7 @@ watch([inputSearch, currentStatus], async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row items-center justify-end col-12 col-sm q-py-sm no-wrap">
|
||||
<div class="row items-center justify-end col-12 col-md q-py-sm no-wrap">
|
||||
<q-input
|
||||
lazy-rules="ondemand"
|
||||
outlined
|
||||
|
|
@ -441,8 +444,19 @@ watch([inputSearch, currentStatus], async () => {
|
|||
}
|
||||
"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
label="test"
|
||||
size="sm"
|
||||
dense
|
||||
round
|
||||
flat
|
||||
@click="() => {}"
|
||||
/>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
||||
<q-tr>asdadadasd</q-tr>
|
||||
</template>
|
||||
<template #item="props">
|
||||
<div class="col-12 col-md-6">
|
||||
|
|
|
|||
|
|
@ -1853,7 +1853,7 @@ const emptyCreateDialog = ref(false);
|
|||
>
|
||||
<BranchPage
|
||||
v-if="currentCustomer"
|
||||
:customer-id="currentCustomer.id"
|
||||
v-model:customer-id="currentCustomer.id"
|
||||
:customer-type="currentCustomer.customerType"
|
||||
v-model:mode-view="gridView"
|
||||
@back="$router.push('/customer-management')"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue