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

This commit is contained in:
Vicent Llopis 2023-02-07 13:40:39 +01:00
parent 4f76465246
commit 6cb3930be0
10 changed files with 84 additions and 37 deletions

View File

@ -1,6 +1,6 @@
<vn-portal slot="menu"> <vn-portal slot="menu">
<vn-item-descriptor <vn-item-descriptor
warehouse-fk="$ctrl.getWarehouseFk()" warehouse-fk="$ctrl.warehouseFk"
item="$ctrl.item" item="$ctrl.item"
card-reload="$ctrl.reload()"></vn-item-descriptor> card-reload="$ctrl.reload()"></vn-item-descriptor>
<vn-left-menu source="card"></vn-left-menu> <vn-left-menu source="card"></vn-left-menu>

View File

@ -2,16 +2,6 @@ import ngModule from '../module';
import ModuleCard from 'salix/components/module-card'; import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard { 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() { 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);

View File

@ -19,7 +19,7 @@
<slot-before> <slot-before>
<div class="photo" text-center> <div class="photo" text-center>
<img vn-id="photo" <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)}}" zoom-image="{{$root.imagePath('catalog', '1600x900', $ctrl.item.id)}}"
on-error-src/> on-error-src/>
<vn-float-button ng-click="uploadPhoto.show('catalog', $ctrl.item.id)" <vn-float-button ng-click="uploadPhoto.show('catalog', $ctrl.item.id)"
@ -36,13 +36,23 @@
<p translate>Available</p> <p translate>Available</p>
<p>{{$ctrl.available | dashIfEmpty}}</p> <p>{{$ctrl.available | dashIfEmpty}}</p>
</vn-one> </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> </vn-horizontal>
</slot-before> </slot-before>
<slot-body> <slot-body>
<div class="attributes"> <div class="attributes">
<vn-label-value <vn-label-value
label="Buyer"> label="Buyer">
<span <span
ng-click="workerDescriptor.show($event, $ctrl.item.itemType.worker.userFk)" ng-click="workerDescriptor.show($event, $ctrl.item.itemType.worker.userFk)"
class="link"> class="link">
{{$ctrl.item.itemType.worker.user.name}} {{$ctrl.item.itemType.worker.user.name}}
@ -50,22 +60,22 @@
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="{{$ctrl.item.tag5}}" label="{{$ctrl.item.tag5}}"
ng-if="$ctrl.item.value5" ng-if="$ctrl.item.value5"
value="{{$ctrl.item.value5}}"> value="{{$ctrl.item.value5}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="{{$ctrl.item.tag6}}" label="{{$ctrl.item.tag6}}"
ng-if="$ctrl.item.value6" ng-if="$ctrl.item.value6"
value="{{$ctrl.item.value6}}"> value="{{$ctrl.item.value6}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="{{$ctrl.item.tag7}}" label="{{$ctrl.item.tag7}}"
ng-if="$ctrl.item.value7" ng-if="$ctrl.item.value7"
value="{{$ctrl.item.value7}}"> value="{{$ctrl.item.value7}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="{{$ctrl.item.tag8}}" label="{{$ctrl.item.tag8}}"
ng-if="$ctrl.item.value8" ng-if="$ctrl.item.value8"
value="{{$ctrl.item.value8}}"> value="{{$ctrl.item.value8}}">
</vn-label-value> </vn-label-value>
</div> </div>
@ -112,7 +122,7 @@
question="Do you want to clone this item?" question="Do you want to clone this item?"
message="All it's properties will be copied"> message="All it's properties will be copied">
</vn-confirm> </vn-confirm>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="workerDescriptor">
</vn-worker-descriptor-popover> </vn-worker-descriptor-popover>
<vn-popup vn-id="summary"> <vn-popup vn-id="summary">
@ -120,7 +130,7 @@
</vn-popup> </vn-popup>
<!-- Upload photo dialog --> <!-- Upload photo dialog -->
<vn-upload-photo <vn-upload-photo
vn-id="uploadPhoto" vn-id="uploadPhoto"
on-response="$ctrl.onUploadResponse()"> on-response="$ctrl.onUploadResponse()">
</vn-upload-photo> </vn-upload-photo>

View File

@ -30,7 +30,10 @@ class Controller extends Descriptor {
set warehouseFk(value) { set warehouseFk(value) {
this._warehouseFk = value; this._warehouseFk = value;
if (value) this.updateStock(); if (value) {
this.updateStock();
this.getWarehouseName(value);
}
} }
loadData() { loadData() {
@ -89,6 +92,22 @@ class Controller extends Descriptor {
this.$.photo.setAttribute('src', newSrc); this.$.photo.setAttribute('src', newSrc);
this.$.photo.setAttribute('zoom-image', newZoomSrc); 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']; Controller.$inject = ['$element', '$scope', '$rootScope'];

View File

@ -37,6 +37,7 @@ class Controller extends Section {
set warehouseFk(value) { set warehouseFk(value) {
if (value && value != this._warehouseFk) { if (value && value != this._warehouseFk) {
this._warehouseFk = value; this._warehouseFk = value;
this.card.warehouseFk = value;
this.$state.go(this.$state.current.name, { this.$state.go(this.$state.current.name, {
warehouseFk: value warehouseFk: value
@ -76,5 +77,8 @@ ngModule.vnComponent('vnItemDiary', {
controller: Controller, controller: Controller,
bindings: { bindings: {
item: '<' item: '<'
},
require: {
card: '?^vnItemCard'
} }
}); });

View File

@ -20,17 +20,18 @@
</vn-one> </vn-one>
<vn-one> <vn-one>
<p translate>Available</p> <p translate>Available</p>
<p>{{$ctrl.summary.available}} <p>{{$ctrl.summary.available}}</p>
</vn-one>
<vn-one>
<p>
<vn-icon <vn-icon
ng-if="$ctrl.warehouseText != null"
icon="info_outline" icon="info_outline"
vn-tooltip="{{'WarehouseFk' | translate:$ctrl.passRequirements}}" vn-tooltip="{{$ctrl.warehouseText}}"
pointer> pointer>
</vn-icon> </vn-icon>
</p> </p>
<!-- <div </vn-one>
info="Search ACL by model name">
'test'
</div> -->
</vn-horizontal> </vn-horizontal>
</vn-one> </vn-one>
<vn-one name="basicData"> <vn-one name="basicData">

View File

@ -7,6 +7,24 @@ class Controller extends Summary {
this.$http.get(`Items/${this.item.id}/getSummary`).then(response => { this.$http.get(`Items/${this.item.id}/getSummary`).then(response => {
this.summary = response.data; 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() { $onChanges() {
@ -37,4 +55,7 @@ ngModule.vnComponent('vnItemSummary', {
bindings: { bindings: {
item: '<', item: '<',
}, },
require: {
card: '?^vnItemCard'
}
}); });

View File

@ -1,2 +1 @@
WarehouseFk: > WarehouseFk: Calculated on the warehouse of {{ warehouseName }}
Calculated on the warehouse of {{ name }}

View File

@ -1,5 +1,4 @@
Barcode: Códigos de barras Barcode: Códigos de barras
Other data: Otros datos Other data: Otros datos
Go to the item: Ir al artículo Go to the item: Ir al artículo
WarehouseFk: > WarehouseFk: Calculado sobre el almacén de {{ warehouseName }}
Calculado sobre el almacén de {{ name }}

View File

@ -29,7 +29,11 @@ vn-item-summary {
padding: 0; padding: 0;
&:nth-child(1) { &:nth-child(1) {
border-right: 1px solid white; border-right: 1px solid white;
}
&:nth-child(2) {
border-right: 1px solid white;
} }
} }
} }