{"version":3,"sources":["webpack:///./src/components/AdminComponents/UsersProcessAdmin.vue?1653","webpack:///./src/components/AdminComponents/UsersProcessAdmin.vue?3315","webpack:///src/components/AdminComponents/UsersProcessAdmin.vue","webpack:///./src/components/AdminComponents/UsersProcessAdmin.vue?9cfa","webpack:///./src/components/AdminComponents/UsersProcessAdmin.vue","webpack:///./src/services/users.service.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","_s","type","ref","on","onReset","attrs","roles","roleState","inProcess","model","value","form","callback","$$v","$set","expression","identificacionState","trim","nombresState","apellidosState","emailState","telefonoState","nacimientoState","maxDateBirthday","handleSubmit","$event","$router","push","name","staticRenderFns","data","usersService","role","identificacion","nombres","apellidos","email","telefono","nacimiento","$moment","format","created","$route","params","id","mounted","recoveryDataRegister","methods","validation","title","variant","message","createRegister","editRegister","$nextTick","validRole","validIdentificacion","validNombres","validApellidos","validEmail","validTelefono","validNacimiento","watch","to","component","UsersService","axios","get","process","post","delete","put"],"mappings":"gHAAA,W,gECAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,oBAAoB,CAACF,EAAG,KAAK,CAACE,YAAY,aAAa,CAACN,EAAIO,GAAG,IAAIP,EAAIQ,GAAe,UAAZR,EAAIS,KAAmB,UAAY,UAAU,gBAAgBL,EAAG,SAAS,CAACM,IAAI,UAAUC,GAAG,CAAC,MAAQX,EAAIY,UAAU,CAACR,EAAG,MAAM,CAACE,YAAY,gBAAgB,CAACF,EAAG,eAAe,CAACE,YAAY,oBAAoBO,MAAM,CAAC,MAAQ,SAAS,CAACT,EAAG,gBAAgB,CAACM,IAAI,OAAOG,MAAM,CAAC,GAAK,OAAO,QAAUb,EAAIc,MAAM,MAAQd,EAAIe,UAAU,SAAW,GAAG,SAAWf,EAAIgB,WAAWC,MAAM,CAACC,MAAOlB,EAAImB,KAAS,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GACd,OAAOoC,IAAMG,KAAKD,mEAAyDtC,K,8BAE7E,SAAiBA,GACf,OAAOoC,IAAMG,KAAKD,oEAA0DtC,K,wBAE9E,SAAWc,GACT,IAAMd,EAAK,CACTc,MAEF,OAAOsB,IAAMI,OAAOF,sDAA4C,CAACtC,W,2BAEnE,SAAcA,GACZ,OAAOoC,IAAMK,IAAIH,mEAAyDtC,K,4BAE5E,SAAeA,GACb,OAAOoC,IAAMK,IAAIH,oEAA0DtC,K,4BAE7E,SAAeA,GACb,OAAOoC,IAAMK,IAAIH,sEAA4DtC,K,yBAG/E,SAAYA,GACV,OAAOoC,IAAMG,KAAKD,yDAA+CtC,K,0BAGnE,WACE,OAAOoC,IAAMI,OAAOF,kE","file":"js/chunk-361765e6.2a07da75.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.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/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./UsersProcessAdmin.vue?vue&type=style&index=0&id=8912f34a&lang=scss&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container-cental\"},[_c('h1',{staticClass:\"mt-5 mb-5\"},[_vm._v(\" \"+_vm._s(_vm.type == \"create\" ? \"AGREGAR\" : \"EDITAR\")+\" USUARIOS \")]),_c('b-form',{ref:\"formAdd\",on:{\"reset\":_vm.onReset}},[_c('div',{staticClass:\"row p-3 mb-5\"},[_c('b-form-group',{staticClass:\"col-md-6 col-lg-4\",attrs:{\"label\":\"Rol*\"}},[_c('b-form-select',{ref:\"role\",attrs:{\"id\":\"role\",\"options\":_vm.roles,\"state\":_vm.roleState,\"required\":\"\",\"disabled\":_vm.inProcess},model:{value:(_vm.form.role),callback:function ($$v) {_vm.$set(_vm.form, \"role\", $$v)},expression:\"form.role\"}})],1),_c('b-form-group',{staticClass:\"col-md-6 col-lg-4\",attrs:{\"label\":\"Identificación*\",\"label-for\":\"identificacion\"}},[_c('b-form-input',{ref:\"identificacion\",attrs:{\"id\":\"identificacion\",\"type\":\"text\",\"state\":_vm.identificacionState,\"required\":\"\",\"disabled\":_vm.inProcess},model:{value:(_vm.form.identificacion),callback:function ($$v) {_vm.$set(_vm.form, \"identificacion\", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:\"form.identificacion\"}})],1),_c('b-form-group',{staticClass:\"col-md-6 col-lg-4\",attrs:{\"label\":\"Nombres*\",\"label-for\":\"nombres\"}},[_c('b-form-input',{ref:\"nombres\",attrs:{\"id\":\"nombres\",\"type\":\"text\",\"state\":_vm.nombresState,\"required\":\"\",\"disabled\":_vm.inProcess},model:{value:(_vm.form.nombres),callback:function ($$v) {_vm.$set(_vm.form, \"nombres\", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:\"form.nombres\"}})],1),_c('b-form-group',{staticClass:\"col-md-6 col-lg-4\",attrs:{\"label\":\"Apellidos*\",\"label-for\":\"apellidos\"}},[_c('b-form-input',{ref:\"apellidos\",attrs:{\"id\":\"apellidos\",\"type\":\"text\",\"state\":_vm.apellidosState,\"required\":\"\",\"disabled\":_vm.inProcess},model:{value:(_vm.form.apellidos),callback:function ($$v) {_vm.$set(_vm.form, \"apellidos\", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:\"form.apellidos\"}})],1),_c('b-form-group',{staticClass:\"col-md-6 col-lg-4\",attrs:{\"label\":\"Email*\",\"label-for\":\"email\"}},[_c('b-form-input',{ref:\"email\",attrs:{\"id\":\"email\",\"type\":\"email\",\"state\":_vm.emailState,\"required\":\"\",\"disabled\":_vm.inProcess || _vm.type == 'edit'},model:{value:(_vm.form.email),callback:function ($$v) {_vm.$set(_vm.form, \"email\", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:\"form.email\"}})],1),_c('b-form-group',{staticClass:\"col-md-6 col-lg-4\",attrs:{\"label\":\"Teléfono*\",\"label-for\":\"telefono\"}},[_c('b-form-input',{ref:\"telefono\",attrs:{\"id\":\"telefono\",\"type\":\"text\",\"state\":_vm.telefonoState,\"required\":\"\",\"disabled\":_vm.inProcess},model:{value:(_vm.form.telefono),callback:function ($$v) {_vm.$set(_vm.form, \"telefono\", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:\"form.telefono\"}})],1),_c('b-form-group',{staticClass:\"col-md-6 col-lg-4\",attrs:{\"label\":\"Nacimiento*\",\"label-for\":\"nacimiento\"}},[_c('b-form-input',{ref:\"nacimiento\",attrs:{\"id\":\"nacimiento\",\"type\":\"date\",\"state\":_vm.nacimientoState,\"max\":_vm.maxDateBirthday,\"required\":\"\",\"disabled\":_vm.inProcess},model:{value:(_vm.form.nacimiento),callback:function ($$v) {_vm.$set(_vm.form, \"nacimiento\", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:\"form.nacimiento\"}})],1)],1),_c('b-button',{attrs:{\"variant\":\"primary\"},on:{\"click\":_vm.handleSubmit}},[_vm._v(\"Aceptar\")]),_c('b-button',{staticClass:\"ml-3\",attrs:{\"variant\":\"danger\"},on:{\"click\":function($event){return _vm.$router.push({ name: 'UsersList' })}}},[_vm._v(\"Cancelar\")])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n  <div class=\"container-cental\">\r\n    <h1 class=\"mt-5 mb-5\">\r\n      {{ type == \"create\" ? \"AGREGAR\" : \"EDITAR\" }} USUARIOS\r\n    </h1>\r\n    <b-form ref=\"formAdd\" @reset=\"onReset\">\r\n      <div class=\"row p-3 mb-5\">\r\n        <!-- role -->\r\n        <b-form-group label=\"Rol*\" class=\"col-md-6 col-lg-4\">\r\n          <b-form-select\r\n            id=\"role\"\r\n            v-model=\"form.role\"\r\n            :options=\"roles\"\r\n            ref=\"role\"\r\n            :state=\"roleState\"\r\n            required\r\n            :disabled=\"inProcess\"\r\n          ></b-form-select>\r\n        </b-form-group>\r\n        <!-- identificacion -->\r\n        <b-form-group\r\n          label=\"Identificación*\"\r\n          label-for=\"identificacion\"\r\n          class=\"col-md-6 col-lg-4\"\r\n        >\r\n          <b-form-input\r\n            id=\"identificacion\"\r\n            v-model.trim=\"form.identificacion\"\r\n            type=\"text\"\r\n            ref=\"identificacion\"\r\n            :state=\"identificacionState\"\r\n            required\r\n            :disabled=\"inProcess\"\r\n          ></b-form-input>\r\n        </b-form-group>\r\n        <!-- nombres -->\r\n        <b-form-group\r\n          label=\"Nombres*\"\r\n          label-for=\"nombres\"\r\n          class=\"col-md-6 col-lg-4\"\r\n        >\r\n          <b-form-input\r\n            id=\"nombres\"\r\n            v-model.trim=\"form.nombres\"\r\n            type=\"text\"\r\n            ref=\"nombres\"\r\n            :state=\"nombresState\"\r\n            required\r\n            :disabled=\"inProcess\"\r\n          ></b-form-input>\r\n        </b-form-group>\r\n        <!-- apellidos -->\r\n        <b-form-group\r\n          label=\"Apellidos*\"\r\n          label-for=\"apellidos\"\r\n          class=\"col-md-6 col-lg-4\"\r\n        >\r\n          <b-form-input\r\n            id=\"apellidos\"\r\n            v-model.trim=\"form.apellidos\"\r\n            type=\"text\"\r\n            ref=\"apellidos\"\r\n            :state=\"apellidosState\"\r\n            required\r\n            :disabled=\"inProcess\"\r\n          ></b-form-input>\r\n        </b-form-group>\r\n        <!-- email -->\r\n        <b-form-group\r\n          label=\"Email*\"\r\n          label-for=\"email\"\r\n          class=\"col-md-6 col-lg-4\"\r\n        >\r\n          <b-form-input\r\n            id=\"email\"\r\n            v-model.trim=\"form.email\"\r\n            type=\"email\"\r\n            ref=\"email\"\r\n            :state=\"emailState\"\r\n            required\r\n            :disabled=\"inProcess || type == 'edit'\"\r\n          ></b-form-input>\r\n        </b-form-group>\r\n        <!-- telefono -->\r\n        <b-form-group\r\n          label=\"Teléfono*\"\r\n          label-for=\"telefono\"\r\n          class=\"col-md-6 col-lg-4\"\r\n        >\r\n          <b-form-input\r\n            id=\"telefono\"\r\n            v-model.trim=\"form.telefono\"\r\n            type=\"text\"\r\n            ref=\"telefono\"\r\n            :state=\"telefonoState\"\r\n            required\r\n            :disabled=\"inProcess\"\r\n          ></b-form-input>\r\n        </b-form-group>\r\n        <!-- nacimiento\t -->\r\n        <b-form-group\r\n          label=\"Nacimiento*\"\r\n          label-for=\"nacimiento\"\r\n          class=\"col-md-6 col-lg-4\"\r\n        >\r\n          <b-form-input\r\n            id=\"nacimiento\"\r\n            v-model.trim=\"form.nacimiento\"\r\n            type=\"date\"\r\n            ref=\"nacimiento\"\r\n            :state=\"nacimientoState\"\r\n            :max=\"maxDateBirthday\"\r\n            required\r\n            :disabled=\"inProcess\"\r\n          ></b-form-input>\r\n        </b-form-group>\r\n      </div>\r\n      <b-button variant=\"primary\" @click=\"handleSubmit\">Aceptar</b-button>\r\n      <b-button\r\n        variant=\"danger\"\r\n        class=\"ml-3\"\r\n        @click=\"$router.push({ name: 'UsersList' })\"\r\n        >Cancelar</b-button\r\n      >\r\n    </b-form>\r\n  </div>\r\n</template>\r\n\r\n<script>\r\nimport UsersService from \"@/services/users.service\";\r\nimport EventBus from \"@/services/eventBus.js\";\r\nexport default {\r\n  name: \"UserProcessAdmin\",\r\n  data() {\r\n    return {\r\n      usersService: null,\r\n      roles: [\r\n        \"admin\",\r\n        \"superadmin\",\r\n        \"public\",\r\n        \"domicilio\" /* , \"produccion\" */,\r\n      ],\r\n      form: {\r\n        role: null,\r\n        identificacion: null,\r\n        nombres: null,\r\n        apellidos: null,\r\n        email: null,\r\n        telefono: null,\r\n        nacimiento: null,\r\n      },\r\n      roleState: null,\r\n      identificacionState: null,\r\n      nombresState: null,\r\n      apellidosState: null,\r\n      emailState: null,\r\n      telefonoState: null,\r\n      nacimientoState: null,\r\n      type: \"create\",\r\n      maxDateBirthday: this.$moment().format(\"YYYY-MM-DD\"),\r\n      inProcess: false,\r\n    };\r\n  },\r\n  created() {\r\n    this.usersService = new UsersService();\r\n    this.$route.params.id ? (this.type = \"edit\") : (this.type = \"create\");\r\n  },\r\n  mounted() {\r\n    if (this.type == \"edit\") {\r\n      this.recoveryDataRegister();\r\n    }\r\n  },\r\n  methods: {\r\n    handleSubmit() {\r\n      if (!this.validation()) {\r\n        EventBus.$emit(\"MOSTRAR_TOAST\", {\r\n          title: \"Error\",\r\n          variant: \"warning\",\r\n          message: \"Debes completar los campos obligatorios\",\r\n        });\r\n        return false;\r\n      }\r\n      if (this.type === \"create\") {\r\n        this.createRegister();\r\n      } else {\r\n        this.editRegister();\r\n      }\r\n    },\r\n    recoveryDataRegister() {\r\n      this.usersService\r\n        .getById(this.$route.params.id)\r\n        .then((result) => {\r\n          this.form = { ...result.data.data };\r\n        })\r\n        .catch((err) => {\r\n          console.log(err);\r\n        });\r\n    },\r\n    createRegister() {\r\n      this.inProcess = true;\r\n      this.usersService\r\n        .createUserAdmin(this.form)\r\n        .then((result) => {\r\n          console.log(\"result\", result);\r\n          if (result.data.status == 200) {\r\n            this.form = {\r\n              role: null,\r\n              identificacion: null,\r\n              nombres: null,\r\n              apellidos: null,\r\n              email: null,\r\n              telefono: null,\r\n              nacimiento: null,\r\n            };\r\n            EventBus.$emit(\"MOSTRAR_TOAST\", {\r\n              title: \"Felicidades\",\r\n              variant: \"success\",\r\n              message: \"Registro creado satisfactoriamente\",\r\n            });\r\n          } else {\r\n            EventBus.$emit(\"MOSTRAR_TOAST\", {\r\n              title: \"Error\",\r\n              variant: \"danger\",\r\n              message: result.data.errores.join(\" - \"),\r\n            });\r\n          }\r\n          this.inProcess = false;\r\n        })\r\n        .catch(() => {\r\n          EventBus.$emit(\"MOSTRAR_TOAST\", {\r\n            title: \"Error\",\r\n            variant: \"danger\",\r\n            message: \"Error al guardar el registro\",\r\n          });\r\n          this.inProcess = false;\r\n        });\r\n    },\r\n    editRegister() {\r\n      this.inProcess = true;\r\n      this.usersService\r\n        .editUserAdmin(this.form)\r\n        .then((result) => {\r\n          if (result.data.status == 200) {\r\n            this.form = {\r\n              role: null,\r\n              identificacion: null,\r\n              nombres: null,\r\n              apellidos: null,\r\n              email: null,\r\n              telefono: null,\r\n              nacimiento: null,\r\n            };\r\n            EventBus.$emit(\"MOSTRAR_TOAST\", {\r\n              title: \"Felicidades\",\r\n              variant: \"success\",\r\n              message: \"Registro editado satisfactoriamente\",\r\n            });\r\n            this.$router.push({ name: \"UsersList\" });\r\n          } else {\r\n            EventBus.$emit(\"MOSTRAR_TOAST\", {\r\n              title: \"Error\",\r\n              variant: \"danger\",\r\n              message: result.data.errores.join(\" - \"),\r\n            });\r\n          }\r\n          this.inProcess = false;\r\n        })\r\n        .catch(() => {\r\n          EventBus.$emit(\"MOSTRAR_TOAST\", {\r\n            title: \"Error\",\r\n            variant: \"danger\",\r\n            message: \"Error al editar el registro\",\r\n          });\r\n          this.inProcess = false;\r\n        });\r\n    },\r\n    onReset() {\r\n      this.form = {\r\n        role: null,\r\n        identificacion: null,\r\n        nombres: null,\r\n        apellidos: null,\r\n        email: null,\r\n        telefono: null,\r\n        nacimiento: null,\r\n      };\r\n      this.$nextTick(() => {\r\n        this.$refs.formAdd.reset();\r\n      });\r\n    },\r\n    validation() {\r\n      /* validando un select*/\r\n      const validRole = this.$refs.role.required\r\n        ? this.$refs.role.value\r\n          ? true\r\n          : false\r\n        : true;\r\n      this.roleState = validRole;\r\n      /* identificacion*/\r\n      const validIdentificacion = this.$refs.identificacion.checkValidity();\r\n      this.identificacionState = validIdentificacion;\r\n      /* nombres*/\r\n      const validNombres = this.$refs.nombres.checkValidity();\r\n      this.nombresState = validNombres;\r\n      /* apellidos*/\r\n      const validApellidos = this.$refs.apellidos.checkValidity();\r\n      this.apellidosState = validApellidos;\r\n      /* email*/\r\n      const validEmail = this.$refs.email.checkValidity();\r\n      this.emailState = validEmail;\r\n      /* telefono*/\r\n      const validTelefono = this.$refs.telefono.checkValidity();\r\n      this.telefonoState = validTelefono;\r\n      /* nacimiento*/\r\n      const validNacimiento = this.$refs.nacimiento.checkValidity();\r\n      this.nacimientoState = validNacimiento;\r\n      return (\r\n        validRole &&\r\n        validNombres &&\r\n        validApellidos &&\r\n        validIdentificacion &&\r\n        validEmail &&\r\n        validTelefono &&\r\n        validNacimiento\r\n      );\r\n    },\r\n  },\r\n  watch: {\r\n    $route(to) {\r\n      to.params.id ? (this.type = \"edit\") : (this.type = \"create\");\r\n    },\r\n  },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.container-cental {\r\n  width: 100%;\r\n  min-height: 700px;\r\n  padding: 0px 300px;\r\n}\r\n@media (max-width: 1400px) {\r\n  .container-cental {\r\n    padding: 0px 10px;\r\n  }\r\n}\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!./UsersProcessAdmin.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!./UsersProcessAdmin.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./UsersProcessAdmin.vue?vue&type=template&id=8912f34a&scoped=true&\"\nimport script from \"./UsersProcessAdmin.vue?vue&type=script&lang=js&\"\nexport * from \"./UsersProcessAdmin.vue?vue&type=script&lang=js&\"\nimport style0 from \"./UsersProcessAdmin.vue?vue&type=style&index=0&id=8912f34a&lang=scss&scoped=true&\"\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  \"8912f34a\",\n  null\n  \n)\n\nexport default component.exports","import axios from \"axios\";\r\n\r\nexport default class UsersService {\r\n  getAll(){\r\n    return axios.get(process.env.VUE_APP_API_PUBLIC + \"usuarios/all\")\r\n  }\r\n  getById(id){\r\n    return axios.get(process.env.VUE_APP_API_PUBLIC + \"usuarios/admin/\"+id)\r\n  }\r\n  createUserAdmin(data){\r\n    return axios.post(process.env.VUE_APP_API_PUBLIC + \"usuarios/create-admin\",data)\r\n  }\r\n  createUserPublic(data){\r\n    return axios.post(process.env.VUE_APP_API_PUBLIC + \"usuarios/create-public\",data)\r\n  }\r\n  deleteUser(id){\r\n    const data={\r\n      id\r\n    }\r\n    return axios.delete(process.env.VUE_APP_API_PUBLIC + \"usuarios\",{data})\r\n  }\r\n  editUserAdmin(data){\r\n    return axios.put(process.env.VUE_APP_API_PUBLIC + \"usuarios/update-admin\",data)\r\n  }\r\n  editUserPublic(data){\r\n    return axios.put(process.env.VUE_APP_API_PUBLIC + \"usuarios/update-public\",data)\r\n  }\r\n  changePassword(data){\r\n    return axios.put(process.env.VUE_APP_API_PUBLIC + \"usuarios/change-password\",data)\r\n  }\r\n\r\n  contactanos(data){\r\n    return axios.post(process.env.VUE_APP_API_PUBLIC + \"contactanos\",data)\r\n  }\r\n\r\n  deletePerfil(){\r\n    return axios.delete(process.env.VUE_APP_API_PUBLIC + \"usuarios/perfil\")\r\n  }\r\n}\r\n"],"sourceRoot":""}