From bfc9228eef788ad69af640a78600942a6225723d Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 28 Oct 2021 09:06:03 +0200 Subject: [PATCH] Restored ticket table and added table compatibility on contextmenu --- front/core/components/contextmenu/index.js | 12 +- modules/ticket/front/index/index.html | 180 +++++++++++++++++++-- modules/ticket/front/index/index.js | 45 +++--- 3 files changed, 194 insertions(+), 43 deletions(-) diff --git a/front/core/components/contextmenu/index.js b/front/core/components/contextmenu/index.js index 646df1a0a..76a25e701 100755 --- a/front/core/components/contextmenu/index.js +++ b/front/core/components/contextmenu/index.js @@ -49,7 +49,7 @@ export default class Contextmenu { get rowIndex() { if (!this.row) return null; - const table = this.row.closest('vn-table, .vn-table'); + const table = this.row.closest('table, vn-table, .vn-table'); const rows = table.querySelectorAll('[ng-repeat]'); return Array.from(rows).findIndex( @@ -67,13 +67,13 @@ export default class Contextmenu { get cell() { if (!this.target) return null; - return this.target.closest('vn-td, .vn-td, vn-td-editable'); + return this.target.closest('td, vn-td, .vn-td, vn-td-editable'); } get cellIndex() { if (!this.row) return null; - const cells = this.row.querySelectorAll('vn-td, .vn-td, vn-td-editable'); + const cells = this.row.querySelectorAll('td, vn-td, .vn-td, vn-td-editable'); return Array.from(cells).findIndex( cellItem => cellItem == this.cell ); @@ -82,8 +82,8 @@ export default class Contextmenu { get rowHeader() { if (!this.row) return null; - const table = this.row.closest('vn-table, .vn-table'); - const headerCells = table && table.querySelectorAll('vn-thead vn-th'); + const table = this.row.closest('table, vn-table, .vn-table'); + const headerCells = table && table.querySelectorAll('thead th, vn-thead vn-th'); const headerCell = headerCells && headerCells[this.cellIndex]; return headerCell; @@ -147,7 +147,7 @@ export default class Contextmenu { */ isActionAllowed() { if (!this.target) return false; - const isTableCell = this.target.closest('vn-td, .vn-td'); + const isTableCell = this.target.closest('td, vn-td, .vn-td'); return isTableCell && this.fieldName; } diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index dc0f49369..e0062fc1f 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -1,12 +1,12 @@ - - + + #ID - - Nickname + + Salesperson + + + Date - Pepinillos + Hour + + Closure + + + Alias + + + Province + + + State + + + Zone + + + Warehouse + + + Total + + @@ -66,9 +92,113 @@ vn-click-stop> - {{::ticket.id}} - {{::ticket.nickname}} - + + + + + + + + + + + + + + + {{::ticket.id}} + + + {{::ticket.userName | dashIfEmpty}} + + + + + {{::ticket.shipped | date: 'dd/MM/yyyy'}} + + + {{::ticket.shipped | date: 'HH:mm'}} + {{::ticket.zoneLanding | date: 'HH:mm'}} + + + {{::ticket.nickname}} + + + {{::ticket.province}} + + + {{::ticket.refFk}} + + + {{ticket.state}} + + + + + {{::ticket.zoneName | dashIfEmpty}} + + + {{::ticket.warehouse}} + + + {{::(ticket.totalWithVat ? ticket.totalWithVat : 0) | currency: 'EUR': 2}} + + + + + + + + @@ -131,6 +261,36 @@ vn-id="invoiceOutDescriptor"> + + + + Filter by selection + + + Exclude selection + + + Remove filter + + + Remove all filters + + + Copy value + + + +