#748 el popover de congifuracion de usuario debe setear unas propedades por defecto

This commit is contained in:
Gerard 2018-10-24 09:31:08 +02:00
parent 0b112b3d59
commit 1e9bd88830
3 changed files with 33 additions and 19 deletions

View File

@ -19,7 +19,8 @@ vn-main-menu {
color: $main-01; color: $main-01;
} }
} }
.vn-popover ul {
vn-menu.vn-popover > div > div.content > ul {
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
color: white; color: white;

View File

@ -20,7 +20,7 @@
vn-one vn-one
label="Local warehouse" label="Local warehouse"
id="localWarehouse" id="localWarehouse"
field="$ctrl.localWarehouse" field="$ctrl.localWarehouseFk"
data="warehouses" data="warehouses"
select-fields="['id','name']" select-fields="['id','name']"
show-field="name" show-field="name"
@ -32,7 +32,7 @@
vn-one vn-one
label="Local bank" label="Local bank"
id="localBank" id="localBank"
field="$ctrl.localBank" field="$ctrl.localBankFk"
data="banks" data="banks"
select-fields="['id','bank']" select-fields="['id','bank']"
show-field="bank" show-field="bank"
@ -44,7 +44,7 @@
vn-one vn-one
label="Local company" label="Local company"
id="localCompany" id="localCompany"
field="$ctrl.localCompany" field="$ctrl.localCompanyFk"
data="companies" data="companies"
select-fields="['id','code']" select-fields="['id','code']"
show-field="code" show-field="code"

View File

@ -11,31 +11,36 @@ class Controller {
this.getUserConfig(); this.getUserConfig();
} }
set localBank(value) { set localBankFk(value) {
window.localStorage.localBank = value; window.localStorage.localBankFk = value;
window.localStorage.defaultCompanyFk = value;
this.showOk(); this.showOk();
} }
get localBank() { get localBankFk() {
return parseInt(window.localStorage.localBank); return parseInt(window.localStorage.localBankFk);
} }
set localWarehouse(value) { set localWarehouseFk(value) {
window.localStorage.localWarehouse = value; window.localStorage.localWarehouseFk = value;
window.localStorage.defaultWarehouseFk = value;
this.showOk(); this.showOk();
} }
get localWarehouse() { get localWarehouseFk() {
return parseInt(window.localStorage.localWarehouse); return parseInt(window.localStorage.localWarehouseFk);
} }
set localCompany(value) { set localCompanyFk(value) {
window.localStorage.localCompany = value; if (value) {
this.showOk(); window.localStorage.localCompanyFk = value;
window.localStorage.defaultCompanyFk = value;
this.showOk();
}
} }
get localCompany() { get localCompanyFk() {
return parseInt(window.localStorage.localCompany); return parseInt(window.localStorage.localCompanyFk);
} }
set warehouseFk(value) { set warehouseFk(value) {
@ -63,11 +68,19 @@ class Controller {
getUserConfig() { getUserConfig() {
this.$http.get('/api/UserConfigs/getUserConfig') this.$http.get('/api/UserConfigs/getUserConfig')
.then(res => { .then(res => {
if (res.data && res.data.warehouseFk) if (res.data && res.data.warehouseFk) {
this.warehouse = 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; this.company = res.data.companyFk;
if (!localStorage.getItem('localCompanyFk'))
localStorage.setItem('defaultCompanyFk', res.data.companyFk);
}
console.log(localStorage.getItem('defaultWarehouseFk'), localStorage.getItem('defaultCompanyFk'));
}); });
} }