refactor: get employee of Branch

This commit is contained in:
Net 2024-08-15 16:36:04 +07:00
parent 11388681cd
commit f322e7fc27

View file

@ -43,7 +43,7 @@ const employeeFormStore = useEmployeeForm();
const customerBranchFormStore = useCustomerBranchForm();
const { t } = useI18n();
const { fetchListCustomeBranch } = customerStore;
const { fetchListCustomeBranch, fetchBranchEmployee } = customerStore;
const {
currentFormData: customerBranchFormData,
state: customerBranchFormState,
@ -59,8 +59,7 @@ const currentCustomerUrlImage = defineModel<string | null>(
'currentCustomerUrlImage',
);
const { state: employeeFormState, currentFromDataEmployee } =
storeToRefs(employeeFormStore);
const { state: employeeFormState } = storeToRefs(employeeFormStore);
const currentStatus = ref<Status | 'All'>('All');
const currentBtnOpen = ref<boolean[]>([]);
@ -494,9 +493,14 @@ watch([customerId, inputSearch, currentStatus], async () => {
round
flat
@click="
() => {
currentBtnOpen[props.rowIndex] =
!currentBtnOpen[props.rowIndex];
async () => {
const res = await fetchBranchEmployee(props.row.id);
if (res) {
listEmployee = res.data.result;
currentBtnOpen[props.rowIndex] =
!currentBtnOpen[props.rowIndex];
}
}
"
/>