From b5e864d88ee835f37a4b12158caa2698ddb25f98 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 21 Dec 2018 07:53:04 +0100 Subject: [PATCH] #919 ticket.index --- client/client/src/web-payment/style.scss | 2 +- client/core/src/components/table/style.scss | 6 +++--- client/salix/src/styles/colors.scss | 4 +++- client/salix/src/styles/font-style.scss | 4 +++- client/ticket/src/index/index.html | 12 ++++++------ client/ticket/src/index/index.js | 11 +++++++++++ client/ticket/src/index/style.scss | 16 ++++++++++++++++ .../loopback/common/methods/ticket/filter.js | 5 ++++- 8 files changed, 47 insertions(+), 13 deletions(-) diff --git a/client/client/src/web-payment/style.scss b/client/client/src/web-payment/style.scss index dbbd120c9..b010ca444 100644 --- a/client/client/src/web-payment/style.scss +++ b/client/client/src/web-payment/style.scss @@ -2,7 +2,7 @@ vn-client-web-payment { vn-icon[icon=clear] { - color: $alert01; + color: $alert-01; } vn-icon[icon=check] { color: $main-02; diff --git a/client/core/src/components/table/style.scss b/client/core/src/components/table/style.scss index c8facf5ea..59753f001 100644 --- a/client/core/src/components/table/style.scss +++ b/client/core/src/components/table/style.scss @@ -99,21 +99,21 @@ vn-table { vn-thead, vn-tbody, vn-empty-rows { border-bottom: 3px solid $lines; } - vn-tbody > vn-tr, vn-tbody > a.vn-tr { + vn-tbody > vn-tr, vn-tbody > a.vn-tr{ border-bottom: 1px solid $lines; transition: background-color 200ms ease-in-out; &.clickable { @extend %clickable; } - &.success { + &.success, & > vn-td.success { background-color: rgba(163, 209, 49, 0.3); &:hover { background-color: rgba(163, 209, 49, 0.5); } } - &.warning { + &.warning, & > vn-td.warning { background-color: rgba(247, 147, 30, 0.3); &:hover { diff --git a/client/salix/src/styles/colors.scss b/client/salix/src/styles/colors.scss index e7d29c2d9..d610b4919 100644 --- a/client/salix/src/styles/colors.scss +++ b/client/salix/src/styles/colors.scss @@ -14,7 +14,9 @@ $main-03: #32b1ce; $main-03-05: rgba($main-03, 0.5); $main-03-03: rgba($main-03, 0.3); $lines: #9b9b9b; -$alert01: #f42121; +$alert-01: #f42121; +$alert-01-03: rgba($alert-01, 0.5); +$alert-01-05: rgba($alert-01, 0.5); $color-green: #a3d131; $color-orange: #f7931e; diff --git a/client/salix/src/styles/font-style.scss b/client/salix/src/styles/font-style.scss index 462023eca..609f98696 100644 --- a/client/salix/src/styles/font-style.scss +++ b/client/salix/src/styles/font-style.scss @@ -9,8 +9,10 @@ html [uppercase], .uppercase { text-transform: uppercase; } -html [green], .green{color: $color-green} html [orange], .orange{color: $main-01} +html [green], .green{color: $main-02} +html [blue], .blue{color: $main-03} +html [red], html [alert], .red, .alert {color: $alert-01} html [white], .white{color: $color-white} html [dark], .dark{color: $color-dark} html [dark-grey], .dark-grey{color: $color-dark-grey} diff --git a/client/ticket/src/index/index.html b/client/ticket/src/index/index.html index 68660380d..0aab6e4e5 100644 --- a/client/ticket/src/index/index.html +++ b/client/ticket/src/index/index.html @@ -50,10 +50,8 @@ - + {{::ticket.id}} {{::ticket.salesPerson | dashIfEmpty}} - {{::ticket.shipped | dateTime: 'dd/MM/yyyy'}} + + {{::ticket.shipped | dateTime: 'dd/MM/yyyy'}} + {{::ticket.shipped | dateTime: 'HH:mm'}} {{::ticket.province}} - {{::ticket.state}} + {{::ticket.state}} {{::ticket.agencyMode}} {{::ticket.warehouse}} {{::ticket.refFk | dashIfEmpty}} diff --git a/client/ticket/src/index/index.js b/client/ticket/src/index/index.js index 37cc9d1e7..ba0b6dc6c 100644 --- a/client/ticket/src/index/index.js +++ b/client/ticket/src/index/index.js @@ -58,6 +58,17 @@ export default class Controller { return 'success'; } + stateColor(ticket) { + if (ticket.alertLevelCode === 'OK') + return 'alertOk'; + else if (ticket.alertLevelCode === 'FREE') + return 'alertFree'; + else if (ticket.alertLevel === 1) + return 'alert1'; + else if (ticket.alertLevel === 0) + return 'alert0'; + } + showDescriptor(event, clientFk) { event.preventDefault(); event.stopImmediatePropagation(); diff --git a/client/ticket/src/index/style.scss b/client/ticket/src/index/style.scss index bc06b4f20..eaef18b00 100644 --- a/client/ticket/src/index/style.scss +++ b/client/ticket/src/index/style.scss @@ -9,4 +9,20 @@ vn-ticket-index{ color: initial; } } + + .alert1 { + background-color: $main-01-03 + } + + .alertOk { + background-color: $main-02-03 + } + + .alertFree { + background-color: $main-03-03 + } + + .alert0 { + background-color: $alert-01-03 + } } \ No newline at end of file diff --git a/services/loopback/common/methods/ticket/filter.js b/services/loopback/common/methods/ticket/filter.js index b83e87d41..3c9969e4d 100644 --- a/services/loopback/common/methods/ticket/filter.js +++ b/services/loopback/common/methods/ticket/filter.js @@ -164,7 +164,10 @@ module.exports = Self => { w.name AS warehouse, am.name AS agencyMode, st.name AS state, - wk.name AS salesPerson + wk.name AS salesPerson, + ts.stateFk as stateFk, + ts.alertLevel as alertLevel, + ts.code as alertLevelCode FROM ticket t LEFT JOIN address a ON a.id = t.addressFk LEFT JOIN province p ON p.id = a.provinceFk