refs #4770 refator: change expeditionTruck.ETD to expeditionTruck.eta
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-07-04 13:52:03 +02:00
parent 854e07cfae
commit c667c67f36
8 changed files with 20 additions and 20 deletions

View File

@ -11,7 +11,7 @@ module.exports = Self => {
description: 'The routes ids to clone' description: 'The routes ids to clone'
}, },
{ {
arg: 'ETD', arg: 'etd',
type: 'date', type: 'date',
required: true, required: true,
description: 'The estimated time of departure for all roadmaps' description: 'The estimated time of departure for all roadmaps'
@ -27,7 +27,7 @@ module.exports = Self => {
} }
}); });
Self.clone = async(ids, ETD) => { Self.clone = async(ids, etd) => {
const tx = await Self.beginTransaction({}); const tx = await Self.beginTransaction({});
try { try {
const models = Self.app.models; const models = Self.app.models;
@ -47,7 +47,7 @@ module.exports = Self => {
include: [{ include: [{
relation: 'expeditionTruck', relation: 'expeditionTruck',
scope: { scope: {
fields: ['roadmapFk', 'warehouseFk', 'ETD', 'description'] fields: ['roadmapFk', 'warehouseFk', 'eta', 'description']
} }
}] }]
@ -58,7 +58,7 @@ module.exports = Self => {
for (const roadmap of originalRoadmaps) { for (const roadmap of originalRoadmaps) {
roadmap.id = undefined; roadmap.id = undefined;
roadmap.etd = ETD; roadmap.etd = etd;
const clone = await models.Roadmap.create(roadmap, options); const clone = await models.Roadmap.create(roadmap, options);

View File

@ -18,7 +18,7 @@
"warehouseFk": { "warehouseFk": {
"type": "number" "type": "number"
}, },
"ETD": { "eta": {
"type": "date" "type": "date"
}, },
"description": { "description": {

View File

@ -95,7 +95,7 @@
<vn-horizontal> <vn-horizontal>
<vn-date-picker <vn-date-picker
label="ETD" label="ETD"
ng-model="$ctrl.ETD"> ng-model="$ctrl.etd">
</vn-date-picker> </vn-date-picker>
</vn-horizontal> </vn-horizontal>
</tpl-body> </tpl-body>

View File

@ -24,19 +24,19 @@ class Controller extends Section {
openClonationDialog() { openClonationDialog() {
this.$.clonationDialog.show(); this.$.clonationDialog.show();
this.ETD = Date.vnNew(); this.etd = Date.vnNew();
} }
cloneSelectedRoadmaps() { cloneSelectedRoadmaps() {
try { try {
if (!this.ETD) if (!this.etd)
throw new Error(`The date can't be empty`); throw new Error(`The date can't be empty`);
const roadmapsIds = []; const roadmapsIds = [];
for (let roadmap of this.checked) for (let roadmap of this.checked)
roadmapsIds.push(roadmap.id); roadmapsIds.push(roadmap.id);
return this.$http.post('Roadmaps/clone', {ids: roadmapsIds, ETD: this.ETD}).then(() => { return this.$http.post('Roadmaps/clone', {ids: roadmapsIds, etd: this.etd}).then(() => {
this.$.model.refresh(); this.$.model.refresh();
this.vnApp.showSuccess(this.$t('Data saved!')); this.vnApp.showSuccess(this.$t('Data saved!'));
}); });

View File

@ -2,7 +2,7 @@
vn-id="model" vn-id="model"
url="ExpeditionTrucks" url="ExpeditionTrucks"
where="{roadmapFk: $ctrl.$params.id}" where="{roadmapFk: $ctrl.$params.id}"
order="ETD ASC" order="eta ASC"
data="$ctrl.expeditionTrucks" data="$ctrl.expeditionTrucks"
auto-load="true"> auto-load="true">
</vn-crud-model> </vn-crud-model>
@ -25,13 +25,13 @@
</vn-autocomplete> </vn-autocomplete>
<vn-date-picker vn-one <vn-date-picker vn-one
label="ETA date" label="ETA date"
ng-model="expeditionTruck.ETD" ng-model="expeditionTruck.eta"
rule> rule>
</vn-date-picker> </vn-date-picker>
<vn-input-time <vn-input-time
vn-one vn-one
label="ETA hour" label="ETA hour"
ng-model="expeditionTruck.ETD"> ng-model="expeditionTruck.eta">
</vn-input-time> </vn-input-time>
<vn-textArea <vn-textArea
vn-one vn-one

View File

@ -15,7 +15,7 @@ export default class Controller extends Section {
this.$.model.insert({ this.$.model.insert({
roadmapFk: this.$params.id, roadmapFk: this.$params.id,
ETD: eta eta: eta
}); });
}); });
} }

View File

@ -60,7 +60,7 @@
<vn-tbody> <vn-tbody>
<vn-tr ng-repeat="expeditionTruck in summary.expeditionTruck"> <vn-tr ng-repeat="expeditionTruck in summary.expeditionTruck">
<vn-td>{{expeditionTruck.warehouse.name}}</vn-td> <vn-td>{{expeditionTruck.warehouse.name}}</vn-td>
<vn-td expand>{{expeditionTruck.ETD | date:'dd/MM/yyyy HH:mm'}}</vn-td> <vn-td expand>{{expeditionTruck.eta | date:'dd/MM/yyyy HH:mm'}}</vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>
</vn-table> </vn-table>
@ -89,13 +89,13 @@
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-date-picker <vn-date-picker
label="ETD date" label="ETA date"
ng-model="$ctrl.expeditionTruck.ETD" ng-model="$ctrl.expeditionTruck.eta"
rule> rule>
</vn-date-picker> </vn-date-picker>
<vn-input-time <vn-input-time
label="ETD hour" label="ETA hour"
ng-model="$ctrl.expeditionTruck.ETD"> ng-model="$ctrl.expeditionTruck.eta">
</vn-input-time> </vn-input-time>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>

View File

@ -36,7 +36,7 @@ class Controller extends Component {
const eta = new Date(this.roadmap.etd); const eta = new Date(this.roadmap.etd);
eta.setDate(eta.getDate() + 1); eta.setDate(eta.getDate() + 1);
this.expeditionTruck = {ETD: eta}; this.expeditionTruck = {eta: eta};
} }
onAddAccept() { onAddAccept() {
@ -44,7 +44,7 @@ class Controller extends Component {
const data = { const data = {
roadmapFk: this.roadmap.id, roadmapFk: this.roadmap.id,
warehouseFk: this.expeditionTruck.warehouseFk, warehouseFk: this.expeditionTruck.warehouseFk,
ETD: this.expeditionTruck.ETD, eta: this.expeditionTruck.eta,
description: this.expeditionTruck.description description: this.expeditionTruck.description
}; };