Commit ccda68dc authored by Yoelvis Gonzalez's avatar Yoelvis Gonzalez
Browse files

merge fin

parent 9b17d4ac
...@@ -2014,20 +2014,6 @@ ...@@ -2014,20 +2014,6 @@
"webpack": "^4.0.0" "webpack": "^4.0.0"
} }
}, },
"@vue/cli-plugin-eslint": {
"version": "4.5.13",
"resolved": "https://registry.npmjs.org/@vue/cli-plugin-eslint/-/cli-plugin-eslint-4.5.13.tgz",
"integrity": "sha512-yc2uXX6aBiy3vEf5TwaueaDqQbdIXIhk0x0KzEtpPo23jBdLkpOSoU5NCgE06g/ZiGAcettpmBSv73Hfp4wHEw==",
"dev": true,
"requires": {
"@vue/cli-shared-utils": "^4.5.13",
"eslint-loader": "^2.2.1",
"globby": "^9.2.0",
"inquirer": "^7.1.0",
"webpack": "^4.0.0",
"yorkie": "^2.0.0"
}
},
"@vue/cli-plugin-router": { "@vue/cli-plugin-router": {
"version": "4.3.1", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/@vue/cli-plugin-router/-/cli-plugin-router-4.3.1.tgz", "resolved": "https://registry.npmjs.org/@vue/cli-plugin-router/-/cli-plugin-router-4.3.1.tgz",
...@@ -3874,12 +3860,6 @@ ...@@ -3874,12 +3860,6 @@
"integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==",
"dev": true "dev": true
}, },
"ci-info": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz",
"integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==",
"dev": true
},
"cipher-base": { "cipher-base": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
...@@ -5158,9 +5138,9 @@ ...@@ -5158,9 +5138,9 @@
} }
}, },
"crypto-js": { "crypto-js": {
"version": "4.0.0", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==" "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
}, },
"crypto-random-string": { "crypto-random-string": {
"version": "2.0.0", "version": "2.0.0",
...@@ -6573,19 +6553,6 @@ ...@@ -6573,19 +6553,6 @@
} }
} }
}, },
"eslint-loader": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-2.2.1.tgz",
"integrity": "sha512-RLgV9hoCVsMLvOxCuNjdqOrUqIj9oJg8hF44vzJaYqsAHuY9G2YAeN3joQ9nxP0p5Th9iFSIpKo+SD8KISxXRg==",
"dev": true,
"requires": {
"loader-fs-cache": "^1.0.0",
"loader-utils": "^1.0.2",
"object-assign": "^4.0.1",
"object-hash": "^1.1.4",
"rimraf": "^2.6.1"
}
},
"eslint-module-utils": { "eslint-module-utils": {
"version": "2.6.1", "version": "2.6.1",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz",
...@@ -8975,15 +8942,6 @@ ...@@ -8975,15 +8942,6 @@
"integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==", "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
"dev": true "dev": true
}, },
"is-ci": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz",
"integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==",
"dev": true,
"requires": {
"ci-info": "^1.5.0"
}
},
"is-color-stop": { "is-color-stop": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz", "resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz",
...@@ -9581,57 +9539,6 @@ ...@@ -9581,57 +9539,6 @@
} }
} }
}, },
"loader-fs-cache": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.3.tgz",
"integrity": "sha512-ldcgZpjNJj71n+2Mf6yetz+c9bM4xpKtNds4LbqXzU/PTdeAX0g3ytnU1AJMEcTk2Lex4Smpe3Q/eCTsvUBxbA==",
"dev": true,
"requires": {
"find-cache-dir": "^0.1.1",
"mkdirp": "^0.5.1"
},
"dependencies": {
"find-cache-dir": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz",
"integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=",
"dev": true,
"requires": {
"commondir": "^1.0.1",
"mkdirp": "^0.5.1",
"pkg-dir": "^1.0.0"
}
},
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"dev": true,
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"path-exists": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"dev": true,
"requires": {
"pinkie-promise": "^2.0.0"
}
},
"pkg-dir": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
"integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
"dev": true,
"requires": {
"find-up": "^1.0.0"
}
}
}
},
"loader-runner": { "loader-runner": {
"version": "2.4.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz",
...@@ -10827,12 +10734,6 @@ ...@@ -10827,12 +10734,6 @@
} }
} }
}, },
"object-hash": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==",
"dev": true
},
"object-inspect": { "object-inspect": {
"version": "1.10.3", "version": "1.10.3",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz",
...@@ -14488,12 +14389,6 @@ ...@@ -14488,12 +14389,6 @@
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true "dev": true
}, },
"strip-indent": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
"integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=",
"dev": true
},
"strip-json-comments": { "strip-json-comments": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
...@@ -17133,74 +17028,6 @@ ...@@ -17133,74 +17028,6 @@
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
"dev": true "dev": true
}, },
"yorkie": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/yorkie/-/yorkie-2.0.0.tgz",
"integrity": "sha512-jcKpkthap6x63MB4TxwCyuIGkV0oYP/YRyuQU5UO0Yz/E/ZAu+653/uov+phdmO54n6BcvFRyyt0RRrWdN2mpw==",
"dev": true,
"requires": {
"execa": "^0.8.0",
"is-ci": "^1.0.10",
"normalize-path": "^1.0.0",
"strip-indent": "^2.0.0"
},
"dependencies": {
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
"dev": true,
"requires": {
"lru-cache": "^4.0.1",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"execa": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz",
"integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=",
"dev": true,
"requires": {
"cross-spawn": "^5.0.1",
"get-stream": "^3.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
}
},
"get-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
"dev": true
},
"lru-cache": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
"dev": true,
"requires": {
"pseudomap": "^1.0.2",
"yallist": "^2.1.2"
}
},
"normalize-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-1.0.0.tgz",
"integrity": "sha1-MtDkcvkf80VwHBWoMRAY07CpA3k=",
"dev": true
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
"dev": true
}
}
},
"zip-stream": { "zip-stream": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-3.0.1.tgz", "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-3.0.1.tgz",
......
import axios from 'axios' import axios from 'axios'
import store from '@/store'
import { REQUEST_DIR } from '../utils/constants' import { REQUEST_DIR } from '../utils/constants'
import { import {
requestData, requestData,
requestDataFormUrlEncoded, requestDataFormUrlEncoded,
} from './requestHeadersHelper' } from './requestHeadersHelper'
export async function getCenters (filters) { export async function getCenters (page = 1) {
const url = `${REQUEST_DIR}centros` const url = `${REQUEST_DIR}centros?page=${page}`
const response = await axios.get(url, requestData(filters)) const response = await axios.get(url, requestData())
const data = response.data.centros
store.commit('setCenters', data)
return response return response
} }
......
...@@ -24,7 +24,7 @@ export async function getSystemStatus () { ...@@ -24,7 +24,7 @@ export async function getSystemStatus () {
return response return response
} }
export async function getHealthStatus () { export async function getHealthStatus () {
const url = `${REQUEST_DIR}nomenclador/salud` const url = `${REQUEST_DIR}nomenclador/estado`
const response = await axios.get(url, requestData()) const response = await axios.get(url, requestData())
const health = response.data const health = response.data
store.commit('setHealthStatuses', health) store.commit('setHealthStatuses', health)
...@@ -45,7 +45,7 @@ export async function getMunicipalities (id = 6) { ...@@ -45,7 +45,7 @@ export async function getMunicipalities (id = 6) {
return response return response
} }
export async function getClasifications () { export async function getClasifications () {
const url = `${REQUEST_DIR}nomenclador/riesgo-categoria` const url = `${REQUEST_DIR}nomenclador/clasificacion`
const response = await axios.get(url, requestData()) const response = await axios.get(url, requestData())
const clasifications = response.data const clasifications = response.data
store.commit('setClasifications', clasifications) store.commit('setClasifications', clasifications)
......
import axios from 'axios' import axios from 'axios'
import { REQUEST_DIR } from '../utils/constants' import { REQUEST_DIR } from '../utils/constants'
import { requestData, requestDataFormUrlEncoded } from './requestHeadersHelper' import { requestData, requestDataFormUrlEncoded } from './requestHeadersHelper'
import queryString from 'query-string'
export async function getPatients (filters) { export async function getPatients (page = 1) {
const url = `${REQUEST_DIR}pacientes` const url = `${REQUEST_DIR}pacientes?page=${page}`
const response = await axios.get(url, requestData(filters)) const response = await axios.get(url, requestData())
return response return response
} }
...@@ -31,19 +32,3 @@ export async function putPatient (data) { ...@@ -31,19 +32,3 @@ export async function putPatient (data) {
const response = await axios.put(url, data, requestDataFormUrlEncoded()) const response = await axios.put(url, data, requestDataFormUrlEncoded())
return response return response
} }
export async function assignatePatient (idCenter, idPatient) {
const url = `${REQUEST_DIR}asignar-pacientes`
const data = {
id_centro: idCenter,
id_paciente: idPatient,
}
const response = await axios.post(url, data, requestDataFormUrlEncoded())
return response
}
export async function admitPatient (idPatient) {
const url = `${REQUEST_DIR}pacientes`
const response = await axios.post(url, idPatient, requestDataFormUrlEncoded())
return response
}
...@@ -13,6 +13,7 @@ export default [ ...@@ -13,6 +13,7 @@ export default [
organismo: 'MINED', organismo: 'MINED',
created_at: '2021-07-06 21:45:51', created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51', updated_at: '2021-07-06 21:45:51',
categoria: 1,
}, },
{ {
id_centro: 2, id_centro: 2,
...@@ -21,6 +22,7 @@ export default [ ...@@ -21,6 +22,7 @@ export default [
organismo: 'MES', organismo: 'MES',
created_at: '2021-07-06 21:45:51', created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51', updated_at: '2021-07-06 21:45:51',
categoria: 1,
}, },
{ {
id_centro: 3, id_centro: 3,
...@@ -29,7 +31,26 @@ export default [ ...@@ -29,7 +31,26 @@ export default [
organismo: 'MES', organismo: 'MES',
created_at: '2021-07-06 21:45:51', created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51', updated_at: '2021-07-06 21:45:51',
categoria: 2,
},
{
id_centro: 4,
nombre_centro: 'Some Site',
municipio: 'Santo Domingo',
organismo: 'CARACOL',
created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51',
categoria: 0,
}, },
{
id_centro: 5,
nombre_centro: 'Another Place',
municipio: 'Caibarien',
organismo: 'MINED',
created_at: '2021-07-06 21:45:51',
updated_at: '2021-07-06 21:45:51',
categoria: 0,
}
], ],
meta: { meta: {
current_page: 1, current_page: 1,
...@@ -111,6 +132,52 @@ export default [ ...@@ -111,6 +132,52 @@ export default [
}), }),
) )
}), }),
rest.get(REQUEST_DIR + 'nomenclador/clasificacion', (req, res, ctx) => {
return res(
ctx.json([
{
id: 1,
nombre: 'ALTO RIESGO',
},
{
id: 2,
nombre: 'RIESGO MEDIO',
},
{
id: 3,
nombre: 'RIESGO BAJO',
},
{
id: 0,
nombre: 'SOSPECHOSO',
},
],
),
)
}),
rest.get(REQUEST_DIR + 'nomenclador/categoria', (req, res, ctx) => {
return res(
ctx.json([
{
id: 1,
nombre: 'ALTO RIESGO',
},
{
id: 2,
nombre: 'RIESGO MEDIO',
},
{
id: 3,
nombre: 'RIESGO BAJO',
},
{
id: 0,
nombre: 'SOSPECHOSO',
},
],
),
)
}),
rest.post(REQUEST_DIR + 'centros/1/areas', (req, res, ctx) => { rest.post(REQUEST_DIR + 'centros/1/areas', (req, res, ctx) => {
return res( return res(
ctx.json({ ctx.json({
...@@ -165,18 +232,28 @@ export default [ ...@@ -165,18 +232,28 @@ export default [
ci: 92121234063, ci: 92121234063,
nombre: 'Pepe', nombre: 'Pepe',
apellidos: 'Glez Hdez', apellidos: 'Glez Hdez',
categoria: 3,
}, },
{ {
id_paciente: '1', id_paciente: '2',
ci: 92121234063, ci: 92121234063,
nombre: 'Pepe', nombre: 'Pepe',
apellidos: 'Glez Hdez', apellidos: 'Glez Hdez',
categoria: 2,
}, },
{ {
id_paciente: '1', id_paciente: '3',
ci: 92121234063, ci: 92121234063,
nombre: 'Pepe', nombre: 'Pepe',
apellidos: 'Glez Hdez', apellidos: 'Glez Hdez',
categoria: 2,
},
{
id_paciente: '4',
ci: 92121234063,
nombre: 'Amancio',
apellidos: 'Perez Perez',
categoria: 0,
}, },
], ],
meta: { meta: {
...@@ -269,26 +346,25 @@ export default [ ...@@ -269,26 +346,25 @@ export default [
cmf: '20.31', cmf: '20.31',
remite_caso: 'Policlinico', remite_caso: 'Policlinico',
hospital: null, hospital: null,
estado_salud: 1, estado_salud: 'De cuidado',
provincia: 1, provincia: 1,
municipio: 1, municipio: 1,
categoria: 1, categoria: 'Loco',
area_salud: 1, estado_sistema: 'Negativo_PCR',
estado_sistema: '1', trabajador_salud: 0,
trabajador_salud: false, embarazada: 0,
embarazada: false, ninho: 0,
ninho: false,
test_antigeno: 'Negativo', test_antigeno: 'Negativo',
vacunado: true, vacunado: 1,
apps: { apps: {
id_app: 1, id_app: 1,
id_paciente: 1, id_paciente: 1,
hipertension: false, hipertension: 0,
diabetes: false, diabetes: 0,
asma: false, asma: 1,
obesidad: false, obesidad: 0,
insuficiencia_renal: false, insuficiencia_renal: 0,
oncologia: false, oncologia: 0,
otros: '', otros: '',
created_at: '2021-07-15 20:12:20', created_at: '2021-07-15 20:12:20',
updated_at: '2021-07-15 20:12:20', updated_at: '2021-07-15 20:12:20',
...@@ -297,14 +373,14 @@ export default [ ...@@ -297,14 +373,14 @@ export default [
id_sintomas: 1, id_sintomas: 1,
id_paciente: 1, id_paciente: 1,
fecha_sintomas: null, fecha_sintomas: null,
fiebre: false, fiebre: 0,
rinorrea: false, rinorrea: 1,
congestion_nasal: false, congestion_nasal: 0,
tos: false, tos: 0,
expectoracion: false, expectoracion: 0,
dificultad_respiratoria: false, dificultad_respiratoria: 0,
cefalea: false, cefalea: 0,
dolor_garganta: false, dolor_garganta: 0,
otros: '', otros: '',
created_at: '2021-07-15 20:12:20', created_at: '2021-07-15 20:12:20',
updated_at: '2021-07-15 20:12:20', updated_at: '2021-07-15 20:12:20',
...@@ -431,130 +507,4 @@ export default [ ...@@ -431,130 +507,4 @@ export default [
]), ]),
), ),
), ),
rest.get(REQUEST_DIR + 'nomenclador/provincia', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'HABANA',
},
{
id: 2,
nombre: 'MATANZAS',
},
{
id: 3,
nombre: 'VILLA CLARA',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/clasificacion', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'ALTO RIESGO',
},
{
id: 2,
nombre: 'MEDIANO RIESGO',
},
{
id: 3,
nombre: 'BAJO RIESGO',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/sistema', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'ENCUESTADO',
},
{
id: 2,
nombre: 'PENDIENTE INGRESO',
},
{
id: 3,
nombre: 'INGRESADO',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/estado', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'DE CUIDADO',
},
{
id: 2,
nombre: 'GRAVE',
},
{
id: 3,
nombre: 'ETC',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/categoria', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'SOSPECHOSO',
},
{
id: 2,
nombre: 'POSITIVO',
},
{
id: 3,
nombre: 'CONTACTO',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/municipio/1', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'Santa Clara',
},
{
id: 2,
nombre: 'Maniv=caragua',
},
{
id: 3,
nombre: 'Santo Domingo',
},
]),
),
),
rest.get(REQUEST_DIR + 'nomenclador/salud/1', (req, res, ctx) =>
res(
ctx.json([
{
id: 1,
nombre: 'Santa Clara',
},
{
id: 2,
nombre: 'XX Aniversario',
},
{
id: 3,
nombre: 'Maleza',
},
]),
),
),
] ]
...@@ -3,10 +3,4 @@ export default { ...@@ -3,10 +3,4 @@ export default {
systemStatuses: state => state.systemStatuses, systemStatuses: state => state.systemStatuses,
provinces: state => state.provinces, provinces: state => state.provinces,
municipalities: state => state.municipalities, municipalities: state => state.municipalities,
categories: state => state.categories,
centers: state => state.centers,
clasifications: state => state.clasifications,
antigens: state => state.antigens,
healthAreas: state => state.healthAreas,
healthStatuses: state => state.healthStatuses,
} }
...@@ -12,22 +12,4 @@ export default { ...@@ -12,22 +12,4 @@ export default {
setMunicipalities (state, data) { setMunicipalities (state, data) {
state.municipalities = data state.municipalities = data
}, },
setCategories (state, data) {
state.categories = data
},
setCenters (state, data) {
state.centers = data
},
setClasifications (state, data) {
state.clasifications = data
},
setAntigens (state, data) {
state.antigens = data
},
setHealthAreas (state, data) {
state.healthAreas = data
},
setHealthStatuses (state, data) {
state.healthStatuses = data
},
} }
...@@ -1459,5 +1459,3 @@ export const COUNTRIES = [{ ...@@ -1459,5 +1459,3 @@ export const COUNTRIES = [{
}, },
] ]
export const DECRYPT_KEY = 'xFr#s1r%K2' export const DECRYPT_KEY = 'xFr#s1r%K2'
export const EXAMPLE_TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjhkNDE2NzJiZGU2OWYzNDI4OWIxMzRkMjdkMmRiOWMyZjJmOGVhNWY4YmE2MTgzYzRiNTBlMzMwNWM3MjMwNjdjYTUxNmI0ZGVhZDhmNzhkIn0.eyJhdWQiOiIxIiwianRpIjoiOGQ0MTY3MmJkZTY5ZjM0Mjg5YjEzNGQyN2QyZGI5YzJmMmY4ZWE1ZjhiYTYxODNjNGI1MGUzMzA1YzcyMzA2N2NhNTE2YjRkZWFkOGY3OGQiLCJpYXQiOjE2MjY5MTcwNDMsIm5iZiI6MTYyNjkxNzA0MywiZXhwIjoxNjU4NDUzMDQzLCJzdWIiOiIyIiwic2NvcGVzIjpbXX0.y2pdg3uMY1NKTsMhFgifxDVcapAwzVPqNUUQNpj8M_0wqGb2qerdUtOfHSGpqhWpvcpBvEA377DwrtOKbsLyevHtY3WGcPO_zXxPDdKCiQ6Yw108ilgq_-FPAL3iCgnuZP_Zlxl00TvYeMqHM6tEo8RiHiC00fKauxLNEgW5wMww6L9dNcJjAeOmp8BpvyjSGb9en2ZldT7eUHcs8O6MEfgjYaUSneMFWuQxaa8lPBN_zATptW2HODkKGrqwT5ZvIEAFkJrO9s8XRznIlFCf1U3SMCA9_PVNtguzu6qqS9xja7Z31bJ_T-MgLDWRsU0_MCsnhTlCPwZZK8P6S-EoO9_do6dRxRcSIOGwtAa7X0wwZZXLVBMiWxwjDx7xxpBJD1l8uTG2xUgOaDH6zDYaBgzEKLUo1htbQBSAYnSAWTLG3FJembbg30sBNispW2TW6L1T-S4N1XH9WY6bg34_Yt02xSK8deoVFHNeEN40zaBt9AmPPKj9IjK7FwYp9X15DBOb4W4k5NWvkMFJXeNfTruZZjUi3IpwjzChEUAankN1kysSo1AFLz66ea3EQd4VUyisfU4NwcSG0N_iVvpm_RDjtslcfaxz5b9-sgRyCAR0CpaiGziFiiT76Pq-K8MqZlxMzG2GZwN9xoRQeraJ2aVU3rVSVlJOw1ukcQ8zwMg'
/* eslint-disable */
<template> <template>
<div style="padding: 8px"> <div style="padding: 8px">
<div v-if="init"> <div
v-if="init"
>
<v-data-table <v-data-table
:headers="headers" :headers="headers"
:items="centers" :items="centers"
...@@ -16,7 +19,9 @@ ...@@ -16,7 +19,9 @@
@pagination="paginateCenters" @pagination="paginateCenters"
> >
<template v-slot:top> <template v-slot:top>
<v-toolbar flat> <v-toolbar
flat
>
<v-toolbar-title>Centros de aislamiento</v-toolbar-title> <v-toolbar-title>Centros de aislamiento</v-toolbar-title>
<v-divider <v-divider
class="mx-4" class="mx-4"
...@@ -155,9 +160,7 @@ ...@@ -155,9 +160,7 @@
max-width="500px" max-width="500px"
> >
<v-card> <v-card>
<v-card-title <v-card-title class="text-h5">
class="text-h5"
>
Este Centro no se puede eliminar porque tiene camas en uso!!!! Este Centro no se puede eliminar porque tiene camas en uso!!!!
</v-card-title> </v-card-title>
<v-card-actions> <v-card-actions>
...@@ -228,16 +231,22 @@ ...@@ -228,16 +231,22 @@
</template> </template>
</v-data-table> </v-data-table>
</div> </div>
<div v-else-if="area"> <div
v-else-if="area"
>
<v-card> <v-card>
<v-btn <v-btn
style="margin: 12px" style="margin: 12px"
@click="init= true" @click="init= true"
> >
<v-icon>mdi-arrow-left</v-icon>Atras <v-icon>
mdi-arrow-left
</v-icon> Atras
</v-btn> </v-btn>
<v-card-title> <v-card-title>
<v-icon large> <v-icon
large
>
mdi-hospital-building mdi-hospital-building
</v-icon> </v-icon>
<v-card-title class="text-h5"> <v-card-title class="text-h5">
...@@ -267,7 +276,9 @@ ...@@ -267,7 +276,9 @@
@pagination="paginateAreas" @pagination="paginateAreas"
> >
<template v-slot:top> <template v-slot:top>
<v-toolbar flat> <v-toolbar
flat
>
<v-toolbar-title>Areas</v-toolbar-title> <v-toolbar-title>Areas</v-toolbar-title>
<v-divider <v-divider
class="mx-4" class="mx-4"
...@@ -380,9 +391,7 @@ ...@@ -380,9 +391,7 @@
max-width="500px" max-width="500px"
> >
<v-card> <v-card>
<v-card-title <v-card-title class="text-h5">
class="text-h5"
>
Esta Area no se puede eliminar porque tiene camas en uso!!!! Esta Area no se puede eliminar porque tiene camas en uso!!!!
</v-card-title> </v-card-title>
<v-card-actions> <v-card-actions>
...@@ -429,7 +438,7 @@ ...@@ -429,7 +438,7 @@
</template> </template>
<span>Eliminar</span> <span>Eliminar</span>
</v-tooltip> </v-tooltip>
<v-tooltip bottom> <!-- <v-tooltip bottom>
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<v-icon <v-icon
color="info" color="info"
...@@ -441,7 +450,7 @@ ...@@ -441,7 +450,7 @@
</v-icon> </v-icon>
</template> </template>
<span>Detalles</span> <span>Detalles</span>
</v-tooltip> </v-tooltip> -->
</template> </template>
<template v-slot:no-data> <template v-slot:no-data>
<v-btn <v-btn
...@@ -455,16 +464,22 @@ ...@@ -455,16 +464,22 @@
</v-card-text> </v-card-text>
</v-card> </v-card>
</div> </div>
<div v-else-if="room"> <div
v-else-if="room"
>
<v-card> <v-card>
<v-btn <v-btn
style="margin: 12px" style="margin: 12px"
@click="area = true" @click="area = true"
> >
<v-icon>mdi-arrow-left</v-icon>Atras <v-icon>
mdi-arrow-left
</v-icon> Atras
</v-btn> </v-btn>
<v-card-title> <v-card-title>
<v-icon large> <v-icon
large
>
mdi-hospital-building mdi-hospital-building
</v-icon> </v-icon>
<v-card-title class="text-h5"> <v-card-title class="text-h5">
...@@ -475,8 +490,9 @@ ...@@ -475,8 +490,9 @@
<v-card-text> <v-card-text>
<v-card> <v-card>
<v-card-title> <v-card-title>
<v-icon>mdi-domain</v-icon> <v-icon>
{{ editedAreaItem.nombre }} mdi-domain
</v-icon>{{ editedAreaItem.nombre }}
</v-card-title> </v-card-title>
<v-card-subtitle>{{ editedAreaItem.categoria }}</v-card-subtitle> <v-card-subtitle>{{ editedAreaItem.categoria }}</v-card-subtitle>
<info-box <info-box
...@@ -493,7 +509,9 @@ ...@@ -493,7 +509,9 @@
class="elevation-1" class="elevation-1"
> >
<template v-slot:top> <template v-slot:top>
<v-toolbar flat> <v-toolbar
flat
>
<v-toolbar-title>Habitaciones</v-toolbar-title> <v-toolbar-title>Habitaciones</v-toolbar-title>
<v-divider <v-divider
class="mx-4" class="mx-4"
...@@ -604,9 +622,7 @@ ...@@ -604,9 +622,7 @@
max-width="500px" max-width="500px"
> >
<v-card> <v-card>
<v-card-title <v-card-title class="text-h5">
class="text-h5"
>
Esta Habitacion no se puede eliminar porque tiene camas en uso!!!! Esta Habitacion no se puede eliminar porque tiene camas en uso!!!!
</v-card-title> </v-card-title>
<v-card-actions> <v-card-actions>
...@@ -672,23 +688,9 @@ ...@@ -672,23 +688,9 @@
<script> <script>
import InfoBox from '@/components/InfoBox.vue' import InfoBox from '@/components/InfoBox.vue'
import { import { getCenters, postCenter, putCenter, deleteCenter } from '@/axios/centers'
getCenters, import { getAreas, postArea, putArea, deleteArea } from '@/axios/areas'
postCenter, import { getMunicipalities, getProvinces } from '@/axios/nomenclators'
putCenter,
deleteCenter,
} from '@/axios/centers'
import {
getAreas,
postArea,
putArea,
deleteArea,
} from '@/axios/areas'
import {
getMunicipalities,
getProvinces,
getCategories,
} from '@/axios/nomenclators'
export default { export default {
components: { InfoBox }, components: { InfoBox },
data: () => ({ data: () => ({
...@@ -704,8 +706,76 @@ ...@@ -704,8 +706,76 @@
loadingCentersData: true, loadingCentersData: true,
totalCentersItems: 0, totalCentersItems: 0,
totalAreasItems: 0, totalAreasItems: 0,
myStats: [], myStats: [
myAreaStats: [], {
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bunk-bed-outline',
title: 'Camas Totales',
data: '450',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed',
title: 'Camas Usadas',
data: '200',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed-empty',
title: 'Camas Disponibles',
data: '250',
action: {
label: 'more',
link: '',
},
},
],
myAreaStats: [
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bunk-bed-outline',
title: 'Camas Totales',
data: '200',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed',
title: 'Camas Usadas',
data: '150',
action: {
label: 'more',
link: '',
},
},
{
bgColor: 'success ligthen-1',
iconClass: 'blue lighten-3 white--text',
icon: 'mdi-bed-empty',
title: 'Camas Disponibles',
data: '50',
action: {
label: 'more',
link: '',
},
},
],
area: false, area: false,
init: true, init: true,
room: false, room: false,
...@@ -809,9 +879,7 @@ ...@@ -809,9 +879,7 @@
return this.editedAreaIndex === -1 ? 'Nueva Area' : 'Editar Area' return this.editedAreaIndex === -1 ? 'Nueva Area' : 'Editar Area'
}, },
roomsFormTitle () { roomsFormTitle () {
return this.editedRoomIndex === -1 return this.editedRoomIndex === -1 ? 'Nueva Habitación' : 'Editar Habitación'
? 'Nueva Habitación'
: 'Editar Habitación'
}, },
}, },
watch: { watch: {
...@@ -865,27 +933,6 @@ ...@@ -865,27 +933,6 @@
}) })
} }
}, },
async getCategoriesData () {
try {
const categoriesResponse = await getCategories()
this.categories = categoriesResponse.data
} catch (e) {
this.$toast.error(e.toString(), {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
}
},
async getProvincesData () { async getProvincesData () {
try { try {
const provincesResponse = await getProvinces() const provincesResponse = await getProvinces()
...@@ -1066,20 +1113,6 @@ ...@@ -1066,20 +1113,6 @@
async deleteItemConfirm () { async deleteItemConfirm () {
try { try {
await deleteCenter(this.editedItem.id_centro) await deleteCenter(this.editedItem.id_centro)
this.$toast.success('Centro eliminado correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
this.loadCentersData() this.loadCentersData()
} catch (err) { } catch (err) {
console.log(err) console.log(err)
...@@ -1090,20 +1123,6 @@ ...@@ -1090,20 +1123,6 @@
async deleteAreaItemConfirm () { async deleteAreaItemConfirm () {
try { try {
await deleteArea(this.editedAreaItem.id_area) await deleteArea(this.editedAreaItem.id_area)
this.$toast.success('Área eliminada correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
this.loadAreasData() this.loadAreasData()
} catch (err) { } catch (err) {
console.log(err) console.log(err)
...@@ -1161,39 +1180,13 @@ ...@@ -1161,39 +1180,13 @@
if (this.editedIndex > -1) { if (this.editedIndex > -1) {
await putCenter(this.editedItem) await putCenter(this.editedItem)
this.loadCentersData() this.loadCentersData()
// TODO: DELETE THIS !!
Object.assign(this.centers[this.editedIndex], this.editedItem) Object.assign(this.centers[this.editedIndex], this.editedItem)
this.$toast.success('Centro editado correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
} else { } else {
await postCenter(this.editedItem) await postCenter(this.editedItem)
this.loadCentersData() this.loadCentersData()
// TODO: DELETE THIS !!
this.centers.push(this.editedItem) this.centers.push(this.editedItem)
this.$toast.success('Centro insertado correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
} }
this.close() this.close()
}, },
...@@ -1202,38 +1195,10 @@ ...@@ -1202,38 +1195,10 @@
await putArea(this.editedAreaItem) await putArea(this.editedAreaItem)
this.loadAreasData() this.loadAreasData()
Object.assign(this.areas[this.editedAreaIndex], this.editedAreaItem) Object.assign(this.areas[this.editedAreaIndex], this.editedAreaItem)
this.$toast.success('Área editada correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
} else { } else {
await postArea(this.editedItem.id_centro, this.editedAreaItem) await postArea(this.editedItem.id_centro, this.editedAreaItem)
this.loadAreasData() this.loadAreasData()
this.areas.push(this.editedAreaItem) this.areas.push(this.editedAreaItem)
this.$toast.success('Área insertada correctamente', {
position: 'bottom-center',
timeout: 5000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
} }
this.closeArea() this.closeArea()
}, },
...@@ -1268,5 +1233,5 @@ ...@@ -1268,5 +1233,5 @@
<style scoped> <style scoped>
.fix-title { .fix-title {
word-break: normal; word-break: normal;
} }
</style> </style>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
:src="require('@/assets/icon.png')" :src="require('@/assets/icon.png')"
alt="SIGI" alt="SIGI"
> >
</v-avatar> SIGI / Inicio de sesión </v-avatar>SIGI / Inicio de sesión
</v-toolbar-title> </v-toolbar-title>
</v-toolbar> </v-toolbar>
<v-card-text> <v-card-text>
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
name="login" name="login"
label="Coreo Electrónico" label="Coreo Electrónico"
required required
type="text" type="text"
@keydown.native.enter="submit"
/> />
<v-text-field <v-text-field
id="password" id="password"
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
<v-card-actions> <v-card-actions>
<v-spacer /> <v-spacer />
<v-btn <v-btn
color="green"
dark
:disabled="!valid" :disabled="!valid"
submit submit
:loading="tryLogin" :loading="tryLogin"
...@@ -105,28 +103,10 @@ ...@@ -105,28 +103,10 @@
const token = loginResponse.data.token const token = loginResponse.data.token
const role = loginResponse.data.user.role const role = loginResponse.data.user.role
localStorage.setItem('role', role) localStorage.setItem('role', role)
localStorage.setItem('tkn', token) const data = encrypt(token)
localStorage.setItem('tkn', data)
this.$router.push({ name: 'Control' }) this.$router.push({ name: 'Control' })
} catch (e) { } catch (e) {
switch (e.response.status) {
case 500: {
this.$toast.error('Error interno del servidor, inténtelo más tarde', {
position: 'bottom-center',
timeout: 3000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
break
}
case 401: {
this.$toast.error('No autorizado', { this.$toast.error('No autorizado', {
position: 'bottom-center', position: 'bottom-center',
timeout: 3000, timeout: 3000,
...@@ -141,26 +121,6 @@ ...@@ -141,26 +121,6 @@
icon: true, icon: true,
rtl: false, rtl: false,
}) })
break
}
default: {
this.$toast.error('No autorizado', {
position: 'bottom-center',
timeout: 3000,
closeOnClick: true,
pauseOnFocusLoss: false,
pauseOnHover: true,
draggable: true,
draggablePercent: 0.6,
showCloseButtonOnHover: false,
hideProgressBar: true,
closeButton: 'button',
icon: true,
rtl: false,
})
}
}
console.log(e.response)
this.tryLogin = false this.tryLogin = false
} }
} }
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</template> </template>
<template v-else> <template v-else>
{{ one }} ttrgrg {{ one }}
</template> </template>
</td> </td>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment