From 11a0b98495d7f6a5b2d15db726a3dae261cd5c10 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 16 May 2024 10:20:08 +0200 Subject: [PATCH 1/4] feat: refs #7296 roadmapStop --- modules/route/back/methods/roadmap/clone.js | 10 +++++----- modules/route/back/model-config.json | 2 +- modules/route/back/models/roadmap.json | 2 +- ...{expedition-truck.json => roadmapStop.json} | 4 ++-- modules/route/front/roadmap/stops/index.html | 16 ++++++++-------- modules/route/front/roadmap/summary/index.html | 18 +++++++++--------- modules/route/front/roadmap/summary/index.js | 12 ++++++------ .../ticket/back/models/expeditionPallet.json | 2 +- myt.config.yml | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) rename modules/route/back/models/{expedition-truck.json => roadmapStop.json} (92%) diff --git a/modules/route/back/methods/roadmap/clone.js b/modules/route/back/methods/roadmap/clone.js index 456ed823d..2226b1e50 100644 --- a/modules/route/back/methods/roadmap/clone.js +++ b/modules/route/back/methods/roadmap/clone.js @@ -62,12 +62,12 @@ module.exports = Self => { const clone = await models.Roadmap.create(roadmap, options); - const expeditionTrucks = roadmap.expeditionTruck(); - expeditionTrucks.map(expeditionTruck => { - expeditionTruck.roadmapFk = clone.id; - return expeditionTruck; + const roadmapStops = roadmap.roadmapStop(); + roadmapStops.map(roadmapStop => { + roadmapStop.roadmapFk = clone.id; + return roadmapStop; }); - await models.ExpeditionTruck.create(expeditionTrucks, options); + await models.roadmapStop.create(roadmapStops, options); } await tx.commit(); diff --git a/modules/route/back/model-config.json b/modules/route/back/model-config.json index 6cf8da986..09cda6b2d 100644 --- a/modules/route/back/model-config.json +++ b/modules/route/back/model-config.json @@ -8,7 +8,7 @@ "DeliveryPoint": { "dataSource": "vn" }, - "ExpeditionTruck": { + "RoadmapStop": { "dataSource": "vn" }, "Roadmap": { diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json index 2f6bb8c02..2b02c64f2 100644 --- a/modules/route/back/models/roadmap.json +++ b/modules/route/back/models/roadmap.json @@ -56,7 +56,7 @@ }, "expeditionTruck": { "type": "hasMany", - "model": "ExpeditionTruck", + "model": "roadmapStop", "foreignKey": "roadmapFk" } } diff --git a/modules/route/back/models/expedition-truck.json b/modules/route/back/models/roadmapStop.json similarity index 92% rename from modules/route/back/models/expedition-truck.json rename to modules/route/back/models/roadmapStop.json index 8edc7347f..51aa3a6db 100644 --- a/modules/route/back/models/expedition-truck.json +++ b/modules/route/back/models/roadmapStop.json @@ -1,9 +1,9 @@ { - "name": "ExpeditionTruck", + "name": "RoadmapStop", "base": "VnModel", "options": { "mysql": { - "table": "expeditionTruck" + "table": "roadmapStop" } }, "properties": { diff --git a/modules/route/front/roadmap/stops/index.html b/modules/route/front/roadmap/stops/index.html index b69492a21..82f30c326 100644 --- a/modules/route/front/roadmap/stops/index.html +++ b/modules/route/front/roadmap/stops/index.html @@ -1,22 +1,22 @@
- + + ng-model="roadmapStop.eta"> diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html index 9fab0bf87..abf5ff90a 100644 --- a/modules/route/front/roadmap/summary/index.html +++ b/modules/route/front/roadmap/summary/index.html @@ -49,7 +49,7 @@ vn-bind="+" vn-tooltip="Add stop" icon="add_circle" - vn-click-stop="addExpeditionTruck.show()"> + vn-click-stop="addRoadmapStop.show()"> @@ -61,9 +61,9 @@ - - {{expeditionTruck.warehouse.name}} - {{expeditionTruck.eta | date:'dd/MM/yyyy HH:mm'}} + + {{roadmapStop.warehouse.name}} + {{roadmapStop.eta | date:'dd/MM/yyyy HH:mm'}} @@ -75,14 +75,14 @@ + ng-model="$ctrl.roadmapStop.eta"> diff --git a/modules/route/front/roadmap/summary/index.js b/modules/route/front/roadmap/summary/index.js index 041b43ce3..e0903f3a7 100644 --- a/modules/route/front/roadmap/summary/index.js +++ b/modules/route/front/roadmap/summary/index.js @@ -20,7 +20,7 @@ class Controller extends Component { include: [ {relation: 'supplier'}, {relation: 'worker'}, - {relation: 'expeditionTruck', + {relation: 'ExpeditionTruck', scope: { include: [ {relation: 'warehouse'} @@ -36,19 +36,19 @@ class Controller extends Component { const eta = new Date(this.roadmap.etd); eta.setDate(eta.getDate() + 1); - this.expeditionTruck = {eta: eta}; + this.roadmapStop = {eta: eta}; } onAddAccept() { try { const data = { roadmapFk: this.roadmap.id, - warehouseFk: this.expeditionTruck.warehouseFk, - eta: this.expeditionTruck.eta, - description: this.expeditionTruck.description + warehouseFk: this.roadmapStop.warehouseFk, + eta: this.roadmapStop.eta, + description: this.roadmapStop.description }; - this.$http.post(`ExpeditionTrucks`, data) + this.$http.post(`roadmapStops`, data) .then(() => { this.loadData(); this.vnApp.showSuccess(this.$t('Data saved!')); diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json index cab3af6ec..8384ab883 100644 --- a/modules/ticket/back/models/expeditionPallet.json +++ b/modules/ticket/back/models/expeditionPallet.json @@ -25,7 +25,7 @@ "relations": { "expeditionTruck": { "type": "belongsTo", - "model": "ExpeditionTruck", + "model": "RoadmapStop", "foreignKey": "truckFk" } } diff --git a/myt.config.yml b/myt.config.yml index 17300aa37..56239ca3c 100755 --- a/myt.config.yml +++ b/myt.config.yml @@ -227,7 +227,7 @@ localFixtures: - expeditionScan - expeditionState - expeditionStateType - - expeditionTruck + - roadmapStop - expense - genus - greuge From 62ca4885c4ccad02f9c8826f0e7bbeb79a8b27e7 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 20 May 2024 12:28:27 +0200 Subject: [PATCH 2/4] feat: refs #7296 requested changes --- modules/route/back/models/roadmap.json | 2 +- modules/ticket/back/models/expeditionPallet.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json index 2b02c64f2..c7c1f15eb 100644 --- a/modules/route/back/models/roadmap.json +++ b/modules/route/back/models/roadmap.json @@ -54,7 +54,7 @@ "model": "Supplier", "foreignKey": "supplierFk" }, - "expeditionTruck": { + "roadmapStop": { "type": "hasMany", "model": "roadmapStop", "foreignKey": "roadmapFk" diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json index 8384ab883..017c5e5d4 100644 --- a/modules/ticket/back/models/expeditionPallet.json +++ b/modules/ticket/back/models/expeditionPallet.json @@ -23,7 +23,7 @@ } }, "relations": { - "expeditionTruck": { + "RoadmapStop": { "type": "belongsTo", "model": "RoadmapStop", "foreignKey": "truckFk" From 34f48e46e7c8b18e4fef7e7c287bba0fba2c5e94 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 20 May 2024 13:19:01 +0200 Subject: [PATCH 3/4] feat: refs #7296 requested changes2 --- modules/route/front/roadmap/summary/index.js | 4 ++-- modules/ticket/back/models/expeditionPallet.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/route/front/roadmap/summary/index.js b/modules/route/front/roadmap/summary/index.js index e0903f3a7..46abe5ca2 100644 --- a/modules/route/front/roadmap/summary/index.js +++ b/modules/route/front/roadmap/summary/index.js @@ -20,7 +20,7 @@ class Controller extends Component { include: [ {relation: 'supplier'}, {relation: 'worker'}, - {relation: 'ExpeditionTruck', + {relation: 'roadmapStop', scope: { include: [ {relation: 'warehouse'} @@ -48,7 +48,7 @@ class Controller extends Component { description: this.roadmapStop.description }; - this.$http.post(`roadmapStops`, data) + this.$http.post(`RoadmapStops`, data) .then(() => { this.loadData(); this.vnApp.showSuccess(this.$t('Data saved!')); diff --git a/modules/ticket/back/models/expeditionPallet.json b/modules/ticket/back/models/expeditionPallet.json index 017c5e5d4..64b3092ae 100644 --- a/modules/ticket/back/models/expeditionPallet.json +++ b/modules/ticket/back/models/expeditionPallet.json @@ -23,7 +23,7 @@ } }, "relations": { - "RoadmapStop": { + "roadmapStop": { "type": "belongsTo", "model": "RoadmapStop", "foreignKey": "truckFk" From 823e8fd7a154a4631fdb454d04297658913d7e89 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 20 May 2024 13:27:38 +0200 Subject: [PATCH 4/4] feat: refs #7296 requested changes3 --- modules/route/back/methods/roadmap/clone.js | 2 +- modules/route/back/models/roadmap.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/route/back/methods/roadmap/clone.js b/modules/route/back/methods/roadmap/clone.js index 2226b1e50..b74cf803c 100644 --- a/modules/route/back/methods/roadmap/clone.js +++ b/modules/route/back/methods/roadmap/clone.js @@ -67,7 +67,7 @@ module.exports = Self => { roadmapStop.roadmapFk = clone.id; return roadmapStop; }); - await models.roadmapStop.create(roadmapStops, options); + await models.RoadmapStop.create(roadmapStops, options); } await tx.commit(); diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json index c7c1f15eb..01572d718 100644 --- a/modules/route/back/models/roadmap.json +++ b/modules/route/back/models/roadmap.json @@ -56,7 +56,7 @@ }, "roadmapStop": { "type": "hasMany", - "model": "roadmapStop", + "model": "RoadmapStop", "foreignKey": "roadmapFk" } }