1. 切换账号功能
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
This commit is contained in:
@@ -1,10 +1,25 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
const prefix = 'register/';
|
||||
/**
|
||||
* 分页查询用户列表
|
||||
* @param data
|
||||
*/
|
||||
export async function getRegisterListApi(data: any) {
|
||||
return requestClient.get<any>(`${prefix}list`, { params: data });
|
||||
|
||||
export interface RegisterOrderItem {
|
||||
id: number;
|
||||
order_no: string;
|
||||
order_number?: number;
|
||||
price: number;
|
||||
is_pay: 0 | 1;
|
||||
type: number;
|
||||
status: number;
|
||||
created_at: string;
|
||||
doctor_info?: { name: string; depart?: { name: string } };
|
||||
user_patient?: { name: string };
|
||||
store?: { name: string };
|
||||
prescription?: { id: number; prescription_no: string }[];
|
||||
}
|
||||
|
||||
export async function getRegisterListApi(data: Record<string, unknown>) {
|
||||
return requestClient.get<{ items: RegisterOrderItem[]; total: number }>(
|
||||
`${prefix}list`,
|
||||
{ params: data },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import type { RegisterOrderItem } from '../api';
|
||||
import { getRegisterListApi } from '../api';
|
||||
|
||||
interface RowType {
|
||||
id: string;
|
||||
name: string;
|
||||
logo: string;
|
||||
introduce: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export const gridOptions: VxeGridProps<RowType> = {
|
||||
export const gridOptions: VxeGridProps<RegisterOrderItem> = {
|
||||
checkboxConfig: {
|
||||
highlight: true,
|
||||
labelField: '',
|
||||
@@ -25,6 +18,8 @@ export const gridOptions: VxeGridProps<RowType> = {
|
||||
{ field: 'store.name', title: '开方诊所' },
|
||||
{ field: 'type', title: '挂号类型', slots: { default: 'type' } },
|
||||
{ field: 'prescription', title: '处方', slots: { default: 'prescription'} },
|
||||
{ field: 'price', title: '挂号价格', width: 110, slots: { default: 'price' } },
|
||||
{ field: 'is_pay', title: '是否支付', width: 100, slots: { default: 'is_pay' } },
|
||||
{ field: 'status', title: '状态', slots: { default: 'status' } },
|
||||
{ field: 'created_at', title: '创建时间' },
|
||||
// {
|
||||
|
||||
@@ -63,6 +63,14 @@ const openPrescriptionDetail = (values) => {
|
||||
});
|
||||
PrescriptionDetailModalApi.open();
|
||||
};
|
||||
|
||||
function formatRegisterPrice(price: unknown) {
|
||||
const n = Number(price);
|
||||
if (!Number.isFinite(n)) {
|
||||
return '—';
|
||||
}
|
||||
return `¥${n.toFixed(2)}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -88,6 +96,14 @@ const openPrescriptionDetail = (values) => {
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<template #price="{ row }">
|
||||
<span>{{ formatRegisterPrice(row.price) }}</span>
|
||||
</template>
|
||||
<template #is_pay="{ row }">
|
||||
<Tag :color="row.is_pay === 1 ? 'green' : 'red'">
|
||||
{{ row.is_pay === 1 ? '已支付' : '未支付' }}
|
||||
</Tag>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
<div class="mt-3">
|
||||
<Tag v-if="row.type === 0" color="purple">线下就诊</Tag>
|
||||
|
||||
@@ -159,6 +159,17 @@ function splitString(str: string): string[] {
|
||||
|
||||
// ==================== 表格列配置 ====================
|
||||
|
||||
/**
|
||||
* 格式化挂号价格
|
||||
*/
|
||||
function formatRegisterPrice(price: unknown) {
|
||||
const n = Number(price);
|
||||
if (!Number.isFinite(n)) {
|
||||
return '—';
|
||||
}
|
||||
return `¥${n.toFixed(2)}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂号记录表格列
|
||||
*/
|
||||
@@ -166,7 +177,23 @@ const registerColumns = [
|
||||
{ title: '订单编号', dataIndex: 'order_no', key: 'order_no' },
|
||||
{ title: '医生', dataIndex: 'doctor', key: 'doctor' },
|
||||
{ title: '诊所', dataIndex: 'store', key: 'store' },
|
||||
{ title: '费用', dataIndex: 'price', key: 'price' },
|
||||
{
|
||||
title: '费用',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
customRender: ({ text }: { text: number }) => formatRegisterPrice(text),
|
||||
},
|
||||
{
|
||||
title: '是否支付',
|
||||
dataIndex: 'is_pay',
|
||||
key: 'is_pay',
|
||||
customRender: ({ text }: { text: number }) =>
|
||||
h(
|
||||
Tag,
|
||||
{ color: text === 1 ? 'green' : 'red' },
|
||||
() => (text === 1 ? '已支付' : '未支付'),
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status_text',
|
||||
|
||||
Reference in New Issue
Block a user