fix: 慢性病管理功能优化完善。
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
<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 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="plannedDate" width="110">
|
||||
<template #default="scope">
|
||||
@@ -75,7 +75,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<div class="ctrl-btn d-flex">
|
||||
<el-tooltip v-if="scope.row.status === 0" class="item" effect="dark" content="确认服药" placement="top">
|
||||
@@ -105,6 +105,19 @@
|
||||
</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-form>
|
||||
@@ -147,6 +160,8 @@ const queryParams = reactive({
|
||||
plannedDateEnd: null
|
||||
})
|
||||
|
||||
const confirmDialogVisible = ref(false)
|
||||
const actualTime = ref('')
|
||||
const skipDialogVisible = ref(false)
|
||||
const skipNotes = ref('')
|
||||
const currentRow = ref(null)
|
||||
@@ -193,14 +208,27 @@ const resetQuery = () => {
|
||||
}
|
||||
|
||||
const handleSelectionChange = (selection) => {
|
||||
ids.value = selection.map(item => item.id)
|
||||
ids.value = selection.map((item) => item.id)
|
||||
multiple.value = !selection.length
|
||||
}
|
||||
|
||||
const handleConfirm = async (row) => {
|
||||
await proxy.$modal.confirm('确认已服药?')
|
||||
await confirmMedication(row.id, 1)
|
||||
const handleConfirm = (row) => {
|
||||
currentRow.value = row
|
||||
// 默认当前时间
|
||||
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('操作成功')
|
||||
confirmDialogVisible.value = false
|
||||
getList()
|
||||
}
|
||||
|
||||
@@ -231,12 +259,28 @@ const indexMethod = (index) => {
|
||||
|
||||
const formatDate = (date) => {
|
||||
if (!date) return '--'
|
||||
return date.substring(0, 10)
|
||||
// 处理数组格式 [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 '--'
|
||||
}
|
||||
|
||||
const formatTime = (time) => {
|
||||
if (!time) return '--'
|
||||
return time.substring(0, 5)
|
||||
// 处理数组格式 [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 '--'
|
||||
}
|
||||
|
||||
const formatDateTime = (datetime) => {
|
||||
@@ -251,5 +295,4 @@ onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user