From d8caa6c7e63efdb218c66189712984d844f62e54 Mon Sep 17 00:00:00 2001 From: bot5 Date: Wed, 18 Mar 2026 14:10:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(health):=20=E6=96=B0=E5=A2=9E=E7=94=A8?= =?UTF-8?q?=E8=8D=AF=E8=AE=A1=E5=88=92=E6=A8=A1=E5=9D=97=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增用药计划和用药记录API接口 - 新增用药计划管理页面(列表/新增/编辑/暂停/恢复/结束) - 新增用药记录管理页面(列表/服药/跳过) --- src/api/health/medicationPlan.js | 68 +++ src/api/health/medicationRecord.js | 79 ++++ src/views/health/medicationPlan/index.vue | 448 ++++++++++++++++++++ src/views/health/medicationRecord/index.vue | 356 ++++++++++++++++ 4 files changed, 951 insertions(+) create mode 100644 src/api/health/medicationPlan.js create mode 100644 src/api/health/medicationRecord.js create mode 100644 src/views/health/medicationPlan/index.vue create mode 100644 src/views/health/medicationRecord/index.vue diff --git a/src/api/health/medicationPlan.js b/src/api/health/medicationPlan.js new file mode 100644 index 0000000..a37ee1b --- /dev/null +++ b/src/api/health/medicationPlan.js @@ -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' + }) +} \ No newline at end of file diff --git a/src/api/health/medicationRecord.js b/src/api/health/medicationRecord.js new file mode 100644 index 0000000..42cd863 --- /dev/null +++ b/src/api/health/medicationRecord.js @@ -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 } + }) +} \ No newline at end of file diff --git a/src/views/health/medicationPlan/index.vue b/src/views/health/medicationPlan/index.vue new file mode 100644 index 0000000..22353c4 --- /dev/null +++ b/src/views/health/medicationPlan/index.vue @@ -0,0 +1,448 @@ + + + \ No newline at end of file diff --git a/src/views/health/medicationRecord/index.vue b/src/views/health/medicationRecord/index.vue new file mode 100644 index 0000000..f039be2 --- /dev/null +++ b/src/views/health/medicationRecord/index.vue @@ -0,0 +1,356 @@ + + + \ No newline at end of file