diff --git a/admin/src/api/tcm.ts b/admin/src/api/tcm.ts index a8231c40..42303f29 100644 --- a/admin/src/api/tcm.ts +++ b/admin/src/api/tcm.ts @@ -319,6 +319,16 @@ export function prescriptionEdit(params: any) { return request.post({ url: '/tcm.prescription/edit', params }) } +/** 仅修正处方笺患者姓名、手机号与性别(不改审核状态),写入业务订单日志表 */ +export function prescriptionPatchPatient(params: { + id: number + patient_name: string + phone: string + gender: number +}) { + return request.post({ url: '/tcm.prescription/patchPatient', params }) +} + // 删除处方 export function prescriptionDelete(params: { id: number }) { return request.post({ url: '/tcm.prescription/delete', params }) diff --git a/admin/src/views/consumer/prescription/index.vue b/admin/src/views/consumer/prescription/index.vue index 81a9c14f..1276666a 100644 --- a/admin/src/views/consumer/prescription/index.vue +++ b/admin/src/views/consumer/prescription/index.vue @@ -216,6 +216,15 @@ 查看 + + 改姓名手机 + + + + + + #{{ patchPatientForm.id || '—' }} + + + + + + + + + + + + + + +

+ 仅更新处方表 patient_name、gender、phone,不改变审核状态;记录写入业务订单操作日志(有关联订单时可在此订单日志中查看)。 +

+ +
+ () +const patchPatientForm = reactive({ + id: 0, + patient_name: '', + gender: 1 as 0 | 1, + phone: '' +}) +const patchPatientRules: FormRules = { + patient_name: [{ required: true, message: '请输入患者姓名', trigger: 'blur' }], + gender: [{ required: true, message: '请选择性别', trigger: 'change' }], + phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }] +} + +function openPatchPatientDialog(row: Record) { + patchPatientForm.id = Number(row.id) || 0 + patchPatientForm.patient_name = String(row.patient_name ?? '').trim() + const g = Number(row.gender) + patchPatientForm.gender = g === 0 || g === 1 ? (g as 0 | 1) : 1 + patchPatientForm.phone = String(row.phone ?? '').trim() + patchPatientVisible.value = true +} + +function resetPatchPatientForm() { + patchPatientForm.id = 0 + patchPatientForm.patient_name = '' + patchPatientForm.gender = 1 + patchPatientForm.phone = '' + patchPatientFormRef.value?.clearValidate() +} + +async function submitPatchPatient() { + const form = patchPatientFormRef.value + if (!form) return + try { + await form.validate() + } catch { + return + } + patchPatientSubmitLoading.value = true + try { + await prescriptionPatchPatient({ + id: patchPatientForm.id, + patient_name: patchPatientForm.patient_name.trim(), + phone: patchPatientForm.phone.trim(), + gender: patchPatientForm.gender + }) + feedback.msgSuccess('已保存') + patchPatientVisible.value = false + getLists() + } catch (e: unknown) { + const msg = e && typeof e === 'object' && 'msg' in e ? String((e as { msg?: string }).msg) : '' + feedback.msgError(msg || '保存失败') + } finally { + patchPatientSubmitLoading.value = false + } +} + /** 从消费者处方创建订单 */ const createOrderVisible = ref(false) /** 创建订单分步向导:0 患者与收货 / 1 服务与支付单 / 2 金额与确认 */ diff --git a/admin/src/views/consumer/prescription/order_list.vue b/admin/src/views/consumer/prescription/order_list.vue index 59265017..bdae4144 100644 --- a/admin/src/views/consumer/prescription/order_list.vue +++ b/admin/src/views/consumer/prescription/order_list.vue @@ -495,7 +495,7 @@ >修改单号
+ 药房直发 - - - - - - - - - - - + @@ -2346,7 +2361,7 @@

药房备注:{{ rxPharmacyRemarkText }}

-

+

出丸:{{ rxOutPelletText }}

@@ -2589,6 +2604,7 @@ import { getDictData } from '@/api/app' import { deptAll } from '@/api/org/department' import { usePaging } from '@/hooks/usePaging' import feedback from '@/utils/feedback' +import { hasPermission } from '@/utils/perm' import { ElMessageBox } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus' import useUserStore from '@/stores/modules/user' @@ -4747,13 +4763,31 @@ const shipForm = reactive({ function openShip(row: { id: number; express_company?: unknown; tracking_number?: unknown; ship_mode?: unknown }) { shipRowId.value = row.id - shipForm.ship_mode = String(row.ship_mode || 'gancao') || 'gancao' + const tn = String(row.tracking_number ?? '').trim() + const sm = String(row.ship_mode ?? '').trim() + if (sm === 'direct' || sm === 'gancao') { + shipForm.ship_mode = sm + } else if (tn) { + // 已填单号时默认走药房直发(如快捷填单号后「确认发货」) + shipForm.ship_mode = 'direct' + } else { + shipForm.ship_mode = 'gancao' + } shipForm.express_company = String(row.express_company || 'auto') || 'auto' shipForm.tracking_number = String(row.tracking_number || '') shipVisible.value = true } async function submitShip() { + if (shipForm.ship_mode !== 'direct') { + if (!hasPermission(['tcm.prescriptionOrder/submitGancaoRecipel'])) { + feedback.msgError('暂无上传甘草药方权限,请改用「药房直发」并填写快递单号,或联系管理员开通权限') + return + } + shipVisible.value = false + await confirmSubmitGancaoRecipel({ id: shipRowId.value }) + return + } if (!shipForm.tracking_number.trim()) { feedback.msgError('请先填写快递单号再确认发货') return @@ -4762,7 +4796,7 @@ async function submitShip() { try { await prescriptionOrderShip({ id: shipRowId.value, - ship_mode: shipForm.ship_mode === 'direct' ? 'direct' : 'gancao', + ship_mode: 'direct', express_company: shipForm.express_company || 'auto', tracking_number: shipForm.tracking_number.trim() }) @@ -5193,6 +5227,8 @@ const rxTypeText = computed(() => { const v = prescriptionViewData.value as any if (!v) return '—' const t = v.prescription_type || '浓缩水丸' + /** 饮片不匹配「丸|散|膏|片」,避免误显示「浓缩丸-饮片」;类型字段直接展示饮片 */ + if (t === '饮片') return '饮片' return /丸|散|膏|片/.test(t) ? `浓缩丸-${t}` : t }) diff --git a/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue b/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue index c2c1e2ec..fd6febad 100644 --- a/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue +++ b/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue @@ -274,6 +274,7 @@ {{ detailData.medication_days ? detailData.medication_days + ' 天' : '—' }} {{ detailData.prev_staff || '—' }} {{ detailData.service_channel || '—' }} + {{ formatServicePackage(detailData.service_package) }} {{ feeTypeText(detailData.fee_type) }} {{ detailData.tracking_number || '—' }} {{ expressCompanyLabel(detailData.express_company) }} @@ -332,7 +333,7 @@ - + diff --git a/server/sql/1.9.20260516/add_prescription_patch_patient_contact_menu.sql b/server/sql/1.9.20260516/add_prescription_patch_patient_contact_menu.sql new file mode 100644 index 00000000..bd255dd4 --- /dev/null +++ b/server/sql/1.9.20260516/add_prescription_patch_patient_contact_menu.sql @@ -0,0 +1,24 @@ +-- 消费者处方列表:修正处方笺姓名 / 手机号(接口 tcm.prescription/patchPatient) +-- 执行前确认表前缀为 zyt_;若已有相同 perms 则跳过。 + +SET @cf_rx_menu_id := ( + SELECT id FROM zyt_system_menu + WHERE type = 'C' + AND ( + component = 'consumer/prescription/index' + OR component LIKE '%consumer/prescription/index%' + ) + LIMIT 1 +); + +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 + @cf_rx_menu_id, 'A', '修正处方患者姓名手机', '', 53, + 'tcm.prescription/patchPatient', '', '', + '', '', 0, 1, 0, UNIX_TIMESTAMP(), UNIX_TIMESTAMP() +FROM DUAL +WHERE @cf_rx_menu_id IS NOT NULL + AND NOT EXISTS (SELECT 1 FROM zyt_system_menu WHERE perms = 'tcm.prescription/patchPatient');