@@ -26,11 +26,11 @@ export function delMedicationTask(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 确认服药
|
// 确认服药
|
||||||
export function confirmMedication(id, confirmType) {
|
export function confirmMedication(id, confirmType, confirmTime) {
|
||||||
return request({
|
return request({
|
||||||
url: '/health/medicationTask/confirm/' + id,
|
url: '/health/medicationTask/confirm/' + id,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: { confirmType }
|
params: { confirmType, confirmTime }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<div class="search-con">
|
<div class="search-con">
|
||||||
<div class="title">查询条件</div>
|
<div class="title">查询条件</div>
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
|
||||||
<el-form-item label="成员" prop="memberId">
|
<el-form-item label="成员" prop="personId">
|
||||||
<el-select v-model="queryParams.memberId" placeholder="请选择成员" clearable filterable>
|
<el-select v-model="queryParams.personId" placeholder="请选择成员" clearable filterable>
|
||||||
<el-option v-for="item in memberList" :key="item.id" :label="item.name" :value="item.id" />
|
<el-option v-for="item in memberList" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<el-table v-loading="loading" :data="chronicDiseaseList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
|
<el-table v-loading="loading" :data="chronicDiseaseList" @selection-change="handleSelectionChange" height="calc(100% - 0.65rem)">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column type="index" label="序号" :index="indexMethod" width="50"></el-table-column>
|
<el-table-column type="index" label="序号" :index="indexMethod" width="50"></el-table-column>
|
||||||
<el-table-column label="成员" align="center" prop="memberName" width="100" />
|
<el-table-column label="成员" align="center" prop="personName" width="100" />
|
||||||
<el-table-column label="疾病名称" align="center" prop="diseaseName" min-width="120" show-overflow-tooltip />
|
<el-table-column label="疾病名称" align="center" prop="diseaseName" min-width="120" show-overflow-tooltip />
|
||||||
<el-table-column label="疾病编码" align="center" prop="diseaseCode" width="100" />
|
<el-table-column label="疾病编码" align="center" prop="diseaseCode" width="100" />
|
||||||
<el-table-column label="确诊日期" align="center" prop="diagnosisDate" width="110">
|
<el-table-column label="确诊日期" align="center" prop="diagnosisDate" width="110">
|
||||||
@@ -91,8 +91,8 @@
|
|||||||
<!-- 添加或修改慢性疾病档案对话框 -->
|
<!-- 添加或修改慢性疾病档案对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="880px" append-to-body>
|
||||||
<el-form ref="chronicDiseaseRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
<el-form ref="chronicDiseaseRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="成员" prop="memberId">
|
<el-form-item label="成员" prop="personId">
|
||||||
<el-select v-model="form.memberId" placeholder="请选择成员" filterable @change="handleMemberChange">
|
<el-select v-model="form.personId" placeholder="请选择成员" filterable @change="handleMemberChange">
|
||||||
<el-option v-for="item in memberList" :key="item.id" :label="item.name" :value="item.id" />
|
<el-option v-for="item in memberList" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -108,13 +108,7 @@
|
|||||||
<el-input v-model="form.diseaseCode" placeholder="ICD-10编码(可选)" />
|
<el-input v-model="form.diseaseCode" placeholder="ICD-10编码(可选)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="确诊日期" prop="diagnosisDate">
|
<el-form-item label="确诊日期" prop="diagnosisDate">
|
||||||
<el-date-picker
|
<el-date-picker v-model="form.diagnosisDate" type="date" placeholder="选择确诊日期" value-format="YYYY-MM-DD" style="width: 200px" />
|
||||||
v-model="form.diagnosisDate"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择确诊日期"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="diseaseStatus">
|
<el-form-item label="状态" prop="diseaseStatus">
|
||||||
<el-select v-model="form.diseaseStatus" placeholder="请选择状态">
|
<el-select v-model="form.diseaseStatus" placeholder="请选择状态">
|
||||||
@@ -130,8 +124,8 @@
|
|||||||
<el-form-item label="科室" prop="department">
|
<el-form-item label="科室" prop="department">
|
||||||
<el-input v-model="form.department" placeholder="请输入科室" />
|
<el-input v-model="form.department" placeholder="请输入科室" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注说明" style="width: 792px" prop="notes">
|
<el-form-item label="诊断结果" style="width: 792px" prop="notes">
|
||||||
<el-input v-model="form.notes" type="textarea" :rows="3" placeholder="请输入备注说明" />
|
<el-input v-model="form.notes" type="textarea" :rows="3" placeholder="请输入说明" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" style="width: 792px" prop="remark">
|
<el-form-item label="备注" style="width: 792px" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||||
@@ -177,13 +171,13 @@ const data = reactive({
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
memberId: null,
|
personId: null,
|
||||||
diseaseName: null,
|
diseaseName: null,
|
||||||
diseaseStatus: null,
|
diseaseStatus: null,
|
||||||
isActive: null
|
isActive: null
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
memberId: [{ required: true, message: '成员不能为空', trigger: 'change' }],
|
personId: [{ required: true, message: '成员不能为空', trigger: 'change' }],
|
||||||
diseaseName: [{ required: true, message: '疾病名称不能为空', trigger: 'blur' }],
|
diseaseName: [{ required: true, message: '疾病名称不能为空', trigger: 'blur' }],
|
||||||
diseaseStatus: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
diseaseStatus: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
||||||
}
|
}
|
||||||
@@ -222,14 +216,14 @@ const handleOperate = (operate, row) => {
|
|||||||
|
|
||||||
/** 查询成员列表 */
|
/** 查询成员列表 */
|
||||||
function getMemberList() {
|
function getMemberList() {
|
||||||
listPerson({ pageNum: 1, pageSize: 1000 }).then(response => {
|
listPerson({ pageNum: 1, pageSize: 1000 }).then((response) => {
|
||||||
memberList.value = response.rows || []
|
memberList.value = response.rows || []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询疾病列表 */
|
/** 查询疾病列表 */
|
||||||
function getDiseaseList() {
|
function getDiseaseList() {
|
||||||
listHealthDiseases({ pageNum: 1, pageSize: 1000 }).then(response => {
|
listHealthDiseases({ pageNum: 1, pageSize: 1000 }).then((response) => {
|
||||||
diseaseList.value = response.rows || []
|
diseaseList.value = response.rows || []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -237,7 +231,7 @@ function getDiseaseList() {
|
|||||||
/** 查询慢性疾病档案列表 */
|
/** 查询慢性疾病档案列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
listChronicDisease(queryParams.value).then(response => {
|
listChronicDisease(queryParams.value).then((response) => {
|
||||||
chronicDiseaseList.value = response.rows
|
chronicDiseaseList.value = response.rows
|
||||||
total.value = response.total
|
total.value = response.total
|
||||||
loading.value = false
|
loading.value = false
|
||||||
@@ -254,7 +248,7 @@ function cancel() {
|
|||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
id: null,
|
id: null,
|
||||||
memberId: null,
|
personId: null,
|
||||||
diseaseId: null,
|
diseaseId: null,
|
||||||
diseaseName: null,
|
diseaseName: null,
|
||||||
diseaseCode: null,
|
diseaseCode: null,
|
||||||
@@ -303,7 +297,7 @@ const indexMethod = (index) => {
|
|||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.id)
|
ids.value = selection.map((item) => item.id)
|
||||||
single.value = selection.length !== 1
|
single.value = selection.length !== 1
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length
|
||||||
}
|
}
|
||||||
@@ -326,7 +320,7 @@ function handleAdd() {
|
|||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset()
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value
|
||||||
getChronicDisease(_id).then(response => {
|
getChronicDisease(_id).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data
|
||||||
open.value = true
|
open.value = true
|
||||||
title.value = '修改慢性疾病档案'
|
title.value = '修改慢性疾病档案'
|
||||||
@@ -336,11 +330,15 @@ function handleUpdate(row) {
|
|||||||
/** 状态修改 */
|
/** 状态修改 */
|
||||||
function handleStatusChange(row) {
|
function handleStatusChange(row) {
|
||||||
const text = row.isActive === 1 ? '启用' : '停用'
|
const text = row.isActive === 1 ? '启用' : '停用'
|
||||||
proxy.$modal.confirm('确认要"' + text + '"该慢性疾病档案吗?').then(() => {
|
proxy.$modal
|
||||||
|
.confirm('确认要"' + text + '"该慢性疾病档案吗?')
|
||||||
|
.then(() => {
|
||||||
return updateChronicDisease({ id: row.id, isActive: row.isActive })
|
return updateChronicDisease({ id: row.id, isActive: row.isActive })
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
proxy.$modal.msgSuccess(text + '成功')
|
proxy.$modal.msgSuccess(text + '成功')
|
||||||
}).catch(() => {
|
})
|
||||||
|
.catch(() => {
|
||||||
row.isActive = row.isActive === 0 ? 1 : 0
|
row.isActive = row.isActive === 0 ? 1 : 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -348,7 +346,7 @@ function handleStatusChange(row) {
|
|||||||
/** 选择疾病时自动填充疾病名称 */
|
/** 选择疾病时自动填充疾病名称 */
|
||||||
function handleDiseaseChange(diseaseId) {
|
function handleDiseaseChange(diseaseId) {
|
||||||
if (diseaseId) {
|
if (diseaseId) {
|
||||||
const disease = diseaseList.value.find(item => item.id === diseaseId)
|
const disease = diseaseList.value.find((item) => item.id === diseaseId)
|
||||||
if (disease) {
|
if (disease) {
|
||||||
form.value.diseaseName = disease.name
|
form.value.diseaseName = disease.name
|
||||||
}
|
}
|
||||||
@@ -362,16 +360,16 @@ function handleMemberChange() {
|
|||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs.chronicDiseaseRef.validate(valid => {
|
proxy.$refs.chronicDiseaseRef.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updateChronicDisease(form.value).then(response => {
|
updateChronicDisease(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess('修改成功')
|
proxy.$modal.msgSuccess('修改成功')
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
addChronicDisease(form.value).then(response => {
|
addChronicDisease(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess('新增成功')
|
proxy.$modal.msgSuccess('新增成功')
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
@@ -402,5 +400,4 @@ getDiseaseList()
|
|||||||
getList()
|
getList()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -44,17 +44,30 @@
|
|||||||
<el-table-column type="index" label="序号" :index="indexMethod" width="50"></el-table-column>
|
<el-table-column type="index" label="序号" :index="indexMethod" width="50"></el-table-column>
|
||||||
<el-table-column label="计划名称" align="center" prop="planName" width="150" />
|
<el-table-column label="计划名称" align="center" prop="planName" width="150" />
|
||||||
<el-table-column label="人员" align="center" prop="personName" width="100" />
|
<el-table-column label="人员" align="center" prop="personName" width="100" />
|
||||||
<el-table-column label="药品" align="center" width="200">
|
<el-table-column label="药品" align="center" prop="medicineName" width="200" />
|
||||||
<template #default="scope"> {{ scope.row.shortName }}-{{ scope.row.brand }} </template>
|
<el-table-column label="剂量" align="center" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<span style="display: inline-flex; align-items: center; gap: 4px">
|
||||||
|
{{ scope.row.dosagePerTime }}
|
||||||
|
<dict-tag :options="medical_unit" :value="scope.row.dosageUnit" style="display: inline-flex" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="剂量/频率" align="center" width="120">
|
<el-table-column label="频次类型" align="center" prop="frequencyType" width="100">
|
||||||
<template #default="scope"> {{ scope.row.dosage }}{{ scope.row.dosageUnit }} × {{ scope.row.frequency }}次/日 </template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="频率类型" align="center" prop="frequencyType" width="100">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="medication_frequency_type" :value="scope.row.frequencyType" />
|
<dict-tag :options="medication_frequency_type" :value="scope.row.frequencyType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="服药时间" align="center" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<div v-if="scope.row.timeSlots" class="time-slots-list">
|
||||||
|
<el-tag v-for="(time, idx) in parseTimeSlots(scope.row.timeSlots)" :key="idx" size="small" type="info" class="time-tag">
|
||||||
|
{{ time }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="开始日期" align="center" prop="startDate" width="110">
|
<el-table-column label="开始日期" align="center" prop="startDate" width="110">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatDate(scope.row.startDate) }}
|
{{ formatDate(scope.row.startDate) }}
|
||||||
@@ -67,13 +80,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="今日进度" align="center" width="100">
|
<el-table-column label="今日进度" align="center" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.status === '1'"> {{ scope.row.todayTakenCount || 0 }}/{{ scope.row.todayTotalCount || 0 }} </span>
|
<span v-if="scope.row.status === 1"> {{ scope.row.todayCompleted || 0 }}/{{ scope.row.todayTotal || 0 }} </span>
|
||||||
<span v-else>--</span>
|
<span v-else>--</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="提醒" align="center" prop="reminderEnabled" width="80">
|
<el-table-column label="提醒" align="center" prop="remindEnabled" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag v-if="scope.row.reminderEnabled === '1'" type="success">开</el-tag>
|
<el-tag v-if="scope.row.remindEnabled === 1" type="success">开</el-tag>
|
||||||
<el-tag v-else type="info">关</el-tag>
|
<el-tag v-else type="info">关</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -82,19 +95,19 @@
|
|||||||
<dict-tag :options="medication_plan_status" :value="scope.row.status" />
|
<dict-tag :options="medication_plan_status" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
<el-table-column label="操作" align="center" class-name="small-padding">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="ctrl-btn d-flex">
|
<div class="ctrl-btn d-flex">
|
||||||
<el-tooltip class="item" effect="dark" content="查看" placement="top">
|
<el-tooltip class="item" effect="dark" content="查看" placement="top">
|
||||||
<el-button icon="View" v-hasPermi="['health:medicationPlan:query']" circle @click="handleView(scope.row)"></el-button>
|
<el-button icon="View" v-hasPermi="['health:medicationPlan:query']" circle @click="handleView(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip v-if="scope.row.status === '1'" class="item" effect="dark" content="暂停" placement="top">
|
<el-tooltip v-if="scope.row.status === 1" class="item" effect="dark" content="暂停" placement="top">
|
||||||
<el-button icon="VideoPause" v-hasPermi="['health:medicationPlan:edit']" circle @click="handlePause(scope.row)"></el-button>
|
<el-button icon="VideoPause" v-hasPermi="['health:medicationPlan:edit']" circle @click="handlePause(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip v-if="scope.row.status === '3'" class="item" effect="dark" content="恢复" placement="top">
|
<el-tooltip v-if="scope.row.status === 2 || scope.row.status === 3" class="item" effect="dark" content="恢复" placement="top">
|
||||||
<el-button icon="VideoPlay" v-hasPermi="['health:medicationPlan:edit']" circle @click="handleResume(scope.row)"></el-button>
|
<el-button icon="VideoPlay" v-hasPermi="['health:medicationPlan:edit']" circle @click="handleResume(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip v-if="scope.row.status !== '2'" class="item" effect="dark" content="结束" placement="top">
|
<el-tooltip v-if="scope.row.status !== 2" class="item" effect="dark" content="结束" placement="top">
|
||||||
<el-button icon="Finished" v-hasPermi="['health:medicationPlan:edit']" circle @click="handleEnd(scope.row)"></el-button>
|
<el-button icon="Finished" v-hasPermi="['health:medicationPlan:edit']" circle @click="handleEnd(scope.row)"></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip class="item" effect="dark" content="修改" placement="top">
|
<el-tooltip class="item" effect="dark" content="修改" placement="top">
|
||||||
@@ -121,20 +134,20 @@
|
|||||||
<el-dialog :title="title" v-model="open" width="900px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="900px" append-to-body>
|
||||||
<el-form ref="planRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
<el-form ref="planRef" :model="form" :inline="true" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="计划名称" prop="planName">
|
<el-form-item label="计划名称" prop="planName">
|
||||||
<el-input v-model="form.planName" placeholder="请输入计划名称(可选)" style="width: 300px" />
|
<el-input v-model="form.planName" placeholder="请输入计划名称(可选)" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="人员" prop="personId">
|
<el-form-item label="人员" prop="personId">
|
||||||
<el-select v-model="form.personId" placeholder="请选择人员" filterable style="width: 200px" @change="handlePersonChange">
|
<el-select v-model="form.personId" placeholder="请选择人员" filterable @change="handlePersonChange">
|
||||||
<el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id" />
|
<el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="慢性疾病" prop="chronicDiseaseId">
|
<el-form-item label="慢性疾病" prop="chronicDiseaseId">
|
||||||
<el-select v-model="form.chronicDiseaseId" placeholder="请选择慢性疾病(可选)" filterable clearable style="width: 300px">
|
<el-select v-model="form.chronicDiseaseId" placeholder="请选择慢性疾病(可选)" filterable clearable>
|
||||||
<el-option v-for="item in chronicDiseaseList" :key="item.id" :label="item.diseaseName" :value="item.id" />
|
<el-option v-for="item in chronicDiseaseList" :key="item.id" :label="item.diseaseName" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="药品" prop="medicineId">
|
<el-form-item label="药品" prop="medicineId">
|
||||||
<el-select v-model="form.medicineId" placeholder="请选择药品" filterable style="width: 300px" @change="handleMedicineChange">
|
<el-select v-model="form.medicineId" placeholder="请选择药品" filterable @change="handleMedicineChange">
|
||||||
<el-option v-for="item in medicineList" :key="item.id" :label="item.shortName + '-' + item.brand" :value="item.id" />
|
<el-option v-for="item in medicineList" :key="item.id" :label="item.shortName + '-' + item.brand" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -145,32 +158,51 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="频次类型" prop="frequencyType">
|
<el-form-item label="频次类型" prop="frequencyType">
|
||||||
<el-select v-model="form.frequencyType" placeholder="请选择频次类型" style="width: 150px">
|
<el-select v-model="form.frequencyType" placeholder="请选择频次类型">
|
||||||
<el-option label="每天" :value="1" />
|
<el-option label="每天" :value="1" />
|
||||||
<el-option label="每周" :value="2" />
|
<el-option label="每周" :value="2" />
|
||||||
<el-option label="隔天" :value="3" />
|
<el-option label="隔天" :value="3" />
|
||||||
<el-option label="自定义" :value="4" />
|
<el-option label="自定义" :value="4" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服药时间点" prop="timeSlots">
|
<el-form-item label="服药时间点" prop="timeSlots" style="width: 100%">
|
||||||
<el-tag v-for="(time, index) in form.timePointList" :key="index" closable @close="removeTimePoint(index)" style="margin-right: 10px">
|
<div class="time-slots-wrapper">
|
||||||
{{ time }}
|
<div v-for="(time, index) in form.timePointList" :key="index" class="time-slot-item">
|
||||||
</el-tag>
|
<span class="time-text">{{ time }}</span>
|
||||||
<el-time-picker v-model="newTimePoint" placeholder="添加时间" format="HH:mm" value-format="HH:mm" @change="addTimePoint" style="width: 120px" />
|
<el-icon class="close-icon" @click="removeTimePoint(index)"><Close /></el-icon>
|
||||||
|
</div>
|
||||||
|
<el-time-picker
|
||||||
|
v-model="newTimePoint"
|
||||||
|
placeholder="添加时间"
|
||||||
|
format="HH:mm"
|
||||||
|
value-format="HH:mm"
|
||||||
|
@change="addTimePoint"
|
||||||
|
style="width: 110px"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开始日期" prop="startDate">
|
<el-form-item label="开始日期" prop="startDate">
|
||||||
<el-date-picker v-model="form.startDate" type="date" placeholder="选择开始日期" value-format="YYYY-MM-DD" style="width: 180px" />
|
<el-date-picker v-model="form.startDate" type="date" placeholder="选择开始日期" value-format="YYYY-MM-DD" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="结束日期" prop="endDate">
|
<el-form-item label="结束日期" prop="endDate">
|
||||||
<el-date-picker v-model="form.endDate" type="date" placeholder="选择结束日期(可选)" value-format="YYYY-MM-DD" style="width: 180px" />
|
<el-date-picker v-model="form.endDate" type="date" placeholder="选择结束日期(可选)" value-format="YYYY-MM-DD" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="启用提醒" prop="remindEnabled">
|
<el-form-item label="启用提醒" prop="remindEnabled">
|
||||||
<el-switch v-model="form.remindEnabled" :active-value="1" :inactive-value="0" />
|
<el-switch v-model="form.remindEnabled" :active-value="1" :inactive-value="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="form.remindEnabled === 1" label="提前提醒" prop="remindAdvanceMin">
|
<el-form-item v-if="form.remindEnabled === 1" label="提前提醒" prop="remindAdvanceMin">
|
||||||
<el-input-number v-model="form.remindAdvanceMin" :min="0" :max="60" style="width: 150px" />
|
<el-input-number v-model="form.remindAdvanceMin" :min="0" :max="60" />
|
||||||
<span style="margin-left: 10px">分钟</span>
|
<span style="margin-left: 10px">分钟</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="通知家属" prop="notifyFamily">
|
||||||
|
<el-switch v-model="form.notifyFamily" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.notifyFamily === 1" label="家属成员" prop="familyMemberIds">
|
||||||
|
<el-select v-model="form.familyMemberIdList" multiple placeholder="请选择家属成员" filterable style="width: 300px">
|
||||||
|
<el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="备注" style="width: 100%">
|
<el-form-item label="备注" style="width: 100%">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" :rows="3" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" :rows="3" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -199,6 +231,7 @@ import {
|
|||||||
import { listMedicineBasic } from '@/api/health/medicineBasic'
|
import { listMedicineBasic } from '@/api/health/medicineBasic'
|
||||||
import { listPerson } from '@/api/health/person'
|
import { listPerson } from '@/api/health/person'
|
||||||
import { listChronicDiseaseByMember } from '@/api/health/chronicDisease'
|
import { listChronicDiseaseByMember } from '@/api/health/chronicDisease'
|
||||||
|
import { Close } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const { medication_frequency_type, medication_plan_status, medical_unit } = proxy.useDict('medication_frequency_type', 'medication_plan_status', 'medical_unit')
|
const { medication_frequency_type, medication_plan_status, medical_unit } = proxy.useDict('medication_frequency_type', 'medication_plan_status', 'medical_unit')
|
||||||
@@ -290,6 +323,7 @@ function reset() {
|
|||||||
remindAdvanceMin: 15,
|
remindAdvanceMin: 15,
|
||||||
notifyFamily: 0,
|
notifyFamily: 0,
|
||||||
familyMemberIds: null,
|
familyMemberIds: null,
|
||||||
|
familyMemberIdList: [],
|
||||||
status: 1,
|
status: 1,
|
||||||
remark: null
|
remark: null
|
||||||
}
|
}
|
||||||
@@ -337,13 +371,46 @@ function handleSelectionChange(selection) {
|
|||||||
// 格式化日期
|
// 格式化日期
|
||||||
function formatDate(date) {
|
function formatDate(date) {
|
||||||
if (!date) return ''
|
if (!date) return ''
|
||||||
|
// 处理数组格式 [2026, 3, 21]
|
||||||
|
if (Array.isArray(date)) {
|
||||||
|
return `${date[0]}-${String(date[1]).padStart(2, '0')}-${String(date[2]).padStart(2, '0')}`
|
||||||
|
}
|
||||||
|
// 处理字符串格式
|
||||||
|
if (typeof date === 'string') {
|
||||||
return date.substring(0, 10)
|
return date.substring(0, 10)
|
||||||
}
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析服药时间点 JSON
|
||||||
|
function parseTimeSlots(timeSlots) {
|
||||||
|
if (!timeSlots) return []
|
||||||
|
try {
|
||||||
|
return typeof timeSlots === 'string' ? JSON.parse(timeSlots) : timeSlots
|
||||||
|
} catch (e) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将数组日期转换为字符串日期
|
||||||
|
function convertArrayDateToString(dateArray) {
|
||||||
|
if (!dateArray) return null
|
||||||
|
if (Array.isArray(dateArray)) {
|
||||||
|
return `${dateArray[0]}-${String(dateArray[1]).padStart(2, '0')}-${String(dateArray[2]).padStart(2, '0')}`
|
||||||
|
}
|
||||||
|
if (typeof dateArray === 'string') {
|
||||||
|
return dateArray.substring(0, 10)
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
// 查看
|
// 查看
|
||||||
const handleView = (row) => {
|
const handleView = (row) => {
|
||||||
getMedicationPlan(row.id).then((response) => {
|
getMedicationPlan(row.id).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data
|
||||||
|
// 转换日期格式
|
||||||
|
form.value.startDate = convertArrayDateToString(form.value.startDate)
|
||||||
|
form.value.endDate = convertArrayDateToString(form.value.endDate)
|
||||||
// 解析 timeSlots JSON
|
// 解析 timeSlots JSON
|
||||||
if (form.value.timeSlots) {
|
if (form.value.timeSlots) {
|
||||||
try {
|
try {
|
||||||
@@ -354,6 +421,16 @@ const handleView = (row) => {
|
|||||||
} else {
|
} else {
|
||||||
form.value.timePointList = []
|
form.value.timePointList = []
|
||||||
}
|
}
|
||||||
|
// 解析 familyMemberIds JSON
|
||||||
|
if (form.value.familyMemberIds) {
|
||||||
|
try {
|
||||||
|
form.value.familyMemberIdList = typeof form.value.familyMemberIds === 'string' ? JSON.parse(form.value.familyMemberIds) : form.value.familyMemberIds
|
||||||
|
} catch (e) {
|
||||||
|
form.value.familyMemberIdList = []
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
form.value.familyMemberIdList = []
|
||||||
|
}
|
||||||
title.value = '查看用药计划'
|
title.value = '查看用药计划'
|
||||||
open.value = true
|
open.value = true
|
||||||
// 加载该人员的慢性疾病列表
|
// 加载该人员的慢性疾病列表
|
||||||
@@ -378,6 +455,9 @@ function handleUpdate(row) {
|
|||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value
|
||||||
getMedicationPlan(_id).then((response) => {
|
getMedicationPlan(_id).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data
|
||||||
|
// 转换日期格式
|
||||||
|
form.value.startDate = convertArrayDateToString(form.value.startDate)
|
||||||
|
form.value.endDate = convertArrayDateToString(form.value.endDate)
|
||||||
// 解析 timeSlots JSON
|
// 解析 timeSlots JSON
|
||||||
if (form.value.timeSlots) {
|
if (form.value.timeSlots) {
|
||||||
try {
|
try {
|
||||||
@@ -388,6 +468,16 @@ function handleUpdate(row) {
|
|||||||
} else {
|
} else {
|
||||||
form.value.timePointList = []
|
form.value.timePointList = []
|
||||||
}
|
}
|
||||||
|
// 解析 familyMemberIds JSON
|
||||||
|
if (form.value.familyMemberIds) {
|
||||||
|
try {
|
||||||
|
form.value.familyMemberIdList = typeof form.value.familyMemberIds === 'string' ? JSON.parse(form.value.familyMemberIds) : form.value.familyMemberIds
|
||||||
|
} catch (e) {
|
||||||
|
form.value.familyMemberIdList = []
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
form.value.familyMemberIdList = []
|
||||||
|
}
|
||||||
open.value = true
|
open.value = true
|
||||||
title.value = '修改用药计划'
|
title.value = '修改用药计划'
|
||||||
// 加载该人员的慢性疾病列表
|
// 加载该人员的慢性疾病列表
|
||||||
@@ -406,7 +496,7 @@ function handlePause(row) {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
return pauseMedicationPlan(row.id)
|
return pauseMedicationPlan(row.id)
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then((response) => {
|
||||||
getList()
|
getList()
|
||||||
proxy.$modal.msgSuccess('暂停成功')
|
proxy.$modal.msgSuccess('暂停成功')
|
||||||
})
|
})
|
||||||
@@ -439,22 +529,34 @@ function handleEnd(row) {
|
|||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs.planRef.validate((valid) => {
|
proxy.$refs.planRef.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
// 构建提交数据,排除后端自动生成的字段
|
||||||
|
const submitData = { ...form.value }
|
||||||
// 将时间点列表转为 JSON 字符串
|
// 将时间点列表转为 JSON 字符串
|
||||||
form.value.timeSlots = JSON.stringify(form.value.timePointList)
|
submitData.timeSlots = JSON.stringify(form.value.timePointList)
|
||||||
// 根据药品ID获取药品名称和规格
|
// 将家属成员ID列表转为 JSON 字符串
|
||||||
const medicine = medicineList.value.find((m) => m.id === form.value.medicineId)
|
if (form.value.familyMemberIdList && form.value.familyMemberIdList.length > 0) {
|
||||||
if (medicine) {
|
submitData.familyMemberIds = JSON.stringify(form.value.familyMemberIdList)
|
||||||
form.value.medicineName = medicine.shortName + '-' + medicine.brand
|
} else {
|
||||||
form.value.specification = medicine.specification || ''
|
submitData.familyMemberIds = null
|
||||||
}
|
}
|
||||||
if (form.value.id != null) {
|
// 根据药品ID获取药品名称和规格
|
||||||
updateMedicationPlan(form.value).then((response) => {
|
const medicine = medicineList.value.find((m) => m.id === submitData.medicineId)
|
||||||
|
if (medicine) {
|
||||||
|
submitData.medicineName = medicine.shortName + '-' + medicine.brand
|
||||||
|
submitData.specification = medicine.specification || ''
|
||||||
|
}
|
||||||
|
// 移除后端自动管理的字段
|
||||||
|
delete submitData.createTime
|
||||||
|
delete submitData.updateTime
|
||||||
|
delete submitData.familyMemberIdList
|
||||||
|
if (submitData.id != null) {
|
||||||
|
updateMedicationPlan(submitData).then((response) => {
|
||||||
proxy.$modal.msgSuccess('修改成功')
|
proxy.$modal.msgSuccess('修改成功')
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
addMedicationPlan(form.value).then((response) => {
|
addMedicationPlan(submitData).then((response) => {
|
||||||
proxy.$modal.msgSuccess('新增成功')
|
proxy.$modal.msgSuccess('新增成功')
|
||||||
open.value = false
|
open.value = false
|
||||||
getList()
|
getList()
|
||||||
@@ -515,3 +617,63 @@ getPersonList()
|
|||||||
getMedicineList()
|
getMedicineList()
|
||||||
getList()
|
getList()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.time-slots-wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
background: #fafbfc;
|
||||||
|
border: 1px solid #e4e7ed;
|
||||||
|
border-radius: 6px;
|
||||||
|
min-height: 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-slot-item {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 4px 10px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #606266;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-slot-item:hover {
|
||||||
|
border-color: #409eff;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-text {
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-icon {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #c0c4cc;
|
||||||
|
transition: all 0.2s;
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-icon:hover {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-slots-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time-tag {
|
||||||
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<!-- 概览卡片 -->
|
<!-- 概览卡片 -->
|
||||||
<div class="overview-cards" v-loading="loading">
|
<div class="overview-cards" v-loading="loading">
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-icon" style="background: #409EFF;">
|
<div class="stat-icon" style="background: #409eff">
|
||||||
<el-icon><Calendar /></el-icon>
|
<el-icon><Calendar /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-content">
|
<div class="stat-content">
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-icon" style="background: #67C23A;">
|
<div class="stat-icon" style="background: #67c23a">
|
||||||
<el-icon><Check /></el-icon>
|
<el-icon><Check /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-content">
|
<div class="stat-content">
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-icon" style="background: #F56C6C;">
|
<div class="stat-icon" style="background: #f56c6c">
|
||||||
<el-icon><Close /></el-icon>
|
<el-icon><Close /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-content">
|
<div class="stat-content">
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-icon" style="background: #E6A23C;">
|
<div class="stat-icon" style="background: #e6a23c">
|
||||||
<el-icon><Timer /></el-icon>
|
<el-icon><Timer /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-content">
|
<div class="stat-content">
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<div class="stat-icon" style="background: #909399;">
|
<div class="stat-icon" style="background: #909399">
|
||||||
<el-icon><Clock /></el-icon>
|
<el-icon><Clock /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-content">
|
<div class="stat-content">
|
||||||
@@ -98,7 +98,9 @@
|
|||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button @click="changeMonth(-1)" icon="ArrowLeft">上月</el-button>
|
<el-button @click="changeMonth(-1)" icon="ArrowLeft">上月</el-button>
|
||||||
<el-button>{{ currentMonth }}</el-button>
|
<el-button>{{ currentMonth }}</el-button>
|
||||||
<el-button @click="changeMonth(1)">下月<el-icon class="el-icon--right"><ArrowRight /></el-icon></el-button>
|
<el-button @click="changeMonth(1)"
|
||||||
|
>下月<el-icon class="el-icon--right"><ArrowRight /></el-icon
|
||||||
|
></el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -107,12 +109,7 @@
|
|||||||
<div v-for="day in weekdays" :key="day" class="weekday">{{ day }}</div>
|
<div v-for="day in weekdays" :key="day" class="weekday">{{ day }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="calendar-days">
|
<div class="calendar-days">
|
||||||
<div
|
<div v-for="(day, index) in calendarDays" :key="index" class="calendar-day" :class="{ 'other-month': day.otherMonth, today: day.isToday }">
|
||||||
v-for="(day, index) in calendarDays"
|
|
||||||
:key="index"
|
|
||||||
class="calendar-day"
|
|
||||||
:class="{ 'other-month': day.otherMonth, 'today': day.isToday }"
|
|
||||||
>
|
|
||||||
<div class="day-number">{{ day.day }}</div>
|
<div class="day-number">{{ day.day }}</div>
|
||||||
<div class="day-stats" v-if="day.data && day.data.totalTasks > 0">
|
<div class="day-stats" v-if="day.data && day.data.totalTasks > 0">
|
||||||
<span class="stat-dot completed" :title="`已服药: ${day.data.completedTasks}`"></span>
|
<span class="stat-dot completed" :title="`已服药: ${day.data.completedTasks}`"></span>
|
||||||
@@ -181,7 +178,7 @@ const calendarDays = computed(() => {
|
|||||||
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`
|
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`
|
||||||
|
|
||||||
const dataMap = {}
|
const dataMap = {}
|
||||||
calendarData.value.forEach(d => {
|
calendarData.value.forEach((d) => {
|
||||||
dataMap[d.date] = d
|
dataMap[d.date] = d
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -276,7 +273,7 @@ const renderTrendChart = (data) => {
|
|||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: data.map(d => d.date?.substring(5) || '')
|
data: data.map((d) => d.date?.substring(5) || '')
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@@ -286,14 +283,14 @@ const renderTrendChart = (data) => {
|
|||||||
{
|
{
|
||||||
name: '服药率',
|
name: '服药率',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: data.map(d => d.adherenceRate || 0),
|
data: data.map((d) => d.adherenceRate || 0),
|
||||||
smooth: true,
|
smooth: true,
|
||||||
itemStyle: { color: '#409EFF' }
|
itemStyle: { color: '#409EFF' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '准时率',
|
name: '准时率',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: data.map(d => d.ontimeRate || 0),
|
data: data.map((d) => d.ontimeRate || 0),
|
||||||
smooth: true,
|
smooth: true,
|
||||||
itemStyle: { color: '#67C23A' }
|
itemStyle: { color: '#67C23A' }
|
||||||
}
|
}
|
||||||
@@ -391,6 +388,11 @@ onMounted(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.app-container {
|
||||||
|
height: calc(100vh - 84px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.overview-cards {
|
.overview-cards {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
@@ -498,19 +500,21 @@ onMounted(() => {
|
|||||||
|
|
||||||
.calendar-day {
|
.calendar-day {
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
border: 1px solid #EBEEF5;
|
border: 1px solid #ebeef5;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
|
||||||
&.other-month {
|
&.other-month {
|
||||||
background: #F5F7FA;
|
background: #f5f7fa;
|
||||||
.day-number { color: #C0C4CC; }
|
.day-number {
|
||||||
|
color: #c0c4cc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.today {
|
&.today {
|
||||||
border-color: #409EFF;
|
border-color: #409eff;
|
||||||
.day-number {
|
.day-number {
|
||||||
color: #409EFF;
|
color: #409eff;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -531,8 +535,12 @@ onMounted(() => {
|
|||||||
height: 8px;
|
height: 8px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|
||||||
&.completed { background: #67C23A; }
|
&.completed {
|
||||||
&.missed { background: #F56C6C; }
|
background: #67c23a;
|
||||||
|
}
|
||||||
|
&.missed {
|
||||||
|
background: #f56c6c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-rate {
|
.stat-rate {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column type="index" label="序号" :index="indexMethod" width="50"></el-table-column>
|
<el-table-column type="index" label="序号" :index="indexMethod" width="50"></el-table-column>
|
||||||
<el-table-column label="计划名称" align="center" prop="planName" width="150" />
|
<el-table-column label="计划名称" align="center" prop="planName" width="150" />
|
||||||
<el-table-column label="人员" align="center" prop="memberName" width="80" />
|
<el-table-column label="人员" align="center" prop="personName" width="80" />
|
||||||
<el-table-column label="药品" align="center" prop="medicineName" width="180" />
|
<el-table-column label="药品" align="center" prop="medicineName" width="180" />
|
||||||
<el-table-column label="计划日期" align="center" prop="plannedDate" width="110">
|
<el-table-column label="计划日期" align="center" prop="plannedDate" width="110">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="notes" show-overflow-tooltip />
|
<el-table-column label="备注" align="center" prop="notes" show-overflow-tooltip />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="ctrl-btn d-flex">
|
<div class="ctrl-btn d-flex">
|
||||||
<el-tooltip v-if="scope.row.status === 0" class="item" effect="dark" content="确认服药" placement="top">
|
<el-tooltip v-if="scope.row.status === 0" class="item" effect="dark" content="确认服药" placement="top">
|
||||||
@@ -105,6 +105,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 确认服药对话框 -->
|
||||||
|
<el-dialog title="确认服药" v-model="confirmDialogVisible" width="400px">
|
||||||
|
<el-form>
|
||||||
|
<el-form-item label="实际服药时间">
|
||||||
|
<el-time-picker v-model="actualTime" placeholder="选择实际服药时间" format="HH:mm" value-format="HH:mm" style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="confirmDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitConfirm">确定</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 跳过对话框 -->
|
<!-- 跳过对话框 -->
|
||||||
<el-dialog title="跳过服药" v-model="skipDialogVisible" width="400px">
|
<el-dialog title="跳过服药" v-model="skipDialogVisible" width="400px">
|
||||||
<el-form>
|
<el-form>
|
||||||
@@ -147,6 +160,8 @@ const queryParams = reactive({
|
|||||||
plannedDateEnd: null
|
plannedDateEnd: null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const confirmDialogVisible = ref(false)
|
||||||
|
const actualTime = ref('')
|
||||||
const skipDialogVisible = ref(false)
|
const skipDialogVisible = ref(false)
|
||||||
const skipNotes = ref('')
|
const skipNotes = ref('')
|
||||||
const currentRow = ref(null)
|
const currentRow = ref(null)
|
||||||
@@ -193,14 +208,27 @@ const resetQuery = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSelectionChange = (selection) => {
|
const handleSelectionChange = (selection) => {
|
||||||
ids.value = selection.map(item => item.id)
|
ids.value = selection.map((item) => item.id)
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleConfirm = async (row) => {
|
const handleConfirm = (row) => {
|
||||||
await proxy.$modal.confirm('确认已服药?')
|
currentRow.value = row
|
||||||
await confirmMedication(row.id, 1)
|
// 默认当前时间
|
||||||
|
const now = new Date()
|
||||||
|
actualTime.value = `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`
|
||||||
|
confirmDialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitConfirm = async () => {
|
||||||
|
if (!actualTime.value) {
|
||||||
|
proxy.$modal.msgError('请选择实际服药时间')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// confirmType=1 表示确认服药,confirmTime 传递时间字符串
|
||||||
|
await confirmMedication(currentRow.value.id, 1, actualTime.value)
|
||||||
proxy.$modal.msgSuccess('操作成功')
|
proxy.$modal.msgSuccess('操作成功')
|
||||||
|
confirmDialogVisible.value = false
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,13 +259,29 @@ const indexMethod = (index) => {
|
|||||||
|
|
||||||
const formatDate = (date) => {
|
const formatDate = (date) => {
|
||||||
if (!date) return '--'
|
if (!date) return '--'
|
||||||
|
// 处理数组格式 [2026, 3, 21]
|
||||||
|
if (Array.isArray(date)) {
|
||||||
|
return `${date[0]}-${String(date[1]).padStart(2, '0')}-${String(date[2]).padStart(2, '0')}`
|
||||||
|
}
|
||||||
|
// 处理字符串格式
|
||||||
|
if (typeof date === 'string') {
|
||||||
return date.substring(0, 10)
|
return date.substring(0, 10)
|
||||||
}
|
}
|
||||||
|
return '--'
|
||||||
|
}
|
||||||
|
|
||||||
const formatTime = (time) => {
|
const formatTime = (time) => {
|
||||||
if (!time) return '--'
|
if (!time) return '--'
|
||||||
|
// 处理数组格式 [8, 0] 或 [14, 30]
|
||||||
|
if (Array.isArray(time)) {
|
||||||
|
return `${String(time[0]).padStart(2, '0')}:${String(time[1]).padStart(2, '0')}`
|
||||||
|
}
|
||||||
|
// 处理字符串格式
|
||||||
|
if (typeof time === 'string') {
|
||||||
return time.substring(0, 5)
|
return time.substring(0, 5)
|
||||||
}
|
}
|
||||||
|
return '--'
|
||||||
|
}
|
||||||
|
|
||||||
const formatDateTime = (datetime) => {
|
const formatDateTime = (datetime) => {
|
||||||
if (!datetime) return '--'
|
if (!datetime) return '--'
|
||||||
@@ -251,5 +295,4 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss"></style>
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user