fixed bug localBank being null
This commit is contained in:
parent
6e6b646978
commit
567f5aaa78
|
@ -41,7 +41,9 @@
|
|||
data="banksData"
|
||||
select-fields="['id','bank']"
|
||||
show-field="bank"
|
||||
order="id"
|
||||
value-field="id">
|
||||
<tpl-item>{{id}}: {{bank}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
|
|
|
@ -43,7 +43,8 @@ class Controller {
|
|||
|
||||
set warehouseFk(value) {
|
||||
this.warehouse = value;
|
||||
if (value && !window.localStorage.localWarehouseFk)
|
||||
if (value &&
|
||||
(!window.localStorage.localWarehouseFk || window.localStorage.localWarehouseFk === 'null'))
|
||||
window.localStorage.defaultWarehouseFk = value;
|
||||
this.setUserConfig('warehouseFk', value);
|
||||
}
|
||||
|
@ -54,7 +55,8 @@ class Controller {
|
|||
|
||||
set companyFk(value) {
|
||||
this.company = value;
|
||||
if (value && !window.localStorage.localCompanyFk)
|
||||
if (value &&
|
||||
(!window.localStorage.localCompanyFk || window.localStorage.localCompanyFk === 'null'))
|
||||
window.localStorage.defaultCompanyFk = value;
|
||||
this.setUserConfig('companyFk', value);
|
||||
}
|
||||
|
@ -103,8 +105,10 @@ class Controller {
|
|||
}
|
||||
|
||||
$onInit() {
|
||||
if (localStorage.getItem('localBankFk'))
|
||||
window.localStorage.defaultBankFk = localStorage.getItem('localBankFk');
|
||||
if (window.localStorage.localBankFk && window.localStorage.localBankFk !== 'null')
|
||||
window.localStorage.defaultBankFk = window.localStorage.localBankFk;
|
||||
else
|
||||
localStorage.removeItem('defaultBankFk');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue