seccion mana creada

This commit is contained in:
Carlos Jimenez 2018-03-23 12:21:26 +01:00
parent e651619714
commit 8c07288378
2 changed files with 13 additions and 116 deletions

View File

@ -71,7 +71,7 @@
} }
}, },
{ {
"url": "/Expedition", "url": "/expedition",
"state": "ticket.card.expedition", "state": "ticket.card.expedition",
"component": "vn-ticket-expedition", "component": "vn-ticket-expedition",
"params": { "params": {
@ -82,6 +82,18 @@
"icon": "icon-volum" "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", "url" : "/package",
"state": "ticket.card.package", "state": "ticket.card.package",

View File

@ -19,121 +19,6 @@ class Controller {
this.ticketVolumes = response.data; 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']; Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp'];