From 8c07288378ddc88cba974c6ead61069e32709bb0 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Fri, 23 Mar 2018 12:21:26 +0100 Subject: [PATCH] seccion mana creada --- client/ticket/routes.json | 14 ++- client/ticket/src/volume/ticket-volume.js | 115 ---------------------- 2 files changed, 13 insertions(+), 116 deletions(-) diff --git a/client/ticket/routes.json b/client/ticket/routes.json index 7115a0a395..c602f87689 100644 --- a/client/ticket/routes.json +++ b/client/ticket/routes.json @@ -71,7 +71,7 @@ } }, { - "url": "/Expedition", + "url": "/expedition", "state": "ticket.card.expedition", "component": "vn-ticket-expedition", "params": { @@ -82,6 +82,18 @@ "icon": "icon-volum" } }, + { + "url": "/mana", + "state": "ticket.card.mana", + "component": "vn-ticket-mana", + "params": { + "ticket": "$ctrl.ticket" + }, + "menu": { + "description": "Mana", + "icon": "icon-sms" + } + }, { "url" : "/package", "state": "ticket.card.package", diff --git a/client/ticket/src/volume/ticket-volume.js b/client/ticket/src/volume/ticket-volume.js index 4f89e282ba..2c41ef28e1 100644 --- a/client/ticket/src/volume/ticket-volume.js +++ b/client/ticket/src/volume/ticket-volume.js @@ -19,121 +19,6 @@ class Controller { this.ticketVolumes = response.data; }); } - - // _setIconAdd() { - // if (this.ticketVolumes.length) { - // this.ticketVolumes.map(element => { - // element.showAddIcon = false; - // return true; - // }); - // this.ticketVolumes[this.ticketVolumes.length - 1].showAddIcon = true; - // } - // } - - // _setDirtyForm() { - // if (this.$scope.form) { - // this.$scope.form.$setDirty(); - // } - // } - - // _unsetDirtyForm() { - // if (this.$scope.form) { - // this.$scope.form.$setPristine(); - // } - // } - - // addVolume() { - // this.ticketVolumes.push({description: null, ticketFk: this.params.id, showAddIcon: true}); - // this._setIconAdd(); - // } - - // removeVolume(index) { - // let item = this.ticketVolumes[index]; - // if (item) { - // this.ticketVolumes.splice(index, 1); - // this._setIconAdd(); - // if (item.id) { - // this.removedVolumes.push(item.id); - // this._setDirtyForm(); - // } - // } - // } - - // _equalVolumes(oldVolume, newVolume) { - // return oldVolume.id === newVolume.id && oldVolume.VolumeTypeFk === newVolume.VolumeTypeFk && oldVolume.description === newVolume.description; - // } - - // setOldVolumes(response) { - // this._setIconAdd(); - // response.data.forEach(Volume => { - // this.oldVolumes[Volume.id] = Object.assign({}, Volume); - // }); - // } - - // getVolumes() { - // let filter = { - // where: {ticketFk: this.params.id}, - // include: ['VolumeType'] - // }; - - // this.$http.get(`/ticket/api/TicketVolumes?filter=${JSON.stringify(filter)}`).then(response => { - // this.ticketVolumes = response.data; - // this.setOldVolumes(response); - // }); - // } - - // submit() { - // let typesDefined = []; - // let repeatedType = false; - // let canSubmit; - // let VolumesObj = { - // delete: this.removedVolumes, - // create: [], - // update: [] - // }; - - // this.ticketVolumes.forEach(Volume => { - // let isNewVolume = !Volume.id; - - // delete Volume.showAddIcon; - - // if (typesDefined.indexOf(Volume.VolumeTypeFk) !== -1) { - // repeatedType = true; - // return; - // } - // typesDefined.push(Volume.VolumeTypeFk); - - // if (isNewVolume && Volume.description && Volume.VolumeTypeFk) { - // VolumesObj.create.push(Volume); - // } - - // if (!isNewVolume && !this._equalVolumes(this.oldVolumes[Volume.id], Volume)) { - // VolumesObj.update.push(Volume); - // } - // }); - - // if (this.$scope.form.$invalid) { - // return this.vnApp.showMessage(this.$translate.instant('Some fields are invalid')); - // } - - // if (repeatedType) { - // return this.vnApp.showMessage(this.$translate.instant('The Volume type must be unique')); - // } - - // canSubmit = VolumesObj.update.length > 0 || VolumesObj.create.length > 0 || VolumesObj.delete.length > 0; - - // if (canSubmit) { - // return this.$http.post(`/ticket/api/TicketVolumes/crudTicketVolumes`, VolumesObj).then(() => { - // this.getVolumes(); - // this._unsetDirtyForm(); - // }); - // } - // this.vnApp.showMessage(this.$translate.instant('No changes to save')); - // } - - $onInit() { - // this.getVolumes(); - } } Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp'];