feat(health): 新增用药计划模块H5/小程序页面

- 新增用药计划和用药记录API接口
- 新增用药计划列表/详情/新增编辑页面
- 新增用药记录列表页面(含今日待服药快捷卡片)
- 支持服药/跳过操作
- 更新pages.json路由配置
This commit is contained in:
bot5
2026-03-18 14:10:32 +08:00
parent bc39cb60d3
commit 366313a1e5
7 changed files with 1808 additions and 1 deletions

View File

@@ -0,0 +1,68 @@
import request from '@/utils/request'
// 查询用药计划列表
export function listMedicationPlan(query) {
return request({
url: '/health/medicationPlan/list',
method: 'get',
params: query
})
}
// 查询用药计划详细
export function getMedicationPlan(id) {
return request({
url: '/health/medicationPlan/' + id,
method: 'get'
})
}
// 新增用药计划
export function addMedicationPlan(data) {
return request({
url: '/health/medicationPlan',
method: 'post',
data
})
}
// 修改用药计划
export function updateMedicationPlan(data) {
return request({
url: '/health/medicationPlan',
method: 'put',
data
})
}
// 删除用药计划
export function delMedicationPlan(id) {
return request({
url: '/health/medicationPlan/' + id,
method: 'delete'
})
}
// 暂停用药计划
export function pauseMedicationPlan(id) {
return request({
url: '/health/medicationPlan/pause/' + id,
method: 'put'
})
}
// 恢复用药计划
export function resumeMedicationPlan(id) {
return request({
url: '/health/medicationPlan/resume/' + id,
method: 'put'
})
}
// 结束用药计划
export function endMedicationPlan(id) {
return request({
url: '/health/medicationPlan/end/' + id,
method: 'put'
})
}

View File

@@ -0,0 +1,79 @@
import request from '@/utils/request'
// 查询用药记录列表
export function listMedicationRecord(query) {
return request({
url: '/health/medicationRecord/list',
method: 'get',
params: query
})
}
// 查询今日用药记录
export function getTodayRecords(personId) {
return request({
url: '/health/medicationRecord/today',
method: 'get',
params: { personId }
})
}
// 查询某计划某天的用药记录
export function getRecordsByPlanAndDate(planId, date) {
return request({
url: '/health/medicationRecord/plan/' + planId + '/date/' + date,
method: 'get'
})
}
// 查询用药记录详细
export function getMedicationRecord(id) {
return request({
url: '/health/medicationRecord/' + id,
method: 'get'
})
}
// 新增用药记录
export function addMedicationRecord(data) {
return request({
url: '/health/medicationRecord',
method: 'post',
data
})
}
// 修改用药记录
export function updateMedicationRecord(data) {
return request({
url: '/health/medicationRecord',
method: 'put',
data
})
}
// 删除用药记录
export function delMedicationRecord(id) {
return request({
url: '/health/medicationRecord/' + id,
method: 'delete'
})
}
// 服药(标记为已服用)
export function takeMedication(id, dosage, remark) {
return request({
url: '/health/medicationRecord/take/' + id,
method: 'put',
params: { dosage, remark }
})
}
// 跳过服药
export function skipMedication(id, remark) {
return request({
url: '/health/medicationRecord/skip/' + id,
method: 'put',
params: { remark }
})
}