fix: แก้ กด ดูรายละเอียดเเล้ว สาขา แสดง

This commit is contained in:
Net 2024-06-26 14:03:44 +07:00
parent 8358f5fcfb
commit 0bc0c2efa9

View file

@ -277,6 +277,7 @@ async function triggerEdit(
code: currentRecord.code, code: currentRecord.code,
}; };
if (typeBranch === 'subBranch') {
const currentRecordHead = branchData.value.result.find( const currentRecordHead = branchData.value.result.find(
(x) => x.id === currentRecord.headOfficeId, (x) => x.id === currentRecord.headOfficeId,
); );
@ -287,7 +288,7 @@ async function triggerEdit(
} else { } else {
currentHq.value = currentEdit.value; currentHq.value = currentEdit.value;
} }
}
formTypeBranch.value = typeBranch; formTypeBranch.value = typeBranch;
} }
@ -505,7 +506,7 @@ watch(locale, () => {
style="height: 50px; display: flex; align-items: center" style="height: 50px; display: flex; align-items: center"
> >
<Icon icon="flowbite:home-solid" width="24px" class="q-mr-md" /> <Icon icon="flowbite:home-solid" width="24px" class="q-mr-md" />
ทั้งหมด {{ $t('all') }}
</div> </div>
<q-tree <q-tree
@ -542,7 +543,7 @@ watch(locale, () => {
<q-list v-close-popup> <q-list v-close-popup>
<q-item <q-item
:id="`view-detail-btn-${node.name}-view`" :id="`view-detail-btn-${node.name}-view`"
@click=" @click.stop="
if (node.isHeadOffice) { if (node.isHeadOffice) {
triggerEdit('drawer', node.id, 'headOffice'); triggerEdit('drawer', node.id, 'headOffice');
} else { } else {
@ -790,8 +791,11 @@ watch(locale, () => {
return false; return false;
} }
if (!!currentHq.id && currentHq.id === v.headOfficeId) if (!!currentHq.id && currentHq.id === v.headOfficeId) {
console.log('ทำงาน');
return true; return true;
}
if (fieldSelectedBranch.value === 'all') return true; if (fieldSelectedBranch.value === 'all') return true;
if (fieldSelectedBranch.value === 'branchHQLabel') if (fieldSelectedBranch.value === 'branchHQLabel')
return v.isHeadOffice; return v.isHeadOffice;