feat: añadido icono info, que indica de que almacén se saca la información
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
4f76465246
commit
6cb3930be0
|
@ -1,6 +1,6 @@
|
|||
<vn-portal slot="menu">
|
||||
<vn-item-descriptor
|
||||
warehouse-fk="$ctrl.getWarehouseFk()"
|
||||
warehouse-fk="$ctrl.warehouseFk"
|
||||
item="$ctrl.item"
|
||||
card-reload="$ctrl.reload()"></vn-item-descriptor>
|
||||
<vn-left-menu source="card"></vn-left-menu>
|
||||
|
|
|
@ -2,16 +2,6 @@ import ngModule from '../module';
|
|||
import ModuleCard from 'salix/components/module-card';
|
||||
|
||||
class Controller extends ModuleCard {
|
||||
getWarehouseFk() {
|
||||
if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary')
|
||||
return this.$params.warehouseFk;
|
||||
|
||||
this.$http.get('ItemConfigs/findOne')
|
||||
.then(res => {
|
||||
return res.data.warehouseFk;
|
||||
});
|
||||
}
|
||||
|
||||
reload() {
|
||||
this.$http.get(`Items/${this.$params.id}/getCard`)
|
||||
.then(res => this.item = res.data);
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
<p translate>Available</p>
|
||||
<p>{{$ctrl.available | dashIfEmpty}}</p>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<p>
|
||||
<vn-icon
|
||||
ng-if="$ctrl.showIcon"
|
||||
icon="info_outline"
|
||||
vn-tooltip="{{$ctrl.warehouseText}}"
|
||||
pointer>
|
||||
</vn-icon>
|
||||
</p>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</slot-before>
|
||||
<slot-body>
|
||||
|
|
|
@ -30,7 +30,10 @@ class Controller extends Descriptor {
|
|||
|
||||
set warehouseFk(value) {
|
||||
this._warehouseFk = value;
|
||||
if (value) this.updateStock();
|
||||
if (value) {
|
||||
this.updateStock();
|
||||
this.getWarehouseName(value);
|
||||
}
|
||||
}
|
||||
|
||||
loadData() {
|
||||
|
@ -89,6 +92,22 @@ class Controller extends Descriptor {
|
|||
this.$.photo.setAttribute('src', newSrc);
|
||||
this.$.photo.setAttribute('zoom-image', newZoomSrc);
|
||||
}
|
||||
|
||||
getWarehouseName(warehouseFk) {
|
||||
this.showIcon = false;
|
||||
|
||||
const filter = {
|
||||
where: {id: warehouseFk}
|
||||
};
|
||||
this.$http.get('Warehouses/findOne', {filter})
|
||||
.then(res => {
|
||||
this.warehouseText = this.$t('WarehouseFk', {
|
||||
warehouseName: res.data.name
|
||||
});
|
||||
|
||||
this.showIcon = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$element', '$scope', '$rootScope'];
|
||||
|
|
|
@ -37,6 +37,7 @@ class Controller extends Section {
|
|||
set warehouseFk(value) {
|
||||
if (value && value != this._warehouseFk) {
|
||||
this._warehouseFk = value;
|
||||
this.card.warehouseFk = value;
|
||||
|
||||
this.$state.go(this.$state.current.name, {
|
||||
warehouseFk: value
|
||||
|
@ -76,5 +77,8 @@ ngModule.vnComponent('vnItemDiary', {
|
|||
controller: Controller,
|
||||
bindings: {
|
||||
item: '<'
|
||||
},
|
||||
require: {
|
||||
card: '?^vnItemCard'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -20,17 +20,18 @@
|
|||
</vn-one>
|
||||
<vn-one>
|
||||
<p translate>Available</p>
|
||||
<p>{{$ctrl.summary.available}}
|
||||
<p>{{$ctrl.summary.available}}</p>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<p>
|
||||
<vn-icon
|
||||
ng-if="$ctrl.warehouseText != null"
|
||||
icon="info_outline"
|
||||
vn-tooltip="{{'WarehouseFk' | translate:$ctrl.passRequirements}}"
|
||||
vn-tooltip="{{$ctrl.warehouseText}}"
|
||||
pointer>
|
||||
</vn-icon>
|
||||
</p>
|
||||
<!-- <div
|
||||
info="Search ACL by model name">
|
||||
'test'
|
||||
</div> -->
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-one>
|
||||
<vn-one name="basicData">
|
||||
|
|
|
@ -7,6 +7,24 @@ class Controller extends Summary {
|
|||
this.$http.get(`Items/${this.item.id}/getSummary`).then(response => {
|
||||
this.summary = response.data;
|
||||
});
|
||||
|
||||
this.$http.get('ItemConfigs/findOne')
|
||||
.then(res => {
|
||||
this.card.warehouseFk = res.data.warehouseFk;
|
||||
this.getWarehouseName(this.card.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
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$onChanges() {
|
||||
|
@ -37,4 +55,7 @@ ngModule.vnComponent('vnItemSummary', {
|
|||
bindings: {
|
||||
item: '<',
|
||||
},
|
||||
require: {
|
||||
card: '?^vnItemCard'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
WarehouseFk: >
|
||||
Calculated on the warehouse of {{ name }}
|
||||
WarehouseFk: Calculated on the warehouse of {{ warehouseName }}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
Barcode: Códigos de barras
|
||||
Other data: Otros datos
|
||||
Go to the item: Ir al artículo
|
||||
WarehouseFk: >
|
||||
Calculado sobre el almacén de {{ name }}
|
||||
WarehouseFk: Calculado sobre el almacén de {{ warehouseName }}
|
||||
|
|
|
@ -31,5 +31,9 @@ vn-item-summary {
|
|||
&:nth-child(1) {
|
||||
border-right: 1px solid white;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
border-right: 1px solid white;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue