1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { fetchBase } from './fetch.js'
import { setSessionStorage, getSessionStorage } from '@/utils/common.js'
// 获取字典
export function getDict() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
}
// 区划编码查询下级
export function getAreaChild(parentCode, loading = true) {
const key = 'chronic-area-cache'
return new Promise((resolve, reject) => {
const result = getSessionStorage(key) || {}
if (result[parentCode]) {
resolve(result[parentCode])
return
}
fetchBase({ url: `/tumour-admin/v1/h5-app/child-area/${parentCode}`, loading }).then(res => {
result[parentCode] = res.data
setSessionStorage(key, result)
resolve(res.data)
}).catch(err => {
reject(err)
})
})
}
// 居民基本信息查询
export function getResidentInfo(idCard) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/residents/${idCard}`, loading: true })
}
// 居民idCard或者tel查询居民信息
export function getResidentByInfo(params) {
return fetchBase({ url: `/chronic-resident/v1/chronic-residents-record/query-resident-info-by-id-card`, body: params, loading: true })
}
// 文件上传
export function fileUpload(params) {
return fetchBase({ url: `/chronic-admin/v1/pictures-info/qiniu`, body: params, contentType: 'file' })
}
// 获取字典管理数据
export function getTemplateList() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
}
//字典数据主键查询
export function getTemplateById() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict`, loading: true })
}
// 血压计-根据单位ID查询绑定的设备
export function getPressureDevices(unitId) {
return fetchBase({ url: '/chronic-admin/v1/base-info/list-device', body: { unitId } })
}
// 血压计-根据设备编码查询测量过的数据
export function getPressureData(deviceNo) {
return fetchBase({ url: '/chronic-admin/v1/base-info/list-blood', body: { deviceNo } })
}