2350-order_index #334
|
@ -133,5 +133,6 @@
|
|||
"Distance must be lesser than 1000": "La distancia debe ser inferior a 1000",
|
||||
"This ticket is deleted": "Este ticket está eliminado",
|
||||
"A travel with this data already exists": "Ya existe un travel con estos datos",
|
||||
"This thermograph id already exists": "La id del termógrafo ya existe"
|
||||
"This thermograph id already exists": "La id del termógrafo ya existe",
|
||||
"ORDER_ALREADY_CONFIRMED": "ORDER_ALREADY_CONFIRMED"
|
||||
}
|
|
@ -10,8 +10,8 @@
|
|||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th field="id" number>Id</vn-th>
|
||||
<vn-th field="clientFk">Client</vn-th>
|
||||
<vn-th field="salesPersonFk">Sales person</vn-th>
|
||||
<vn-th field="clientFk">Client</vn-th>
|
||||
<vn-th field="isConfirmed" center>Confirmed</vn-th>
|
||||
<vn-th field="created" center>Created</vn-th>
|
||||
<vn-th field="landed" default-order="DESC" center>Landed</vn-th>
|
||||
|
@ -26,16 +26,16 @@
|
|||
<vn-td number>{{::order.id}}</vn-td>
|
||||
<vn-td expand>
|
||||
<span
|
||||
vn-click-stop="clientDescriptor.show($event, order.clientFk)"
|
||||
class="link">
|
||||
{{::order.clientName}}
|
||||
vn-click-stop="workerDescriptor.show($event, order.salesPersonFk)"
|
||||
class="link" >
|
||||
{{::order.name | dashIfEmpty}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td expand>
|
||||
<span
|
||||
vn-click-stop="workerDescriptor.show($event, order.salesPersonFk)"
|
||||
class="link" >
|
||||
{{::order.name | dashIfEmpty}}
|
||||
vn-click-stop="clientDescriptor.show($event, order.clientFk)"
|
||||
class="link">
|
||||
{{::order.clientName}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td center>
|
||||
|
@ -45,7 +45,11 @@
|
|||
</vn-check>
|
||||
</vn-td>
|
||||
<vn-td center>{{::order.created | date: 'dd/MM/yyyy HH:mm'}}</vn-td>
|
||||
<vn-td center>{{::order.landed | date:'dd/MM/yyyy'}}</vn-td>
|
||||
<vn-td center>
|
||||
<span class="chip {{$ctrl.compareDate(order.landed)}}">
|
||||
{{::order.landed | date:'dd/MM/yyyy'}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number>{{::order.total | currency: 'EUR': 2 | dashIfEmpty}}</vn-td>
|
||||
<vn-td shrink>
|
||||
<vn-icon-button
|
||||
|
|
|
@ -3,9 +3,24 @@ import Section from 'salix/components/section';
|
|||
|
||||
export default class Controller extends Section {
|
||||
preview(order) {
|
||||
console.log('order', order);
|
||||
this.selectedOrder = order;
|
||||
this.$.summary.show();
|
||||
}
|
||||
|
||||
compareDate(date) {
|
||||
let today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
let timeTicket = new Date(date);
|
||||
timeTicket.setHours(0, 0, 0, 0);
|
||||
|
||||
let comparation = today - timeTicket;
|
||||
|
||||
if (comparation == 0)
|
||||
return 'warning';
|
||||
if (comparation < 0)
|
||||
return 'success';
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnOrderIndex', {
|
||||
|
|
|
@ -22,3 +22,5 @@ Descendant: Descendente
|
|||
Created from: Creado desde
|
||||
Search order by id: Buscar el pedido por identificador
|
||||
order: pedido
|
||||
Confirm lines: Confirmar las lineas
|
||||
Confirm: Confirmar
|
|
@ -1,5 +1,14 @@
|
|||
<vn-card class="summary">
|
||||
<h5>{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}} - {{$ctrl.summary.client.salesPerson.id}}</h5>
|
||||
<h5>{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}} - {{$ctrl.summary.client.salesPerson.id}}
|
||||
<vn-button
|
||||
disabled="$ctrl.order.isConfirmed"
|
||||
class="flat"
|
||||
style="color: inherit;"
|
||||
label="Confirm"
|
||||
ng-click="$ctrl.save()"
|
||||
vn-tooltip="Confirm lines">
|
||||
</vn-button>
|
||||
</h5>
|
||||
<vn-horizontal class="ticketSummary__data">
|
||||
<vn-one>
|
||||
<vn-label-value label="Id"
|
||||
|
|
|
@ -21,6 +21,15 @@ class Controller extends Section {
|
|||
if (this.order && this.order.id)
|
||||
this.setSummary();
|
||||
}
|
||||
|
||||
save() {
|
||||
this.$http.post(`Orders/${this.$params.id}/confirm`).then(() => {
|
||||
this.vnApp.showSuccess(this.$t('Order confirmed'));
|
||||
this.$state.go(`ticket.index`, {
|
||||
q: JSON.stringify({clientFk: this.order.clientFk})
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.component('vnOrderSummary', {
|
||||
|
|
|
@ -3,6 +3,21 @@
|
|||
vn-order-summary .summary{
|
||||
max-width: $width-lg;
|
||||
|
||||
h5 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
|
||||
|
||||
span {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
vn-button {
|
||||
flex: none
|
||||
}
|
||||
}
|
||||
& > div > vn-horizontal > vn-one {
|
||||
min-width: 160px !important;
|
||||
|
||||
|
|
Loading…
Reference in New Issue