fix: 挂号订单列表

This commit is contained in:
2025-04-22 08:40:33 +08:00
parent e7267a67b5
commit 35b0f5413a
9 changed files with 275 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getPrescriptionListApi } from '#/views/business/prescriptions/prescription/api';
import { getPrescriptionListApi } from '../api';
interface RowType {
id: string;

View File

@@ -4,14 +4,11 @@ import type { VxeGridListeners } from '#/adapter/vxe-table';
import { ref } from 'vue';
import {
AnalysisOverview,
type AnalysisOverviewItem,
Page,
useVbenModal,
} from '@vben/common-ui';
import { SvgCakeIcon } from '@vben/icons';
import { Button, Image, Tag } from 'ant-design-vue';
import { Button, Tag } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { TableAction } from '#/components/table-action';
@@ -41,35 +38,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
gridEvents,
});
const infoModal = (data = {}) => {
modalApi.setData({
//
values: data,
gridApi,
});
modalApi.open();
};
const wareSend = (data = {}) => {
formModalApi.setData({
//
values: {
order_id: data?.id,
order_no: data?.order_no,
},
gridApi,
});
formModalApi.open();
};
const expandAll = () => {
gridApi.grid?.setAllRowExpand(true);
};
const collapseAll = () => {
gridApi.grid?.setAllRowExpand(false);
};
const overviewItems = ref<AnalysisOverviewItem[]>([]);
const [PrescrtionDetailModal, PrescrtionDetailModalApi] = useVbenModal({
connectedComponent: PrescrtionDetail,
});

View File

@@ -0,0 +1,10 @@
import { requestClient } from '#/api/request';
const prefix = 'register/';
/**
* 分页查询用户列表
* @param data
*/
export async function getRegisterListApi(data: any) {
return requestClient.get<any>(`${prefix}list`, { params: data });
}

View File

@@ -0,0 +1,38 @@
import type { VbenFormProps } from '#/adapter/form';
import dayjs from 'dayjs';
export const formOptions: VbenFormProps = {
// 默认展开
collapsed: false,
schema: [
{
component: 'VbenInput',
componentProps: {
placeholder: '输入订单号',
},
defaultValue: '',
fieldName: 'order_no',
label: '订单号',
},
{
component: 'RangePicker',
componentProps: {
format: 'YYYY-MM-DD', // 确保格式与你需要的一致
},
defaultValue: [dayjs().startOf('month'), dayjs()],
fieldName: 'search_time',
label: '时间范围',
},
],
// 控制表单是否显示折叠按钮
showCollapseButton: true,
submitButtonOptions: {
content: '查询',
},
// 是否在字段值改变时提交表单
// submitOnChange: true,
// submitOnChange: true,
// 按下回车时是否提交表单
submitOnEnter: true,
};

View File

