#919 ticket.index

This commit is contained in:
Gerard 2018-12-21 07:53:04 +01:00
parent b84d94e3a4
commit b5e864d88e
8 changed files with 47 additions and 13 deletions

View File

@ -2,7 +2,7 @@
vn-client-web-payment { vn-client-web-payment {
vn-icon[icon=clear] { vn-icon[icon=clear] {
color: $alert01; color: $alert-01;
} }
vn-icon[icon=check] { vn-icon[icon=check] {
color: $main-02; color: $main-02;

View File

@ -99,21 +99,21 @@ vn-table {
vn-thead, vn-tbody, vn-empty-rows { vn-thead, vn-tbody, vn-empty-rows {
border-bottom: 3px solid $lines; 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; border-bottom: 1px solid $lines;
transition: background-color 200ms ease-in-out; transition: background-color 200ms ease-in-out;
&.clickable { &.clickable {
@extend %clickable; @extend %clickable;
} }
&.success { &.success, & > vn-td.success {
background-color: rgba(163, 209, 49, 0.3); background-color: rgba(163, 209, 49, 0.3);
&:hover { &:hover {
background-color: rgba(163, 209, 49, 0.5); background-color: rgba(163, 209, 49, 0.5);
} }
} }
&.warning { &.warning, & > vn-td.warning {
background-color: rgba(247, 147, 30, 0.3); background-color: rgba(247, 147, 30, 0.3);
&:hover { &:hover {

View File

@ -14,7 +14,9 @@ $main-03: #32b1ce;
$main-03-05: rgba($main-03, 0.5); $main-03-05: rgba($main-03, 0.5);
$main-03-03: rgba($main-03, 0.3); $main-03-03: rgba($main-03, 0.3);
$lines: #9b9b9b; $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-green: #a3d131;
$color-orange: #f7931e; $color-orange: #f7931e;

View File

@ -9,8 +9,10 @@ html [uppercase], .uppercase {
text-transform: uppercase; text-transform: uppercase;
} }
html [green], .green{color: $color-green}
html [orange], .orange{color: $main-01} 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 [white], .white{color: $color-white}
html [dark], .dark{color: $color-dark} html [dark], .dark{color: $color-dark}
html [dark-grey], .dark-grey{color: $color-dark-grey} html [dark-grey], .dark-grey{color: $color-dark-grey}

View File

@ -50,10 +50,8 @@
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
<vn-tbody> <vn-tbody>
<a <a ng-repeat="ticket in tickets" class="clickable vn-tr"
ng-repeat="ticket in tickets" ui-sref="ticket.card.summary({id: {{::ticket.id}}})">
class="{{::$ctrl.compareDate(ticket.shipped)}} clickable vn-tr"
ui-sref="ticket.card.summary({id: {{::ticket.id}}})">
<vn-td> <vn-td>
<vn-icon ng-show="ticket.problem" class="bright" <vn-icon ng-show="ticket.problem" class="bright"
vn-tooltip="{{ticket.problem}}" vn-tooltip="{{ticket.problem}}"
@ -62,7 +60,9 @@
</vn-td> </vn-td>
<vn-td number>{{::ticket.id}}</vn-td> <vn-td number>{{::ticket.id}}</vn-td>
<vn-td>{{::ticket.salesPerson | dashIfEmpty}}</vn-td> <vn-td>{{::ticket.salesPerson | dashIfEmpty}}</vn-td>
<vn-td>{{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}</vn-td> <vn-td class="{{$ctrl.compareDate(ticket.shipped)}}">
{{::ticket.shipped | dateTime: 'dd/MM/yyyy'}}
</vn-td>
<vn-td>{{::ticket.shipped | dateTime: 'HH:mm'}}</vn-td> <vn-td>{{::ticket.shipped | dateTime: 'HH:mm'}}</vn-td>
<vn-td> <vn-td>
<span <span
@ -72,7 +72,7 @@
</span> </span>
</vn-td> </vn-td>
<vn-td>{{::ticket.province}}</vn-td> <vn-td>{{::ticket.province}}</vn-td>
<vn-td>{{::ticket.state}}</vn-td> <vn-td class="{{$ctrl.stateColor(ticket)}}">{{::ticket.state}}</vn-td>
<vn-td>{{::ticket.agencyMode}}</vn-td> <vn-td>{{::ticket.agencyMode}}</vn-td>
<vn-td>{{::ticket.warehouse}}</vn-td> <vn-td>{{::ticket.warehouse}}</vn-td>
<vn-td number>{{::ticket.refFk | dashIfEmpty}}</vn-td> <vn-td number>{{::ticket.refFk | dashIfEmpty}}</vn-td>

View File

@ -58,6 +58,17 @@ export default class Controller {
return 'success'; 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) { showDescriptor(event, clientFk) {
event.preventDefault(); event.preventDefault();
event.stopImmediatePropagation(); event.stopImmediatePropagation();

View File

@ -9,4 +9,20 @@ vn-ticket-index{
color: initial; 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
}
} }

View File

@ -164,7 +164,10 @@ module.exports = Self => {
w.name AS warehouse, w.name AS warehouse,
am.name AS agencyMode, am.name AS agencyMode,
st.name AS state, 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 FROM ticket t
LEFT JOIN address a ON a.id = t.addressFk LEFT JOIN address a ON a.id = t.addressFk
LEFT JOIN province p ON p.id = a.provinceFk LEFT JOIN province p ON p.id = a.provinceFk