fix: คำนวนหน้าผิด
This commit is contained in:
parent
dc2507d5a6
commit
069dcce9b6
1 changed files with 5 additions and 7 deletions
|
|
@ -4,15 +4,11 @@ import AppBox from 'components/app/AppBox.vue';
|
|||
import BranchCardCustomer from 'components/03_customer-management/BranchCardCustomer.vue';
|
||||
import { onMounted } from 'vue';
|
||||
import useCustomerStore from 'src/stores/customer';
|
||||
import {
|
||||
CustomerBranch,
|
||||
Customer,
|
||||
CustomerType,
|
||||
} from 'src/stores/customer/types';
|
||||
import { CustomerBranch, CustomerType } from 'src/stores/customer/types';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const userCustomer = useCustomerStore();
|
||||
const { fetchListById, fetchListBranch } = userCustomer;
|
||||
const { fetchListBranch } = userCustomer;
|
||||
|
||||
const inputSearch = ref<string>('');
|
||||
|
||||
|
|
@ -63,19 +59,21 @@ onMounted(async () => {
|
|||
});
|
||||
if (result) {
|
||||
currentCustomerName.value = 'dasd';
|
||||
|
||||
maxPageBranch.value = Math.ceil(result.total / pageSizeBranch.value);
|
||||
branch.value = result.result;
|
||||
}
|
||||
});
|
||||
|
||||
watch(currentPageBranch, async () => {
|
||||
const resultList = await fetchListBranch({
|
||||
customerId: prop.customerId,
|
||||
page: currentPageBranch.value,
|
||||
pageSize: pageSizeBranch.value,
|
||||
});
|
||||
|
||||
if (resultList) {
|
||||
currentPageBranch.value = resultList.page;
|
||||
|
||||
maxPageBranch.value = Math.ceil(resultList.total / pageSizeBranch.value);
|
||||
branch.value = resultList.result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue