Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onAddComprobante: function (oEvent) {
- var oFileUploader = this.byId("fileUploader");
- var sFilename = oFileUploader.mProperties.value;
- oFileUploader.removeAllHeaderParameters();
- var oCustomerHeaderToken = new sap.ui.unified.FileUploaderParameter({
- name: "x-csrf-token",
- value: oFileUploader.getModel().getSecurityToken()
- });
- oFileUploader.addHeaderParameter(oCustomerHeaderToken);
- // se pasan por parámetro la clave del vuelo + el nombre del archivo
- var oSlug = new sap.ui.unified.FileUploaderParameter({
- name: "slug",
- value: this._NumVuelo + "," + this._Fecha + "," + sFilename
- });
- oFileUploader.addHeaderParameter(oSlug);
- oFileUploader.setSendXHR(true);
- oFileUploader.setUploadUrl("/sap/opu/odata/sap/ZOS_ACADEMIA_LUUC3_VUELOS_2_SRV/ComprobanteSet");
- oFileUploader.upload();
- },
- handleUploadComplete: function (oEvent) {
- sap.m.MessageToast.show("Comprobante subido correctamente");
- },
- onDescargarComprobante: function (oEvent) {
- var path = this.getView().getModel().createKey("/ComprobanteSet", {
- NumVuelo: this._NumVuelo,
- Fecha: this._Fecha
- });
- var fullpath = "/sap/opu/odata/sap/ZOS_ACADEMIA_LUUC3_VUELOS_2_SRV" + path + "/$value//";
- window.open(fullpath, "_parent");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement