This commit is contained in:
Juan Ferrer 2018-12-21 12:51:48 +01:00
commit efe6265b12
12 changed files with 119 additions and 18 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,9 +50,7 @@
</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"
class="{{::$ctrl.compareDate(ticket.shipped)}} clickable vn-tr"
ui-sref="ticket.card.summary({id: {{::ticket.id}}})"> 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"
@ -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,32 @@ vn-ticket-index{
color: initial; color: initial;
} }
} }
.alert1 {
background-color: $main-01-03;
&:hover {
background-color: $main-01-05;
}
}
.alertOk {
background-color: $main-02-03;
&:hover {
background-color: $main-02-05;
}
}
.alertFree {
background-color: $main-03-03;
&:hover {
background-color: $main-03-05;
}
}
.alert0 {
background-color: $alert-01-03;
&:hover {
background-color: $alert-01-05;
}
}
} }

View File

@ -35,10 +35,10 @@
<vn-td number>{{::request.id}}</vn-td> <vn-td number>{{::request.id}}</vn-td>
<vn-td>{{::request.description}}</vn-td> <vn-td>{{::request.description}}</vn-td>
<vn-td number>{{::request.created | dateTime: 'dd/MM/yyyy'}}</vn-td> <vn-td number>{{::request.created | dateTime: 'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::request.requester.firstName}} {{::request.requester.name}}</vn-td> <vn-td>{{::request.requester.user.name}}</vn-td>
<vn-td>{{::request.atender.firstName}} {{::request.atender.name}}</vn-td> <vn-td>{{::request.atender.user.name}}</vn-td>
<vn-td number>{{::request.quantity}}</vn-td> <vn-td number>{{::request.quantity}}</vn-td>
<vn-td number>{{::request.price}}</vn-td> <vn-td number>{{::request.price | currency: '€': 2}}</vn-td>
<vn-td number> <vn-td number>
<span <span
ng-show="::request.saleFk" ng-show="::request.saleFk"

View File

@ -6,8 +6,20 @@ class Controller {
this.$scope = $scope; this.$scope = $scope;
this.filter = { this.filter = {
include: [ include: [
{relation: 'atender', fields: ['firstName', 'name']}, {relation: 'atender',
{relation: 'requester', fields: ['firstName', 'name']}, scope: {
include: {
relation: 'user'
}
}
},
{relation: 'requester',
scope: {
include: {
relation: 'user'
}
}
},
{relation: 'sale'} {relation: 'sale'}
] ]
}; };

View File

@ -85,6 +85,14 @@
</vn-textfield> </vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-autocomplete
vn-one
label="State"
value-field="alertLevel"
show-field="code"
field="filter.alertLevel"
url="/api/AlertLevels">
</vn-autocomplete>
<vn-check <vn-check
vn-one vn-one
label="My team" label="My team"

View File

@ -67,6 +67,10 @@ module.exports = Self => {
arg: 'orderFk', arg: 'orderFk',
type: 'Number', type: 'Number',
description: `The order id filter` description: `The order id filter`
}, {
arg: 'alertLevel',
type: 'Number',
description: `The alert level of the tickets`
} }
], ],
returns: { returns: {
@ -132,6 +136,8 @@ module.exports = Self => {
return {'ts.stateFk': value}; return {'ts.stateFk': value};
case 'myTeam': case 'myTeam':
return {'c.salesPersonFk': {inq: teamIds}}; return {'c.salesPersonFk': {inq: teamIds}};
case 'alertLevel':
return {'ts.alertLevel': value};
case 'id': case 'id':
case 'clientFk': case 'clientFk':
case 'agencyModeFk': case 'agencyModeFk':
@ -164,7 +170,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

View File

@ -0,0 +1,29 @@
{
"name": "AlertLevel",
"description": "Alert levels of a ticket",
"base": "VnModel",
"options": {
"mysql": {
"table": "alertLevel"
}
},
"properties": {
"code": {
"type": "String",
"id": true,
"description": "Identifier"
},
"alertLevel": {
"type": "Number",
"id": true
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}