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/pages.json b/src/pages.json
index 1284e45..d326bfc 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -266,7 +266,31 @@
"style": {
"navigationBarTitleText": "吃奶量统计"
}
- }
+ },
+ {
+ "path": "pages/health/medicationPlan/list",
+ "style": {
+ "navigationBarTitleText": "用药计划"
+ }
+ },
+ {
+ "path": "pages/health/medicationPlan/details",
+ "style": {
+ "navigationBarTitleText": "用药计划详情"
+ }
+ },
+ {
+ "path": "pages/health/medicationPlan/addEdit",
+ "style": {
+ "navigationBarTitleText": "用药计划"
+ }
+ },
+ {
+ "path": "pages/health/medicationRecord/index",
+ "style": {
+ "navigationBarTitleText": "用药记录"
+ }
+ }
],
"subPackages": [
{
diff --git a/src/pages/health/medicationPlan/addEdit.vue b/src/pages/health/medicationPlan/addEdit.vue
new file mode 100644
index 0000000..d99f7bd
--- /dev/null
+++ b/src/pages/health/medicationPlan/addEdit.vue
@@ -0,0 +1,456 @@
+
+
+
+ {{ title }}
+
+
+
+
+
+
+
+
+
+
+ ▼
+
+
+
+
+
+
+ ▼
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ {{ form.frequency }}
+ +
+
+
+
+
+
+
+ ▼
+
+
+
+
+
+
+ {{ time }}
+
+
+
+
+
+
+
+
+
+
+
+ ▼
+
+
+
+
+
+
+ ▼
+
+
+
+
+
+
+
+
+
+ -
+ {{ form.reminderMinutes }}分钟
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/health/medicationPlan/details.vue b/src/pages/health/medicationPlan/details.vue
new file mode 100644
index 0000000..72a1aa7
--- /dev/null
+++ b/src/pages/health/medicationPlan/details.vue
@@ -0,0 +1,357 @@
+
+
+
+
+
+
+ 基本信息
+
+
+ 人员
+ {{ detail.personName || '--' }}
+
+
+ 药品
+ {{ detail.medicineDisplayName || '--' }}
+
+
+ 每次剂量
+ {{ detail.dosage }}{{ detail.dosageUnit }}
+
+
+ 每日次数
+ {{ detail.frequency }}次
+
+
+ 频率类型
+ {{ getFrequencyText(detail.frequencyType) }}
+
+
+ 开始日期
+ {{ formatDate(detail.startDate) }}
+
+
+ 结束日期
+ {{ detail.endDate ? formatDate(detail.endDate) : '长期' }}
+
+
+ 提醒
+ {{ detail.reminderEnabled === '1' ? '开启 (提前' + detail.reminderMinutes + '分钟)' : '关闭' }}
+
+
+
+
+
+ 今日进度
+
+
+
+
+ {{ detail.todayTakenCount || 0 }}/{{ detail.todayTotalCount || 0 }} 次
+
+
+
+ {{ time }}
+ {{ takenTimes.includes(idx) ? '已服' : '待服' }}
+
+
+
+
+
+ 备注
+
+
+
+
+
+
+
+ 今日记录
+
+
+
+ 修改计划
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/health/medicationPlan/list.vue b/src/pages/health/medicationPlan/list.vue
new file mode 100644
index 0000000..10a8404
--- /dev/null
+++ b/src/pages/health/medicationPlan/list.vue
@@ -0,0 +1,359 @@
+
+
+
+
+
+
+
+
+ 筛选
+
+
+
+ 新增
+
+
+
+
+ 人员
+
+ {{ item.name }}
+
+ 状态
+
+ {{ item.label }}
+
+
+
+
+
+ 重置
+
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 人员
+ {{ item.personName || '--' }}
+
+
+ 药品
+ {{ item.shortName }}-{{ item.brand }}
+
+
+ 剂量
+ {{ item.dosage }}{{ item.dosageUnit }} × {{ item.frequency }}次/日
+
+
+ 今日进度
+ {{ item.todayTakenCount || 0 }}/{{ item.todayTotalCount || 0 }}
+ --
+
+
+ 开始日期
+ {{ formatDate(item.startDate) }}
+
+
+ 结束日期
+ {{ item.endDate ? formatDate(item.endDate) : '长期' }}
+
+
+
+
+
+
+
+ 今日记录
+
+
+
+ 暂停
+
+
+
+ 恢复
+
+
+
+ 结束
+
+
+
+ 修改
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/health/medicationRecord/index.vue b/src/pages/health/medicationRecord/index.vue
new file mode 100644
index 0000000..0de779c
--- /dev/null
+++ b/src/pages/health/medicationRecord/index.vue
@@ -0,0 +1,464 @@
+
+
+
+
+
+
+
+
+ 筛选
+
+
+
+
+ 人员
+
+ {{ item.name }}
+
+ 状态
+
+ {{ item.label }}
+
+ 日期范围
+
+
+ 至
+
+
+
+
+
+
+ 重置
+
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.shortName }}
+ {{ item.dosage }}{{ item.dosageUnit }}
+
+
+ {{ formatTime(item.scheduledTime) }}
+ 点击服药
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 计划时间
+ {{ formatDateTime(item.scheduledTime) }}
+
+
+ 实际时间
+ {{ item.actualTime ? formatDateTime(item.actualTime) : '--' }}
+
+
+ 剂量
+ {{ item.dosage }}{{ item.dosageUnit }}
+
+
+ 人员
+ {{ item.personName }}
+
+
+
+
+
+
+
+ 服药
+
+
+
+ 跳过
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file