「已开处方」新增作废、医生电子签署身份两个按钮权限,按角色勾选

- 作废(tcm.prescription/void):未勾选的角色看不到按钮、接口也拒绝;开方/删除/审核权限不再隐含作废。
  勾选后仍只能作废本人开具的处方,具备审核角色的可作废数据范围内他人的处方;审核驳回作废不受影响
- 医生电子签署身份(tcm.prescription/esignDoctor):医生角色未勾选时,顶部下拉入口与签署面板「签署身份与证书」隐藏,
  服务端认证、快捷签授权一并拒绝(即不能签署处方);药师审核签署身份不受影响。桌面端入口同步按此权限判断
- 迁移 2026_11_27_prescription_void_esign_doctor_menu.sql:挂在「已开处方」下,默认不授予任何角色
- 重新构建管理后台
- 记录诊单 IM 聊天补拉改为独立系统 cron 的部署说明(原串行调度会被其阻塞数小时)

Co-Authored-By: Claude Opus 5 (1M context) <[EMAIL]>
This commit is contained in:
Your Name
2026-11-27 15:45:58 +08:00
co-authored by Claude Opus 5 (1M context)
parent 3451f43c22
commit dfe5768cd2
394 changed files with 472 additions and 377 deletions
+6 -2
View File
@@ -117,7 +117,7 @@ function createDialog({ read = () => status(), start = () => authenticating(), c
}
}
test('account menu requires a signed-in doctor with a prescription write grant', async () => {
test('account menu requires a signed-in doctor with the signing identity button grant', async () => {
const store = vue.reactive({ token: 'synthetic', userInfo: { id: 21, role_ids: [2], root: 1 }, perms: ['*'] })
let mounted
const component = load(menuScript.script, {
@@ -128,7 +128,8 @@ test('account menu requires a signed-in doctor with a prescription write grant',
'@/components/EsignDoctorDialog.vue': {},
'@/stores/modules/user': { default: () => store },
'@/utils/feedback': {},
'@/utils/perm': { hasPermission: ([perm]) => store.perms.includes(perm) }
'@/utils/perm': { hasPermission: ([perm]) => store.perms.includes(perm) || store.perms.includes('*') },
'@/utils/prescription-esign': { DOCTOR_ESIGN_IDENTITY_PERMISSION: 'tcm.prescription/esignDoctor' }
}).default
const scope = vue.effectScope()
const menu = scope.run(() => component.setup({}, { expose() {} }))
@@ -145,6 +146,9 @@ test('account menu requires a signed-in doctor with a prescription write grant',
store.perms = ['cf.prescription/edit']
assert.equal(menu.reviewEsignOpen.value, false)
await menu.handleCommand('doctor-esign')
assert.equal(menu.doctorEsignOpen.value, false, 'a prescription write grant alone no longer opens the signing identity')
store.perms = ['cf.prescription/edit', 'tcm.prescription/esignDoctor']
await menu.handleCommand('doctor-esign')
assert.equal(menu.doctorEsignOpen.value, true)
store.userInfo.id = 23
assert.equal(menu.doctorEsignOpen.value, false)