4033-route #1050
|
@ -49,7 +49,8 @@ module.exports = Self => {
|
||||||
a.city,
|
a.city,
|
||||||
am.name AS agencyModeName,
|
am.name AS agencyModeName,
|
||||||
u.nickname AS userNickname,
|
u.nickname AS userNickname,
|
||||||
vn.ticketTotalVolume(t.id) AS volume
|
vn.ticketTotalVolume(t.id) AS volume,
|
||||||
|
tob.description
|
||||||
FROM route r
|
FROM route r
|
||||||
JOIN ticket t ON t.routeFk = r.id
|
JOIN ticket t ON t.routeFk = r.id
|
||||||
LEFT JOIN ticketState ts ON ts.ticketFk = t.id
|
LEFT JOIN ticketState ts ON ts.ticketFk = t.id
|
||||||
|
|
|
@ -25,6 +25,12 @@
|
||||||
vn-tooltip="Open buscaman"
|
vn-tooltip="Open buscaman"
|
||||||
icon="icon-buscaman">
|
icon="icon-buscaman">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
|
<vn-button
|
||||||
|
disabled="!$ctrl.isChecked"
|
||||||
|
ng-click="$ctrl.deletePriority()()"
|
||||||
|
vn-tooltip="Delete priority"
|
||||||
|
icon="contact_support">
|
||||||
|
</vn-button>
|
||||||
</vn-tool-bar>
|
</vn-tool-bar>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
<vn-card class="vn-mt-lg">
|
<vn-card class="vn-mt-lg">
|
||||||
|
@ -36,6 +42,7 @@
|
||||||
model="model">
|
model="model">
|
||||||
</vn-multi-check>
|
</vn-multi-check>
|
||||||
</vn-th>
|
</vn-th>
|
||||||
|
<vn-th shrink></vn-th>
|
||||||
<vn-th field="priority">Order</vn-th>
|
<vn-th field="priority">Order</vn-th>
|
||||||
<vn-th field="street" expand>Street</vn-th>
|
<vn-th field="street" expand>Street</vn-th>
|
||||||
<vn-th field="city">City</vn-th>
|
<vn-th field="city">City</vn-th>
|
||||||
|
@ -46,6 +53,7 @@
|
||||||
<vn-th field="id" number>Ticket</vn-th>
|
<vn-th field="id" number>Ticket</vn-th>
|
||||||
<vn-th shrink></vn-th>
|
<vn-th shrink></vn-th>
|
||||||
<vn-th shrink></vn-th>
|
<vn-th shrink></vn-th>
|
||||||
|
<vn-th shrink></vn-th>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-thead>
|
</vn-thead>
|
||||||
<vn-tbody>
|
<vn-tbody>
|
||||||
|
@ -62,6 +70,14 @@
|
||||||
vn-click-stop>
|
vn-click-stop>
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
|
<vn-td>
|
||||||
|
<vn-icon-button
|
||||||
|
icon="add_circle"
|
||||||
|
ng-click="$ctrl.setHighestPriority(ticket.id)"
|
||||||
|
tabindex="-1"
|
||||||
|
vn-click-stop>
|
||||||
|
</vn-icon-button>
|
||||||
|
</vn-td>
|
||||||
<vn-td>
|
<vn-td>
|
||||||
<vn-input-number
|
<vn-input-number
|
||||||
on-change="$ctrl.setPriority(ticket.id, ticket.priority)"
|
on-change="$ctrl.setPriority(ticket.id, ticket.priority)"
|
||||||
|
@ -110,6 +126,15 @@
|
||||||
vn-click-stop>
|
vn-click-stop>
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
</vn-td>
|
</vn-td>
|
||||||
|
<vn-td>
|
||||||
|
<vn-icon-button
|
||||||
|
ng-if="::ticket.description"
|
||||||
|
vn-tooltip="{{::ticket.description}}"
|
||||||
|
icon="icon-notes"
|
||||||
|
tabindex="-1"
|
||||||
|
vn-click-stop>
|
||||||
|
</vn-icon-button>
|
||||||
|
</vn-td>
|
||||||
</a>
|
</a>
|
||||||
</vn-tbody>
|
</vn-tbody>
|
||||||
</vn-table>
|
</vn-table>
|
||||||
|
|
|
@ -24,6 +24,16 @@ class Controller extends Section {
|
||||||
return highestPriority + 1;
|
return highestPriority + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setHighestPriority(id) {
|
||||||
|
const highestPriority = this.getHighestPriority();
|
||||||
|
const params = {priority: highestPriority};
|
||||||
|
const query = `Tickets/${id}/`;
|
||||||
|
this.$http.patch(query, params).then(() => {
|
||||||
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
|
this.$.model.refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setPriority(id, priority) {
|
setPriority(id, priority) {
|
||||||
let params = {priority: priority};
|
let params = {priority: priority};
|
||||||
let query = `Tickets/${id}/`;
|
let query = `Tickets/${id}/`;
|
||||||
|
@ -33,6 +43,17 @@ class Controller extends Section {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deletePriority() {
|
||||||
|
const lines = this.getSelectedItems(this.tickets);
|
||||||
|
|
||||||
|
for (const line of lines) {
|
||||||
|
this.$http.patch(`Tickets/${line.id}/`, {priority: null}).then(() => {
|
||||||
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
|
this.$.model.refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getSelectedItems(items) {
|
getSelectedItems(items) {
|
||||||
const selectedItems = [];
|
const selectedItems = [];
|
||||||
|
|
||||||
|
@ -61,10 +82,10 @@ class Controller extends Section {
|
||||||
let lines = this.getSelectedItems(this.tickets);
|
let lines = this.getSelectedItems(this.tickets);
|
||||||
|
|
||||||
let url = 'http://gps.buscalia.com/usuario/localizar.aspx?bmi=true&addr=';
|
let url = 'http://gps.buscalia.com/usuario/localizar.aspx?bmi=true&addr=';
|
||||||
lines.forEach(line => {
|
lines.forEach((line, index) => {
|
||||||
// if lineOld.street <> line.street
|
const previusLine = lines[index - 1] ? lines[index - 1].street : null;
|
||||||
addresses = addresses + '+to:' + line.postalCode + ' ' + line.city + ' ' + line.street;
|
if (previusLine != line.street)
|
||||||
// lineOld = line
|
addresses = addresses + '+to:' + line.postalCode + ' ' + line.city + ' ' + line.street;
|
||||||
});
|
});
|
||||||
|
|
||||||
window.open(url + addresses, '_blank');
|
window.open(url + addresses, '_blank');
|
||||||
|
|
|
@ -13,3 +13,4 @@ The route's vehicle doesn't have a delivery point: El vehículo de la ruta no ti
|
||||||
The route doesn't have a vehicle: La ruta no tiene un vehículo
|
The route doesn't have a vehicle: La ruta no tiene un vehículo
|
||||||
Population: Población
|
Population: Población
|
||||||
Unlink selected zone?: Desvincular zona seleccionada?
|
Unlink selected zone?: Desvincular zona seleccionada?
|
||||||
|
Delete priority: Borrar orden
|
||||||
|
|
Loading…
Reference in New Issue