feat: fetchListById และ byค่า
This commit is contained in:
parent
817d70a593
commit
a96161ffc2
1 changed files with 19 additions and 1 deletions
|
|
@ -2,17 +2,30 @@
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import AppBox from 'components/app/AppBox.vue';
|
import AppBox from 'components/app/AppBox.vue';
|
||||||
import BranchCardCustomer from 'components/03_customer-management/BranchCardCustomer.vue';
|
import BranchCardCustomer from 'components/03_customer-management/BranchCardCustomer.vue';
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
import useCustomerStore from 'src/stores/customer';
|
||||||
|
import { CustomerBranch } from 'src/stores/customer/types';
|
||||||
|
|
||||||
|
const userCustomer = useCustomerStore();
|
||||||
|
const { fetchListById } = userCustomer;
|
||||||
|
|
||||||
const inputSearch = ref<string>('');
|
const inputSearch = ref<string>('');
|
||||||
|
const branch = ref<CustomerBranch[]>();
|
||||||
|
|
||||||
withDefaults(
|
const prop = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
color: 'purple' | 'green';
|
color: 'purple' | 'green';
|
||||||
|
customerId: string;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
color: 'green',
|
color: 'green',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
const result = await fetchListById(prop.customerId);
|
||||||
|
if (result) branch.value = result.branch;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -110,10 +123,15 @@ withDefaults(
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row q-pa-lg q-col-gutter-xl">
|
<div class="row q-pa-lg q-col-gutter-xl">
|
||||||
|
<<<<<<< HEAD
|
||||||
<div v-for="i in 2" class="col-4">
|
<div v-for="i in 2" class="col-4">
|
||||||
<BranchCardCustomer
|
<BranchCardCustomer
|
||||||
@view-detail="$emit('viewDetail')"
|
@view-detail="$emit('viewDetail')"
|
||||||
></BranchCardCustomer>
|
></BranchCardCustomer>
|
||||||
|
=======
|
||||||
|
<div v-for="(br, i) in branch" class="col-4" :key="i">
|
||||||
|
<BranchCardCustomer :data="br"></BranchCardCustomer>
|
||||||
|
>>>>>>> 10383c3 (feat: fetchListById และ byค่า)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AppBox>
|
</AppBox>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue