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);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<slot-before>
|
||||
<div class="photo" text-center>
|
||||
<img vn-id="photo"
|
||||
ng-src="{{$root.imagePath('catalog', '200x200', $ctrl.item.id)}}"
|
||||
ng-src="{{$root.imagePath('catalog', '200x200', $ctrl.item.id)}}"
|
||||
zoom-image="{{$root.imagePath('catalog', '1600x900', $ctrl.item.id)}}"
|
||||
on-error-src/>
|
||||
<vn-float-button ng-click="uploadPhoto.show('catalog', $ctrl.item.id)"
|
||||
|
@ -36,13 +36,23 @@
|
|||
<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>
|
||||
<div class="attributes">
|
||||
<vn-label-value
|
||||
label="Buyer">
|
||||
<span
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.item.itemType.worker.userFk)"
|
||||
class="link">
|
||||
{{$ctrl.item.itemType.worker.user.name}}
|
||||
|
@ -50,22 +60,22 @@
|
|||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="{{$ctrl.item.tag5}}"
|
||||
ng-if="$ctrl.item.value5"
|
||||
ng-if="$ctrl.item.value5"
|
||||
value="{{$ctrl.item.value5}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="{{$ctrl.item.tag6}}"
|
||||
ng-if="$ctrl.item.value6"
|
||||
label="{{$ctrl.item.tag6}}"
|
||||
ng-if="$ctrl.item.value6"
|
||||
value="{{$ctrl.item.value6}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="{{$ctrl.item.tag7}}"
|
||||
ng-if="$ctrl.item.value7"
|
||||
label="{{$ctrl.item.tag7}}"
|
||||
ng-if="$ctrl.item.value7"
|
||||
value="{{$ctrl.item.value7}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="{{$ctrl.item.tag8}}"
|
||||
ng-if="$ctrl.item.value8"
|
||||
label="{{$ctrl.item.tag8}}"
|
||||
ng-if="$ctrl.item.value8"
|
||||
value="{{$ctrl.item.value8}}">
|
||||
</vn-label-value>
|
||||
</div>
|
||||
|
@ -112,7 +122,7 @@
|
|||
question="Do you want to clone this item?"
|
||||
message="All it's properties will be copied">
|
||||
</vn-confirm>
|
||||
<vn-worker-descriptor-popover
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
<vn-popup vn-id="summary">
|
||||
|
@ -120,7 +130,7 @@
|
|||
</vn-popup>
|
||||
|
||||
<!-- Upload photo dialog -->
|
||||
<vn-upload-photo
|
||||
vn-id="uploadPhoto"
|
||||
<vn-upload-photo
|
||||
vn-id="uploadPhoto"
|
||||
on-response="$ctrl.onUploadResponse()">
|
||||
</vn-upload-photo>
|
||||
</vn-upload-photo>
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -29,7 +29,11 @@ vn-item-summary {
|
|||
padding: 0;
|
||||
|
||||
&:nth-child(1) {
|
||||
border-right: 1px solid white;
|
||||
border-right: 1px solid white;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
border-right: 1px solid white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue