{"version":3,"sources":["webpack:///./src/views/TseArquivoNF.vue?9ed4","webpack:///./src/services/nfse/tse.service.js","webpack:///src/views/TseArquivoNF.vue","webpack:///./src/views/TseArquivoNF.vue?2175","webpack:///./src/views/TseArquivoNF.vue","webpack:///./src/conf/config.money.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_m","attrs","erros","on","$event","type","indexOf","_k","keyCode","key","geraArquivo","model","value","callback","$$v","dataInicial","expression","dataFinal","loading","staticRenderFns","_v","API_URL","TseService","idCliente","idUsuario","LoginService","currentUser","subscribe","data","token","currentUserValue","usuario","axios","url","method","responseType","headers","then","response","fileURL","window","URL","createObjectURL","Blob","fileLink","document","createElement","href","console","log","headerLine","startFileNameIndex","endFileNameIndex","lastIndexOf","filename","substring","setAttribute","body","appendChild","click","name","components","money","inativo","display","mounted","created","methods","processando","show","$root","$emit","computed","component","decimal","thousands","prefix","suffix","precision","masked"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,mBAAmB,CAACF,EAAG,MAAM,CAACA,EAAG,MAAM,CAACE,YAAY,QAAQ,CAACN,EAAIO,GAAG,GAAGH,EAAG,MAAM,CAACE,YAAY,aAAa,CAACF,EAAG,aAAa,CAACI,MAAM,CAAC,MAAQR,EAAIS,SAASL,EAAG,MAAM,CAACE,YAAY,OAAO,CAACF,EAAG,MAAM,CAACE,YAAY,0BAA0B,CAACF,EAAG,OAAO,CAACE,YAAY,WAAW,CAACF,EAAG,WAAW,CAACI,MAAM,CAAC,GAAK,UAAU,KAAO,UAAU,UAAW,EAAK,WAAa,WAAW,YAAc,wBAAwBE,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAIA,EAAOC,KAAKC,QAAQ,QAAQb,EAAIc,GAAGH,EAAOI,QAAQ,QAAQ,GAAGJ,EAAOK,IAAI,SAAkB,KA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wB,SAAU,EACfxB,KAAK4E,MAAMC,MAAM,kBAIzB,YAXA,WAWA,WACW7E,KAAKqB,YAILrB,KAAKuB,WAIVvB,KAAK0E,aAAY,GAEjB,EAAN,mDACA,MACA,YACQ,QAAR,UAEA,YACQ,IAAR,6BACA,aACU,EAAV,iBAEQ,QAAR,OACQ,EAAR,YACU,SAAV,QACU,QAAV,OAMA,iBACQ,EAAR,oBAzBQ1E,KAAK4E,MAAMC,MAAM,aAAc,wCAJ/B7E,KAAK4E,MAAMC,MAAM,aAAc,4CAiCrCC,SAAU,IC9I0U,I,YCOlVC,EAAY,eACd,EACAjF,EACA2B,GACA,EACA,KACA,WACA,MAIa,aAAAsD,E,6CClBf,IAAMX,EAAQ,CACVY,QAAS,IACTC,UAAW,IACXC,OAAQ,MACRC,OAAQ,GACRC,UAAW,EACXC,QAAQ,GAEGjB","file":"js/tse.arquivo.nf.2bd5682b.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container-fluid\"},[_c('div',[_c('div',{staticClass:\"card\"},[_vm._m(0),_c('div',{staticClass:\"card-body\"},[_c('error-list',{attrs:{\"erros\":_vm.erros}}),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-md-4 col-lg-2 mb-3\"},[_c('span',{staticClass:\"p-fluid\"},[_c('Calendar',{attrs:{\"id\":\"dataIni\",\"name\":\"dataIni\",\"showIcon\":true,\"dateFormat\":\"dd/mm/yy\",\"placeholder\":\"Data Emissão Inicial\"},on:{\"keyup\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }return _vm.geraArquivo($event)}},model:{value:(_vm.dataInicial),callback:function ($$v) {_vm.dataInicial=$$v},expression:\"dataInicial\"}})],1)]),_c('div',{staticClass:\"col-md-4 col-lg-2 mb-3\"},[_c('span',{staticClass:\"p-fluid\"},[_c('Calendar',{attrs:{\"id\":\"dataFim\",\"name\":\"dataFim\",\"showIcon\":true,\"dateFormat\":\"dd/mm/yy\",\"placeholder\":\"Data Emissão Final\"},on:{\"keyup\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }return _vm.geraArquivo($event)}},model:{value:(_vm.dataFinal),callback:function ($$v) {_vm.dataFinal=$$v},expression:\"dataFinal\"}})],1)])]),_c('div',{staticClass:\"mb-2\"},[_c('Button',{staticClass:\"p-button-primary mr-2\",attrs:{\"label\":\"Gerar Arquivo\",\"type\":\"button\",\"icon\":\"pi pi-search\",\"disabled\":_vm.loading},on:{\"click\":function($event){return _vm.geraArquivo()}}})],1),_c('hr')],1)])])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"card-header\",attrs:{\"id\":\"topo\"}},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col col-xs-2\"},[_c('h4',{staticClass:\"panel-title\"},[_c('span',{staticClass:\"title\"},[_vm._v(\"TSE - Geração de arquivo de Notas Fiscais\")]),_c('br'),_c('span',{staticClass:\"navigation\"},[_vm._v(\"Nota Fiscal > Arquivo de Notas TSE\")])])])])])}]\n\nexport { render, staticRenderFns }","import axios from 'axios';\r\nimport LoginService from '../acesso/login.service'\r\n\r\nconst API_URL = process.env.VUE_APP_BASE_URL + '/api/tse/';\r\n\r\nclass TseService {\r\n    constructor() {\r\n        this.idCliente = null;\r\n        this.idUsuario = null;\r\n        LoginService.currentUser.subscribe(data => {\r\n            this.token = data;\r\n        });\r\n    }\r\n    downloadArquivoNF(dataInicial, dataFinal){\r\n        this.idCliente = LoginService.currentUserValue.usuario.idCliente;\r\n        this.idUsuario = LoginService.currentUserValue.usuario.idUsuario;\r\n        return axios({\r\n            url: API_URL + \"arquivoNF?idCliente=\" + this.idCliente + \"&idUsuario=\" + this.idCliente + (dataInicial ? ('&dataInicial=' + dataInicial) : \"\") + (dataFinal ? ('&dataFinal=' + dataFinal) : \"\"),\r\n            method: \"GET\",\r\n            responseType: \"blob\",\r\n            data: null,\r\n            headers: {\r\n              'Content-Type':'text/plain',\r\n              'authorization':'Bearer ' + (this.token ? this.token.token:'')\r\n          }\r\n        }).then(response => {\r\n          var fileURL = window.URL.createObjectURL(\r\n            new Blob([response.data], { type: \"text/plain\" })\r\n          );\r\n          var fileLink = document.createElement(\"a\");\r\n          fileLink.href = fileURL;\r\n          //console.log(response);\r\n          console.log( response.headers);\r\n          let headerLine = response.headers['content-disposition']\r\n          let startFileNameIndex = headerLine.indexOf('name=\"') + 5\r\n          let endFileNameIndex = headerLine.lastIndexOf('\"; filename')\r\n          let filename = headerLine.substring(startFileNameIndex, endFileNameIndex)\r\n          console.log(filename);\r\n          fileLink.setAttribute(\"download\", filename + \".txt\");\r\n          document.body.appendChild(fileLink);\r\n\r\n\r\n          fileLink.click();\r\n        });                                 \r\n    }\r\n}\r\n\r\nexport default new TseService();","<template>\r\n  <div class=\"container-fluid\">\r\n    <div>\r\n      <div class=\"card\">\r\n        <div id=\"topo\" class=\"card-header\">\r\n          <div class=\"row\">\r\n            <div class=\"col col-xs-2\">\r\n              <h4 class=\"panel-title\">\r\n                <span class=\"title\"\r\n                  >TSE - Geração de arquivo de Notas Fiscais</span\r\n                >\r\n                <br />\r\n                <span class=\"navigation\">Nota Fiscal > Arquivo de Notas TSE</span>\r\n              </h4>\r\n            </div>\r\n          </div>\r\n        </div>\r\n        <div class=\"card-body\">\r\n          <error-list :erros=\"erros\" />\r\n\r\n          <div class=\"row\">\r\n            <div class=\"col-md-4 col-lg-2 mb-3\">\r\n              <span class=\"p-fluid\">\r\n                <Calendar\r\n                  id=\"dataIni\"\r\n                  name=\"dataIni\"\r\n                  v-model=\"dataInicial\"\r\n                  :showIcon=\"true\"\r\n                  dateFormat=\"dd/mm/yy\"\r\n                  placeholder=\"Data Emissão Inicial\"\r\n                  @keyup.enter=\"geraArquivo\"\r\n                />\r\n              </span>\r\n            </div>\r\n            <div class=\"col-md-4 col-lg-2 mb-3\">\r\n              <span class=\"p-fluid\">\r\n                <Calendar\r\n                  id=\"dataFim\"\r\n                  name=\"dataFim\"\r\n                  v-model=\"dataFinal\"\r\n                  :showIcon=\"true\"\r\n                  dateFormat=\"dd/mm/yy\"\r\n                  placeholder=\"Data Emissão Final\"\r\n                  @keyup.enter=\"geraArquivo\"\r\n                />\r\n              </span>\r\n            </div>\r\n          </div>\r\n\r\n          <div class=\"mb-2\">\r\n            <Button\r\n              @click=\"geraArquivo()\"\r\n              label=\"Gerar Arquivo\"\r\n              type=\"button\"\r\n              class=\"p-button-primary mr-2\"\r\n              icon=\"pi pi-search\"\r\n              :disabled=\"loading\"\r\n            />\r\n          </div>\r\n          <hr />\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n</template>\r\n<script>\r\n\r\nimport TseService from \"../services/nfse/tse.service\";\r\nimport money from \"../conf/config.money\";\r\n\r\nexport default {\r\n  name: \"TseArquivoNF\",\r\n\r\n  components: {\r\n    \r\n  },\r\n\r\n  data() {\r\n    return {\r\n      money: money,\r\n      inativo: false,\r\n      display: false,\r\n      loading: false,\r\n      dataInicial: null,\r\n      dataFinal: null,\r\n      erros: []\r\n    };\r\n  },\r\n\r\n  mounted() {\r\n    //document.getElementById(\"dataIni\").focus();\r\n  },\r\n\r\n  created() {\r\n  },\r\n\r\n  methods: {\r\n    processando(show) {\r\n      if (show) {\r\n        this.loading = true;\r\n        this.$root.$emit(\"loading:show\");\r\n      } else {\r\n        this.loading = false;\r\n        this.$root.$emit(\"loading:hide\");\r\n      }\r\n    },\r\n\r\n  geraArquivo() {\r\n      if (!this.dataInicial) {\r\n        this.$root.$emit(\"alert:warn\", \"Data de emissão inicial não informada!\");\r\n        return;\r\n      }\r\n      if (!this.dataFinal) {\r\n        this.$root.$emit(\"alert:warn\", \"Data de emissão final não informada!\");\r\n        return;\r\n      }      \r\n      this.processando(true);\r\n\r\n      TseService.downloadArquivoNF(this.dataInicial, this.dataFinal)\r\n        .then(\r\n          data => {\r\n            console.log(data);\r\n          },\r\n          error => {\r\n            let errorMessage = \"Erro ao gerar o arquivo.\";\r\n            if (error.response) {\r\n              errorMessage = error.response.data;\r\n            }\r\n            console.log(error);\r\n            this.$toast.add({\r\n              severity: \"error\",\r\n              summary: errorMessage\r\n            });\r\n            //this.$root.$emit(\"alert:warn\", \"Erro ao efetuar o download!\");\r\n            //console.log(error);\r\n          }\r\n        )\r\n        .then(() => {\r\n          this.processando(false);\r\n        });      \r\n    }\r\n  },\r\n  computed: {}\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n</style>\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TseArquivoNF.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TseArquivoNF.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./TseArquivoNF.vue?vue&type=template&id=3a1004c0&scoped=true&\"\nimport script from \"./TseArquivoNF.vue?vue&type=script&lang=js&\"\nexport * from \"./TseArquivoNF.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"3a1004c0\",\n  null\n  \n)\n\nexport default component.exports","const money = {\r\n    decimal: \",\",\r\n    thousands: \".\",\r\n    prefix: \"R$ \",\r\n    suffix: \"\",\r\n    precision: 2,\r\n    masked: false\r\n}\r\nexport default money"],"sourceRoot":""}