diff --git a/.gitignore b/.gitignore index 3c3629e..cee5989 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +/dist/ diff --git a/src/api/health/chronicDiseaseManage.js b/src/api/health/chronicDiseaseManage.js new file mode 100644 index 0000000..34614f8 --- /dev/null +++ b/src/api/health/chronicDiseaseManage.js @@ -0,0 +1,71 @@ +import request from '@/utils/request' + +export function listIndicator(query) { + return request({ + url: '/health/chronicDiseaseManage/indicator/list', + method: 'get', + params: query + }) +} + +export function addIndicator(data) { + return request({ + url: '/health/chronicDiseaseManage/indicator', + method: 'post', + data + }) +} + +export function updateIndicator(data) { + return request({ + url: '/health/chronicDiseaseManage/indicator', + method: 'put', + data + }) +} + +export function delIndicator(id) { + return request({ + url: '/health/chronicDiseaseManage/indicator/' + id, + method: 'delete' + }) +} + +export function listFollowUp(query) { + return request({ + url: '/health/chronicDiseaseManage/followUp/list', + method: 'get', + params: query + }) +} + +export function addFollowUp(data) { + return request({ + url: '/health/chronicDiseaseManage/followUp', + method: 'post', + data + }) +} + +export function updateFollowUp(data) { + return request({ + url: '/health/chronicDiseaseManage/followUp', + method: 'put', + data + }) +} + +export function delFollowUp(id) { + return request({ + url: '/health/chronicDiseaseManage/followUp/' + id, + method: 'delete' + }) +} + +export function listStatusHistory(query) { + return request({ + url: '/health/chronicDiseaseManage/statusHistory/list', + method: 'get', + params: query + }) +} diff --git a/src/api/health/statisticAnalysis.js b/src/api/health/statisticAnalysis.js index 8552779..bccd122 100644 --- a/src/api/health/statisticAnalysis.js +++ b/src/api/health/statisticAnalysis.js @@ -1,4 +1,5 @@ import request from '@/utils/request' +import { downloadAction } from '@/utils/request' export function getMarAnalysis(query) { return request({ @@ -25,6 +26,14 @@ export function getHealthAnalysis(query) { }) } +export function getHealthScreen(query) { + return request({ + url: '/health/analysis/healthScreen', + method: 'get', + params: query + }) +} + export function getRecordAnalysis(query) { return request({ url: '/health/analysis/recordAnalysis', @@ -33,6 +42,18 @@ export function getRecordAnalysis(query) { }) } +export function getRecordScreen(query) { + return request({ + url: '/health/analysis/recordScreen', + method: 'get', + params: query + }) +} + +export function exportRecordFull(query, filename) { + return downloadAction('/health/analysis/recordFullExport', query, filename) +} + export function getDoctorAnalysis(query) { return request({ url: '/health/analysis/doctorAnalysis', diff --git a/src/pages.json b/src/pages.json index 606805b..62209f1 100644 --- a/src/pages.json +++ b/src/pages.json @@ -100,6 +100,12 @@ "navigationBarTitleText": "健康档案" } }, + { + "path": "pages/health/healthRecord/details", + "style": { + "navigationBarTitleText": "档案统计" + } + }, { "path": "pages/health/marRecord/list", "style": { @@ -248,6 +254,18 @@ "style": { "navigationBarTitleText": "档案统计" } + }, + { + "path": "pages/health/statistic/healthScreen/index", + "style": { + "navigationBarTitleText": "健康总览态势" + } + }, + { + "path": "pages/health/statistic/recordScreen/index", + "style": { + "navigationBarTitleText": "健康档案态势" + } } , { "path": "pages/health/statistic/marStatistic/index", @@ -291,6 +309,12 @@ "navigationBarTitleText": "慢性疾病档案" } }, + { + "path": "pages/health/chronicDisease/details", + "style": { + "navigationBarTitleText": "慢性疾病详情" + } + }, { "path": "pages/health/medicationTask/list", "style": { diff --git a/src/pages/health/activity/addEdit.vue b/src/pages/health/activity/addEdit.vue index 7fb5ef2..60232fb 100644 --- a/src/pages/health/activity/addEdit.vue +++ b/src/pages/health/activity/addEdit.vue @@ -11,7 +11,7 @@ - @@ -26,14 +26,14 @@ - - @@ -44,7 +44,7 @@ --> - diff --git a/src/pages/health/chronicDisease/addEdit.vue b/src/pages/health/chronicDisease/addEdit.vue index 40b8ca0..6467605 100644 --- a/src/pages/health/chronicDisease/addEdit.vue +++ b/src/pages/health/chronicDisease/addEdit.vue @@ -7,7 +7,7 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - @@ -22,14 +22,14 @@ - - diff --git a/src/pages/health/chronicDisease/details.vue b/src/pages/health/chronicDisease/details.vue new file mode 100644 index 0000000..dc5dd26 --- /dev/null +++ b/src/pages/health/chronicDisease/details.vue @@ -0,0 +1,886 @@ + + + + + diff --git a/src/pages/health/chronicDisease/list.vue b/src/pages/health/chronicDisease/list.vue index e1f7f85..48bc088 100644 --- a/src/pages/health/chronicDisease/list.vue +++ b/src/pages/health/chronicDisease/list.vue @@ -52,7 +52,7 @@ - + @@ -228,6 +228,11 @@ function handleEdit(item) { isShow.value = true } +function enterDetails(item) { + uni.navigateTo({ url: `/pages/health/chronicDisease/details?id=${item.id}` }) + isShow.value = true +} + function handleDelete(item) { uni.showModal({ title: '确认删除', diff --git a/src/pages/health/doctorRecord/addEdit.vue b/src/pages/health/doctorRecord/addEdit.vue index 7142ca2..ff24b0c 100644 --- a/src/pages/health/doctorRecord/addEdit.vue +++ b/src/pages/health/doctorRecord/addEdit.vue @@ -7,14 +7,14 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - @@ -25,7 +25,7 @@ - @@ -40,7 +40,7 @@ - + diff --git a/src/pages/health/doctorRecord/costAddEdit.vue b/src/pages/health/doctorRecord/costAddEdit.vue index 384c8bb..1070989 100644 --- a/src/pages/health/doctorRecord/costAddEdit.vue +++ b/src/pages/health/doctorRecord/costAddEdit.vue @@ -7,42 +7,42 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - - - - - @@ -64,7 +64,7 @@ - diff --git a/src/pages/health/healthRecord/addEdit.vue b/src/pages/health/healthRecord/addEdit.vue index 9698208..1ebb871 100644 --- a/src/pages/health/healthRecord/addEdit.vue +++ b/src/pages/health/healthRecord/addEdit.vue @@ -7,7 +7,7 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - @@ -18,34 +18,34 @@ - - - + - - + diff --git a/src/pages/health/healthRecord/details.vue b/src/pages/health/healthRecord/details.vue new file mode 100644 index 0000000..355ac6a --- /dev/null +++ b/src/pages/health/healthRecord/details.vue @@ -0,0 +1,476 @@ + + + + + diff --git a/src/pages/health/healthRecord/list.vue b/src/pages/health/healthRecord/list.vue index fb475d8..7d4598f 100644 --- a/src/pages/health/healthRecord/list.vue +++ b/src/pages/health/healthRecord/list.vue @@ -94,7 +94,7 @@ - + @@ -149,6 +149,10 @@ + + + 导出 + 修改 @@ -175,6 +179,7 @@ @@ -437,4 +453,4 @@ function settingCancel() { } } } - \ No newline at end of file + diff --git a/src/pages/health/heightWeightRecord/addEdit.vue b/src/pages/health/heightWeightRecord/addEdit.vue index 4d86e3a..205c81e 100644 --- a/src/pages/health/heightWeightRecord/addEdit.vue +++ b/src/pages/health/heightWeightRecord/addEdit.vue @@ -7,14 +7,14 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - diff --git a/src/pages/health/index.vue b/src/pages/health/index.vue index 824c19e..5a172f1 100644 --- a/src/pages/health/index.vue +++ b/src/pages/health/index.vue @@ -115,6 +115,8 @@ import auth from "@/plugins/auth"; // 建议使用auth进行鉴权操作 ]) const healthStaticGridList = ref([ + { path: '/pages/health/statistic/healthScreen/index', text: '健康总览态势', icon: 'map-filled', color: 'linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%)', permission: 'health:healthRecord:list' }, + { path: '/pages/health/statistic/recordScreen/index', text: '健康档案态势', icon: 'folder-add-filled', color: 'linear-gradient(135deg, #7c3aed 0%, #ec4899 100%)', permission: 'health:healthRecord:list' }, { path: '/pages/health/statistic/healthStatistic/index', text: '档案统计', icon: 'paperplane-filled', color: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)', permission: 'health:healthRecord:list' }, { path: '/pages/health/statistic/doctorStatistic/index', text: '就医统计', icon: 'home-filled', color: 'linear-gradient(135deg, #fc5c65 0%, #fd79a8 100%)', permission: 'health:doctorRecord:list' }, { path: '/pages/health/statistic/marStatistic/index', text: '用药统计', icon: 'wallet-filled', color: 'linear-gradient(135deg, #fd79a8 0%, #e84393 100%)', permission: 'health:marRecord:list' }, diff --git a/src/pages/health/marRecord/addEdit.vue b/src/pages/health/marRecord/addEdit.vue index 4a812c6..a78e4ce 100644 --- a/src/pages/health/marRecord/addEdit.vue +++ b/src/pages/health/marRecord/addEdit.vue @@ -7,49 +7,49 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - - - - - - @@ -60,7 +60,7 @@ - diff --git a/src/pages/health/medicationPlan/addEdit.vue b/src/pages/health/medicationPlan/addEdit.vue index bca7629..5ea0781 100644 --- a/src/pages/health/medicationPlan/addEdit.vue +++ b/src/pages/health/medicationPlan/addEdit.vue @@ -11,21 +11,21 @@ - - - @@ -35,14 +35,14 @@ - - @@ -61,14 +61,14 @@ - - @@ -184,8 +184,10 @@ onLoad((option) => { form.value.id = option.id title.value = '用药计划-修改' loadDetail(option.id) + } else { + applyChronicDiseasePrefill(option) } - loadPersonList() + loadPersonList().then(() => fillPersonName()) loadMedicineList() loadUnitList() }) @@ -224,8 +226,9 @@ function convertDate(date) { } function loadPersonList() { - listPerson({ pageNum: 1, pageSize: 100 }).then(res => { + return listPerson({ pageNum: 1, pageSize: 100 }).then(res => { personColumns.value = [res.rows || []] + return res.rows || [] }) } @@ -237,11 +240,42 @@ function loadMedicineList() { } function loadDiseaseList(personId) { - listChronicDiseaseByMember(personId).then(res => { + return listChronicDiseaseByMember(personId).then(res => { diseaseColumns.value = [res.data || []] + return res.data || [] }) } +function applyChronicDiseasePrefill(option) { + const personId = option.personId ? Number(option.personId) : null + const chronicDiseaseId = option.chronicDiseaseId ? Number(option.chronicDiseaseId) : null + if (!personId || !chronicDiseaseId) { + return + } + const diseaseName = option.diseaseName ? decodeURIComponent(option.diseaseName) : '' + form.value.personId = personId + form.value.chronicDiseaseId = chronicDiseaseId + form.value.diseaseName = diseaseName + form.value.planName = diseaseName ? `${diseaseName}用药计划` : null + loadDiseaseList(personId).then((list) => { + const disease = list.find(item => item.id == chronicDiseaseId) + if (disease) { + form.value.diseaseName = disease.diseaseName + } + }) +} + +function fillPersonName() { + if (!form.value.personId || form.value.personName) { + return + } + const list = personColumns.value[0] || [] + const person = list.find(item => item.id == form.value.personId) + if (person) { + form.value.personName = person.name + } +} + function loadUnitList() { getDicts('medical_unit').then(res => { unitColumns.value = [res.data || []] diff --git a/src/pages/health/medicationPlan/list.vue b/src/pages/health/medicationPlan/list.vue index 0fd8f43..188ba77 100644 --- a/src/pages/health/medicationPlan/list.vue +++ b/src/pages/health/medicationPlan/list.vue @@ -105,11 +105,11 @@ 暂停 - + 恢复 - + 结束 @@ -144,8 +144,8 @@ const status = ref('loadmore') const personList = ref([]) const statusList = ref([ { label: '进行中', value: 1 }, - { label: '已结束', value: 2 }, - { label: '已暂停', value: 3 } + { label: '已暂停', value: 2 }, + { label: '已结束', value: 3 } ]) const data = reactive({ @@ -179,7 +179,7 @@ function getPersonList() { } function getStatusLabel(s) { - const map = { 1: '进行中', 2: '已结束', 3: '已暂停' } + const map = { 1: '进行中', 2: '已暂停', 3: '已结束' } return map[s] || '未知' } @@ -223,7 +223,7 @@ function loadmore() { function getList() { status.value = 'loading' - listMedicationPlan({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => { + listMedicationPlan({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value, keyword: queryParams.value.keys }).then(res => { listData.value = listData.value.concat(res.rows || []) if (listData.value.length < res.total) { status.value = 'loadmore' @@ -345,12 +345,12 @@ function handleDelete(item) { color: #52c41a; } &.status-ended, &.status-2 { - background: rgba(144, 147, 153, 0.2); - color: #909399; - } - &.status-paused, &.status-3 { background: rgba(250, 140, 22, 0.2); color: #fa8c16; } + &.status-paused, &.status-3 { + background: rgba(144, 147, 153, 0.2); + color: #909399; + } } diff --git a/src/pages/health/medicineBasic/addEdit.vue b/src/pages/health/medicineBasic/addEdit.vue index c655f87..b80152d 100644 --- a/src/pages/health/medicineBasic/addEdit.vue +++ b/src/pages/health/medicineBasic/addEdit.vue @@ -33,21 +33,21 @@ - - - @@ -55,14 +55,14 @@ - - @@ -70,7 +70,7 @@ - @@ -81,7 +81,7 @@ - @@ -92,7 +92,7 @@ - diff --git a/src/pages/health/medicineStockIn/addEdit.vue b/src/pages/health/medicineStockIn/addEdit.vue index cb0cc3a..78d072a 100644 --- a/src/pages/health/medicineStockIn/addEdit.vue +++ b/src/pages/health/medicineStockIn/addEdit.vue @@ -7,14 +7,14 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - @@ -33,33 +33,33 @@ - - + - + - + - @@ -67,7 +67,7 @@ - diff --git a/src/pages/health/milkPowderRecord/addEdit.vue b/src/pages/health/milkPowderRecord/addEdit.vue index 50b262d..89435b2 100644 --- a/src/pages/health/milkPowderRecord/addEdit.vue +++ b/src/pages/health/milkPowderRecord/addEdit.vue @@ -7,14 +7,14 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - diff --git a/src/pages/health/person/addEdit.vue b/src/pages/health/person/addEdit.vue index 4fd8428..ab41e18 100644 --- a/src/pages/health/person/addEdit.vue +++ b/src/pages/health/person/addEdit.vue @@ -15,21 +15,21 @@ - - - diff --git a/src/pages/health/processRecord/addEdit.vue b/src/pages/health/processRecord/addEdit.vue index 2b7bfb3..4b91476 100644 --- a/src/pages/health/processRecord/addEdit.vue +++ b/src/pages/health/processRecord/addEdit.vue @@ -7,21 +7,21 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - - + diff --git a/src/pages/health/statistic/healthScreen/index.vue b/src/pages/health/statistic/healthScreen/index.vue new file mode 100644 index 0000000..d4f34d9 --- /dev/null +++ b/src/pages/health/statistic/healthScreen/index.vue @@ -0,0 +1,1167 @@ + + + + + diff --git a/src/pages/health/statistic/index.vue b/src/pages/health/statistic/index.vue index 47fa66b..0213712 100644 --- a/src/pages/health/statistic/index.vue +++ b/src/pages/health/statistic/index.vue @@ -33,6 +33,20 @@ import auth from "@/plugins/auth"; import { ref } from "vue"; const healthGridList = ref([ + { + path: '/pages/health/statistic/healthScreen/index', + text: '健康总览态势', + icon: 'map-filled', + permission: 'health:healthRecord:list', + gradient: 'linear-gradient(135deg, #0ea5e9 0%, #14b8a6 100%)' + }, + { + path: '/pages/health/statistic/recordScreen/index', + text: '健康档案态势', + icon: 'folder-add-filled', + permission: 'health:healthRecord:list', + gradient: 'linear-gradient(135deg, #7c3aed 0%, #ec4899 100%)' + }, { path: '/pages/health/statistic/healthStatistic/index', text: '档案统计', diff --git a/src/pages/health/statistic/recordScreen/index.vue b/src/pages/health/statistic/recordScreen/index.vue new file mode 100644 index 0000000..dbdf2d0 --- /dev/null +++ b/src/pages/health/statistic/recordScreen/index.vue @@ -0,0 +1,1159 @@ + + + + + diff --git a/src/pages/health/temperatureRecord/addEdit.vue b/src/pages/health/temperatureRecord/addEdit.vue index c06d7f4..6ef30c1 100644 --- a/src/pages/health/temperatureRecord/addEdit.vue +++ b/src/pages/health/temperatureRecord/addEdit.vue @@ -7,21 +7,21 @@ :labelStyle="{ color: '#333333', fontSize: '30rpx', marginRight: '24rpx' }"> - - - + diff --git a/src/static/scss/global.scss b/src/static/scss/global.scss index 10a5c90..54cca3a 100644 --- a/src/static/scss/global.scss +++ b/src/static/scss/global.scss @@ -246,4 +246,19 @@ } } + // 下拉选择输入框:整块输入区域响应父级点击,避免移动端只点箭头才触发 + .input-with-arrow { + width: 100%; + cursor: pointer; + + .u--input, + .u-input, + .u-input__content, + .u-input__content__field-wrapper, + .u-input__content__field-wrapper__field, + input { + pointer-events: none !important; + } + } + diff --git a/src/utils/request.ts b/src/utils/request.ts index 6884b80..831d564 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -87,4 +87,84 @@ export function deleteAction(url: string, data?: any, isToken: boolean = true) { return request({ data, url, method: 'DELETE', headers: { isToken }, }) } +export function downloadAction(url: string, data: any = {}, filename: string = 'download.xlsx') { + const token = getToken() + const fullUrl = baseUrl + url + // #ifdef H5 + return new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest() + xhr.open('POST', fullUrl, true) + xhr.responseType = 'blob' + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') + if (token) { + xhr.setRequestHeader('Authorization', 'Bearer ' + token) + } + xhr.onload = () => { + if (xhr.status >= 200 && xhr.status < 300) { + const blob = xhr.response + const link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = filename + link.click() + window.URL.revokeObjectURL(link.href) + resolve(blob) + } else { + toast('下载文件出现错误') + reject(xhr.status) + } + } + xhr.onerror = () => { + toast('下载文件出现错误') + reject(new Error('download error')) + } + xhr.send(tansParams(data)) + }) + // #endif + // #ifndef H5 + return new Promise((resolve, reject) => { + uni.request({ + method: 'POST', + url: fullUrl, + data: tansParams(data), + responseType: 'arraybuffer', + header: { + 'Content-Type': 'application/x-www-form-urlencoded', + ...(token ? { Authorization: 'Bearer ' + token } : {}) + }, + success: (res: any) => { + if (res.statusCode !== 200) { + toast('下载文件出现错误') + reject(res.statusCode) + return + } + // #ifdef MP-WEIXIN + const filePath = `${wx.env.USER_DATA_PATH}/${filename}` + uni.getFileSystemManager().writeFile({ + filePath, + data: res.data, + success: () => { + uni.openDocument({ + filePath, + fileType: 'xlsx', + showMenu: true, + success: resolve, + fail: reject + }) + }, + fail: reject + }) + // #endif + // #ifndef MP-WEIXIN + resolve(res.data) + // #endif + }, + fail: (err) => { + toast('下载文件出现错误') + reject(err) + } + }) + }) + // #endif +} + export default request