refactor: set page Size
This commit is contained in:
parent
7cb55879f8
commit
829a5d8221
2 changed files with 13 additions and 4 deletions
|
|
@ -213,8 +213,10 @@ function openEmployerBranchForm(formType: 'create' | 'edit' | 'info') {
|
||||||
customerBranchFormState.value.dialogModal = true;
|
customerBranchFormState.value.dialogModal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchEmployee(branchId: string) {
|
async function fetchEmployee(opts: { branchId: string; pageSize?: number }) {
|
||||||
const res = await fetchBranchEmployee(branchId);
|
const res = await fetchBranchEmployee(opts.branchId, {
|
||||||
|
pageSize: opts.pageSize,
|
||||||
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
listEmployee.value = res.data.result;
|
listEmployee.value = res.data.result;
|
||||||
|
|
@ -232,7 +234,10 @@ watch(
|
||||||
() => statusEmployeeCreate.value,
|
() => statusEmployeeCreate.value,
|
||||||
async () => {
|
async () => {
|
||||||
if (statusEmployeeCreate.value) {
|
if (statusEmployeeCreate.value) {
|
||||||
await fetchEmployee(currentBranchEmployee.value);
|
await fetchEmployee({
|
||||||
|
branchId: currentBranchEmployee.value,
|
||||||
|
pageSize: 999,
|
||||||
|
});
|
||||||
|
|
||||||
const br = branch.value?.find(
|
const br = branch.value?.find(
|
||||||
(v) => v.id === currentBranchEmployee.value,
|
(v) => v.id === currentBranchEmployee.value,
|
||||||
|
|
@ -512,7 +517,10 @@ watch(
|
||||||
@click.stop="
|
@click.stop="
|
||||||
async () => {
|
async () => {
|
||||||
currentBranchEmployee = props.row.id;
|
currentBranchEmployee = props.row.id;
|
||||||
await fetchEmployee(currentBranchEmployee);
|
await fetchEmployee({
|
||||||
|
branchId: currentBranchEmployee,
|
||||||
|
pageSize: 999,
|
||||||
|
});
|
||||||
|
|
||||||
currentBtnOpen.map((v, i) => {
|
currentBtnOpen.map((v, i) => {
|
||||||
if (i !== props.rowIndex) {
|
if (i !== props.rowIndex) {
|
||||||
|
|
|
||||||
|
|
@ -1346,6 +1346,7 @@ const emptyCreateDialog = ref(false);
|
||||||
async () => {
|
async () => {
|
||||||
const res = await employeeStore.fetchList({
|
const res = await employeeStore.fetchList({
|
||||||
customerId: props.row.id,
|
customerId: props.row.id,
|
||||||
|
pageSize: 999,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue