处方作废不再受签署/审核/订单状态限制,作废后订单随重新开方自动关联;签署原文去掉辅方方名;出丸显示辅方克数;查看处方可下载 CA 原件或药房联/处方联
- 作废:药师签署、审核通过、已有业务订单后均可作废(仍需「作废」权限;已提交药房的订单须先远端取消)。 作废时关联的待审核/履约中订单处方审核重置为待审核(履约中退回待审核,支付审核保留), 同诊单重新开方后自动改关联到新处方并写订单日志;已发货/已完成订单按原处方留档。 迁移 2026_11_30_prescription_order_reissue.sql 新增 reissue_from_prescription_id - 签署 PDF 不再写入「辅方方名」 - 出丸:有辅方药材时显示「主方 X克,辅方 Y克」(管理后台与桌面端) - 已开处方「查看处方」下载改为下拉:CA 签署处方 PDF、药房联 PDF、处方联 PDF(A4,按当前笺面样式) - 重新构建管理后台 Co-Authored-By: Claude Opus 5 <[EMAIL]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0eeb572f0f
commit
b55f30753c
@@ -308,8 +308,29 @@ function computeOutPellet(data: Record<string, any>): string {
|
||||
return formatNum(perDose * getDoseCount(data))
|
||||
}
|
||||
|
||||
/** 辅方出丸 = 辅方服用天数 × 每日次数 × 每袋用量 × 每次袋数;仅浓缩水丸且确有辅方药材时计算。 */
|
||||
function computeAuxOutPellet(data: Record<string, any>): string {
|
||||
if ((data.prescription_type || '浓缩水丸') !== '浓缩水丸' || !getAuxHerbs(data).length) return ''
|
||||
let raw = data.aux_usage
|
||||
if (typeof raw === 'string') {
|
||||
try {
|
||||
raw = JSON.parse(raw)
|
||||
} catch {
|
||||
raw = null
|
||||
}
|
||||
}
|
||||
const aux = normalizeAuxUsageForm(raw, '浓缩水丸')
|
||||
const days = Number(aux.usage_days)
|
||||
const times = Number(aux.times_per_day)
|
||||
const doseG = Number(aux.dosage_amount)
|
||||
const bags = Number(aux.dosage_bag_count) > 0 ? Number(aux.dosage_bag_count) : 1
|
||||
return days > 0 && times > 0 && doseG > 0 ? formatNum(days * times * doseG * bags) : ''
|
||||
}
|
||||
|
||||
export function rxOutPelletText(data: Record<string, any> | null | undefined): string {
|
||||
if (!data) return ''
|
||||
const out = computeOutPellet(data)
|
||||
const aux = computeAuxOutPellet(data)
|
||||
if (out && aux) return `主方 ${out}克,辅方 ${aux}克`
|
||||
return out ? `${out}克` : ''
|
||||
}
|
||||
|
||||
@@ -701,16 +701,16 @@
|
||||
{{ requiresOriginalEsignPdf(savedPrescription.esign) ? '下载已签原始 PDF' : '下载PDF' }}
|
||||
</el-button>
|
||||
<el-tooltip
|
||||
v-if="savedPrescription.void_status !== 1 && !approvedPreviewOnly"
|
||||
:disabled="!hasPrescriptionOrderBlockVoid"
|
||||
content="该处方已存在业务订单,无法作废,请前往已开处方里修改"
|
||||
v-if="savedPrescription.void_status !== 1 && savedPrescription.can_void !== false"
|
||||
:disabled="!hasLinkedPrescriptionOrder"
|
||||
content="作废后,关联的业务订单会在同诊单重新开方时自动关联到新处方"
|
||||
placement="top"
|
||||
>
|
||||
<span class="inline-block">
|
||||
<el-button
|
||||
v-perms="['tcm.prescription/void']"
|
||||
type="danger"
|
||||
plain
|
||||
:disabled="hasPrescriptionOrderBlockVoid"
|
||||
:loading="voiding"
|
||||
@click="handleVoid"
|
||||
>
|
||||
@@ -1080,8 +1080,8 @@ const approvedPreviewOnly = computed(() => {
|
||||
return Number(s.audit_status) === 1 && Number(s.void_status) !== 1
|
||||
})
|
||||
|
||||
/** 已有关联业务订单(与列表 has_prescription_order 一致)则禁止作废 */
|
||||
const hasPrescriptionOrderBlockVoid = computed(() => {
|
||||
/** 已有关联业务订单(与列表 has_prescription_order 一致):作废时提示订单将随重新开方迁移 */
|
||||
const hasLinkedPrescriptionOrder = computed(() => {
|
||||
const s = savedPrescription.value
|
||||
if (!s) return false
|
||||
return Number(s.has_prescription_order) === 1
|
||||
@@ -2165,12 +2165,10 @@ const formatVoidTime = (ts: number | null | undefined) => {
|
||||
const handleVoid = async () => {
|
||||
const id = savedPrescription.value?.id
|
||||
if (!id) return
|
||||
if (Number(savedPrescription.value?.has_prescription_order) === 1) {
|
||||
feedback.msgWarning('该处方已存在业务订单,无法作废')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await feedback.confirm('确定要作废该处方吗?作废后不可恢复。')
|
||||
await feedback.confirm(Number(savedPrescription.value?.has_prescription_order) === 1
|
||||
? '确定要作废该处方吗?作废后不可恢复;关联的业务订单将退回待审核,同诊单重新开方后自动关联到新处方。'
|
||||
: '确定要作废该处方吗?作废后不可恢复。')
|
||||
voiding.value = true
|
||||
await prescriptionVoid({ id })
|
||||
feedback.msgSuccess('作废成功')
|
||||
|
||||
Reference in New Issue
Block a user