feat: search branch (local)
All data already get from back-end so search can be done locally
This commit is contained in:
parent
d81f3556d6
commit
ddc225eb39
1 changed files with 12 additions and 8 deletions
|
|
@ -649,6 +649,7 @@ watch(locale, () => {
|
|||
dense
|
||||
label="ค้นหา"
|
||||
v-model="inputSearch"
|
||||
debounce="500"
|
||||
></q-input>
|
||||
</div>
|
||||
|
||||
|
|
@ -685,18 +686,20 @@ watch(locale, () => {
|
|||
) {
|
||||
return false;
|
||||
}
|
||||
if (!!currentHq.id && currentHq.id === v.headOfficeId) {
|
||||
return true;
|
||||
|
||||
const terms = `${v.code} ${$i18n.locale === 'en-US' ? v.nameEN : v.name} ${v.telephoneNo}`;
|
||||
if (inputSearch && !terms.includes(inputSearch)) {
|
||||
return false;
|
||||
}
|
||||
if (fieldSelectedBranch.value === 'all') {
|
||||
|
||||
if (!!currentHq.id && currentHq.id === v.headOfficeId)
|
||||
return true;
|
||||
}
|
||||
if (fieldSelectedBranch.value === 'branchHQLabel') {
|
||||
if (fieldSelectedBranch.value === 'all') return true;
|
||||
if (fieldSelectedBranch.value === 'branchHQLabel')
|
||||
return v.isHeadOffice;
|
||||
}
|
||||
if (fieldSelectedBranch.value === 'branchLabel') {
|
||||
if (fieldSelectedBranch.value === 'branchLabel')
|
||||
return !v.isHeadOffice;
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
.map((v) => ({
|
||||
|
|
@ -722,6 +725,7 @@ watch(locale, () => {
|
|||
() => {
|
||||
if (item.hq) {
|
||||
fieldSelectedBranch.value = '';
|
||||
inputSearch = '';
|
||||
currentHq = { id: item.id, code: item.branchLabelCode };
|
||||
beforeBranch = {
|
||||
id: '',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue