This commit is contained in:
Your Name
2026-07-09 17:58:02 +08:00
parent a650747fd3
commit f5a89b4310
290 changed files with 478 additions and 332 deletions
@@ -10,7 +10,7 @@
<el-tooltip placement="top">
<template #content>
<div class="max-w-xs leading-relaxed">
在实单诊次序号上叠加偏移量设为 1默认 1 笔实单计为二诊设为 2 1 笔实单计为三诊若有 5 笔实单则统计上相当于计至七诊5+2
在实单诊次序号上叠加偏移量设为 0默认 1 笔实单计为一诊设为 1 1 笔实单计为二诊设为 2 1 笔实单计为三诊若有 5 笔实单且偏移 2则统计上相当于计至七诊5+2
</div>
</template>
<el-icon class="text-gray-400 align-middle ml-1"><QuestionFilled /></el-icon>
@@ -18,7 +18,7 @@
<el-input-number
v-model="revisitSlotStartOffset"
v-perms="['tcm.diagnosis/setRevisitSlotStartOffset']"
:min="1"
:min="0"
:max="20"
:step="1"
controls-position="right"
@@ -147,8 +147,8 @@ const { pager, getLists, resetPage } = usePaging({
size: 10
})
const revisitSlotStartOffset = ref(1)
const savedRevisitSlotStartOffset = ref(1)
const revisitSlotStartOffset = ref(0)
const savedRevisitSlotStartOffset = ref(0)
const offsetSaving = ref(false)
const offsetLoading = ref(false)
@@ -157,10 +157,11 @@ const offsetDirty = computed(
)
const visitSlotStartLabel = computed(() => {
const offset = Number(revisitSlotStartOffset.value) || 1
const raw = Number(revisitSlotStartOffset.value)
const offset = Number.isFinite(raw) ? raw : 0
const slot = offset + 1
const cn = ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
if (slot >= 2 && slot <= 10) {
if (slot >= 1 && slot <= 10) {
return cn[slot] + '诊'
}
return `${slot}`
@@ -184,12 +185,12 @@ async function loadRevisitSlotStartOffset() {
const res: any = await tcmDiagnosisDetail({ id: props.diagnosisId })
const d = res?.data ?? res ?? {}
const offset = Number(d.revisit_slot_start_offset)
const val = offset >= 1 && offset <= 20 ? offset : 1
const val = Number.isFinite(offset) && offset >= 0 && offset <= 20 ? offset : 0
revisitSlotStartOffset.value = val
savedRevisitSlotStartOffset.value = val
} catch {
revisitSlotStartOffset.value = 1
savedRevisitSlotStartOffset.value = 1
revisitSlotStartOffset.value = 0
savedRevisitSlotStartOffset.value = 0
} finally {
offsetLoading.value = false
}
@@ -198,8 +199,8 @@ async function loadRevisitSlotStartOffset() {
async function saveRevisitSlotStartOffset() {
if (props.diagnosisId <= 0) return
const offset = Number(revisitSlotStartOffset.value)
if (!Number.isFinite(offset) || offset < 1 || offset > 20) {
feedback.msgWarning('起始偏移须在 120 之间')
if (!Number.isFinite(offset) || offset < 0 || offset > 20) {
feedback.msgWarning('起始偏移须在 020 之间')
return
}
offsetSaving.value = true