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-icon[icon=clear] {
color: $alert01;
color: $alert-01;
}
vn-icon[icon=check] {
color: $main-02;

View File

@ -106,14 +106,14 @@ vn-table {
&.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 {

View File

@ -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;

View File

@ -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}

View File

@ -50,9 +50,7 @@
</vn-tr>
</vn-thead>
<vn-tbody>
<a
ng-repeat="ticket in tickets"
class="{{::$ctrl.compareDate(ticket.shipped)}} clickable vn-tr"
<a ng-repeat="ticket in tickets" class="clickable vn-tr"
ui-sref="ticket.card.summary({id: {{::ticket.id}}})">
<vn-td>
<vn-icon ng-show="ticket.problem" class="bright"
@ -62,7 +60,9 @@
</vn-td>
<vn-td number>{{::ticket.id}}</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>
<span
@ -72,7 +72,7 @@
</span>
</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.warehouse}}</vn-td>
<vn-td number>{{::ticket.refFk | dashIfEmpty}}</vn-td>

View File

@ -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();

View File

@ -9,4 +9,32 @@ vn-ticket-index{
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>{{::request.description}}</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.atender.firstName}} {{::request.atender.name}}</vn-td>
<vn-td>{{::request.requester.user.name}}</vn-td>
<vn-td>{{::request.atender.user.name}}</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>
<span
ng-show="::request.saleFk"

View File

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

View File

@ -85,6 +85,14 @@
</vn-textfield>
</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-one
label="My team"

View File

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

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"
}
]
}