#748 el popover de congifuracion de usuario debe setear unas propedades por defecto
This commit is contained in:
parent
0b112b3d59
commit
1e9bd88830
|
@ -19,7 +19,8 @@ vn-main-menu {
|
|||
color: $main-01;
|
||||
}
|
||||
}
|
||||
.vn-popover ul {
|
||||
|
||||
vn-menu.vn-popover > div > div.content > ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
color: white;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
vn-one
|
||||
label="Local warehouse"
|
||||
id="localWarehouse"
|
||||
field="$ctrl.localWarehouse"
|
||||
field="$ctrl.localWarehouseFk"
|
||||
data="warehouses"
|
||||
select-fields="['id','name']"
|
||||
show-field="name"
|
||||
|
@ -32,7 +32,7 @@
|
|||
vn-one
|
||||
label="Local bank"
|
||||
id="localBank"
|
||||
field="$ctrl.localBank"
|
||||
field="$ctrl.localBankFk"
|
||||
data="banks"
|
||||
select-fields="['id','bank']"
|
||||
show-field="bank"
|
||||
|
@ -44,7 +44,7 @@
|
|||
vn-one
|
||||
label="Local company"
|
||||
id="localCompany"
|
||||
field="$ctrl.localCompany"
|
||||
field="$ctrl.localCompanyFk"
|
||||
data="companies"
|
||||
select-fields="['id','code']"
|
||||
show-field="code"
|
||||
|
|
|
@ -11,31 +11,36 @@ class Controller {
|
|||
this.getUserConfig();
|
||||
}
|
||||
|
||||
set localBank(value) {
|
||||
window.localStorage.localBank = value;
|
||||
set localBankFk(value) {
|
||||
window.localStorage.localBankFk = value;
|
||||
window.localStorage.defaultCompanyFk = value;
|
||||
this.showOk();
|
||||
}
|
||||
|
||||
get localBank() {
|
||||
return parseInt(window.localStorage.localBank);
|
||||
get localBankFk() {
|
||||
return parseInt(window.localStorage.localBankFk);
|
||||
}
|
||||
|
||||
set localWarehouse(value) {
|
||||
window.localStorage.localWarehouse = value;
|
||||
set localWarehouseFk(value) {
|
||||
window.localStorage.localWarehouseFk = value;
|
||||
window.localStorage.defaultWarehouseFk = value;
|
||||
this.showOk();
|
||||
}
|
||||
|
||||
get localWarehouse() {
|
||||
return parseInt(window.localStorage.localWarehouse);
|
||||
get localWarehouseFk() {
|
||||
return parseInt(window.localStorage.localWarehouseFk);
|
||||
}
|
||||
|
||||
set localCompany(value) {
|
||||
window.localStorage.localCompany = value;
|
||||
set localCompanyFk(value) {
|
||||
if (value) {
|
||||
window.localStorage.localCompanyFk = value;
|
||||
window.localStorage.defaultCompanyFk = value;
|
||||
this.showOk();
|
||||
}
|
||||
}
|
||||
|
||||
get localCompany() {
|
||||
return parseInt(window.localStorage.localCompany);
|
||||
get localCompanyFk() {
|
||||
return parseInt(window.localStorage.localCompanyFk);
|
||||
}
|
||||
|
||||
set warehouseFk(value) {
|
||||
|
@ -63,11 +68,19 @@ class Controller {
|
|||
getUserConfig() {
|
||||
this.$http.get('/api/UserConfigs/getUserConfig')
|
||||
.then(res => {
|
||||
if (res.data && res.data.warehouseFk)
|
||||
if (res.data && res.data.warehouseFk) {
|
||||
this.warehouse = res.data.warehouseFk;
|
||||
if (!localStorage.getItem('localWarehouseFk'))
|
||||
localStorage.setItem('defaultWarehouseFk', res.data.warehouseFk);
|
||||
}
|
||||
|
||||
if (res.data && res.data.companyFk)
|
||||
if (res.data && res.data.companyFk) {
|
||||
this.company = res.data.companyFk;
|
||||
if (!localStorage.getItem('localCompanyFk'))
|
||||
localStorage.setItem('defaultCompanyFk', res.data.companyFk);
|
||||
}
|
||||
|
||||
console.log(localStorage.getItem('defaultWarehouseFk'), localStorage.getItem('defaultCompanyFk'));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue