{"version":3,"sources":["webpack:///./src/views/app/memberGetMember/MemberGetMember.vue?e228","webpack:///./src/views/app/memberGetMember/MemberGetMember.vue?ae15","webpack:///./src/scripts/models/enums/importMemberGetMemberStatus.enum.js","webpack:///src/views/app/memberGetMember/MemberGetMember.vue","webpack:///./src/views/app/memberGetMember/MemberGetMember.vue?6c28","webpack:///./src/views/app/memberGetMember/MemberGetMember.vue"],"names":["content","__esModule","default","module","i","locals","exports","add","push","ImportMemberGetMemberStatus","Initiated","Finished","Error","ImportMemberGetMemberStatusName","statusId","data","campaignService","CampaignService","personService","PersonService","fileService","FileService","importMemberGetMemberStatusName","file","File","campaignId","listCampaign","fileUpload","listMgm","created","loadCampaigns","methods","_this","listAllByCompanyId","$route","query","companyId","then","fileChanged","event","target","files","reader","FileReader","onload","name","path","result","bind","readAsDataURL","upload","_this2","formData","mountFormData","uploadMemberGetMember","changeCampaign","CommonHelper","swal","FormData","append","$refs","_this3","finAllMgmByCampaignId","downloadFile","render","id","a","document","createElement","href","download","click","_vm","this","_h","$createElement","_c","_self","staticClass","_m","_v","attrs","on","$event","model","value","callback","$$v","expression","_s","ref","_l","mgm","key","_f","createdAt","user","persons","staticRenderFns","injectStyle","context","__vue_template_functional__","__vue_styles__","__vue_scopeId__","__vue_module_identifier__","Component"],"mappings":"qGAGA,IAAIA,EAAU,EAAQ,QACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACG,EAAOC,EAAIJ,EAAS,MAC7DA,EAAQK,SAAQF,EAAOG,QAAUN,EAAQK,QAE5C,IAAIE,EAAM,EAAQ,QAAqEL,QAC1EK,EAAI,WAAYP,GAAS,EAAM,K,qBCT5CM,EAAUH,EAAOG,QAAU,EAAQ,OAAR,EAA+D,GAK1FA,EAAQE,KAAK,CAACL,EAAOC,EAAI,+4BAAg5B,M,mHCLn6BK,EAA8B,CAChCC,UAAW,EACXC,SAAU,EACVC,MAAO,GAGLC,EAAkC,SAASC,GAC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I,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOX,EAAItB,YAAY,CAACsB,EAAIQ,GAAG,iBAAiB,GAAGR,EAAIQ,GAAG,KAAKJ,EAAG,KAAK,CAACE,YAAY,iCAAiCN,EAAImB,GAAInB,EAAW,SAAE,SAASoB,GAAK,OAAOhB,EAAG,KAAK,CAACiB,IAAID,EAAI3B,GAAGa,YAAY,eAAe,CAACN,EAAIQ,GAAG,uBAAuBR,EAAIiB,GAAGjB,EAAIlD,gCAAgCsE,EAAI9E,WAAW,gBAAgB8D,EAAG,MAAMJ,EAAIQ,GAAG,0BAA0BR,EAAIiB,GAAGjB,EAAIsB,GAAG,aAAPtB,CAAqBoB,EAAIG,UAAU,oBAAoB,gBAAgBnB,EAAG,MAAMJ,EAAIQ,GAAG,wBAAwBR,EAAIiB,GAAGG,EAAII,KAAKC,QAAQ,GAAGpD,MAAM,gBAAgB+B,EAAG,MAAMJ,EAAIQ,GAAG,wBAAwBJ,EAAG,IAAI,CAACM,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOX,EAAIT,aAAa6B,EAAIrE,SAAS,CAACiD,EAAIQ,GAAGR,EAAIiB,GAAGG,EAAIrE,KAAKsB,cAAa,UAC/rDqD,EAAkB,CAAC,WAAa,IAAI1B,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,eAAe,CAACF,EAAG,KAAK,CAACJ,EAAIQ,GAAG,mB,YCDhK,SAASmB,EAAaC,GACpB,EAAQ,QAQV,IAAIC,GAA8B,EAE9BC,EAAiBH,EAEjBI,EAAkB,kBAElBC,EAA4B,KAE5BC,EAAY,eACd,EACA,EACA,EACAJ,EACAC,EACAC,EACAC,GAGa,aAAAC,EAAiB","file":"assets/js/chunk-359eafb9.js","sourcesContent":["// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../../node_modules/css-loader/index.js?minimize!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"id\\\":\\\"data-v-d739f00c\\\",\\\"scoped\\\":true,\\\"sourceMap\\\":false}!../../../../node_modules/stylus-loader/index.js!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./MemberGetMember.vue\");\nif(content.__esModule) content = content.default;\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"14fdb7bf\", content, true, {});","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\\n.flex-wrap[data-v-d739f00c] {\\n -ms-flex-wrap: wrap;\\n flex-wrap: wrap;\\n margin-left: -10px;\\n margin-right: -10px;\\n width: calc(100% + 20px);\\n}\\n.flex-wrap .flex[data-v-d739f00c] {\\n padding-left: 10px;\\n padding-right: 10px;\\n}\\n.fileUpload[data-v-d739f00c] {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n height: 45px;\\n width: 100%;\\n margin-top: 8px;\\n}\\n.fileUpload label[data-v-d739f00c] {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n -webkit-box-align: center;\\n -ms-flex-align: center;\\n align-items: center;\\n background: #fff;\\n border: 1px solid #c3c6d5;\\n width: 100%;\\n height: 100%;\\n padding: 0 1rem;\\n border-radius: 4px 0 0 4px;\\n -webkit-box-flex: 1;\\n -ms-flex-positive: 1;\\n flex-grow: 1;\\n}\\n.fileUpload button[data-v-d739f00c] {\\n height: 100%;\\n border-radius: 0 4px 4px 0;\\n}\\n\", \"\"]);\n\n// exports\n","const ImportMemberGetMemberStatus = {\n Initiated: 1,\n Finished: 2,\n Error: 3\n};\n\nconst ImportMemberGetMemberStatusName = function(statusId) {\n if(statusId == ImportMemberGetMemberStatus.Initiated) {\n return \"Processando\";\n }\n else if(statusId == ImportMemberGetMemberStatus.Finished) {\n return \"Finalizado\";\n }\n else if(statusId == ImportMemberGetMemberStatus.Error) {\n return \"Falhou\";\n }\n return \"\";\n}\n\nexport {ImportMemberGetMemberStatus, ImportMemberGetMemberStatusName};","<template>\n <div class=\"container\">\n <div class=\"boxapp\">\n <div class=\"boxapp-head\">\n <h1>Campanhas</h1>\n </div>\n <div class=\"box-main\">\n <div class=\"d-flex flex-wrap\">\n <v-flex xs12 md6>\n <v-select\n v-model=\"campaignId\"\n :items=\"listCampaign\"\n item-text=\"name\"\n item-value=\"id\"\n placeholder=\"Campanha\"\n @change=\"changeCampaign()\"\n ></v-select>\n </v-flex>\n <v-flex xs12 md6>\n <div class=\"fileUpload\">\n <label for=\"fileUpload\">{{ file.path != '' ? file.name : 'Fazer Upload' }}</label>\n <input ref=\"fileUpload\" id=\"fileUpload\" type=\"file\" @change=\"fileChanged($event)\" />\n <!-- <div v-if=\"file.path != ''\">{{file.name}}</div> -->\n <button\n @click=\"upload()\"\n class=\"btn-primary v-btn v-btn--flat theme--light white--text mx-0\"\n >Enviar</button>\n </div>\n </v-flex>\n </div>\n\n <ul class=\"projects-list px-0 w-100 mt-3\">\n <li v-for=\"mgm in listMgm\" :key=\"mgm.id\" class=\"layout item\">\n Status: {{importMemberGetMemberStatusName(mgm.statusId)}}\n <br />\n Criado em: {{mgm.createdAt | FormatDate('DD/MM/YYYY h:mm')}}\n <br />\n Usuário: {{mgm.user.persons[0].name}}\n <br />Arquivo:\n <a @click=\"downloadFile(mgm.file)\">{{mgm.file.name}}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</template>\n<script type=\"plain/text\">\nimport CampaignService from \"@/scripts/services/campaign.service.js\";\nimport PersonService from \"@/scripts/services/person.service.js\";\nimport FileService from \"@/scripts/services/file.service.js\";\nimport CommonHelper from \"@/scripts/helpers/common.helper\";\nimport File from \"@/scripts/models/file.model\";\nimport {\n ImportMemberGetMemberStatus,\n ImportMemberGetMemberStatusName,\n} from \"@/scripts/models/enums/importMemberGetMemberStatus.enum.js\";\nexport default {\n data() {\n return {\n campaignService: new CampaignService(),\n personService: new PersonService(),\n fileService: new FileService(),\n importMemberGetMemberStatusName: ImportMemberGetMemberStatusName,\n file: new File(),\n campaignId: 0,\n listCampaign: [],\n fileUpload: null,\n listMgm: [],\n };\n },\n created() {\n this.loadCampaigns();\n },\n methods: {\n loadCampaigns() {\n this.campaignService\n .listAllByCompanyId(this.$route.query.companyId)\n .then(data => {this.listCampaign = data});\n },\n fileChanged(event) {\n var file = event.target.files[0];\n if (file) {\n let reader = new FileReader();\n reader.onload = function () {\n this.file.name = file.name;\n this.file.path = reader.result;\n this.file.path = reader.result;\n }.bind(this);\n reader.readAsDataURL(file);\n }\n },\n upload() {\n if (this.campaignId != 0 && this.file.path != \"\") {\n let formData = this.mountFormData();\n this.personService.uploadMemberGetMember(formData).then((data) => {\n this.changeCampaign();\n });\n } else {\n CommonHelper.swal(\n \"Selecione uma campanha e faça o upload de um arquivo\"\n );\n }\n },\n mountFormData() {\n let formData = new FormData();\n formData.append(\"streamFile\", this.$refs.fileUpload.files[0]);\n formData.append(\"file.name\", this.file.name);\n formData.append(\"file.path\", this.file.path);\n formData.append(\"campaignId\", this.campaignId);\n return formData;\n },\n changeCampaign() {\n this.personService.finAllMgmByCampaignId(this.campaignId).then((data) => {\n this.listMgm = data;\n });\n },\n downloadFile(file) {\n this.fileService.render(file.id).then(function (data) {\n var a = document.createElement(\"a\");\n a.href = data;\n a.download = file.name + \".xlsx\";\n a.click();\n });\n },\n },\n};\n</script>\n<style lang=\"stylus\" scoped>\n.flex-wrap {\n flex-wrap: wrap;\n margin-left: -10px;\n margin-right: -10px;\n width: calc(100% + 20px);\n\n .flex {\n padding-left: 10px;\n padding-right: 10px;\n }\n}\n\n.fileUpload {\n display: flex;\n height: 45px;\n width: 100%;\n margin-top: 8px;\n\n label {\n display: flex;\n align-items: center;\n background: white;\n border: 1px solid #c3c6d5;\n width: 100%;\n height: 100%;\n padding: 0 1rem;\n border-radius: 4px 0 0 4px;\n flex-grow: 1;\n }\n\n button {\n height: 100%;\n border-radius: 0 4px 4px 0;\n }\n}\n</style>","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container\"},[_c('div',{staticClass:\"boxapp\"},[_vm._m(0),_vm._v(\" \"),_c('div',{staticClass:\"box-main\"},[_c('div',{staticClass:\"d-flex flex-wrap\"},[_c('v-flex',{attrs:{\"xs12\":\"\",\"md6\":\"\"}},[_c('v-select',{attrs:{\"items\":_vm.listCampaign,\"item-text\":\"name\",\"item-value\":\"id\",\"placeholder\":\"Campanha\"},on:{\"change\":function($event){return _vm.changeCampaign()}},model:{value:(_vm.campaignId),callback:function ($$v) {_vm.campaignId=$$v},expression:\"campaignId\"}})],1),_vm._v(\" \"),_c('v-flex',{attrs:{\"xs12\":\"\",\"md6\":\"\"}},[_c('div',{staticClass:\"fileUpload\"},[_c('label',{attrs:{\"for\":\"fileUpload\"}},[_vm._v(_vm._s(_vm.file.path != '' ? _vm.file.name : 'Fazer Upload'))]),_vm._v(\" \"),_c('input',{ref:\"fileUpload\",attrs:{\"id\":\"fileUpload\",\"type\":\"file\"},on:{\"change\":function($event){return _vm.fileChanged($event)}}}),_vm._v(\" \"),_c('button',{staticClass:\"btn-primary v-btn v-btn--flat theme--light white--text mx-0\",on:{\"click\":function($event){return _vm.upload()}}},[_vm._v(\"Enviar\")])])])],1),_vm._v(\" \"),_c('ul',{staticClass:\"projects-list px-0 w-100 mt-3\"},_vm._l((_vm.listMgm),function(mgm){return _c('li',{key:mgm.id,staticClass:\"layout item\"},[_vm._v(\"\\n Status: \"+_vm._s(_vm.importMemberGetMemberStatusName(mgm.statusId))+\"\\n \"),_c('br'),_vm._v(\"\\n Criado em: \"+_vm._s(_vm._f(\"FormatDate\")(mgm.createdAt,'DD/MM/YYYY h:mm'))+\"\\n \"),_c('br'),_vm._v(\"\\n Usuário: \"+_vm._s(mgm.user.persons[0].name)+\"\\n \"),_c('br'),_vm._v(\"Arquivo:\\n \"),_c('a',{on:{\"click\":function($event){return _vm.downloadFile(mgm.file)}}},[_vm._v(_vm._s(mgm.file.name))])])}),0)])])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"boxapp-head\"},[_c('h1',[_vm._v(\"Campanhas\")])])}]\nexport { render, staticRenderFns }","function injectStyle (context) {\n require(\"!!vue-style-loader!css-loader?minimize!../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"optionsId\\\":\\\"0\\\",\\\"vue\\\":true,\\\"id\\\":\\\"data-v-d739f00c\\\",\\\"scoped\\\":true,\\\"sourceMap\\\":false}!stylus-loader!../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./MemberGetMember.vue\")\n}\n/* script */\nexport * from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./MemberGetMember.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./MemberGetMember.vue\"\n/* template */\nimport {render as __vue_render__, staticRenderFns as __vue_static_render_fns__} from \"!!../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-d739f00c\\\",\\\"hasScoped\\\":true,\\\"optionsId\\\":\\\"0\\\",\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./MemberGetMember.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = \"data-v-d739f00c\"\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nimport normalizeComponent from \"!../../../../node_modules/vue-loader/lib/runtime/component-normalizer\"\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_render__,\n __vue_static_render_fns__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n"],"sourceRoot":""}