{"version":3,"sources":["webpack:///./src/components/process-batch-file/index.vue?c769","webpack:///./src/components/process-batch-file/scripts.js","webpack:///./src/components/process-batch-file/scripts.js?64cf","webpack:///./src/components/process-batch-file/index.vue","webpack:///./src/components/process-batch-file/index.vue?c312"],"names":["render","_vm","this","_h","$createElement","_c","_self","attrs","staticClass","model","value","callback","$$v","selectedStep","expression","_v","_e","$vuetify","dark","availableBaskets","isLoading","selectedBasket","Object","keys","length","nativeOn","$event","_s","name","uploadedFile","dialog","class","messageError","amountRowsInvalid","mainHeaders","errosValidation","scopedSlots","_u","key","fn","props","item","row","msgReport","_b","on","createExampleFile","options","staticRenderFns","components","FileUpload","data","isLoadingGetRequestFields","text","align","sortable","loadingOverlay","computed","mapGetters","getterBaskets","filter","basket","enable","idClient","getterAccount","loading","watch","val","addJob","mounted","getAllBaskets","methods","mapActions","actionGetAllBaskets","then","catch","file","params","userId","idUser","userName","idUserType","file64","base64","filename","fullName","idProviderFlow","actionAddJob","response","showValidationFile","today","Date","size","page","startDate","Moment","format","endDate","actionGetAllJobs","error","status","type","sendToast","message","code","setTimeout","find","fields","atributes","emptyText","actionGetRequestFieldsBySystemProvider","getterRequestFieldsBySystemProvider","forEach","push","idCliente","downloadCSV","convertArrayOfObjectsToCSV","args","result","columnDelimiter","lineDelimiter","join","ctr","link","csv","match","encodeURI","document","createElement","setAttribute","click","component","VAutocomplete","VBtn","VCard","VCardActions","VCardText","VCardTitle","VDataTable","VDialog","VDivider","VFlex","VIcon","VLayout","VProgressCircular","VSpacer","VStepper","VStepperContent","VStepperHeader","VStepperStep"],"mappings":"kYAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,WAAW,CAACE,MAAM,CAAC,GAAK,uBAAuB,CAACF,EAAG,YAAY,CAACG,YAAY,gBAAgBC,MAAM,CAACC,MAAOT,EAAgB,aAAEU,SAAS,SAAUC,GAA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KAAMC,aAAA,OAAaC,UAAA,OAAUC,aAAA,KAAWC,aAAA,KAAWC,UAAA,KAAQC,WAAA,KAASC,QAAA,KAAMC,QAAA,KAAMC,UAAA,KAAQC,oBAAA,KAAkBC,QAAA,OAAQC,WAAA,KAASC,kBAAA,KAAgBC,eAAA,OAAeC,eAAA,Q,oCCzC3M,yBAA+kB,EAAG,G","file":"js/chunk-07f180a8.922ee897.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-layout',{attrs:{\"id\":\"process-batch-file\"}},[_c('v-stepper',{staticClass:\"wrapper-steps\",model:{value:(_vm.selectedStep),callback:function ($$v) {_vm.selectedStep=$$v},expression:\"selectedStep\"}},[(_vm.loadingOverlay)?_c('div',{staticClass:\"loadingOverlay\"},[_c('div',[_c('v-progress-circular',{attrs:{\"indeterminate\":\"\",\"color\":\"default\"}}),_c('p',[_vm._v(\"\\n Estamos analisando o arquivo enviado, isso pode levar alguns minutos.\"),_c('br'),_vm._v(\"Aguarde...\\n \")])],1)]):_vm._e(),_c('v-stepper-header',[_c('v-stepper-step',{attrs:{\"complete\":_vm.selectedStep > 1,\"step\":\"1\",\"color\":_vm.$vuetify.dark ? 'secondary' : 'primary'}},[_vm._v(\"\\n Selecionar cesta\\n \")]),_c('v-divider'),_c('v-stepper-step',{attrs:{\"complete\":_vm.selectedStep > 2,\"step\":\"2\",\"color\":_vm.$vuetify.dark ? 'secondary' : 'primary'}},[_vm._v(\"\\n Baixar e enviar arquivo de lote\\n \")])],1),_c('v-stepper-content',{attrs:{\"step\":\"1\"}},[_c('v-layout',{staticClass:\"pa-4\",attrs:{\"column\":\"\"}},[_c('v-card-title',{attrs:{\"primary-title\":\"\"}},[_c('v-layout',{attrs:{\"column\":\"\"}},[_c('p',[_vm._v(\"\\n Selecione uma cesta para processamento.\\n \")]),_c('v-autocomplete',{attrs:{\"items\":_vm.availableBaskets,\"loading\":_vm.isLoading,\"disabled\":_vm.isLoading,\"label\":\"Cesta\",\"item-text\":\"name\",\"return-object\":\"\",\"color\":_vm.$vuetify.dark ? 'secondary' : 'primary'},model:{value:(_vm.selectedBasket),callback:function ($$v) {_vm.selectedBasket=$$v},expression:\"selectedBasket\"}})],1)],1)],1),_c('v-layout',{attrs:{\"row\":\"\",\"align-center\":\"\",\"justify-center\":\"\"}},[_c('v-btn',{staticClass:\"white--text\",attrs:{\"color\":\"primary\",\"disabled\":Object.keys(_vm.selectedBasket).length === 0},nativeOn:{\"click\":function($event){_vm.selectedStep = 2}}},[_vm._v(\"\\n Próximo\\n\\n \"),_c('v-icon',{staticClass:\"ml-2\"},[_vm._v(\"\\n navigate_next\\n \")])],1)],1)],1),_c('v-stepper-content',{attrs:{\"step\":\"2\"}},[_c('v-flex',{staticClass:\"steps\",attrs:{\"xs12\":\"\"}},[_c('v-layout',{staticClass:\"pa-4\",attrs:{\"column\":\"\"}},[_c('p',[_vm._v(\"\\n Utilize o arquivo gerado para preencher os dados de processamento. Posteriormente envie o arquivo \"),_c('strong',[_vm._v(\".csv\")]),_vm._v(\" para iniciar o processamento.\\n \"),_c('br'),_c('br'),_c('strong',[_vm._v(\"Atenção,\")]),_vm._v(\" a cesta selecionada para processamento é: \"),_c('br'),_c('b',[_vm._v(_vm._s(_vm.selectedBasket.name))])]),_c('file-upload',{attrs:{\"light\":_vm.$vuetify.dark,\"enabled-extensions\":['csv']},model:{value:(_vm.uploadedFile),callback:function ($$v) {_vm.uploadedFile=$$v},expression:\"uploadedFile\"}})],1),_c('v-dialog',{attrs:{\"content-class\":\"modal-file-validation-errors\",\"persistent\":\"\",\"scrollable\":\"\",\"width\":\"600\"},model:{value:(_vm.dialog),callback:function ($$v) {_vm.dialog=$$v},expression:\"dialog\"}},[_c('v-card',[_c('v-card-title',{staticClass:\"headline grey\",class:(\"\" + (_vm.$vuetify.dark ? 'darken-2' : 'lighten-2')),attrs:{\"primary-title\":\"\"}},[_vm._v(\"\\n Erros encontrados na validação do arquivo\\n \")]),_c('v-card-text',[_c('p',{staticClass:\"mb-4\"},[_vm._v(\"\\n Total de erro(s) encontrado(s): \"),_c('b',[_vm._v(_vm._s(_vm.messageError.amountRowsInvalid || 0))])]),_c('v-data-table',{staticClass:\"elevation-1\",attrs:{\"headers\":_vm.mainHeaders,\"items\":_vm.messageError.errosValidation || [],\"no-data-text\":\"Não foi possível validar este arquivo, verifique se o mesmo esta correto.\",\"rows-per-page-text\":\"Linhas por Página\",\"hide-actions\":\"\"},scopedSlots:_vm._u([{key:\"items\",fn:function(props){return [_c('td',{staticClass:\"text-md-center\"},[_vm._v(\"\\n \"+_vm._s(props.item.row)+\"\\n \")]),_c('td',{staticClass:\"text-md-center\"},[_vm._v(\"\\n \"+_vm._s(props.item.msgReport)+\"\\n \")])]}}])})],1),_c('v-card-actions',[_c('v-spacer'),_c('v-btn',{attrs:{\"color\":\"secondary\",\"flat\":\"\"},nativeOn:{\"click\":function($event){_vm.dialog = false}}},[_vm._v(\"\\n Cancelar\\n \")])],1)],1)],1)],1),_c('v-layout',{attrs:{\"row\":\"\",\"align-center\":\"\",\"justify-center\":\"\"}},[_c('v-btn',{staticClass:\"white--text\",attrs:{\"color\":\"primary\"},nativeOn:{\"click\":function($event){_vm.selectedStep = 1}}},[_c('v-icon',{staticClass:\"mr-2\"},[_vm._v(\"\\n navigate_before\\n \")]),_vm._v(\"\\n\\n Voltar\\n \")],1),_c('v-btn',_vm._b({staticClass:\"white--text mr-1\",attrs:{\"color\":\"secondary\"},on:{\"click\":function($event){return _vm.createExampleFile()}}},'v-btn',_vm.options,false),[_c('v-icon',{staticClass:\"mr-2\"},[_vm._v(\"\\n archive\\n \")]),_vm._v(\"\\n\\n Baixar\\n \")],1)],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import Moment from 'moment'\nimport { mapGetters, mapActions } from 'vuex'\nimport { find } from 'lodash'\nimport FileUpload from '../file-upload/index.vue'\n\nexport default {\n components: {\n FileUpload\n },\n data () {\n return {\n selectedStep: 0,\n isLoading: false,\n isLoadingGetRequestFields: false,\n dialog: false,\n uploadedFile: [],\n selectedBasket: {},\n messageError: {},\n mainHeaders: [\n { text: 'Linha no arquivo', align: 'center', sortable: false },\n { text: 'Descrição', align: 'center', sortable: false }\n ],\n loadingOverlay: false\n }\n },\n computed: {\n ...mapGetters([\n 'getterAccount',\n 'getterBaskets',\n 'getterRequestFieldsBySystemProvider'\n ]),\n availableBaskets () {\n return this.getterBaskets ? this.getterBaskets.filter((basket) => basket.enable && (basket.idClient === this.getterAccount.idClient)) : []\n },\n options () {\n return {\n loading: this.isLoadingGetRequestFields\n }\n }\n },\n watch: {\n uploadedFile (val) {\n if (val && val.length > 0) {\n this.addJob()\n }\n }\n },\n mounted () {\n this.getAllBaskets()\n },\n methods: {\n ...mapActions([\n 'actionGetAllBaskets',\n 'actionGetRequestFieldsBySystemProvider',\n 'actionAddJob',\n 'actionGetAllJobs'\n ]),\n getAllBaskets () {\n this.isLoading = true\n\n this.actionGetAllBaskets(this.getterAccount.idClient)\n .then(() => {\n this.isLoading = false\n })\n .catch(() => {\n this.isLoading = false\n })\n },\n addJob () {\n const [file] = this.uploadedFile\n\n const params = {\n userId: this.getterAccount.idUser,\n name: this.getterAccount.userName,\n idUserType: this.getterAccount.idUserType,\n idClient: this.getterAccount.idClient,\n file64: file.base64,\n filename: file.fullName,\n idProviderFlow: this.selectedBasket.idProviderFlow\n }\n\n this.loadingOverlay = true\n\n this.actionAddJob(params)\n .then((response) => {\n this.showValidationFile('success', response)\n\n const today = new Date()\n\n const params = {\n idClient: this.getterAccount.idClient,\n size: 5,\n page: 1,\n startDate: `${Moment(today, 'DD/MM/YYYY').format('YYYY-MM-DD')}T00:00:00` || '',\n endDate: `${Moment(today, 'DD/MM/YYYY').format('YYYY-MM-DD')}T23:59:59` || ''\n }\n this.actionGetAllJobs(params)\n })\n .catch((error) => {\n if (error.status === 401) {\n this.showValidationFile('credit', error)\n } else {\n this.showValidationFile('error', error)\n }\n })\n },\n showValidationFile (type, response) {\n this.loadingOverlay = false\n\n if (response && response.data && response.data.amountRowsInvalid && response.data.errosValidation) {\n this.dialog = true\n\n this.messageError = response.data\n }\n\n if (type === 'success') {\n this.sendToast({\n text: 'Job criado com sucesso, acompanhe o progresso na tabela abaixo',\n type: 'success'\n })\n }\n\n if (type === 'credit') {\n let message = 'Seu saldo não é suficiente para criar o Job. Entre em contato com o setor comercial'\n if (response.data.code === 'INSUFFICIENT_LIMIT') {\n message = 'Seu limite não permite a criação desse Job. Entre em contato com o setor comercial'\n }\n\n this.sendToast({\n text: message,\n type: 'warning'\n })\n }\n\n if (type === 'error') {\n this.sendToast({\n text: 'Ocorreu um erro ao criar o Job, tente novamente mais tarde!',\n type: 'danger'\n })\n }\n\n setTimeout(() => {\n this.uploadedFile = []\n })\n },\n createExampleFile () {\n const basket = find(this.getterBaskets, { idProviderFlow: this.selectedBasket.idProviderFlow })\n\n if (basket) {\n const name = basket.name\n const fields = []\n const atributes = {}\n const emptyText = 'vazio'\n\n this.isLoadingGetRequestFields = true\n\n this.actionGetRequestFieldsBySystemProvider(basket.idProviderFlow)\n .then(() => {\n /* if (this.getterAccount.idClient === '35133b3e-ca3c-4318-9178-a399a82adf40') {\n fields.push({\n cpf: emptyText,\n nome: emptyText,\n data_nascimento: emptyText,\n sexo: emptyText,\n nome_mae: emptyText,\n nome_pai: emptyText,\n profissao: emptyText,\n cep: emptyText,\n logradouro: emptyText,\n municipio: emptyText,\n uf: emptyText,\n numero_registro_cnh: emptyText,\n numero_documento_identidade: emptyText,\n uf_expedidor: emptyText,\n telefone: emptyText\n })\n } */\n\n this.getterRequestFieldsBySystemProvider.forEach((item) => {\n atributes[item.name] = emptyText\n })\n\n fields.push(atributes)\n\n if (atributes.idCliente) {\n delete atributes.idCliente\n }\n\n this.downloadCSV({ name, fields })\n\n this.isLoadingGetRequestFields = false\n })\n .catch(() => {\n this.sendToast({\n text: 'Ocorreu um erro ao buscar os Request Fields, tente novamente mais tarde!',\n type: 'danger'\n })\n\n this.isLoadingGetRequestFields = false\n })\n } else {\n this.sendToast({\n text: 'Cesta não encontrada!',\n type: 'warning'\n })\n }\n },\n convertArrayOfObjectsToCSV (args) {\n let result = null\n let keys = null\n let columnDelimiter = null\n let lineDelimiter = null\n let data = null\n\n data = args.data || null\n\n if (data === null || !data.length) {\n return null\n }\n\n columnDelimiter = args.columnDelimiter || ';'\n lineDelimiter = args.lineDelimiter || '\\n'\n\n keys = Object.keys(data[0])\n\n result = ''\n result += keys.join(columnDelimiter)\n result += lineDelimiter\n\n data.forEach((item) => {\n let ctr = 0\n\n keys.forEach((key) => {\n if (ctr > 0) {\n result += columnDelimiter\n }\n\n result += item[key]\n\n ctr += 1\n })\n\n result += lineDelimiter\n })\n\n return result\n },\n downloadCSV (params) {\n let data = null\n let filename = null\n let link = null\n let csv = this.convertArrayOfObjectsToCSV({\n data: params.fields\n })\n\n if (csv === null) {\n return\n }\n\n filename = `${`Exemplo - ${params.name}.csv`}`\n\n if (!csv.match(/^data:text\\/csv/i)) {\n csv = `data:text/csv;charset=utf-8,${csv}`\n }\n\n data = encodeURI(csv)\n\n link = document.createElement('a')\n link.setAttribute('href', data)\n link.setAttribute('download', filename)\n link.click()\n }\n }\n}\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/eslint-loader/index.js??ref--13-0!./scripts.js?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/eslint-loader/index.js??ref--13-0!./scripts.js?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=19745e26&lang=html&\"\nimport script from \"./scripts?vue&type=script&lang=js&\"\nexport * from \"./scripts?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&lang=scss&\"\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 null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!/opt/atlassian/pipelines/agent/build/node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAutocomplete } from 'vuetify/lib'\nimport { VBtn } from 'vuetify/lib'\nimport { VCard } from 'vuetify/lib'\nimport { VCardActions } from 'vuetify/lib'\nimport { VCardText } from 'vuetify/lib'\nimport { VCardTitle } from 'vuetify/lib'\nimport { VDataTable } from 'vuetify/lib'\nimport { VDialog } from 'vuetify/lib'\nimport { VDivider } from 'vuetify/lib'\nimport { VFlex } from 'vuetify/lib'\nimport { VIcon } from 'vuetify/lib'\nimport { VLayout } from 'vuetify/lib'\nimport { VProgressCircular } from 'vuetify/lib'\nimport { VSpacer } from 'vuetify/lib'\nimport { VStepper } from 'vuetify/lib'\nimport { VStepperContent } from 'vuetify/lib'\nimport { VStepperHeader } from 'vuetify/lib'\nimport { VStepperStep } from 'vuetify/lib'\ninstallComponents(component, {VAutocomplete,VBtn,VCard,VCardActions,VCardText,VCardTitle,VDataTable,VDialog,VDivider,VFlex,VIcon,VLayout,VProgressCircular,VSpacer,VStepper,VStepperContent,VStepperHeader,VStepperStep})\n","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/vuetify-loader/lib/loader.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/vuetify-loader/lib/loader.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&lang=scss&\""],"sourceRoot":""}