update
h5 :问诊列表 add 完成诊单 +医生备注
This commit is contained in:
@@ -509,6 +509,32 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="completeDialogVisible"
|
||||||
|
title="完成问诊"
|
||||||
|
width="420px"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
destroy-on-close
|
||||||
|
>
|
||||||
|
<div class="complete-dialog">
|
||||||
|
<p class="complete-dialog-tip">是否添加医生备注?</p>
|
||||||
|
<el-input
|
||||||
|
v-if="canAddCompleteNote"
|
||||||
|
v-model="completeNoteContent"
|
||||||
|
type="textarea"
|
||||||
|
:rows="4"
|
||||||
|
maxlength="500"
|
||||||
|
show-word-limit
|
||||||
|
placeholder="填写完成备注,将追加到医生备注时间轴"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="completeDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="completeSubmitting" @click="submitComplete">确认完成</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -518,7 +544,9 @@ import { defineAsyncComponent, onMounted, onUnmounted, watch } from 'vue'
|
|||||||
import { appointmentLists, cancelAppointment, completeAppointment, appointmentDetail } from '@/api/doctor'
|
import { appointmentLists, cancelAppointment, completeAppointment, appointmentDetail } from '@/api/doctor'
|
||||||
import { getCallSignature, generateMiniProgramQrcode, tcmDiagnosisDetail, prescriptionGetByAppointment } from '@/api/tcm'
|
import { getCallSignature, generateMiniProgramQrcode, tcmDiagnosisDetail, prescriptionGetByAppointment } from '@/api/tcm'
|
||||||
import { getDictData } from '@/api/app'
|
import { getDictData } from '@/api/app'
|
||||||
|
import { addDoctorNote } from '@/api/patient'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
|
import { hasPermission } from '@/utils/perm'
|
||||||
import {
|
import {
|
||||||
formatDiabetesDiscoveryDisplay,
|
formatDiabetesDiscoveryDisplay,
|
||||||
isDiabetesDiscoveryFilled
|
isDiabetesDiscoveryFilled
|
||||||
@@ -797,6 +825,12 @@ const ensureDetailDictOptions = async () => {
|
|||||||
const editRef = ref()
|
const editRef = ref()
|
||||||
const prescriptionRef = ref()
|
const prescriptionRef = ref()
|
||||||
const chatDialogRef = ref()
|
const chatDialogRef = ref()
|
||||||
|
const COMPLETE_NOTE_PERMISSION = ['doctor.appointment/addDoctorNote']
|
||||||
|
const completeDialogVisible = ref(false)
|
||||||
|
const completeSubmitting = ref(false)
|
||||||
|
const completeNoteContent = ref('')
|
||||||
|
const completeRow = ref<any>(null)
|
||||||
|
const canAddCompleteNote = computed(() => hasPermission(COMPLETE_NOTE_PERMISSION))
|
||||||
|
|
||||||
// 小程序二维码相关
|
// 小程序二维码相关
|
||||||
const qrcodeDialogVisible = ref(false)
|
const qrcodeDialogVisible = ref(false)
|
||||||
@@ -866,6 +900,12 @@ const handleCancel = async (row: any) => {
|
|||||||
|
|
||||||
// 完成挂号
|
// 完成挂号
|
||||||
const handleComplete = async (row: any) => {
|
const handleComplete = async (row: any) => {
|
||||||
|
completeRow.value = row
|
||||||
|
completeNoteContent.value = ''
|
||||||
|
if (canAddCompleteNote.value) {
|
||||||
|
completeDialogVisible.value = true
|
||||||
|
return
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await feedback.confirm('确认患者已就诊完成?')
|
await feedback.confirm('确认患者已就诊完成?')
|
||||||
await completeAppointment({ id: row.id })
|
await completeAppointment({ id: row.id })
|
||||||
@@ -875,6 +915,37 @@ const handleComplete = async (row: any) => {
|
|||||||
// 用户取消操作
|
// 用户取消操作
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const submitComplete = async () => {
|
||||||
|
const row = completeRow.value
|
||||||
|
if (!row?.id || completeSubmitting.value) return
|
||||||
|
completeSubmitting.value = true
|
||||||
|
try {
|
||||||
|
const note = completeNoteContent.value.trim()
|
||||||
|
await completeAppointment({ id: row.id })
|
||||||
|
let noteFailureMsg = ''
|
||||||
|
if (canAddCompleteNote.value && note) {
|
||||||
|
const diagnosisId = row.patient_id || row.diagnosis_id
|
||||||
|
if (diagnosisId) {
|
||||||
|
try {
|
||||||
|
await addDoctorNote({ diagnosis_id: Number(diagnosisId), content: note })
|
||||||
|
} catch (e) {
|
||||||
|
noteFailureMsg = '问诊已完成,但备注未保存'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
noteFailureMsg = '问诊已完成,但该预约没有关联诊单,备注未保存'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
noteFailureMsg ? feedback.msgWarning(noteFailureMsg) : feedback.msgSuccess('操作成功')
|
||||||
|
completeDialogVisible.value = false
|
||||||
|
completeNoteContent.value = ''
|
||||||
|
completeRow.value = null
|
||||||
|
loadData()
|
||||||
|
} catch (e: any) {
|
||||||
|
feedback.msgError(e?.msg || e?.message || '操作失败')
|
||||||
|
} finally {
|
||||||
|
completeSubmitting.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 编辑患者资料
|
// 编辑患者资料
|
||||||
const handleEditPatient = (row: any) => {
|
const handleEditPatient = (row: any) => {
|
||||||
@@ -1330,6 +1401,13 @@ onUnmounted(() => {
|
|||||||
color: var(--el-color-danger);
|
color: var(--el-color-danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.complete-dialog-tip {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
.qrcode-content {
|
.qrcode-content {
|
||||||
padding: 16px 0;
|
padding: 16px 0;
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,71 @@
|
|||||||
|
-- 企业微信菜单:新增「问诊列表」H5 页面
|
||||||
|
-- 位置:企业微信 > 问诊列表,与「诊单」「业务订单」同级
|
||||||
|
-- 前端地址:/admin/wx/appointment?
|
||||||
|
|
||||||
|
SET @qywx_pid := (
|
||||||
|
SELECT zhend.`pid`
|
||||||
|
FROM `zyt_system_menu` zhend
|
||||||
|
WHERE zhend.`name` = '诊单'
|
||||||
|
AND zhend.`pid` > 0
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM `zyt_system_menu` orders
|
||||||
|
WHERE orders.`pid` = zhend.`pid`
|
||||||
|
AND orders.`name` = '业务订单'
|
||||||
|
)
|
||||||
|
ORDER BY id ASC
|
||||||
|
LIMIT 1
|
||||||
|
);
|
||||||
|
|
||||||
|
SET @sort_no := (
|
||||||
|
SELECT IFNULL(MAX(`sort`), 0) + 1
|
||||||
|
FROM `zyt_system_menu`
|
||||||
|
WHERE `pid` = @qywx_pid
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 若之前执行过旧版 SQL(如 paths = wenzhen / patient),先修正为当前内部路由。
|
||||||
|
UPDATE `zyt_system_menu`
|
||||||
|
SET
|
||||||
|
`name` = '问诊列表',
|
||||||
|
`perms` = 'doctor.appointment/lists',
|
||||||
|
`paths` = 'appointment',
|
||||||
|
`component` = 'tcm/appointment/list_h5',
|
||||||
|
`is_show` = 1,
|
||||||
|
`is_disable` = 0,
|
||||||
|
`update_time` = UNIX_TIMESTAMP()
|
||||||
|
WHERE @qywx_pid IS NOT NULL
|
||||||
|
AND `pid` = @qywx_pid
|
||||||
|
AND (
|
||||||
|
`component` = 'tcm/appointment/list_h5'
|
||||||
|
OR `paths` IN ('wenzhen', 'patient', 'appointment')
|
||||||
|
OR `name` IN ('患者列表', '问诊列表')
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO `zyt_system_menu` (
|
||||||
|
`pid`, `type`, `name`, `icon`, `sort`, `perms`, `paths`, `component`,
|
||||||
|
`selected`, `params`, `is_cache`, `is_show`, `is_disable`, `create_time`, `update_time`
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
@qywx_pid,
|
||||||
|
'C',
|
||||||
|
'问诊列表',
|
||||||
|
'',
|
||||||
|
@sort_no,
|
||||||
|
'doctor.appointment/lists',
|
||||||
|
'appointment',
|
||||||
|
'tcm/appointment/list_h5',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
UNIX_TIMESTAMP(),
|
||||||
|
UNIX_TIMESTAMP()
|
||||||
|
FROM DUAL
|
||||||
|
WHERE @qywx_pid IS NOT NULL
|
||||||
|
AND NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM `zyt_system_menu`
|
||||||
|
WHERE `pid` = @qywx_pid
|
||||||
|
AND (`paths` = 'appointment' OR `component` = 'tcm/appointment/list_h5')
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user