{"version":3,"sources":["webpack:///./src/sync/upload.js","webpack:///./src/mixins/basePageMixin.js","webpack:///./src/mixins/common.js"],"names":["CHUNK_SIZE","doSync","$offline","$api","$loading","$alert","chunkSize","maxCalls","silent","tables","db","idusuario","store","get","pendingCalls","select","from","sync","innerJoin","dummyTable","pk","eq","dummyPk","where","op","and","pending","or","isNull","orderBy","timestamp","limit","exec","length","ok","errors","idsyncUpload","set","showManual","call","silentMessages","disableUI","remoteSynUpload","syncUpload","insert","idsync_upload","data","result","dataset","syncCalls","pendingCall","push","method","params","values","_","cloneDeep","idsync","local_ts","update","count_total","totalChunks","chunk","syncCallsChunk","setMessage","batchCall","silentErrors","synced","changeCalls","__idsync_upload__","__idsync__","id","changeCallsChunk","changeResponses","Object","keys","response","respCall","error","SYNC_UPLOAD","results","error_message","toString","correcto","count_ok","count_errors","delete","JSON","stringify","hide","resultado","showDialogError","SyncError","process","showSnackbarSuccess","getParteClean","Vue","idparteTrabajo","parteTrabajo","innerJoins","table","orden_trabajo","predicate","parte_trabajo","idorden_trabajo","sistema","idsistema","idparte_trabajo","parte","cleanParte","parteTrabajoMatsist","parte_trabajo_matsist","respParteMatsist","map","idparte_trabajo_matsist","in","lparteTrabajo","lparte_trabajo","respLparteTrabajo","idlparte_trabajo","tiempoTrabajado","tiempo_trabajado","respTiempoTrabajado","idtiempo_trabajado","fichero","idtabla","TABLA","respFicheroParteTrabajo","ficheroParteTrabajo","idfichero","solicitudMaterial","solicitud_material","respSolicitudMaterial","idsolicitud_material","parteTrabajoTecnico","parte_trabajo_tecnico","respParteTecnico","idparte_trabajo_tecnico","vAlmacenesParte","v_almacenes_parte","respAlmacenesParte","AlmacenesParte","idv_almacenes_parte","nota","identificador","respNotaParteTrabajo","notaParteTrabajo","idnota","cleanOrdenTrabajo","idordenTrabajo","fn","count","as","numParte","cant_partes","checklistOt","checklist_ot","countChecklistOt","respFicheroOrdenTrabajo","ficheroOrdenTrabajo","accionCorrectoraOt","tanomalia_checklist_ot","accion_correctora_ot","idtanomalia_checklist_ot","pregunta_checklist_ot","idpregunta_checklist_ot","grupo_checklist_ot","idgrupo_checklist_ot","idchecklist_ot","respAccionCorrectoraOt","idaccion_correctora_ot","respFicheroAccionCorrectora","ficheroAccionCorrectora","tanomaliaChecklistOt","respTanomaliaChecklistOt","respFicheroAnomalia","ficheroAnomalia","valorColumnaOt","agrupacion_pregunta_ot","valor_columna_ot","idagrupacion_pregunta_ot","respValorColumnaOt","idvalor_columna_ot","preguntaChecklistOt","respPreguntaChecklistOt","agrupacionPreguntaOt","respAgrupacionPreguntaOt","grupoChecklistOt","respGrupoChecklistOt","checklistOtSubsis","checklist_ot_subsis","respChecklistOtSubis","idchecklist_ot_subsis","respChecklistOt","accionEjec","orden_trabajo_matsist","accion_ejec","idorden_trabajo_matsist","respAccionEjec","idaccion_ejec","ordenTrabajoMatsist","respOrdenTrabajoMatsist","ordenTrabajoMant","orden_trabajo_mant","respOrdenTrabajoMant","idorden_trabajo_mant","lordenTrabajoDetalle","lorden_trabajo","lorden_trabajo_detalle","idlorden_trabajo","respLordenTrabajoDetalle","idlorden_trabajo_detalle","lordenTrabajo","respLordenTrabajo","ordenTrabajoSubsis","orden_trabajo_subsis","respOrdenTrabajoSubsis","idorden_trabajo_subsis","anticipocli","respAnticipocli","idanticipocli","respNotaOrdenTrabajo","notaOrdenTrabajo","ordenTrabajo","cleanBancoPrecio","idbancoPrecio","idbanco_precio","numOT","cant_ot","lbancoPrecioDetalle","lbanco_precio","lbanco_precio_detalle","idlbanco_precio","respLbancoPrecioDetalle","idlbanco_precio_detalle","lbancoPrecio","respLbancoPrecio","bancoPrecioCapitulo","banco_precio_capitulo","respBancoPrecioCapitulo","idbanco_precio_capitulo","bancoPrecioGrupoDto","banco_precio_grupo_dto","respBancoPrecioGrupoDto","idbanco_precio_grupo_dto","bancoPrecio","banco_precio","cleanSistema","numOt","datoMaterialSistema","material_sistema","dato_material_sistema","idmaterial_sistema","subsis","idsubsis","respDatoMaterialSistema","iddato_material_sistema","materialSistema","respMaterialSistema","respSubsis","sistemaMant","sistema_mant","respSistemaMant","idsistema_mant","sistemaTelefono","sistema_telefono","respSistemaTelefono","idsistema_telefono","sistemaCuota","sistema_cuota","respSistemaCuota","idsistema_cuota","datoSistema","dato_sistema","respDatoSistema","iddato_sistema","sistemaTviacomunicacion","sistema_tviacomunicacion","respSistemaTviacomunicacion","idsistema_tviacomunicacion","cleanCliente","idcliente","numSistema","cant_sistema","clienteDireccion","cliente_direccion","respClienteDireccion","idcliente_direccion","clienteTelefono","cliente_telefono","respClienteTelefono","idcliente_telefono","clienteAviso","cliente_aviso","respClienteAviso","idcliente_aviso","cliente","cleanParteTrabajo","uploadParteTrabajo","idtecnico","idparteTrabajoTecnico","updateParteTrabajoSubidoSync","basePageMixin","title","routeParams","routeQuery","loadingData","rememberState","rememberScroll","showingDialogs","pageLoaded","bottomNavBarButtons","dbReady","created","this","$route","query","extra","decodeBase64","computed","routeFromBrowserHistory","meta","fromBrowserHistory","userPermissions","permissions","methods","initDB","connect","initSchema","init","closeDB","close","copyRouteParamsToPageStore","pageStoreName","routeParam","storeHasProperty","setStoreProperty","initStore","property","$store","value","getStoreProperty","dispatchStore","actionName","payload","dispatch","hasViewPerm","perm","hasInsertPerm","hasEditPerm","hasDeletePerm","hasPerm","beforeRouteLeaveBase","to","next","beforeRouteLeaveCommon","initNavigationBottom","addNavigationBottomButton","name","icon","visible","badge","badgeColor","index","order","that","showingDialog","dialog","$set"],"mappings":"0WAIaA,EAAa,GAEbC,EAAM,yDAAG,WAAOC,EAAUC,EAAMC,EAAUC,GAAjC,gLAAyCC,EAAzC,+BAAqDN,EAAYO,EAAjE,+BAA4E,EAAGC,EAA/E,gCACdC,EAASP,EAASQ,GAAGD,OACrBE,EAAYC,OAAMC,IAAI,qBAExBC,EAAeZ,EAASQ,GACzBK,SACAC,KAAKP,EAAOQ,MACZC,UAAUhB,EAASe,KAAKE,WAAYjB,EAASe,KAAKG,GAAGC,GAAGnB,EAASe,KAAK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7B8C,0BAtEO,SAsEoBtD,EAAOuD,EAAMC,GAA0D,IAApDC,IAAoD,yDAApCC,EAAoC,uDAA5B,KAAMC,EAAsB,uDAAT,QACjFC,EAAQjD,KAAKH,oBAAoBpQ,KAAK,CAC1C4P,QACAuD,OACAC,OACAK,MAAOlD,KAAKH,oBAAoBtR,OAAS,EACzCuU,UACAC,QACAC,eAEF,OAAOhD,KAAKH,oBAAoBoD,EAAQ,O,oCCvH9C,kCAAO,IAAMR,EAAyB,SAACU,EAAMZ,EAAIjV,EAAMkV,GACrD,GAAIW,EAAK3D,YAEP,OADAgD,GAAK,IACE,EAEP,IAAIY,GAAgB,EACpB,IAAK,IAAMC,KAAUF,EAAKxD,eACxB,GAAIwD,EAAKxD,eAAe0D,GAAS,CAC/BF,EAAKG,KAAKH,EAAKxD,eAAgB0D,GAAQ,GACvCD,GAAgB,EAChBZ,GAAK,GACL,MAGJ,OAAOY","file":"js/chunk-7c1e073a.09db9a8b.js","sourcesContent":["import _ from '@/utils/lodash'\r\nimport { TABLA, SYNC_UPLOAD, SyncError } from '@/utils/consts'\r\nimport store from '@/store'\r\n\r\nexport const CHUNK_SIZE = 25\r\n\r\nexport const doSync = async ($offline, $api, $loading, $alert, chunkSize = CHUNK_SIZE, maxCalls = 0, silent = false) => {\r\n const tables = $offline.db.tables\r\n const idusuario = store.get('usuario/idusuario')\r\n // llamadas pendientes\r\n let pendingCalls = $offline.db\r\n .select()\r\n .from(tables.sync)\r\n .innerJoin($offline.sync.dummyTable, $offline.sync.pk.eq($offline.sync.dummyPk))\r\n .where(\r\n $offline.db.op.and(\r\n tables.sync.pending.eq(true),\r\n $offline.db.op.or(\r\n tables.sync.idusuario.eq(idusuario),\r\n // idusuario -> no debería ser nullable pero el upgrade de la BD se podría ejecutar\r\n // sin un usuario logado\r\n tables.sync.idusuario.isNull(),\r\n )\r\n )\r\n )\r\n .orderBy(tables.sync.timestamp)\r\n if (maxCalls > 0) {\r\n pendingCalls.limit(maxCalls)\r\n }\r\n pendingCalls = await pendingCalls.exec()\r\n if (pendingCalls.length > 0) {\r\n const ok = []\r\n const errors = []\r\n let idsyncUpload = null\r\n await store.set('sync/syncing', true)\r\n if (!silent) {\r\n $loading.showManual('Sincronizando...')\r\n }\r\n try {\r\n // crear siguiente paquete de cambios (SYNC_UPLOAD)\r\n const remoteSynUpload = await $api.call(\r\n 'syncUpload.insert',\r\n {},\r\n {\r\n silentMessages: true,\r\n disableUI: !silent,\r\n },\r\n )\r\n const syncUpload = await $offline.syncUpload.insert({\r\n idsync_upload: remoteSynUpload.data.result.dataset[0].idsync_upload\r\n })\r\n idsyncUpload = syncUpload[0].idsync_upload\r\n // sincronizar tabla SYNC\r\n const syncCalls = []\r\n for (let pendingCall of pendingCalls) {\r\n syncCalls.push({\r\n method: 'sync.insert',\r\n params: {\r\n values: {\r\n method: pendingCall.sync.method,\r\n params: _.cloneDeep(pendingCall.sync.params),\r\n idsync: pendingCall.sync.idsync,\r\n idsync_upload: idsyncUpload,\r\n local_ts: pendingCall.sync.timestamp,\r\n },\r\n },\r\n })\r\n }\r\n // Actualiar total de cambios\r\n await $offline.syncUpload.update({\r\n idsync_upload: idsyncUpload,\r\n count_total: syncCalls.length,\r\n })\r\n // partir en paquetes de chunkSize llamadas\r\n let totalChunks = 0\r\n for (let syncCallsChunk of _.chunk(syncCalls, chunkSize)) {\r\n totalChunks += syncCallsChunk.length\r\n if (!silent) {\r\n $loading.setMessage(`Sincronizando ${totalChunks} de ${syncCalls.length} cambios...`)\r\n }\r\n await $api.batchCall(\r\n syncCallsChunk,\r\n {\r\n silentMessages: true,\r\n silentErrors: true,\r\n disableUI: !silent,\r\n }\r\n )\r\n }\r\n // marcar paquete de cambios -> sincronizado\r\n await $offline.syncUpload.update({\r\n idsync_upload: idsyncUpload,\r\n synced: true,\r\n })\r\n // incluir cambios en el paquete-> sincronizado\r\n for (let pendingCall of pendingCalls) {\r\n await $offline.sync.update({\r\n idsync: pendingCall.sync.idsync,\r\n idsync_upload: idsyncUpload,\r\n })\r\n }\r\n // sincronizar cambios\r\n // incluye un parámetros especiales: __idsync__ / __idsync_upload__\r\n // para loguear error en el servidor\r\n const changeCalls = []\r\n for (let pendingCall of pendingCalls) {\r\n const params = _.cloneDeep(pendingCall.sync.params)\r\n params.__idsync_upload__ = idsyncUpload\r\n params.__idsync__ = pendingCall.sync.idsync\r\n changeCalls.push({\r\n id: pendingCall.sync.idsync,\r\n method: pendingCall.sync.method,\r\n params: params\r\n })\r\n }\r\n // partir en paquetes de chunkSize llamadas\r\n totalChunks = 0\r\n for (let changeCallsChunk of _.chunk(changeCalls, chunkSize)) {\r\n totalChunks += changeCallsChunk.length\r\n if (!silent) {\r\n $loading.setMessage(`Aplicando ${totalChunks} de ${syncCalls.length} cambios...`)\r\n }\r\n const changeResponses = await $api.batchCall(\r\n changeCallsChunk,\r\n {\r\n silentMessages: true,\r\n silentErrors: true,\r\n disableUI: !silent,\r\n }\r\n )\r\n // actualizar local el resultado de los cambios aplicados\r\n for (let response of Object.keys(changeResponses.data)) {\r\n const respCall = changeResponses.data[response]\r\n if (respCall.error) {\r\n await $offline.sync.update({\r\n idsync: respCall.id,\r\n pending: false,\r\n result: SYNC_UPLOAD.results.error,\r\n error_message: respCall.error.toString()\r\n })\r\n errors.push(respCall)\r\n } else {\r\n await $offline.sync.update({\r\n idsync: respCall.id,\r\n pending: false,\r\n result: SYNC_UPLOAD.results.correcto\r\n })\r\n ok.push(respCall)\r\n }\r\n // Actualizo la cantidad de OK y erroes\r\n await $offline.syncUpload.update({\r\n idsync_upload: idsyncUpload,\r\n count_ok: ok.length,\r\n count_errors: errors.length,\r\n })\r\n }\r\n }\r\n // purgar cambios enviados\r\n await $offline.db\r\n .delete()\r\n .from(tables.sync)\r\n .where(\r\n $offline.db.op.and(\r\n tables.sync.pending.eq(false),\r\n tables.sync.idsync_upload.eq(idsyncUpload),\r\n )\r\n )\r\n .exec()\r\n // actualizar total ok/error\r\n await $offline.syncUpload.update({\r\n idsync_upload: idsyncUpload,\r\n count_ok: ok.length,\r\n count_errors: errors.length,\r\n errors: JSON.stringify(errors),\r\n })\r\n } finally {\r\n await store.set('sync/syncing', false)\r\n if (!silent) {\r\n $loading.hide()\r\n }\r\n }\r\n const resultado = { errors, ok, idsyncUpload }\r\n if (resultado.errors.length > 0) {\r\n $alert.showDialogError(`\r\n La sincronización Nº${resultado.idsyncUpload} (IMPORTANTE para soporte técnico)\r\n se ha realizado pero con errores\r\n (${resultado.ok.length}\r\n correctos y ${resultado.errors.length} con error)\r\n `)\r\n throw new SyncError(\r\n `Sincronización Nº${resultado.idsyncUpload} con ${resultado.errors.length} error/es (${process.env.VUE_APP_DOMAIN})`\r\n )\r\n } else if (resultado.ok.length > 0 && !silent) {\r\n $alert.showSnackbarSuccess(`Sincronización finalizada (Nº${resultado.idsyncUpload})`)\r\n }\r\n return resultado\r\n }\r\n}\r\n\r\nconst getParteClean = async (Vue, idparteTrabajo) => {\r\n const tables = Vue.$offline.db.tables\r\n const parte = await Vue.$offline.parteTrabajo.select({\r\n innerJoins: [\r\n {\r\n table: tables.orden_trabajo,\r\n predicate: tables.parte_trabajo.idorden_trabajo.eq(tables.orden_trabajo.idorden_trabajo)\r\n },\r\n {\r\n table: tables.sistema,\r\n predicate: tables.orden_trabajo.idsistema.eq(tables.sistema.idsistema)\r\n }\r\n ],\r\n where: tables.parte_trabajo.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n return parte[0]\r\n}\r\n\r\nconst cleanParte = async (Vue, idparteTrabajo) => {\r\n const tables = Vue.$offline.db.tables\r\n // PARTE_TRABAJO_MATSIST\r\n const respParteMatsist = await Vue.$offline.parteTrabajoMatsist.select({\r\n where: tables.parte_trabajo_matsist.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n const parteTrabajoMatsist = _.map(respParteMatsist, 'parte_trabajo_matsist.idparte_trabajo_matsist')\r\n await Vue.$offline.parteTrabajoMatsist.delete({\r\n where: tables.parte_trabajo_matsist.idparte_trabajo_matsist.in(parteTrabajoMatsist)\r\n })\r\n // LPARTE_TRABAJO\r\n const respLparteTrabajo = await Vue.$offline.lparteTrabajo.select({\r\n where: tables.lparte_trabajo.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n const lparteTrabajo = _.map(respLparteTrabajo, 'lparte_trabajo.idlparte_trabajo')\r\n await Vue.$offline.lparteTrabajo.delete({\r\n where: tables.lparte_trabajo.idlparte_trabajo.in(lparteTrabajo)\r\n })\r\n // TIEMPO_TRABAJADO\r\n const respTiempoTrabajado = await Vue.$offline.tiempoTrabajado.select({\r\n where: tables.tiempo_trabajado.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n const tiempoTrabajado = _.map(respTiempoTrabajado, 'tiempo_trabajado.idtiempo_trabajado')\r\n await Vue.$offline.tiempoTrabajado.delete({\r\n where: tables.tiempo_trabajado.idtiempo_trabajado.in(tiempoTrabajado)\r\n })\r\n // FICHERO_PARTE_TRABAJO\r\n const respFicheroParteTrabajo = await Vue.$offline.fichero.select({\r\n where: Vue.$offline.db.op.and(\r\n tables.fichero.id.eq(idparteTrabajo),\r\n tables.fichero.idtabla.eq(TABLA.parte_trabajo.idtabla)\r\n )\r\n })\r\n const ficheroParteTrabajo = _.map(respFicheroParteTrabajo, 'fichero.idfichero')\r\n await Vue.$offline.fichero.delete({\r\n where: tables.fichero.idfichero.in(ficheroParteTrabajo)\r\n })\r\n // SOLICITUD_MATERIAL\r\n const respSolicitudMaterial = await Vue.$offline.solicitudMaterial.select({\r\n where: tables.solicitud_material.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n const solicitudMaterial = _.map(respSolicitudMaterial, 'solicitud_material.idsolicitud_material')\r\n await Vue.$offline.solicitudMaterial.delete({\r\n where: tables.solicitud_material.idsolicitud_material.in(solicitudMaterial)\r\n })\r\n // PARTE_TRABAJO_TECNICO\r\n const respParteTecnico = await Vue.$offline.parteTrabajoTecnico.select({\r\n where: tables.parte_trabajo_tecnico.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n const parteTrabajoTecnico = _.map(respParteTecnico, 'parte_trabajo_tecnico.idparte_trabajo_tecnico')\r\n await Vue.$offline.parteTrabajoTecnico.delete({\r\n where: tables.parte_trabajo_tecnico.idparte_trabajo_tecnico.in(parteTrabajoTecnico)\r\n })\r\n // ALMACEN_PARTE_MONTAJE\r\n const respAlmacenesParte = await Vue.$offline.vAlmacenesParte.select({\r\n where: tables.v_almacenes_parte.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n const AlmacenesParte = _.map(respAlmacenesParte, 'v_almacenes_parte.idv_almacenes_parte')\r\n await Vue.$offline.vAlmacenesParte.delete({\r\n where: tables.v_almacenes_parte.idv_almacenes_parte.in(AlmacenesParte)\r\n })\r\n // NOTAS_PARTE_TRABAJO\r\n const respNotaParteTrabajo = await Vue.$offline.nota.select({\r\n where: Vue.$offline.db.op.and(\r\n tables.nota.identificador.eq(idparteTrabajo),\r\n tables.nota.idtabla.eq(TABLA.parte_trabajo.idtabla)\r\n )\r\n })\r\n const notaParteTrabajo = _.map(respNotaParteTrabajo, 'nota.idnota')\r\n await Vue.$offline.nota.delete({\r\n where: tables.nota.idnota.in(notaParteTrabajo)\r\n })\r\n // TODO: Comprobar en v_almacenes_parte qué idalmacenes hay, y cotjarlo con los stock, si no es necesario un almacén entconces borrar el stock\r\n // PARTE_TRABAJO\r\n await Vue.$offline.parteTrabajo.delete({\r\n where: tables.parte_trabajo.idparte_trabajo.eq(idparteTrabajo)\r\n })\r\n}\r\n\r\nconst cleanOrdenTrabajo = async (Vue, idordenTrabajo) => {\r\n const tables = Vue.$offline.db.tables\r\n const numParte = await Vue.$offline.db\r\n .select(\r\n Vue.$offline.db.fn.count(tables.parte_trabajo.idparte_trabajo).as('cant_partes')\r\n )\r\n .from(tables.parte_trabajo)\r\n .where(tables.parte_trabajo.idorden_trabajo.eq(idordenTrabajo))\r\n .exec()\r\n if (numParte[0].cant_partes === 0) {\r\n const countChecklistOt = await Vue.$offline.checklistOt.select({\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n if (countChecklistOt.length > 0) {\r\n // FICHERO_ORDEN_TRABAJO\r\n const respFicheroOrdenTrabajo = await Vue.$offline.fichero.select({\r\n where: Vue.$offline.db.op.and(\r\n tables.fichero.id.eq(idordenTrabajo),\r\n tables.fichero.idtabla.eq(TABLA.orden_trabajo.idtabla)\r\n )\r\n })\r\n const ficheroOrdenTrabajo = _.map(respFicheroOrdenTrabajo, 'fichero.idfichero')\r\n await Vue.$offline.fichero.delete({\r\n where: tables.fichero.idfichero.in(ficheroOrdenTrabajo)\r\n })\r\n // ACCION_CORRECTORA\r\n const respAccionCorrectoraOt = await Vue.$offline.accionCorrectoraOt.select({\r\n innerJoins: [\r\n {\r\n table: tables.tanomalia_checklist_ot,\r\n predicate: tables.accion_correctora_ot.idtanomalia_checklist_ot.eq(tables.tanomalia_checklist_ot.idtanomalia_checklist_ot)\r\n },\r\n {\r\n table: tables.pregunta_checklist_ot,\r\n predicate: tables.tanomalia_checklist_ot.idpregunta_checklist_ot.eq(tables.pregunta_checklist_ot.idpregunta_checklist_ot)\r\n },\r\n {\r\n table: tables.grupo_checklist_ot,\r\n predicate: tables.pregunta_checklist_ot.idgrupo_checklist_ot.eq(tables.grupo_checklist_ot.idgrupo_checklist_ot)\r\n },\r\n {\r\n table: tables.checklist_ot,\r\n predicate: tables.grupo_checklist_ot.idchecklist_ot.eq(tables.checklist_ot.idchecklist_ot)\r\n }\r\n ],\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const accionCorrectoraOt = _.map(respAccionCorrectoraOt, 'accion_correctora_ot.idaccion_correctora_ot')\r\n await Vue.$offline.accionCorrectoraOt.delete({\r\n where: tables.accion_correctora_ot.idaccion_correctora_ot.in(accionCorrectoraOt)\r\n })\r\n // FICHERO_ACCION_CORRECTORA\r\n const respFicheroAccionCorrectora = await Vue.$offline.fichero.select({\r\n where: Vue.$offline.db.op.and(\r\n tables.fichero.id.in(accionCorrectoraOt),\r\n tables.fichero.idtabla.eq(TABLA.accion_correctora_ot.idtabla)\r\n )\r\n })\r\n const ficheroAccionCorrectora = _.map(respFicheroAccionCorrectora, 'fichero.idfichero')\r\n await Vue.$offline.fichero.delete({\r\n where: tables.fichero.idfichero.in(ficheroAccionCorrectora)\r\n })\r\n // TANOMALIA_CHECKLIST_OT\r\n const respTanomaliaChecklistOt = await Vue.$offline.tanomaliaChecklistOt.select({\r\n innerJoins: [\r\n {\r\n table: tables.pregunta_checklist_ot,\r\n predicate: tables.tanomalia_checklist_ot.idpregunta_checklist_ot.eq(tables.pregunta_checklist_ot.idpregunta_checklist_ot)\r\n },\r\n {\r\n table: tables.grupo_checklist_ot,\r\n predicate: tables.pregunta_checklist_ot.idgrupo_checklist_ot.eq(tables.grupo_checklist_ot.idgrupo_checklist_ot)\r\n },\r\n {\r\n table: tables.checklist_ot,\r\n predicate: tables.grupo_checklist_ot.idchecklist_ot.eq(tables.checklist_ot.idchecklist_ot)\r\n }\r\n ],\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const tanomaliaChecklistOt = _.map(respTanomaliaChecklistOt, 'tanomalia_checklist_ot.idtanomalia_checklist_ot')\r\n await Vue.$offline.tanomaliaChecklistOt.delete({\r\n where: tables.tanomalia_checklist_ot.idtanomalia_checklist_ot.in(tanomaliaChecklistOt)\r\n })\r\n // FICHERO_TANOMALIA_CHECKLIST_OT\r\n const respFicheroAnomalia = await Vue.$offline.fichero.select({\r\n where: Vue.$offline.db.op.and(\r\n tables.fichero.id.in(tanomaliaChecklistOt),\r\n tables.fichero.idtabla.eq(TABLA.tanomalia_checklist_ot.idtabla)\r\n )\r\n })\r\n const ficheroAnomalia = _.map(respFicheroAnomalia, 'fichero.idfichero')\r\n await Vue.$offline.fichero.delete({\r\n where: tables.fichero.idfichero.in(ficheroAnomalia)\r\n })\r\n // VALOR_COLUMNA_OT\r\n const respValorColumnaOt = await Vue.$offline.valorColumnaOt.select({\r\n innerJoins: [\r\n {\r\n table: tables.agrupacion_pregunta_ot,\r\n predicate: tables.valor_columna_ot.idagrupacion_pregunta_ot.eq(tables.agrupacion_pregunta_ot.idagrupacion_pregunta_ot)\r\n },\r\n {\r\n table: tables.grupo_checklist_ot,\r\n predicate: tables.agrupacion_pregunta_ot.idgrupo_checklist_ot.eq(tables.grupo_checklist_ot.idgrupo_checklist_ot)\r\n },\r\n {\r\n table: tables.checklist_ot,\r\n predicate: tables.grupo_checklist_ot.idchecklist_ot.eq(tables.checklist_ot.idchecklist_ot)\r\n }\r\n ],\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const valorColumnaOt = _.map(respValorColumnaOt, 'valor_columna_ot.idvalor_columna_ot')\r\n await Vue.$offline.valorColumnaOt.delete({\r\n where: tables.valor_columna_ot.idvalor_columna_ot.in(valorColumnaOt)\r\n })\r\n // PREGUNTA_CHECKLIST_OT\r\n const respPreguntaChecklistOt = await Vue.$offline.preguntaChecklistOt.select({\r\n innerJoins: [\r\n {\r\n table: tables.grupo_checklist_ot,\r\n predicate: tables.pregunta_checklist_ot.idgrupo_checklist_ot.eq(tables.grupo_checklist_ot.idgrupo_checklist_ot)\r\n },\r\n {\r\n table: tables.checklist_ot,\r\n predicate: tables.grupo_checklist_ot.idchecklist_ot.eq(tables.checklist_ot.idchecklist_ot)\r\n }\r\n ],\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const preguntaChecklistOt = _.map(respPreguntaChecklistOt, 'pregunta_checklist_ot.idpregunta_checklist_ot')\r\n await Vue.$offline.preguntaChecklistOt.delete({\r\n where: tables.pregunta_checklist_ot.idpregunta_checklist_ot.in(preguntaChecklistOt)\r\n })\r\n // AGRUPACION_PREGUNTA_OT\r\n const respAgrupacionPreguntaOt = await Vue.$offline.agrupacionPreguntaOt.select({\r\n innerJoins: [\r\n {\r\n table: tables.grupo_checklist_ot,\r\n predicate: tables.agrupacion_pregunta_ot.idgrupo_checklist_ot.eq(tables.grupo_checklist_ot.idgrupo_checklist_ot)\r\n },\r\n {\r\n table: tables.checklist_ot,\r\n predicate: tables.grupo_checklist_ot.idchecklist_ot.eq(tables.checklist_ot.idchecklist_ot)\r\n }\r\n ],\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const agrupacionPreguntaOt = _.map(respAgrupacionPreguntaOt, 'agrupacion_pregunta_ot.idagrupacion_pregunta_ot')\r\n await Vue.$offline.agrupacionPreguntaOt.delete({\r\n where: tables.agrupacion_pregunta_ot.idagrupacion_pregunta_ot.in(agrupacionPreguntaOt)\r\n })\r\n // GRUPO_CHECKLIST_OT\r\n const respGrupoChecklistOt = await Vue.$offline.grupoChecklistOt.select({\r\n innerJoins: [\r\n {\r\n table: tables.checklist_ot,\r\n predicate: tables.grupo_checklist_ot.idchecklist_ot.eq(tables.checklist_ot.idchecklist_ot)\r\n }\r\n ],\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const grupoChecklistOt = _.map(respGrupoChecklistOt, 'grupo_checklist_ot.idgrupo_checklist_ot')\r\n await Vue.$offline.grupoChecklistOt.delete({\r\n where: tables.grupo_checklist_ot.idgrupo_checklist_ot.in(grupoChecklistOt)\r\n })\r\n // CHECKLIST_OT_SUBSIS\r\n const respChecklistOtSubis = await Vue.$offline.checklistOtSubsis.select({\r\n innerJoins: [\r\n {\r\n table: tables.checklist_ot,\r\n predicate: tables.checklist_ot_subsis.idchecklist_ot.eq(tables.checklist_ot.idchecklist_ot)\r\n }\r\n ],\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const checklistOtSubsis = _.map(respChecklistOtSubis, 'checklist_ot_subsis.idchecklist_ot_subsis')\r\n await Vue.$offline.checklistOtSubsis.delete({\r\n where: tables.checklist_ot_subsis.idchecklist_ot_subsis.in(checklistOtSubsis)\r\n })\r\n // CHECKLIST_OT\r\n const respChecklistOt = await Vue.$offline.checklistOt.select({\r\n where: tables.checklist_ot.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n await Vue.$offline.checklistOt.delete({\r\n where: tables.checklist_ot.idchecklist_ot.eq(respChecklistOt[0].checklist_ot.idchecklist_ot)\r\n })\r\n }\r\n // ACCION_EJEC\r\n const respAccionEjec = await Vue.$offline.accionEjec.select({\r\n innerJoins: [\r\n {\r\n table: tables.orden_trabajo_matsist,\r\n predicate: tables.accion_ejec.idorden_trabajo_matsist.eq(tables.orden_trabajo_matsist.idorden_trabajo_matsist)\r\n }\r\n ],\r\n where: tables.orden_trabajo_matsist.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const accionEjec = _.map(respAccionEjec, 'accion_ejec.idaccion_ejec')\r\n await Vue.$offline.accionEjec.delete({\r\n where: tables.accion_ejec.idaccion_ejec.in(accionEjec)\r\n })\r\n // ORDEN_TRABAJO_MATSIST\r\n const respOrdenTrabajoMatsist = await Vue.$offline.ordenTrabajoMatsist.select({\r\n where: tables.orden_trabajo_matsist.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const ordenTrabajoMatsist = _.map(respOrdenTrabajoMatsist, 'orden_trabajo_matsist.idorden_trabajo_matsist')\r\n await Vue.$offline.ordenTrabajoMatsist.delete({\r\n where: tables.orden_trabajo_matsist.idorden_trabajo_matsist.in(ordenTrabajoMatsist)\r\n })\r\n // ORDEN_TRABAJO_MANT\r\n const respOrdenTrabajoMant = await Vue.$offline.ordenTrabajoMant.select({\r\n where: tables.orden_trabajo_mant.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const ordenTrabajoMant = _.map(respOrdenTrabajoMant, 'orden_trabajo_mant.idorden_trabajo_mant')\r\n await Vue.$offline.ordenTrabajoMant.delete({\r\n where: tables.orden_trabajo_mant.idorden_trabajo_mant.in(ordenTrabajoMant)\r\n })\r\n // LORDEN_TRABAJO_DETALLE\r\n const respLordenTrabajoDetalle = await Vue.$offline.lordenTrabajoDetalle.select({\r\n innerJoins: [\r\n {\r\n table: tables.lorden_trabajo,\r\n predicate: tables.lorden_trabajo_detalle.idlorden_trabajo.eq(tables.lorden_trabajo.idlorden_trabajo)\r\n }\r\n ],\r\n where: tables.lorden_trabajo.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const lordenTrabajoDetalle = _.map(respLordenTrabajoDetalle, 'lorden_trabajo_detalle.idlorden_trabajo_detalle')\r\n await Vue.$offline.lordenTrabajoDetalle.delete({\r\n where: tables.lorden_trabajo_detalle.idlorden_trabajo_detalle.in(lordenTrabajoDetalle)\r\n })\r\n // LORDEN_TRABAJO\r\n const respLordenTrabajo = await Vue.$offline.lordenTrabajo.select({\r\n where: tables.lorden_trabajo.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const lordenTrabajo = _.map(respLordenTrabajo, 'lorden_trabajo.idlorden_trabajo')\r\n await Vue.$offline.lordenTrabajo.delete({\r\n where: tables.lorden_trabajo.idlorden_trabajo.in(lordenTrabajo)\r\n })\r\n // ORDEN_TRABAJO_SUBSIS\r\n const respOrdenTrabajoSubsis = await Vue.$offline.ordenTrabajoSubsis.select({\r\n where: tables.orden_trabajo_subsis.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const ordenTrabajoSubsis = _.map(respOrdenTrabajoSubsis, 'orden_trabajo_subsis.idorden_trabajo_subsis')\r\n await Vue.$offline.ordenTrabajoSubsis.delete({\r\n where: tables.orden_trabajo_subsis.idorden_trabajo_subsis.in(ordenTrabajoSubsis)\r\n })\r\n // ANTICIPOCLI\r\n const respAnticipocli = await Vue.$offline.anticipocli.select({\r\n where: tables.anticipocli.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n const anticipocli = _.map(respAnticipocli, 'anticipocli.idanticipocli')\r\n await Vue.$offline.anticipocli.delete({\r\n where: tables.anticipocli.idanticipocli.in(anticipocli)\r\n })\r\n // NOTAS_ORDEN_TRABAJO\r\n const respNotaOrdenTrabajo = await Vue.$offline.nota.select({\r\n where: Vue.$offline.db.op.and(\r\n tables.nota.identificador.eq(idordenTrabajo),\r\n tables.nota.idtabla.eq(TABLA.orden_trabajo.idtabla)\r\n )\r\n })\r\n const notaOrdenTrabajo = _.map(respNotaOrdenTrabajo, 'nota.idnota')\r\n await Vue.$offline.nota.delete({\r\n where: tables.nota.idnota.in(notaOrdenTrabajo)\r\n })\r\n // ORDEN_TRABAJO\r\n await Vue.$offline.ordenTrabajo.delete({\r\n where: tables.orden_trabajo.idorden_trabajo.eq(idordenTrabajo)\r\n })\r\n }\r\n}\r\n\r\nconst cleanBancoPrecio = async (Vue, idbancoPrecio) => {\r\n const tables = Vue.$offline.db.tables\r\n const numOT = await Vue.$offline.db\r\n .select(\r\n Vue.$offline.db.fn.count(tables.orden_trabajo.idorden_trabajo).as('cant_ot')\r\n )\r\n .from(tables.orden_trabajo)\r\n .where(tables.orden_trabajo.idbanco_precio.eq(idbancoPrecio))\r\n .exec()\r\n if (numOT[0].cant_ot === 0) {\r\n // LBANCO_PRECIO_DETALLE\r\n const respLbancoPrecioDetalle = await Vue.$offline.lbancoPrecioDetalle.select({\r\n innerJoins: [\r\n {\r\n table: tables.lbanco_precio,\r\n predicate: tables.lbanco_precio_detalle.idlbanco_precio.eq(tables.lbanco_precio.idlbanco_precio)\r\n }\r\n ],\r\n where: tables.lbanco_precio.idbanco_precio.eq(idbancoPrecio)\r\n })\r\n const lbancoPrecioDetalle = _.map(respLbancoPrecioDetalle, 'lbanco_precio_detalle.idlbanco_precio_detalle')\r\n await Vue.$offline.lbancoPrecioDetalle.delete({\r\n where: tables.lbanco_precio_detalle.idlbanco_precio_detalle.in(lbancoPrecioDetalle)\r\n })\r\n // LBANCO_PRECIO\r\n const respLbancoPrecio = await Vue.$offline.lbancoPrecio.select({\r\n where: tables.lbanco_precio.idbanco_precio.eq(idbancoPrecio)\r\n })\r\n const lbancoPrecio = _.map(respLbancoPrecio, 'lbanco_precio.idlbanco_precio')\r\n await Vue.$offline.lbancoPrecio.delete({\r\n where: tables.lbanco_precio.idlbanco_precio.in(lbancoPrecio)\r\n })\r\n // BANCO_PRECIO_CAPITULO\r\n const respBancoPrecioCapitulo = await Vue.$offline.bancoPrecioCapitulo.select({\r\n where: tables.banco_precio_capitulo.idbanco_precio.eq(idbancoPrecio)\r\n })\r\n const bancoPrecioCapitulo = _.map(respBancoPrecioCapitulo, 'banco_precio_capitulo.idbanco_precio_capitulo')\r\n await Vue.$offline.bancoPrecioCapitulo.delete({\r\n where: tables.banco_precio_capitulo.idbanco_precio_capitulo.in(bancoPrecioCapitulo)\r\n })\r\n // BANCO_PRECIO_GRUPO_DTO\r\n const respBancoPrecioGrupoDto = await Vue.$offline.bancoPrecioGrupoDto.select({\r\n where: tables.banco_precio_grupo_dto.idbanco_precio.eq(idbancoPrecio)\r\n })\r\n const bancoPrecioGrupoDto = _.map(respBancoPrecioGrupoDto, 'banco_precio_grupo_dto.idbanco_precio_grupo_dto')\r\n await Vue.$offline.bancoPrecioGrupoDto.delete({\r\n where: tables.banco_precio_grupo_dto.idbanco_precio_grupo_dto.in(bancoPrecioGrupoDto)\r\n })\r\n // BANCO_PRECIO\r\n await Vue.$offline.bancoPrecio.delete({\r\n where: tables.banco_precio.idbanco_precio.eq(idbancoPrecio)\r\n })\r\n }\r\n}\r\n\r\nconst cleanSistema = async (Vue, idsistema) => {\r\n const tables = Vue.$offline.db.tables\r\n const numOt = await Vue.$offline.db\r\n .select(\r\n Vue.$offline.db.fn.count(tables.orden_trabajo.idorden_trabajo).as('cant_ot')\r\n )\r\n .from(tables.orden_trabajo)\r\n .innerJoin(\r\n tables.sistema,\r\n tables.orden_trabajo.idsistema.eq(tables.sistema.idsistema)\r\n )\r\n .where(tables.orden_trabajo.idsistema.eq(idsistema))\r\n .exec()\r\n if (numOt[0].cant_ot === 0) {\r\n // DATO_MATERIAL_SISTEMA\r\n const respDatoMaterialSistema = await Vue.$offline.datoMaterialSistema.select({\r\n innerJoins: [\r\n {\r\n table: tables.material_sistema,\r\n predicate: tables.dato_material_sistema.idmaterial_sistema.eq(tables.material_sistema.idmaterial_sistema)\r\n },\r\n {\r\n table: tables.subsis,\r\n predicate: tables.material_sistema.idsubsis.eq(tables.subsis.idsubsis)\r\n }\r\n ],\r\n where: tables.subsis.idsistema.eq(idsistema)\r\n })\r\n const datoMaterialSistema = _.map(respDatoMaterialSistema, 'dato_material_sistema.iddato_material_sistema')\r\n await Vue.$offline.datoMaterialSistema.delete({\r\n where: tables.dato_material_sistema.iddato_material_sistema.in(datoMaterialSistema)\r\n })\r\n // MATERIAL_SISTEMA\r\n const respMaterialSistema = await Vue.$offline.materialSistema.select({\r\n innerJoins: [\r\n {\r\n table: tables.subsis,\r\n predicate: tables.material_sistema.idsubsis.eq(tables.subsis.idsubsis)\r\n }\r\n ],\r\n where: tables.subsis.idsistema.eq(idsistema)\r\n })\r\n const materialSistema = _.map(respMaterialSistema, 'material_sistema.idmaterial_sistema')\r\n await Vue.$offline.materialSistema.delete({\r\n where: tables.material_sistema.idmaterial_sistema.in(materialSistema)\r\n })\r\n // SUBSIS\r\n const respSubsis = await Vue.$offline.subsis.select({\r\n where: tables.subsis.idsistema.eq(idsistema)\r\n })\r\n const subsis = _.map(respSubsis, 'subsis.idsubsis')\r\n await Vue.$offline.subsis.delete({\r\n where: tables.subsis.idsubsis.in(subsis)\r\n })\r\n // SISTEMA_MANT\r\n const respSistemaMant = await Vue.$offline.sistemaMant.select({\r\n where: tables.sistema_mant.idsistema.eq(idsistema)\r\n })\r\n const sistemaMant = _.map(respSistemaMant, 'sistema_mant.idsistema_mant')\r\n await Vue.$offline.sistemaMant.delete({\r\n where: tables.sistema_mant.idsistema_mant.in(sistemaMant)\r\n })\r\n // SISTEMA_TELEFONO\r\n const respSistemaTelefono = await Vue.$offline.sistemaTelefono.select({\r\n where: tables.sistema_telefono.idsistema.eq(idsistema)\r\n })\r\n const sistemaTelefono = _.map(respSistemaTelefono, 'sistema_telefono.idsistema_telefono')\r\n await Vue.$offline.sistemaTelefono.delete({\r\n where: tables.sistema_telefono.idsistema_telefono.in(sistemaTelefono)\r\n })\r\n // SISTEMA_CUOTA\r\n const respSistemaCuota = await Vue.$offline.sistemaCuota.select({\r\n where: tables.sistema_cuota.idsistema.eq(idsistema)\r\n })\r\n const sistemaCuota = _.map(respSistemaCuota, 'sistema_cuota.idsistema_cuota')\r\n await Vue.$offline.sistemaCuota.delete({\r\n where: tables.sistema_cuota.idsistema_cuota.in(sistemaCuota)\r\n })\r\n // DATO_SISTEMA\r\n const respDatoSistema = await Vue.$offline.datoSistema.select({\r\n where: tables.dato_sistema.idsistema.eq(idsistema)\r\n })\r\n const datoSistema = _.map(respDatoSistema, 'dato_sistema.iddato_sistema')\r\n await Vue.$offline.datoSistema.delete({\r\n where: tables.dato_sistema.iddato_sistema.in(datoSistema)\r\n })\r\n // SISTEMA_TVIACOMUNICACION\r\n const respSistemaTviacomunicacion = await Vue.$offline.sistemaTviacomunicacion.select({\r\n where: tables.sistema_tviacomunicacion.idsistema.eq(idsistema)\r\n })\r\n const sistemaTviacomunicacion = _.map(respSistemaTviacomunicacion, 'sistema_tviacomunicacion.idsistema_tviacomunicacion')\r\n await Vue.$offline.sistemaTviacomunicacion.delete({\r\n where: tables.sistema_tviacomunicacion.idsistema_tviacomunicacion.in(sistemaTviacomunicacion)\r\n })\r\n // SISTEMA\r\n await Vue.$offline.sistema.delete({\r\n where: tables.sistema.idsistema.eq(idsistema)\r\n })\r\n }\r\n}\r\n\r\nconst cleanCliente = async (Vue, idcliente) => {\r\n const tables = Vue.$offline.db.tables\r\n const numSistema = await Vue.$offline.db\r\n .select(\r\n Vue.$offline.db.fn.count(tables.sistema.idsistema).as('cant_sistema')\r\n )\r\n .from(tables.sistema)\r\n .where(tables.sistema.idcliente.eq(idcliente))\r\n .exec()\r\n if (numSistema[0].cant_sistema === 0) {\r\n // CLIENTE_DIRECCION\r\n const respClienteDireccion = await Vue.$offline.clienteDireccion.select({\r\n where: tables.cliente_direccion.idcliente.eq(idcliente)\r\n })\r\n const clienteDireccion = _.map(respClienteDireccion, 'cliente_direccion.idcliente_direccion')\r\n await Vue.$offline.clienteDireccion.delete({\r\n where: tables.cliente_direccion.idcliente_direccion.in(clienteDireccion)\r\n })\r\n // CLIENTE_TELEFONO\r\n const respClienteTelefono = await Vue.$offline.clienteTelefono.select({\r\n where: tables.cliente_telefono.idcliente.eq(idcliente)\r\n })\r\n const clienteTelefono = _.map(respClienteTelefono, 'cliente_telefono.idcliente_telefono')\r\n await Vue.$offline.clienteTelefono.delete({\r\n where: tables.cliente_telefono.idcliente_telefono.in(clienteTelefono)\r\n })\r\n // CLIENTE_AVISO\r\n const respClienteAviso = await Vue.$offline.clienteAviso.select({\r\n where: tables.cliente_aviso.idcliente.eq(idcliente)\r\n })\r\n const clienteAviso = _.map(respClienteAviso, 'cliente_aviso.idcliente_aviso')\r\n await Vue.$offline.clienteAviso.delete({\r\n where: tables.cliente_aviso.idcliente_aviso.in(clienteAviso)\r\n })\r\n // CLIENTE\r\n await Vue.$offline.cliente.delete({\r\n where: tables.cliente.idcliente.eq(idcliente)\r\n })\r\n }\r\n}\r\n\r\nexport const cleanParteTrabajo = async (Vue, id) => {\r\n // parte, OT, sistema y cliente\r\n const parte = await getParteClean(Vue, id)\r\n if (parte) {\r\n await cleanParte(Vue, id)\r\n if (parte.orden_trabajo) {\r\n await cleanOrdenTrabajo(Vue, parte.orden_trabajo.idorden_trabajo)\r\n if (parte.orden_trabajo.idbanco_precio) {\r\n await cleanBancoPrecio(Vue, parte.orden_trabajo.idbanco_precio)\r\n }\r\n }\r\n if (parte.sistema) {\r\n await cleanSistema(Vue, parte.sistema.idsistema)\r\n await cleanCliente(Vue, parte.sistema.idcliente)\r\n }\r\n }\r\n}\r\n\r\nexport const uploadParteTrabajo = async (Vue, id) => {\r\n const tables = Vue.$offline.db.tables\r\n const parteTrabajoTecnico = await Vue.$offline.parteTrabajoTecnico.select({\r\n where: Vue.$offline.db.op.and(\r\n tables.parte_trabajo_tecnico.idparte_trabajo.eq(id),\r\n tables.parte_trabajo_tecnico.idtecnico.eq(store.get('usuario/idtecnico'))\r\n )\r\n })\r\n const idparteTrabajoTecnico = parteTrabajoTecnico[0].parte_trabajo_tecnico.idparte_trabajo_tecnico\r\n await Vue.$offline.parteTrabajo.updateParteTrabajoSubidoSync(idparteTrabajoTecnico)\r\n await cleanParteTrabajo(Vue, id)\r\n}\r\n","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","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"],"sourceRoot":""}