处方作废不再受签署/审核/订单状态限制,作废后订单随重新开方自动关联;签署原文去掉辅方方名;出丸显示辅方克数;查看处方可下载 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:
Your Name
2026-11-30 10:45:08 +08:00
co-authored by Claude Opus 5
parent 0eeb572f0f
commit b55f30753c
396 changed files with 582 additions and 459 deletions
+10 -8
View File
@@ -1425,7 +1425,7 @@ test('list upload can retry and opens signing without exposing audit to the phar
assert.match(messages[0], /请完成医师签署/)
})
test('issued prescriptions can void pending drafts with permission and keep the record', async () => {
test('issued prescriptions can be voided in any review state when the server allows it', async () => {
const calls = []
const messages = []
let cancel = true
@@ -1443,24 +1443,26 @@ test('issued prescriptions can void pending drafts with permission and keep the
msgSuccess: (message) => messages.push(message)
}
}
const { canVoidPendingPrescription, voidPendingPrescription } = pageDeclarations(
const { canVoidPrescription, voidPendingPrescription } = pageDeclarations(
'views/consumer/prescription/index.vue',
['isPendingPrescriptionAudit', 'canVoidPendingPrescription', 'voidPendingPrescription'], globals
['canVoidPrescription', 'voidPendingPrescription'], globals
)
assert.equal(canVoidPendingPrescription(row), true)
for (const other of [{ audit_status: 1 }, { audit_status: 2 }, { void_status: 1 }, { can_void: false }]) {
assert.equal(canVoidPrescription(row), true)
// 审核通过(药师已签署)后仍可作废;以服务端 can_void 为准。
assert.equal(canVoidPrescription({ ...row, audit_status: 1 }), true)
for (const other of [{ void_status: 1 }, { can_void: false }]) {
await voidPendingPrescription({ ...row, ...other })
}
await voidPendingPrescription(row)
assert.deepEqual(calls, [])
cancel = false
await voidPendingPrescription(row)
assert.equal(canVoidPendingPrescription(row), true)
assert.equal(canVoidPrescription(row), true)
await Promise.all([voidPendingPrescription(row), voidPendingPrescription(row)])
assert.deepEqual(calls, [{ id: 17, pending_only: true }, { id: 17, pending_only: true }])
assert.deepEqual(calls, [{ id: 17 }, { id: 17 }])
assert.equal(row.void_status, 1)
assert.equal(row.can_submit_for_review, false)
assert.equal(canVoidPendingPrescription(row), false)
assert.equal(canVoidPrescription(row), false)
assert.equal(refreshes, 1)
assert.deepEqual(messages, ['处方已作废'])
})