@@ -0,0 +1,84 @@
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getRegisterListApi } from '../api';
interface RowType {
id: string;
name: string;
logo: string;
introduce: string;
created_at: string;
}
export const gridOptions: VxeGridProps<RowType> = {
checkboxConfig: {
highlight: true,
labelField: '',
},
columns: [
// { type: 'checkbox', width: 60 },
{ field: 'id', align: 'left', title: 'ID' },
{ field: 'order_no', title: '挂号订单号' },
{ field: 'doctor_info.name', title: '开方医生' },
{ field: 'doctor_info.depart.name', title: '科室' },
{ field: 'user_patient.name', title: '就诊人名称' },
{ field: 'store.name', title: '开方诊所' },
{ field: 'prescription', title: '处方', slots: { default: 'prescription'} },
{ field: 'status', title: '状态', slots: { default: 'status' } },
// { field: 'created_at', title: '下单时间' },
// {
// type: 'html',
// title: '操作',
// align: 'right',
// slots: { default: 'action' },
// width: 200,
// },
],
keepSource: true,
pagerConfig: {},
columnConfig: {
useKey: true,
},
rowConfig: {
useKey: true,
},
// scrollY: {
// enabled: true,
// gt: 0,
// },
proxyConfig: {
ajax: {
// 请求后端接口方法
query: async ({ page }, formValues) => {
return await getRegisterListApi({
page: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
height: 'auto',
border: false,
toolbarConfig: {
// 是否显示搜索表单控制按钮
// @ts-ignore 正式环境时有完整的类型声明
search: true,
refresh: true, // 刷新
print: false, // 打印
export: false, // 导出
// custom: true, // 自定义列
zoom: true, // 最大化最小化
slots: {
buttons: 'toolbar-buttons',
},
custom: {
// 自定义列-图标
icon: 'vxe-icon-menu',
},
},
expandConfig: {
// expandAll: true,
},
showOverflow: false,
};

View File

@@ -0,0 +1,137 @@
<script lang="ts" setup>
import type { VxeGridListeners } from '#/adapter/vxe-table';
import { ref } from 'vue';
import {
Page,
useVbenModal,
} from '@vben/common-ui';
import { Button, Tag } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { TableAction } from '#/components/table-action';
import PrescrtionDetail from '#/views/doctor/doctor-reception/components/PrescrtionDetail.vue';
import { formOptions } from './config/search';
import { gridOptions } from './config/table';
const hasTopTableDropDownActions = ref(false);
const gridEvents: VxeGridListeners<any> = {
checkboxChange() {
// eslint-disable-next-line no-use-before-define
const records = gridApi.grid.getCheckboxRecords();
hasTopTableDropDownActions.value = records.length > 0;
},
checkboxAll() {
// eslint-disable-next-line no-use-before-define
const records = gridApi.grid.getCheckboxRecords();
hasTopTableDropDownActions.value = records.length > 0;
},
};
const [Grid, gridApi] = useVbenVxeGrid({
formOptions,
gridOptions,
gridEvents,
});
const [PrescrtionDetailModal, PrescrtionDetailModalApi] = useVbenModal({
connectedComponent: PrescrtionDetail,
});
const openPrescriptionDetail = (values) => {
// 打开西药处方模态框逻辑
PrescrtionDetailModalApi.setData({
values,
});
PrescrtionDetailModalApi.open();
};
</script>
<template>
<Page auto-content-height title="订单管理">
<PrescrtionDetailModal />
<Grid>
<template #toolbar-buttons>
<TableAction
:actions="[]"
:drop-down-actions="[]"
>
<template #more>
<Button style="margin-left: 16px">
批量操作
<Icon icon="ant-design:down-outlined" />
</Button>
</template>
</TableAction>
</template>
<template #prescription="{ row }">
<div v-for="item in row.prescription">
<Button type="link" @click="openPrescriptionDetail(item.id)">{{ item.prescription_no }}</Button>
</div>
</template>
<template #status="{ row }">
<div class="mt-3">
<!-- 状态:0待支付1已支付待接诊2接诊中3已结束4已取消5待评价6已评价7已拒诊-->
<Tag v-if="row.status === 0" color="red">代支付</Tag>
<Tag v-else-if="row.status === 1" color="green">待接诊</Tag>
<Tag v-else-if="row.status === 2" color="red">接诊中</Tag>
<Tag v-else-if="row.status === 3" color="purple">已结束</Tag>
<Tag v-else-if="row.status === 4" color="orange">已取消</Tag>
<Tag v-else-if="row.status === 5" color="purple">待评价</Tag>
<Tag v-else-if="row.status === 6" color="purple">已评价</Tag>
<Tag v-else-if="row.status === 7" color="red">已拒诊</Tag>
</div>
</template>
<template #toolbar-tools></template>
<template #action="{ row }">
<TableAction
:actions="[
{
label: '查看处方',
type: 'link',
icon: 'ri:send-plane-fill',
// auth: ['超级订单', 'sys:user:save'],
onClick: openPrescriptionDetail.bind(null, row.id),
},
]"
:drop-down-actions="[
]"
/>
</template>
</Grid>
</Page>
</template>
<style scoped lang="scss">
.custom-list {
list-style-type: none;
padding-left: 0;
}
.custom-list-item {
background-color: rgba(64, 158, 255, 0.04);
border-radius: 4px;
margin-bottom: 8px;
padding: 8px 12px;
font-size: 14px;
transition: background-color 0.3s;
&:hover {
background-color: rgba(64, 158, 255, 0.1);
}
&::before {
content: '';
display: inline-block;
width: 6px;
height: 6px;
background-color: #409eff;
border-radius: 50%;
margin-right: 8px;
vertical-align: middle;
}
}
</style>

View File

@@ -204,7 +204,7 @@ const decrypt = (str: string) => str; // 简单base64解码示例
item.doctor_info.identity_info.sign_image
}`"
alt="签名"
style="width: 120px; height: 50px; display: inline-block"
style="width: 120px; height: 50px; display: inline-block; "
/>
<span v-else>{{ item.content?.doctor.name }}</span>
</div>
@@ -277,6 +277,9 @@ const decrypt = (str: string) => str; // 简单base64解码示例
</template>
<style scoped>
.dark .signature img {
filter: invert(100%);
}
.prescription-container {
padding: 20px;
font-family: 'SimSun', serif;