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 { 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];
|
||||
}
|
||||
}
|
||||
"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue