#762 refactor componente fetched tags
This commit is contained in:
parent
35e6132b17
commit
e06798cf90
|
@ -1,10 +1,10 @@
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-one>{{::$ctrl.concept}}</vn-one>
|
<vn-one>{{::$ctrl.item.name}}</vn-one>
|
||||||
<vn-auto>
|
<vn-auto>
|
||||||
<section
|
<section
|
||||||
class="inline-tag ellipsize" ng-class="{'empty': !fetchedTag.value}"
|
class="inline-tag ellipsize" ng-class="{'empty': !fetchedTag.value}"
|
||||||
ng-repeat="fetchedTag in $ctrl.tags track by $index"
|
ng-repeat="fetchedTag in $ctrl.tags track by $index"
|
||||||
vn-tooltip="{{::fetchedTag.tag.name}}: {{::fetchedTag.value}}">
|
vn-tooltip="{{::fetchedTag.name}}: {{::fetchedTag.value}}">
|
||||||
{{::fetchedTag.value}}
|
{{::fetchedTag.value}}
|
||||||
</section>
|
</section>
|
||||||
</vn-auto>
|
</vn-auto>
|
||||||
|
|
|
@ -1,10 +1,53 @@
|
||||||
import ngModule from '../../module';
|
import ngModule from '../../module';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
|
export default class FetchedTags {
|
||||||
|
set item(value) {
|
||||||
|
if (value) {
|
||||||
|
let tags = [];
|
||||||
|
for (let i = 5; i < 5 + this.maxLength; i++)
|
||||||
|
if (value['tag' + i]) {
|
||||||
|
let tagValue = value['value' + i];
|
||||||
|
let tagKey = value['tag' + i];
|
||||||
|
tags.push({name: tagKey, value: tagValue, position: i - 5});
|
||||||
|
}
|
||||||
|
this.tags = tags;
|
||||||
|
}
|
||||||
|
this._item = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
get item() {
|
||||||
|
return this._item;
|
||||||
|
}
|
||||||
|
|
||||||
|
set tags(value) {
|
||||||
|
if (value) {
|
||||||
|
let organizedTags = new Array(parseInt(this.maxLength));
|
||||||
|
for (let i = 0; i < this.maxLength; i++) {
|
||||||
|
let organizedTag = {};
|
||||||
|
for (let j = 0; j < value.length; j++) {
|
||||||
|
if (value[j].position === i) {
|
||||||
|
organizedTag.name = value[j].name;
|
||||||
|
organizedTag.value = value[j].value;
|
||||||
|
}
|
||||||
|
organizedTags[i] = JSON.parse(JSON.stringify(organizedTag));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this._tags = organizedTags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get tags() {
|
||||||
|
return this._tags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ngModule.component('vnFetchedTags', {
|
ngModule.component('vnFetchedTags', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
|
controller: FetchedTags,
|
||||||
bindings: {
|
bindings: {
|
||||||
concept: '<',
|
maxLength: '<',
|
||||||
tags: '<'
|
item: '<'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
@import "colors";
|
@import "colors";
|
||||||
|
|
||||||
vn-fetched-tags {
|
vn-fetched-tags {
|
||||||
|
&.noTitle vn-one {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1600px){
|
@media screen and (max-width: 1600px){
|
||||||
& vn-horizontal {
|
& vn-horizontal {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<vn-label-value label="Buyer"
|
<vn-label-value label="Buyer"
|
||||||
value="{{::$ctrl.item.firstName}} {{::$ctrl.item.worker}}">
|
value="{{::$ctrl.item.firstName}} {{::$ctrl.item.worker}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-fetched-tags tags="$ctrl.item.tags"/>
|
<vn-fetched-tags max-length="4" item="$ctrl.item" class="noTitle"/>
|
||||||
</vn-one>
|
</vn-one>
|
||||||
<vn-horizontal class="buttons">
|
<vn-horizontal class="buttons">
|
||||||
<vn-icon
|
<vn-icon
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
{{("000000"+row.itemFk).slice(-6)}}
|
{{("000000"+row.itemFk).slice(-6)}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td><vn-fetched-tags concept="row.item.name" tags="row.item.tags"/></vn-td>
|
<vn-td><vn-fetched-tags max-length="6" item="row.item"/></vn-td>
|
||||||
<vn-td>{{row.warehouse.name}}</vn-td>
|
<vn-td>{{row.warehouse.name}}</vn-td>
|
||||||
<vn-td>{{row.shipped | dashIfEmpty}}</vn-td>
|
<vn-td>{{row.shipped | dashIfEmpty}}</vn-td>
|
||||||
<vn-td number>{{row.quantity}}</vn-td>
|
<vn-td number>{{row.quantity}}</vn-td>
|
||||||
|
|
|
@ -20,22 +20,7 @@ class Controller {
|
||||||
let filter = {
|
let filter = {
|
||||||
where: {orderFk: this.$state.params.id},
|
where: {orderFk: this.$state.params.id},
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name', 'image']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{relation: 'warehouse'}]
|
{relation: 'warehouse'}]
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,22 +29,7 @@ describe('Order', () => {
|
||||||
let filter = {
|
let filter = {
|
||||||
where: {orderFk: controller.$state.params.id},
|
where: {orderFk: controller.$state.params.id},
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name', 'image']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{relation: 'warehouse'}]
|
{relation: 'warehouse'}]
|
||||||
};
|
};
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
{{("000000"+row.itemFk).slice(-6)}}
|
{{("000000"+row.itemFk).slice(-6)}}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td><vn-fetched-tags concept="row.item.name" tags="row.item.tags"/></td>
|
<td><vn-fetched-tags max-length="6" item="row.item"/></td>
|
||||||
<td number>{{::row.quantity}}</td>
|
<td number>{{::row.quantity}}</td>
|
||||||
<td number>{{::row.price | currency:'€':2}}</td>
|
<td number>{{::row.price | currency:'€':2}}</td>
|
||||||
<td number>{{::row.quantity * row.price | currency:'€':2}}</td>
|
<td number>{{::row.quantity * row.price | currency:'€':2}}</td>
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
{{::row.itemFk}}
|
{{::row.itemFk}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td><vn-fetched-tags concept="row.item.name" tags="row.item.tags"/></vn-td>
|
<vn-td><vn-fetched-tags max-length="6" item="row.item"/></vn-td>
|
||||||
<vn-td number>{{::row.quantity}}</vn-td>
|
<vn-td number>{{::row.quantity}}</vn-td>
|
||||||
<vn-td number>{{::row.volume | number:3}}</vn-td>
|
<vn-td number>{{::row.volume | number:3}}</vn-td>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
|
|
|
@ -8,23 +8,7 @@ class Controller {
|
||||||
this.$stateParams = $stateParams;
|
this.$stateParams = $stateParams;
|
||||||
this.filter = {
|
this.filter = {
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
limit: 6
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name']
|
|
||||||
}
|
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
this.order = {};
|
this.order = {};
|
||||||
|
@ -33,17 +17,15 @@ class Controller {
|
||||||
|
|
||||||
onDataChange() {
|
onDataChange() {
|
||||||
this.$http.get(`/order/api/Orders/${this.$stateParams.id}/getVolumes`)
|
this.$http.get(`/order/api/Orders/${this.$stateParams.id}/getVolumes`)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.data) {
|
if (response.data)
|
||||||
this.$scope.model.data.forEach(order => {
|
this.$scope.model.data.forEach(order => {
|
||||||
response.data.volumes.forEach(volume => {
|
response.data.volumes.forEach(volume => {
|
||||||
if (order.itemFk === volume.itemFk) {
|
if (order.itemFk === volume.itemFk)
|
||||||
order.volume = volume.volume;
|
order.volume = volume.volume;
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showDescriptor(event, itemFk) {
|
showDescriptor(event, itemFk) {
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="{{
|
<td rowspan="{{
|
||||||
::sale.components.length + 1
|
::sale.components.length + 1
|
||||||
}}"><vn-fetched-tags concept="sale.concept" tags="sale.item.tags"/></td>
|
}}"><vn-fetched-tags max-length="6" item="sale.item"/></td>
|
||||||
<td rowspan="{{
|
<td rowspan="{{
|
||||||
::sale.components.length + 1
|
::sale.components.length + 1
|
||||||
}}" number>{{::sale.quantity}}</td>
|
}}" number>{{::sale.quantity}}</td>
|
||||||
|
|
|
@ -9,22 +9,6 @@ class Controller {
|
||||||
order: 'concept ASC',
|
order: 'concept ASC',
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item',
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
limit: 6
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
relation: 'components',
|
relation: 'components',
|
||||||
|
@ -52,9 +36,10 @@ class Controller {
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
if (!sales) return;
|
if (!sales) return;
|
||||||
|
|
||||||
for (let sale of sales)
|
for (let sale of sales) {
|
||||||
for (let component of sale.components)
|
for (let component of sale.components)
|
||||||
sum += sale.quantity * component.value;
|
sum += sale.quantity * component.value;
|
||||||
|
}
|
||||||
|
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
@ -65,10 +50,12 @@ class Controller {
|
||||||
|
|
||||||
if (!sales) return;
|
if (!sales) return;
|
||||||
|
|
||||||
for (let sale of sales)
|
for (let sale of sales) {
|
||||||
for (let component of sale.components)
|
for (let component of sale.components) {
|
||||||
if (component.componentRate.name == 'valor de compra')
|
if (component.componentRate.name == 'valor de compra')
|
||||||
sum += sale.quantity * component.value;
|
sum += sale.quantity * component.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
@ -79,10 +66,12 @@ class Controller {
|
||||||
|
|
||||||
if (!sales) return;
|
if (!sales) return;
|
||||||
|
|
||||||
for (let sale of sales)
|
for (let sale of sales) {
|
||||||
for (let component of sale.components)
|
for (let component of sale.components) {
|
||||||
if (component.componentRate.name != 'valor de compra')
|
if (component.componentRate.name != 'valor de compra')
|
||||||
sum += sale.quantity * component.value;
|
sum += sale.quantity * component.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="sale in $ctrl.ticket.sale.items track by sale.id">
|
<tr ng-repeat="sale in $ctrl.ticket.sale.items track by sale.id">
|
||||||
<td number>{{("000000"+sale.itemFk).slice(-6)}}</td>
|
<td number>{{("000000"+sale.itemFk).slice(-6)}}</td>
|
||||||
<td><vn-fetched-tags concept="sale.concept" tags="sale.item.tags"/></td>
|
<td><vn-fetched-tags max-length="6" item="sale.item"/></td>
|
||||||
<td number>{{::sale.quantity}}</td>
|
<td number>{{::sale.quantity}}</td>
|
||||||
<td number>{{::sale.price | currency: '€': 2}}</td>
|
<td number>{{::sale.price | currency: '€': 2}}</td>
|
||||||
<td number>{{::sale.component.newPrice | currency: '€': 2}}</td>
|
<td number>{{::sale.component.newPrice | currency: '€': 2}}</td>
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
{{("000000"+sale.itemFk).slice(-6)}}
|
{{("000000"+sale.itemFk).slice(-6)}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td><vn-fetched-tags concept="sale.concept" tags="sale.item.tags"/></vn-td>
|
<vn-td><vn-fetched-tags max-length="6" item="sale.item"/></vn-td>
|
||||||
<vn-td number>{{::sale.quantity}}</vn-td>
|
<vn-td number>{{::sale.quantity}}</vn-td>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-tbody>
|
</vn-tbody>
|
||||||
|
|
|
@ -6,23 +6,7 @@ class Controller {
|
||||||
this.$stateParams = $stateParams;
|
this.$stateParams = $stateParams;
|
||||||
this.filter = {
|
this.filter = {
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
limit: 6
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
relation: 'isChecked',
|
relation: 'isChecked',
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
{{("000000"+sale.itemFk).slice(-6)}}
|
{{("000000"+sale.itemFk).slice(-6)}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td><vn-fetched-tags concept="sale.concept" tags="sale.item.tags"/></vn-td>
|
<vn-td><vn-fetched-tags max-length="6" item="sale.item"/></vn-td>
|
||||||
<vn-td>{{::sale.quantity}}</vn-td>
|
<vn-td>{{::sale.quantity}}</vn-td>
|
||||||
<vn-td>{{::sale.originalQuantity}}</vn-td>
|
<vn-td>{{::sale.originalQuantity}}</vn-td>
|
||||||
<vn-td title="{{::sale.firstName}} {{::sale.name}}"
|
<vn-td title="{{::sale.firstName}} {{::sale.name}}"
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
{{("000000"+sale.itemFk).slice(-6)}}
|
{{("000000"+sale.itemFk).slice(-6)}}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td><vn-fetched-tags concept="sale.concept" tags="sale.item.tags"/></td>
|
<td><vn-fetched-tags max-length="6" item="sale.item"/></td>
|
||||||
<td number>{{::sale.quantity}}</td>
|
<td number>{{::sale.quantity}}</td>
|
||||||
<td number>{{::sale.price | currency:'€':2}}</td>
|
<td number>{{::sale.price | currency:'€':2}}</td>
|
||||||
<td number>{{::sale.discount}} %</td>
|
<td number>{{::sale.discount}} %</td>
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
{{("000000"+sale.itemFk).slice(-6)}}
|
{{("000000"+sale.itemFk).slice(-6)}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
<vn-td><vn-fetched-tags concept="sale.concept" tags="sale.item.tags"/></vn-td>
|
<vn-td><vn-fetched-tags max-length="6" item="sale.item"/></vn-td>
|
||||||
<vn-td number>{{::sale.quantity}}</vn-td>
|
<vn-td number>{{::sale.quantity}}</vn-td>
|
||||||
<vn-td number>{{::sale.volume.m3 | number:3}}</vn-td>
|
<vn-td number>{{::sale.volume.m3 | number:3}}</vn-td>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
|
|
|
@ -8,23 +8,7 @@ class Controller {
|
||||||
this.$stateParams = $stateParams;
|
this.$stateParams = $stateParams;
|
||||||
this.filter = {
|
this.filter = {
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
limit: 6
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name']
|
|
||||||
}
|
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,17 +17,16 @@ class Controller {
|
||||||
|
|
||||||
onDataChange() {
|
onDataChange() {
|
||||||
this.$http.get(`/api/tickets/${this.ticket.id}/getVolume`)
|
this.$http.get(`/api/tickets/${this.ticket.id}/getVolume`)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.$scope.model.data.forEach(sale => {
|
this.$scope.model.data.forEach(sale => {
|
||||||
response.data.volumes.forEach(volume => {
|
response.data.volumes.forEach(volume => {
|
||||||
if (sale.id === volume.saleFk) {
|
if (sale.id === volume.saleFk)
|
||||||
sale.volume = volume;
|
sale.volume = volume;
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showDescriptor(event, itemFk) {
|
showDescriptor(event, itemFk) {
|
||||||
|
|
|
@ -25,30 +25,14 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.priceDifference = async(ticketFk, data) => {
|
Self.priceDifference = async (ticketFk, data) => {
|
||||||
let filter = {
|
let filter = {
|
||||||
where: {
|
where: {
|
||||||
ticketFk: ticketFk
|
ticketFk: ticketFk
|
||||||
},
|
},
|
||||||
order: 'concept ASC',
|
order: 'concept ASC',
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
limit: 6
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name']
|
|
||||||
}
|
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
let salesObj = {};
|
let salesObj = {};
|
||||||
|
|
|
@ -92,22 +92,6 @@ module.exports = Self => {
|
||||||
order: 'itemFk ASC',
|
order: 'itemFk ASC',
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'item',
|
relation: 'item',
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
limit: 6
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fields: ['itemFk', 'name']
|
|
||||||
}
|
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,18 @@
|
||||||
},
|
},
|
||||||
"value8": {
|
"value8": {
|
||||||
"type": "String"
|
"type": "String"
|
||||||
|
},
|
||||||
|
"tag9": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"value9": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"tag10": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"value10": {
|
||||||
|
"type": "String"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
|
@ -59,12 +59,7 @@ module.exports = Self => {
|
||||||
relation: 'rows',
|
relation: 'rows',
|
||||||
scope: {
|
scope: {
|
||||||
include: {
|
include: {
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
include: {
|
|
||||||
relation: 'tags'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,23 +46,7 @@ module.exports = Self => {
|
||||||
let salesFilter = {
|
let salesFilter = {
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'item',
|
relation: 'item'
|
||||||
scope: {
|
|
||||||
fields: ['itemFk', 'name'],
|
|
||||||
include: {
|
|
||||||
relation: 'tags',
|
|
||||||
scope: {
|
|
||||||
fields: ['tagFk', 'value'],
|
|
||||||
include: {
|
|
||||||
relation: 'tag',
|
|
||||||
scope: {
|
|
||||||
fields: ['name']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
limit: 6
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
where: {ticketFk: filter.where.ticketFk}
|
where: {ticketFk: filter.where.ticketFk}
|
||||||
|
|
Loading…
Reference in New Issue