diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 0094dca9a..941c86038 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -171,9 +171,9 @@ export default { itemsIndex: { goBackToModuleIndexButton: `vn-ticket-descriptor a[href="#!/ticket/index"]`, createItemButton: `${components.vnFloatButton}`, - searchResult: `vn-item-product a`, - searchResultPreviewButton: `vn-item-product .buttons > [icon="desktop_windows"]`, - searchResultCloneButton: `vn-item-product .buttons > [icon="icon-clone"]`, + searchResult: `vn-item-index a.vn-tr`, + searchResultPreviewButton: `vn-item-index .buttons > [icon="desktop_windows"]`, + searchResultCloneButton: `vn-item-index .buttons > [icon="icon-clone"]`, acceptClonationAlertButton: `vn-item-index [vn-id="clone"] [response="ACCEPT"]`, searchItemInput: `vn-searchbar vn-textfield input`, searchButton: `vn-searchbar vn-icon[icon="search"]`, diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index 316fd2ef6..cc047c608 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -32,12 +32,19 @@ module.exports = Self => { let stmt = new ParameterizedSQL( `SELECT i.id, i.image, i.name, i.description, i.size, i.tag5, i.value5, i.tag6, i.value6, - i.tag7, i.value7, i.tag8, i.value8, - t.name type, u.nickname userNickname + i.tag7, i.value7, i.tag8, i.value8, i.isActive, + t.name type, u.nickname userNickname, + intr.description AS intrastat, i.stems, + ori.code AS origin, t.name AS type, + ic.name AS category FROM item i JOIN itemType t ON t.id = i.typeFk + LEFT JOIN itemCategory ic ON ic.id = t.categoryFk JOIN worker w ON w.id = t.workerFk - JOIN account.user u ON u.id = w.userFk` + JOIN account.user u ON u.id = w.userFk + LEFT JOIN intrastat intr ON intr.id = i.intrastatFk + LEFT JOIN producer pr ON pr.id = i.producerFk + LEFT JOIN origin ori ON ori.id = i.originFk` ); if (tags) { diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index e2d2df6e5..d4def30a2 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -1,10 +1,10 @@ + auto-load="true">
@@ -17,23 +17,76 @@ vn-focus> - - - - +
+ + + + + + Id + Description + Stems + Type + Category + Intrastat + Origin + Sales person + Active + + + + + + + + + {{::item.id | zeroFill:6}} + + + + + {{::item.stems}} + {{::item.type}} + {{::item.category}} + {{::item.intrastat}} + {{::item.origin}} + {{::item.userNickname}} + + + + + + + + + + + + + + + No results - - Enter a new search - - - -
+ + + diff --git a/modules/item/front/index/index.js b/modules/item/front/index/index.js index 7926c33c6..e2decd07b 100644 --- a/modules/item/front/index/index.js +++ b/modules/item/front/index/index.js @@ -8,6 +8,12 @@ class Controller { this.$state = $state; this.$ = $scope; this.itemSelected = null; + this.imagesPath = '//verdnatura.es/vn-image-data/catalog'; + + this.showFields = { + id: false, + actions: false + }; } exprBuilder(param, value) { @@ -25,6 +31,23 @@ class Controller { } } + showDescriptor(event, itemFk) { + this.quicklinks = { + btnThree: { + icon: 'icon-transaction', + state: `item.card.diary({ + id: ${itemFk}, + warehouseFk: ${this.ticket.warehouseFk}, + ticketFk: ${this.ticket.id} + })`, + tooltip: 'Item diary' + } + }; + this.$scope.descriptor.itemFk = itemFk; + this.$scope.descriptor.parent = event.target; + this.$scope.descriptor.show(); + } + paramBuilder(param, value) { switch (param) { case 'tags': @@ -32,7 +55,9 @@ class Controller { } } - cloneItem(item) { + cloneItem(event, item) { + event.preventDefault(); + event.stopImmediatePropagation(); this.itemSelected = item; this.$.clone.show(); } @@ -49,7 +74,9 @@ class Controller { this.itemSelected = null; } - showItemPreview(item) { + preview(event, item) { + event.preventDefault(); + event.stopImmediatePropagation(); this.itemSelected = item; this.$.preview.show(); } diff --git a/modules/item/front/index/style.scss b/modules/item/front/index/style.scss index b73c1e32c..0dc1f3049 100644 --- a/modules/item/front/index/style.scss +++ b/modules/item/front/index/style.scss @@ -25,3 +25,10 @@ vn-item-product { margin-top: 0.9em; } } + +vn-table { + img { + border-radius: 50%; + max-width: 50px; + } +} \ No newline at end of file