refs # añadidos botones para eliminar radmaps y para eliminar/insertar expeditionTrucks
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-05-04 10:15:18 +02:00
parent eda58eb099
commit 16ca2416d1
10 changed files with 99 additions and 55 deletions

View File

@ -6,3 +6,5 @@ ALTER TABLE `vn`.`roadmap` CHANGE name name varchar(45) CHARACTER SET utf8mb3 CO
ALTER TABLE `vn`.`roadmap` MODIFY COLUMN etd datetime NOT NULL;
ALTER TABLE `vn`.`expeditionTruck` COMMENT='Distintas paradas que hacen los trocales';
ALTER TABLE `vn`.`expeditionTruck` DROP FOREIGN KEY expeditionTruck_FK_2;
ALTER TABLE `vn`.`expeditionTruck` ADD CONSTRAINT expeditionTruck_FK_2 FOREIGN KEY (roadmapFk) REFERENCES vn.roadmap(id) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -8,7 +8,7 @@
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield
<vn-textfield vn-focus
vn-one
label="Roadmap"
ng-model="$ctrl.roadmap.name"
@ -74,8 +74,7 @@
vn-one
label="Observations"
ng-model="$ctrl.roadmap.observations"
rule
vn-focus>
rule>
</vn-textArea>
</vn-horizontal>
</vn-card>

View File

@ -2,6 +2,14 @@
module="route"
base-state="route.roadmap"
description="$ctrl.roadmap.name">
<slot-menu>
<vn-item
ng-click="deleteRoadmap.show()"
name="deleteRoadmap"
translate>
Delete roadmap
</vn-item>
</slot-menu>
<slot-body>
<div class="attributes">
<vn-label-value
@ -20,7 +28,12 @@
</div>
</slot-body>
</vn-descriptor-content>
<vn-confirm
vn-id="deleteRoadmap"
on-accept="$ctrl.onDelete()"
question="Are you sure you want to continue?"
message="The roadmap will be removed">
</vn-confirm>
<vn-supplier-descriptor-popover
vn-id="supplierDescriptor">
</vn-supplier-descriptor-popover>

View File

@ -9,6 +9,12 @@ class Controller extends Descriptor {
set roadmap(value) {
this.entity = value;
}
onDelete() {
return this.$http.delete(`Roadmaps/${this.roadmap.id}`)
.then(() => this.$state.go('route.roadmap'))
.then(() => this.vnApp.showSuccess(this.$t('Roadmap removed')));
}
}
ngModule.component('vnRoadmapDescriptor', {

View File

@ -0,0 +1,3 @@
Delete roadmap: Eliminar troncal
The roadmap will be removed: La troncal será eliminada
Roadmap removed: Troncal eliminada

View File

@ -6,42 +6,59 @@
data="$ctrl.expeditionTrucks"
auto-load="true">
</vn-crud-model>
<vn-data-viewer
model="model">
<form
class="vn-w-md"
name="form">
<vn-card>
<section class="vn-pa-md">
<vn-table class="vn-pt-md" model="model" auto-load="false" vn-droppable="$ctrl.onDrop($event)">
<vn-thead>
<vn-tr>
<vn-th field="warehouse">Warehouse</vn-th>
<vn-th expand field="ETD" expand>ETA</vn-th>
<vn-th field="description">Description</vn-th>
<vn-th shrink></vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="expeditionTruck in $ctrl.expeditionTrucks">
<vn-td>{{::expeditionTruck.warehouseFk}}</vn-td>
<vn-td expand>{{::expeditionTruck.ETD | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td>{{::expeditionTruck.description}}</vn-td>
<vn-td>
<vn-icon-button
translate-attr="{title: 'Remove stop'}"
icon="delete"
ng-click="$ctrl.showDeleteConfirm(expeditionTruck.id)"
tabindex="-1">
</vn-icon-button>
</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>
</section>
</vn-card>
</form>
</vn-data-viewer>
<vn-watcher
vn-id="watcher"
data="$ctrl.expeditionTrucks"
form="form">
</vn-watcher>
<form class="vn-w-md" name="form" ng-submit="$ctrl.onSubmit()">
<vn-card class="vn-pa-lg">
<vn-horizontal ng-repeat="expeditionTruck in $ctrl.expeditionTrucks">
<vn-autocomplete vn-one
label="Warehouse"
ng-model="expeditionTruck.warehouseFk"
url="Warehouses"
show-field="name"
value-field="id"
vn-focus
rule>
</vn-autocomplete>
<vn-date-picker vn-one
label="ETD"
ng-model="expeditionTruck.ETD"
rule>
</vn-date-picker>
<vn-textArea
vn-one
label="Description"
ng-model="expeditionTruck.description"
rule>
</vn-textArea>
<vn-none>
<vn-icon-button
vn-tooltip="Remove stop"
icon="delete"
ng-click="model.remove($index)"
tabindex="-1">
</vn-icon-button>
</vn-none>
</vn-horizontal>
<vn-one>
<vn-icon-button
vn-bind="+"
vn-tooltip="Add stop"
icon="add_circle"
ng-click="$ctrl.add()">
</vn-icon-button>
</vn-one>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
</vn-button-bar>
</form>
<vn-confirm
vn-id="confirm"
question="Delete stop?"

View File

@ -2,18 +2,18 @@ import ngModule from '../../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
showDeleteConfirm(id) {
this.selectedExpeditionTruck = id;
this.$.confirm.show();
add() {
this.$.model.insert({
roadmapFk: this.$params.id
});
}
removeExpeditionTruck($index) {
let params = {routeFk: null};
let query = `Tickets/${this.selectedExpeditionTruck}/`;
this.$http.patch(query, params).then(() => {
this.$.model.remove($index);
this.vnApp.showSuccess(this.$t('Ticket removed from route'));
this.updateVolume();
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
this.$.model.refresh();
});
}
}

View File

@ -1 +1,2 @@
Delete stop: Eliminar parada
Remove stop: Eliminar parada
Add stop: Añadir parada

View File

@ -7,7 +7,7 @@
ng-click="deleteShelving.show()"
name="deleteShelving"
translate>
Delete
Delete shelving
</vn-item>
</slot-menu>
<slot-body>
@ -32,7 +32,7 @@
</slot-body>
</vn-descriptor-content>
<vn-confirm
vn-id="delete-shelving"
vn-id="deleteShelving"
on-accept="$ctrl.onDelete()"
question="Are you sure you want to continue?"
message="Shelving will be removed">
@ -40,6 +40,6 @@
<vn-popup vn-id="summary">
<vn-shelving-summary shelving="$ctrl.shelving"></vn-shelving-summary>
</vn-popup>
<vn-worker-descriptor-popover
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>
</vn-worker-descriptor-popover>

View File

@ -0,0 +1,3 @@
Delete shelving: Eliminar carro
Shelving will be removed: El carro será eliminado
Shelving removed: Carro eliminado