{"version":3,"sources":["webpack:///./src/mixins/basePageMixin.js","webpack:///./src/mixins/formPageMixin.js","webpack:///./src/mixins/common.js","webpack:///./src/pages/operacionescrm/operacioncrmAdd/OperacioncrmAdd.vue?8287","webpack:///./src/pages/operacionescrm/operacioncrmAdd/OperacioncrmAddData.js","webpack:///src/pages/operacionescrm/operacioncrmAdd/OperacioncrmAdd.vue","webpack:///./src/pages/operacionescrm/operacioncrmAdd/OperacioncrmAdd.vue?0a16","webpack:///./src/pages/operacionescrm/operacioncrmAdd/OperacioncrmAdd.vue"],"names":["basePageMixin","data","title","routeParams","routeQuery","loadingData","rememberState","rememberScroll","showingDialogs","pageLoaded","bottomNavBarButtons","dbReady","created","this","_","cloneDeep","$route","params","query","extra","decodeBase64","computed","routeFromBrowserHistory","meta","fromBrowserHistory","userPermissions","get","permissions","methods","initDB","$offline","db","$loading","showManual","connect","initSchema","init","hide","closeDB","close","copyRouteParamsToPageStore","pageStoreName","routeParam","storeHasProperty","setStoreProperty","initStore","property","$store","value","set","getStoreProperty","dispatchStore","actionName","payload","dispatch","hasViewPerm","perm","hasInsertPerm","hasEditPerm","hasDeletePerm","hasPerm","beforeRouteLeaveBase","to","from","next","beforeRouteLeaveCommon","initNavigationBottom","addNavigationBottomButton","name","icon","visible","badge","badgeColor","index","push","order","length","formPageMixin","mixins","formData","submitMessage","scrollPosition","gotoScrollPosition","clickSubmit","form","validate","submitForm","formInvalid","saveFormData","Object","keys","fieldname","currentScrollPosition","that","showingDialog","dialog","$set","render","_vm","_h","$createElement","_c","_self","attrs","on","$event","stopPropagation","$refs","slot","_v","_s","$vuetify","icons","values","check","ref","tabla","usuarioIdempleado","usuarioIddelegacion","usuarioIdtecnico","usuarioIdcomercial","usuarioIdvigilante","descripcion","changeFormData","staticRenderFns","insertLoperacioncrmCliente","Vue","idoperacioncrm","idcliente","$api","call","insertLoperacioncrmClientePotencial","idclientePotencial","idcliente_potencial","idsistema","apiFilter","APIFilter","addExact","filter","resp","result","dataset","idpresupuestocli","idordenTrabajo","idorden_trabajo","insertLoperacioncrmSistema","identificador","TABLA","cliente","sistema","cliente_potencial","presupuestocli","insertLoperacioncrmPresupuestocli","orden_trabajo","insertLoperacioncrmOrdenTrabajo","Error","titleSingular","ahora","currentDateTime","idtoperacioncrm","toperacioncrm","idserie_operacioncrm","serie_operacioncrm","noperacioncrm","idprioridad","finicio","observaciones","iddelegacion","iddepartamento","idinformador","fproximarevision","fprevistafin","ffin","fasignacion","idest_operacioncrm","idgrupo_empleado","respOperacionCRM","insertarLineasOperacionCRM","$online","dato","batchCallInsertDeFormData","datos","apiCalls","cita","fcita","combinarDateTime","cita_fecha","cita_inicio","cita_fin","method","titulo","cita_titulo","cita_cita","tipo","CITA","crm","estado","pendiente","idempleado","batchCall","components","OperacioncrmForm","props","type","default","viewRoute","loadPage","Data","inserted","component","VBtn","VIcon"],"mappings":"sRAOaA,EAAgB,CAC3BC,KAD2B,WAEzB,MAAO,CACLC,MAAO,GACPC,YAAa,KACbC,WAAY,KACZC,aAAa,EACbC,eAAe,EACfC,gBAAgB,EAChBC,eAAgB,GAChBC,YAAY,EACZC,oBAAqB,GACrBC,SAAS,IAGbC,QAf2B,WAgBzBC,KAAKV,YAAcW,OAAEC,UAAUF,KAAKG,OAAOC,QAC3CJ,KAAKT,WAAaU,OAAEC,UAAUF,KAAKG,OAAOE,OACtCL,KAAKT,WAAWe,QAClBN,KAAKT,WAAWe,MAAQC,eAAaP,KAAKT,WAAWe,SAGzDE,SAAU,CACRC,wBADQ,WAGN,OAAOT,KAAKG,OAAOO,KAAKC,oBAE1BC,gBAAiBC,eAAI,oBACrBC,YANQ,WAON,OAAOA,SAGXC,QAAS,CACDC,OADC,WACS,2JACT,EAAKC,SAASC,GADL,wBAEZ,EAAKC,SAASC,WAAW,kCAFb,cAIJ,EAAKH,SAJD,SAIqBI,eAAQC,kBAJ7B,wCAIUC,KAJV,uCAMV,EAAKzB,SAAU,EACf,EAAKqB,SAASK,OAPJ,4CAUZ,EAAK1B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79f21abf.js","sourcesContent":["import { decodeBase64 } from '@/utils/router'\r\nimport { get } from 'vuex-pathify'\r\nimport _ from '@/utils/lodash'\r\nimport { beforeRouteLeaveCommon } from './common'\r\nimport { hasViewPerm, hasInsertPerm, hasEditPerm, hasDeletePerm, hasPerm, permissions } from '@/utils/permissions'\r\nimport { initSchema, connect } from '@/offline/database'\r\n\r\nexport const basePageMixin = {\r\n data () {\r\n return {\r\n title: '',\r\n routeParams: null,\r\n routeQuery: null,\r\n loadingData: false,\r\n rememberState: false,\r\n rememberScroll: false,\r\n showingDialogs: {},\r\n pageLoaded: false,\r\n bottomNavBarButtons: [],\r\n dbReady: false,\r\n }\r\n },\r\n created () {\r\n this.routeParams = _.cloneDeep(this.$route.params)\r\n this.routeQuery = _.cloneDeep(this.$route.query)\r\n if (this.routeQuery.extra) {\r\n this.routeQuery.extra = decodeBase64(this.routeQuery.extra)\r\n }\r\n },\r\n computed: {\r\n routeFromBrowserHistory () {\r\n // no mostrar alerts en el \"back\" del navegador\r\n return this.$route.meta.fromBrowserHistory\r\n },\r\n userPermissions: get('usuario/permisos'),\r\n permissions () {\r\n return permissions\r\n },\r\n },\r\n methods: {\r\n async initDB () {\r\n if (!this.$offline.db) {\r\n this.$loading.showManual('Inicializando base de datos...')\r\n try {\r\n await this.$offline.init(await connect(initSchema()))\r\n } finally {\r\n this.dbReady = true\r\n this.$loading.hide()\r\n }\r\n } else {\r\n this.dbReady = true\r\n }\r\n },\r\n async closeDB () {\r\n if (this.$offline.db) {\r\n await this.$offline.db.close()\r\n this.$offline.db = null\r\n this.dbReady = false\r\n }\r\n },\r\n async copyRouteParamsToPageStore () {\r\n if (this.pageStoreName) {\r\n for (const routeParam in this.routeParams) {\r\n if (this.storeHasProperty(routeParam)) {\r\n await this.setStoreProperty(routeParam, this.routeParams[routeParam])\r\n }\r\n }\r\n }\r\n },\r\n async initStore () {\r\n // routeParams -> ¿existe en el store de la página? -> copiar valor\r\n // usado para: nextRoute, readonly\r\n await this.copyRouteParamsToPageStore()\r\n },\r\n storeHasProperty (property) {\r\n return property in this.$store.get(`${this.pageStoreName}`)\r\n },\r\n async setStoreProperty (property, value) {\r\n await this.$store.set(`${this.pageStoreName}/${property}`, value)\r\n },\r\n async getStoreProperty (property) {\r\n return await this.$store.get(`${this.pageStoreName}/${property}`)\r\n },\r\n async dispatchStore (actionName, payload) {\r\n return await this.$store.dispatch(`${this.pageStoreName}/${actionName}`, payload)\r\n },\r\n hasViewPerm (perm) {\r\n return hasViewPerm(this.userPermissions, perm)\r\n },\r\n hasInsertPerm (perm) {\r\n return hasInsertPerm(this.userPermissions, perm)\r\n },\r\n hasEditPerm (perm) {\r\n return hasEditPerm(this.userPermissions, perm)\r\n },\r\n hasDeletePerm (perm) {\r\n return hasDeletePerm(this.userPermissions, perm)\r\n },\r\n hasPerm (perm) {\r\n return hasPerm(this.userPermissions, perm)\r\n },\r\n beforeRouteLeaveBase (to, from, next) {\r\n if (!beforeRouteLeaveCommon(this, to, from, next)) {\r\n next()\r\n }\r\n },\r\n initNavigationBottom () {\r\n this.bottomNavBarButtons = []\r\n },\r\n addNavigationBottomButton (title, name, icon, visible = true, badge = null, badgeColor = 'green') {\r\n const index = this.bottomNavBarButtons.push({\r\n title,\r\n name,\r\n icon,\r\n order: this.bottomNavBarButtons.length + 1,\r\n visible,\r\n badge,\r\n badgeColor,\r\n })\r\n return this.bottomNavBarButtons[index - 1]\r\n },\r\n }\r\n}\r\n","import { basePageMixin } from '@/mixins/basePageMixin'\r\nimport { beforeRouteLeaveCommon } from './common'\r\nimport { currentScrollPosition } from '@/utils/ui'\r\nimport { gotoScrollPosition } from '@/utils/ui'\r\n\r\nexport const formPageMixin = {\r\n mixins: [basePageMixin],\r\n data () {\r\n return {\r\n formData: {},\r\n submitMessage: 'Guardando cambios...',\r\n }\r\n },\r\n methods: {\r\n async initStore () {\r\n await this.copyRouteParamsToPageStore()\r\n if (this.scrollPosition > 0) {\r\n gotoScrollPosition(this.scrollPosition)\r\n }\r\n },\r\n async clickSubmit (form) {\r\n if (await form.validate()) {\r\n this.$loading.showManual(this.submitMessage)\r\n try {\r\n // submit de la página donde se aplica el mixin\r\n await this.submitForm()\r\n } finally {\r\n this.$loading.hide()\r\n }\r\n } else {\r\n await this.formInvalid()\r\n }\r\n },\r\n async formInvalid () {\r\n // sobreescribir donde se aplica el mixin\r\n },\r\n async saveFormData (formData) {\r\n for (const fieldname of Object.keys(formData)) {\r\n await this.setStoreProperty(`formData@${fieldname}`, formData[fieldname])\r\n }\r\n },\r\n async beforeRouteLeaveBase (to, from, next) {\r\n if (!beforeRouteLeaveCommon(this, to, from, next)) {\r\n if (this.pageStoreName) {\r\n if (this.rememberScroll) {\r\n await this.setStoreProperty('scrollPosition', currentScrollPosition())\r\n } else {\r\n await this.dispatchStore('resetScroll')\r\n }\r\n if (!this.rememberState) {\r\n await this.dispatchStore('resetStore')\r\n }\r\n }\r\n next()\r\n }\r\n },\r\n }\r\n}\r\n","export const beforeRouteLeaveCommon = (that, to, from, next) => {\r\n if (that.loadingData) {\r\n next(false)\r\n return true\r\n } else {\r\n let showingDialog = false\r\n for (const dialog in that.showingDialogs) {\r\n if (that.showingDialogs[dialog]) {\r\n that.$set(that.showingDialogs, dialog, false)\r\n showingDialog = true\r\n next(false)\r\n break\r\n }\r\n }\r\n return showingDialog\r\n }\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b10-base',[_c('b10-toolbar',{attrs:{\"title\":_vm.title}},[_c('v-btn',{attrs:{\"slot\":\"right\",\"icon\":\"\"},on:{\"click\":function($event){$event.stopPropagation();return _vm.clickSubmit(_vm.$refs.form)}},slot:\"right\"},[_c('v-icon',[_vm._v(_vm._s(_vm.$vuetify.icons.values.check))])],1)],1),_c('b10-page-content',{attrs:{\"padding\":3}},[_c('ValidationObserver',{ref:\"form\"},[_c('operacioncrm-form',{attrs:{\"tabla\":_vm.tabla,\"idempleado\":_vm.usuarioIdempleado,\"iddelegacion\":_vm.usuarioIddelegacion,\"es-tecnico\":!!_vm.usuarioIdtecnico,\"es-comercial\":!!_vm.usuarioIdcomercial,\"es-vigilante\":!!_vm.usuarioIdvigilante,\"descripcion\":_vm.routeQuery.descripcion},on:{\"change-values\":_vm.changeFormData}})],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { TABLA, CITA } from '@/utils/consts'\r\nimport { APIFilter } from '@/utils/api'\r\nimport { currentDateTime, combinarDateTime } from '@/utils/date'\r\n\r\nexport default {\r\n async insertLoperacioncrmCliente(Vue, idoperacioncrm, idcliente) {\r\n await Vue.$api.call(\r\n 'loperacioncrm.insert',\r\n {\r\n values: {\r\n idoperacioncrm: idoperacioncrm,\r\n idcliente: idcliente,\r\n },\r\n },\r\n )\r\n },\r\n async insertLoperacioncrmClientePotencial(Vue, idoperacioncrm, idclientePotencial) {\r\n await Vue.$api.call(\r\n 'loperacioncrm.insert',\r\n {\r\n values: {\r\n idoperacioncrm: idoperacioncrm,\r\n idcliente_potencial: idclientePotencial,\r\n },\r\n },\r\n )\r\n },\r\n async insertLoperacioncrmCliente(Vue, idoperacioncrm, idcliente) {\r\n await Vue.$api.call(\r\n 'loperacioncrm.insert',\r\n {\r\n values: {\r\n idoperacioncrm: idoperacioncrm,\r\n idcliente: idcliente,\r\n },\r\n },\r\n )\r\n },\r\n async insertLoperacioncrmSistema(Vue, idoperacioncrm, idsistema) {\r\n await Vue.$api.call(\r\n 'loperacioncrm.insert',\r\n {\r\n values: {\r\n idoperacioncrm: idoperacioncrm,\r\n idsistema: idsistema,\r\n },\r\n },\r\n )\r\n const apiFilter = new APIFilter()\r\n apiFilter.addExact('idsistema', idsistema)\r\n const resp = await Vue.$api.call('sistema.select', { filter: apiFilter })\r\n await this.insertLoperacioncrmCliente(Vue, idoperacioncrm, resp.data.result.dataset[0].idcliente)\r\n },\r\n async insertLoperacioncrmPresupuestocli(Vue, idoperacioncrm, idpresupuestocli) {\r\n await Vue.$api.call(\r\n 'loperacioncrm.insert',\r\n {\r\n values: {\r\n idoperacioncrm: idoperacioncrm,\r\n idpresupuestocli: idpresupuestocli,\r\n },\r\n },\r\n )\r\n const apiFilter = new APIFilter()\r\n apiFilter.addExact('idpresupuestocli', idpresupuestocli)\r\n const resp = await Vue.$api.call('presupuestocli.select', { filter: apiFilter })\r\n if (resp.data.result.dataset[0].idcliente) {\r\n await this.insertLoperacioncrmCliente(Vue, idoperacioncrm, resp.data.result.dataset[0].idcliente)\r\n } else if (resp.data.result.dataset[0].idcliente_potencial) {\r\n await this.insertLoperacioncrmClientePotencial(Vue, idoperacioncrm, resp.data.result.dataset[0].idcliente_potencial)\r\n }\r\n },\r\n async insertLoperacioncrmOrdenTrabajo(Vue, idoperacioncrm, idordenTrabajo) {\r\n await Vue.$api.call(\r\n 'loperacioncrm.insert',\r\n {\r\n values: {\r\n idoperacioncrm: idoperacioncrm,\r\n idorden_trabajo: idordenTrabajo,\r\n },\r\n },\r\n )\r\n const apiFilter = new APIFilter()\r\n apiFilter.addExact('idorden_trabajo', idordenTrabajo)\r\n const resp = await Vue.$api.call('ordenTrabajo.select', { filter: apiFilter })\r\n // Cuando mete el sistema mete el cliente\r\n await this.insertLoperacioncrmSistema(Vue, idoperacioncrm, resp.data.result.dataset[0].idsistema)\r\n },\r\n async insertarLineasOperacionCRM(Vue, tabla, idoperacioncrm, identificador) {\r\n if (tabla) {\r\n if (tabla === TABLA.cliente) {\r\n await this.insertLoperacioncrmCliente(Vue, idoperacioncrm, identificador)\r\n } else if (tabla === TABLA.sistema) {\r\n await this.insertLoperacioncrmSistema(Vue, idoperacioncrm, identificador)\r\n } else if (tabla === TABLA.cliente_potencial) {\r\n await this.insertLoperacioncrmClientePotencial(Vue, idoperacioncrm, identificador)\r\n } else if (tabla === TABLA.presupuestocli) {\r\n await this.insertLoperacioncrmPresupuestocli(Vue, idoperacioncrm, identificador)\r\n } else if (tabla === TABLA.orden_trabajo) {\r\n await this.insertLoperacioncrmOrdenTrabajo(Vue, idoperacioncrm, identificador)\r\n } else {\r\n throw new Error(`No está implementada la inserción de líneas de operaciones para ${tabla.titleSingular}`)\r\n }\r\n }\r\n },\r\n async insert (Vue, formData, tabla, identificador, usuarioIdempleado) {\r\n const ahora = currentDateTime()\r\n const respOperacionCRM = await Vue.$api.call(\r\n 'operacioncrm.insert',\r\n {\r\n values: {\r\n idtoperacioncrm: formData.toperacioncrm?.idtoperacioncrm || null,\r\n idserie_operacioncrm: formData.serie_operacioncrm?.idserie_operacioncrm || null,\r\n noperacioncrm: null, // Se lo envío a null para que el trg le asigne el número\r\n idprioridad: formData.idprioridad,\r\n finicio: ahora,\r\n descripcion: formData.descripcion,\r\n observaciones: formData.observaciones,\r\n iddelegacion: formData.iddelegacion,\r\n iddepartamento: formData.iddepartamento,\r\n idinformador: formData.idinformador,\r\n fproximarevision: formData.fproximarevision,\r\n fprevistafin: formData.fprevistafin,\r\n ffin: formData.ffin,\r\n fasignacion: ahora,\r\n idest_operacioncrm: formData.idest_operacioncrm,\r\n idgrupo_empleado: formData.idgrupo_empleado,\r\n },\r\n },\r\n )\r\n const idoperacioncrm = respOperacionCRM.data.result.dataset[0].idoperacioncrm\r\n await this.insertarLineasOperacionCRM(Vue, tabla, idoperacioncrm, identificador)\r\n // Datos\r\n let apiCalls = await Vue.$online.dato.batchCallInsertDeFormData(idoperacioncrm, formData.datos)\r\n if (formData.cita) {\r\n const fcita = combinarDateTime(formData.cita_fecha, formData.cita_inicio)\r\n let ffin\r\n if (formData.cita_fin) {\r\n ffin = combinarDateTime(formData.cita_fecha, formData.cita_fin)\r\n } else {\r\n ffin = null\r\n }\r\n apiCalls.push({\r\n name: 'citaInsert',\r\n method: 'cita.insert',\r\n params: {\r\n values: {\r\n titulo: formData.cita_titulo,\r\n cita: formData.cita_cita,\r\n tipo: CITA.tipo.crm,\r\n estado: CITA.estado.pendiente,\r\n fcita: fcita,\r\n identificador: idoperacioncrm,\r\n ffin: ffin,\r\n idempleado: usuarioIdempleado,\r\n },\r\n },\r\n })\r\n }\r\n await Vue.$api.batchCall(apiCalls)\r\n return respOperacionCRM.data.result.dataset[0]\r\n },\r\n}\r\n","\r\n \r\n \r\n \r\n {{ $vuetify.icons.values.check }}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OperacioncrmAdd.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OperacioncrmAdd.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./OperacioncrmAdd.vue?vue&type=template&id=8f584470&\"\nimport script from \"./OperacioncrmAdd.vue?vue&type=script&lang=js&\"\nexport * from \"./OperacioncrmAdd.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 null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\ninstallComponents(component, {VBtn,VIcon})\n"],"sourceRoot":""}