refactor: get employee of Branch
This commit is contained in:
parent
11388681cd
commit
f322e7fc27
1 changed files with 10 additions and 6 deletions
|
|
@ -43,7 +43,7 @@ const employeeFormStore = useEmployeeForm();
|
||||||
const customerBranchFormStore = useCustomerBranchForm();
|
const customerBranchFormStore = useCustomerBranchForm();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { fetchListCustomeBranch } = customerStore;
|
const { fetchListCustomeBranch, fetchBranchEmployee } = customerStore;
|
||||||
const {
|
const {
|
||||||
currentFormData: customerBranchFormData,
|
currentFormData: customerBranchFormData,
|
||||||
state: customerBranchFormState,
|
state: customerBranchFormState,
|
||||||
|
|
@ -59,8 +59,7 @@ const currentCustomerUrlImage = defineModel<string | null>(
|
||||||
'currentCustomerUrlImage',
|
'currentCustomerUrlImage',
|
||||||
);
|
);
|
||||||
|
|
||||||
const { state: employeeFormState, currentFromDataEmployee } =
|
const { state: employeeFormState } = storeToRefs(employeeFormStore);
|
||||||
storeToRefs(employeeFormStore);
|
|
||||||
|
|
||||||
const currentStatus = ref<Status | 'All'>('All');
|
const currentStatus = ref<Status | 'All'>('All');
|
||||||
const currentBtnOpen = ref<boolean[]>([]);
|
const currentBtnOpen = ref<boolean[]>([]);
|
||||||
|
|
@ -494,9 +493,14 @@ watch([customerId, inputSearch, currentStatus], async () => {
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
@click="
|
@click="
|
||||||
() => {
|
async () => {
|
||||||
currentBtnOpen[props.rowIndex] =
|
const res = await fetchBranchEmployee(props.row.id);
|
||||||
!currentBtnOpen[props.rowIndex];
|
|
||||||
|
if (res) {
|
||||||
|
listEmployee = res.data.result;
|
||||||
|
currentBtnOpen[props.rowIndex] =
|
||||||
|
!currentBtnOpen[props.rowIndex];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue