fix: cuando haces F5 en cualquier sección que no sea Diary, te coge el warehouse por defecto
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-02-21 11:48:56 +01:00
parent ceab11cc41
commit eda70b009b
2 changed files with 23 additions and 0 deletions

View File

@ -5,6 +5,25 @@ class Controller extends ModuleCard {
reload() { reload() {
this.$http.get(`Items/${this.$params.id}/getCard`) this.$http.get(`Items/${this.$params.id}/getCard`)
.then(res => this.item = res.data); .then(res => this.item = res.data);
this.$http.get('ItemConfigs/findOne')
.then(res => {
if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary') return;
this.warehouseFk = res.data.warehouseFk;
this.getWarehouseName(res.data.warehouseFk);
});
}
getWarehouseName(warehouseFk) {
const filter = {
where: {id: warehouseFk}
};
this.$http.get('Warehouses/findOne', {filter})
.then(res => {
this.warehouseText = this.$t('WarehouseFk', {
warehouseName: res.data.name
});
});
} }
} }

View File

@ -68,6 +68,10 @@ class Controller extends Section {
this.$[descriptor].show(event.target, sale.origin); this.$[descriptor].show(event.target, sale.origin);
} }
$onDestroy() {
this.card.reload();
}
} }
Controller.$inject = ['$element', '$scope', '$anchorScroll', '$location']; Controller.$inject = ['$element', '$scope', '$anchorScroll', '$location'];