fix: แก้ กด ดูรายละเอียดเเล้ว สาขา แสดง
This commit is contained in:
parent
8358f5fcfb
commit
0bc0c2efa9
1 changed files with 16 additions and 12 deletions
|
|
@ -277,17 +277,18 @@ async function triggerEdit(
|
|||
code: currentRecord.code,
|
||||
};
|
||||
|
||||
const currentRecordHead = branchData.value.result.find(
|
||||
(x) => x.id === currentRecord.headOfficeId,
|
||||
);
|
||||
if (typeBranch === 'subBranch') {
|
||||
const currentRecordHead = branchData.value.result.find(
|
||||
(x) => x.id === currentRecord.headOfficeId,
|
||||
);
|
||||
|
||||
if (currentRecordHead) {
|
||||
currentHq.value.id = currentRecordHead.id;
|
||||
currentHq.value.code = currentRecordHead.code;
|
||||
} else {
|
||||
currentHq.value = currentEdit.value;
|
||||
if (currentRecordHead) {
|
||||
currentHq.value.id = currentRecordHead.id;
|
||||
currentHq.value.code = currentRecordHead.code;
|
||||
} else {
|
||||
currentHq.value = currentEdit.value;
|
||||
}
|
||||
}
|
||||
|
||||
formTypeBranch.value = typeBranch;
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +506,7 @@ watch(locale, () => {
|
|||
style="height: 50px; display: flex; align-items: center"
|
||||
>
|
||||
<Icon icon="flowbite:home-solid" width="24px" class="q-mr-md" />
|
||||
ทั้งหมด
|
||||
{{ $t('all') }}
|
||||
</div>
|
||||
|
||||
<q-tree
|
||||
|
|
@ -542,7 +543,7 @@ watch(locale, () => {
|
|||
<q-list v-close-popup>
|
||||
<q-item
|
||||
:id="`view-detail-btn-${node.name}-view`"
|
||||
@click="
|
||||
@click.stop="
|
||||
if (node.isHeadOffice) {
|
||||
triggerEdit('drawer', node.id, 'headOffice');
|
||||
} else {
|
||||
|
|
@ -790,8 +791,11 @@ watch(locale, () => {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!!currentHq.id && currentHq.id === v.headOfficeId)
|
||||
if (!!currentHq.id && currentHq.id === v.headOfficeId) {
|
||||
console.log('ทำงาน');
|
||||
|
||||
return true;
|
||||
}
|
||||
if (fieldSelectedBranch.value === 'all') return true;
|
||||
if (fieldSelectedBranch.value === 'branchHQLabel')
|
||||
return v.isHeadOffice;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue