diff --git a/apps/web-antd/src/views/system/delivery-warehouse-order/components/detail-modal.vue b/apps/web-antd/src/views/system/delivery-warehouse-order/components/detail-modal.vue index 73db8ec7..8e729f09 100644 --- a/apps/web-antd/src/views/system/delivery-warehouse-order/components/detail-modal.vue +++ b/apps/web-antd/src/views/system/delivery-warehouse-order/components/detail-modal.vue @@ -3,8 +3,9 @@ import { computed, nextTick, ref } from 'vue'; import { useVbenModal } from '@vben/common-ui'; -import { Button, Descriptions, Image, Tabs, Tag, Timeline } from 'ant-design-vue'; +import { Button, Descriptions, Image, Space, Tabs, Tag, Timeline } from 'ant-design-vue'; +import PrescriptionDetail from '#/views/doctor/doctor-reception/components/PrescriptionDetail.vue'; import { getDeliveryWarehouseOrderDetail } from '#/views/system/delivery-warehouse-order/api'; defineOptions({ @@ -25,6 +26,18 @@ const canShip = computed(() => { Number(data.value.status) === 1; return (mineUnsent || legacy) && typeof onShipFn.value === 'function'; }); + +/** 详情内是否可查看处方:有 p_id 且非商城类订单 */ +const canViewPrescription = computed(() => { + const pId = Number(data.value.p_id ?? 0); + const orderType = Number(data.value.order_type ?? 0); + return pId > 0 && orderType !== 2 && orderType !== 3; +}); + +/** 顶部操作栏:有发货或查看处方任一即可显示 */ +const showToolbar = computed( + () => canShip.value || canViewPrescription.value, +); /** 仅使用仓侧详情返回的本仓 packages,避免平台物流接口带出他仓商品 */ const packageTabs = computed(() => { return Array.isArray(data.value.packages) ? data.value.packages : []; @@ -91,6 +104,21 @@ function handleShip() { } } +/** 详情内打开处方详情弹窗 */ +function openPrescriptionDetail() { + const pId = Number(data.value.p_id ?? 0); + if (!pId) { + return; + } + PrescriptionDetailModalApi.setData({ values: pId }); + PrescriptionDetailModalApi.open(); +} + +/** 复用医生端处方详情,详情内自建避免与列表页耦合 */ +const [PrescriptionDetailModal, PrescriptionDetailModalApi] = useVbenModal({ + connectedComponent: PrescriptionDetail, +}); + const [Modal, modalApi] = useVbenModal({ fullscreenButton: false, draggable: true, @@ -119,9 +147,15 @@ const [Modal, modalApi] = useVbenModal({