2350-order_index #334

Merged
joan merged 11 commits from 2350-order_index into dev 2020-07-16 12:02:15 +00:00
7 changed files with 66 additions and 11 deletions
Showing only changes of commit d414db73de - Show all commits

View File

@ -133,5 +133,6 @@
"Distance must be lesser than 1000": "La distancia debe ser inferior a 1000", "Distance must be lesser than 1000": "La distancia debe ser inferior a 1000",
"This ticket is deleted": "Este ticket está eliminado", "This ticket is deleted": "Este ticket está eliminado",
"A travel with this data already exists": "Ya existe un travel con estos datos", "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"
} }

View File

@ -10,8 +10,8 @@
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th field="id" number>Id</vn-th> <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="salesPersonFk">Sales person</vn-th>
<vn-th field="clientFk">Client</vn-th>
<vn-th field="isConfirmed" center>Confirmed</vn-th> <vn-th field="isConfirmed" center>Confirmed</vn-th>
<vn-th field="created" center>Created</vn-th> <vn-th field="created" center>Created</vn-th>
<vn-th field="landed" default-order="DESC" center>Landed</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 number>{{::order.id}}</vn-td>
<vn-td expand> <vn-td expand>
<span <span
vn-click-stop="clientDescriptor.show($event, order.clientFk)" vn-click-stop="workerDescriptor.show($event, order.salesPersonFk)"
class="link"> class="link" >
{{::order.clientName}} {{::order.name | dashIfEmpty}}
</span> </span>
</vn-td> </vn-td>
<vn-td expand> <vn-td expand>
<span <span
vn-click-stop="workerDescriptor.show($event, order.salesPersonFk)" vn-click-stop="clientDescriptor.show($event, order.clientFk)"
class="link" > class="link">
{{::order.name | dashIfEmpty}} {{::order.clientName}}
</span> </span>
</vn-td> </vn-td>
<vn-td center> <vn-td center>
@ -45,7 +45,11 @@
</vn-check> </vn-check>
</vn-td> </vn-td>
<vn-td center>{{::order.created | date: 'dd/MM/yyyy HH:mm'}}</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 number>{{::order.total | currency: 'EUR': 2 | dashIfEmpty}}</vn-td>
<vn-td shrink> <vn-td shrink>
<vn-icon-button <vn-icon-button

View File

@ -3,9 +3,24 @@ import Section from 'salix/components/section';
export default class Controller extends Section { export default class Controller extends Section {
preview(order) { preview(order) {
console.log('order', order);
this.selectedOrder = order; this.selectedOrder = order;
this.$.summary.show(); 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', { ngModule.component('vnOrderIndex', {

View File

@ -21,4 +21,6 @@ Ascendant: Ascendente
Descendant: Descendente Descendant: Descendente
Created from: Creado desde Created from: Creado desde
Search order by id: Buscar el pedido por identificador Search order by id: Buscar el pedido por identificador
order: pedido order: pedido
Confirm lines: Confirmar las lineas
Confirm: Confirmar

View File

@ -1,5 +1,14 @@
<vn-card class="summary"> <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-horizontal class="ticketSummary__data">
<vn-one> <vn-one>
<vn-label-value label="Id" <vn-label-value label="Id"

View File

@ -21,6 +21,15 @@ class Controller extends Section {
if (this.order && this.order.id) if (this.order && this.order.id)
this.setSummary(); this.setSummary();
} }
save() {
this.$http.post(`Orders/${this.$params.id}/confirm`).then(() => {
Outdated
Review

Esto no funcionará desde la vista previa del order.index

Esto no funcionará desde la vista previa del order.index
this.vnApp.showSuccess(this.$t('Order confirmed'));
this.$state.go(`ticket.index`, {
q: JSON.stringify({clientFk: this.order.clientFk})
});
});
}
} }
ngModule.component('vnOrderSummary', { ngModule.component('vnOrderSummary', {

View File

@ -3,6 +3,21 @@
vn-order-summary .summary{ vn-order-summary .summary{
max-width: $width-lg; 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 { & > div > vn-horizontal > vn-one {
min-width: 160px !important; min-width: 160px !important;