|
@@ -1,24 +1,20 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import ReportAnalysisCountEdit from '@/components/ReportAnalysisCountEdit.vue';
|
|
|
|
|
-import ReportHistoryPreview from '@/components/ReportHistoryPreview.vue';
|
|
|
|
|
-import type { PatientQuery, PatientReportModel } from '@/model';
|
|
|
|
|
-import { patientsHistoryMethod } from '@/request/api/patient.api';
|
|
|
|
|
-import { tagsSearchMethod } from '@/request/api/system.api';
|
|
|
|
|
-import { usePagination, useRequest } from 'alova/client';
|
|
|
|
|
-import { h } from 'vue';
|
|
|
|
|
|
|
+import { h } from 'vue';
|
|
|
|
|
|
|
|
-import {
|
|
|
|
|
- VxeButton,
|
|
|
|
|
- type VxeFormListeners,
|
|
|
|
|
- type VxeFormProps,
|
|
|
|
|
- type VxeGridInstance,
|
|
|
|
|
- type VxeGridListeners,
|
|
|
|
|
- type VxeGridProps,
|
|
|
|
|
- VxeUI,
|
|
|
|
|
-} from 'vxe-pc-ui';
|
|
|
|
|
|
|
+import { usePagination, useRequest } from 'alova/client';
|
|
|
|
|
+import { patientsHistoryMethod, patientsHistoryPullMethod, searchTagsFromSelectableMethod } from '@/request/api/patient.api';
|
|
|
|
|
+import type { PatientQuery, PatientReportModel, PatientTagVO } from '@/model';
|
|
|
|
|
+import { list2Groups } from '@/tools/data';
|
|
|
|
|
|
|
|
|
|
+import { VxeButton, type VxeFormListeners, type VxeFormProps, VxeUI } from 'vxe-pc-ui';
|
|
|
|
|
+import type { VxeGridInstance, VxeGridListeners, VxeGridProps } from 'vxe-table';
|
|
|
|
|
|
|
|
-const { data: tags, loading: tagsLoading } = useRequest(tagsSearchMethod, { initialData: { total: 0, data: [] } });
|
|
|
|
|
|
|
+import ReportAnalysisCountEdit from '@/components/ReportAnalysisCountEdit.vue';
|
|
|
|
|
+import PatientEdit from '@/components/PatientEdit.vue';
|
|
|
|
|
+import PatientTagEdit from '@/components/PatientTagEdit.vue';
|
|
|
|
|
+import PatientHealthRecordPreview from '@/components/PatientHealthRecordPreview.vue';
|
|
|
|
|
+
|
|
|
|
|
+const { data: selectable, loading: tagsLoading } = useRequest(searchTagsFromSelectableMethod, { initialData: [] });
|
|
|
|
|
|
|
|
const model = shallowRef<PatientQuery>();
|
|
const model = shallowRef<PatientQuery>();
|
|
|
const searchFormProps = reactive<VxeFormProps<PatientQuery>>({
|
|
const searchFormProps = reactive<VxeFormProps<PatientQuery>>({
|
|
@@ -27,11 +23,14 @@ const searchFormProps = reactive<VxeFormProps<PatientQuery>>({
|
|
|
titleColon: true,
|
|
titleColon: true,
|
|
|
data: {},
|
|
data: {},
|
|
|
items: [
|
|
items: [
|
|
|
- { field: 'patientName', title: '患者姓名', span: 8, itemRender: { name: 'VxeInput' } },
|
|
|
|
|
- // { field: 'phone', title: '手机号码', span: 8, itemRender: { name: 'VxeInput', props: { maxLength: 11 } } },
|
|
|
|
|
- { field: 'cardno', title: '身份证号', span: 8, itemRender: { name: 'VxeInput', props: { maxLength: 18 } } },
|
|
|
|
|
|
|
+ { field: 'patientName', title: '患者姓名', span: 6, itemRender: { name: 'VxeInput' } },
|
|
|
|
|
+ { field: 'phone', title: '手机号码', span: 6, itemRender: { name: 'VxeInput', props: { maxLength: 11 } } },
|
|
|
|
|
+ { field: 'cardno', title: '身份证号', span: 6, itemRender: { name: 'VxeInput', props: { maxLength: 18 } } },
|
|
|
{
|
|
{
|
|
|
- field: 'isHaveHealthAnalysisReport', title: '健康分析报告', span: 8, itemRender: {
|
|
|
|
|
|
|
+ field: 'isHaveHealthAnalysisReport',
|
|
|
|
|
+ title: '健康分析报告',
|
|
|
|
|
+ span: 6,
|
|
|
|
|
+ itemRender: {
|
|
|
name: 'VxeRadioGroup',
|
|
name: 'VxeRadioGroup',
|
|
|
options: [
|
|
options: [
|
|
|
{ label: '有', value: true },
|
|
{ label: '有', value: true },
|
|
@@ -43,18 +42,31 @@ const searchFormProps = reactive<VxeFormProps<PatientQuery>>({
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- field: 'tagIds', title: '标签', span: 8, itemRender: {
|
|
|
|
|
|
|
+ field: 'tagIds',
|
|
|
|
|
+ title: '标签',
|
|
|
|
|
+ span: 6,
|
|
|
|
|
+ itemRender: {
|
|
|
name: 'VxeSelect',
|
|
name: 'VxeSelect',
|
|
|
props: {
|
|
props: {
|
|
|
loading: tagsLoading,
|
|
loading: tagsLoading,
|
|
|
- options: computed(() => tags.value.data),
|
|
|
|
|
|
|
+ options: computed(() =>
|
|
|
|
|
+ list2Groups(
|
|
|
|
|
+ selectable.value.filter((tag) => !tag.disabled),
|
|
|
|
|
+ 'category',
|
|
|
|
|
+ (key) => ({ 1: '系统标签', 2: '个人标签' })[key]!
|
|
|
|
|
+ )
|
|
|
|
|
+ ),
|
|
|
optionProps: { value: 'id', label: 'name' },
|
|
optionProps: { value: 'id', label: 'name' },
|
|
|
- clearable: true, multiple: true, filterable: true,
|
|
|
|
|
|
|
+ optionGroupProps: { options: 'groups' },
|
|
|
|
|
+ clearable: true,
|
|
|
|
|
+ multiple: true,
|
|
|
|
|
+ filterable: true,
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- span: 8, itemRender: {
|
|
|
|
|
|
|
+ span: 6,
|
|
|
|
|
+ itemRender: {
|
|
|
name: 'VxeButtonGroup',
|
|
name: 'VxeButtonGroup',
|
|
|
options: [
|
|
options: [
|
|
|
{ type: 'submit', content: '查询', status: 'primary' },
|
|
{ type: 'submit', content: '查询', status: 'primary' },
|
|
@@ -72,14 +84,17 @@ const searchFormEmits: VxeFormListeners<PatientQuery> = {
|
|
|
const gridRef = ref<VxeGridInstance<PatientReportModel>>();
|
|
const gridRef = ref<VxeGridInstance<PatientReportModel>>();
|
|
|
const gridOptions = reactive<VxeGridProps<PatientReportModel>>({
|
|
const gridOptions = reactive<VxeGridProps<PatientReportModel>>({
|
|
|
id: 'patient-history-list',
|
|
id: 'patient-history-list',
|
|
|
- border: true,
|
|
|
|
|
|
|
+ border: false,
|
|
|
showOverflow: true,
|
|
showOverflow: true,
|
|
|
- height: 'auto', autoResize: false, syncResize: true,
|
|
|
|
|
|
|
+ height: 'auto',
|
|
|
|
|
+ autoResize: false,
|
|
|
|
|
+ syncResize: true,
|
|
|
scrollY: { enabled: true, gt: 0 },
|
|
scrollY: { enabled: true, gt: 0 },
|
|
|
toolbarConfig: {
|
|
toolbarConfig: {
|
|
|
custom: true,
|
|
custom: true,
|
|
|
zoom: true,
|
|
zoom: true,
|
|
|
slots: {
|
|
slots: {
|
|
|
|
|
+ buttons: 'toolbar-buttons',
|
|
|
tools: 'toolbar-extra',
|
|
tools: 'toolbar-extra',
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -93,9 +108,9 @@ const gridOptions = reactive<VxeGridProps<PatientReportModel>>({
|
|
|
{ type: 'seq', width: 70, fixed: 'left' },
|
|
{ type: 'seq', width: 70, fixed: 'left' },
|
|
|
{ field: 'name', title: '姓名', minWidth: 80 },
|
|
{ field: 'name', title: '姓名', minWidth: 80 },
|
|
|
{ field: 'gender', title: '性别', minWidth: 40, formatter: 'gender' },
|
|
{ field: 'gender', title: '性别', minWidth: 40, formatter: 'gender' },
|
|
|
- { field: 'age', title: '年龄', minWidth: 40, formatter: ({ cellValue }) => cellValue ? `${ cellValue }岁` : '' },
|
|
|
|
|
|
|
+ { field: 'age', title: '年龄', minWidth: 40, formatter: ({ cellValue }) => (cellValue ? `${cellValue}岁` : '') },
|
|
|
|
|
+ { field: 'diagnosis', title: '诊断', minWidth: 40 },
|
|
|
{ field: 'tags', title: '标签' },
|
|
{ field: 'tags', title: '标签' },
|
|
|
- { field: 'report.time', title: '最近一次健康分析时间' },
|
|
|
|
|
{ field: 'createTime', title: '创建时间' },
|
|
{ field: 'createTime', title: '创建时间' },
|
|
|
{
|
|
{
|
|
|
title: '操作',
|
|
title: '操作',
|
|
@@ -107,14 +122,20 @@ const gridOptions = reactive<VxeGridProps<PatientReportModel>>({
|
|
|
mode: 'text',
|
|
mode: 'text',
|
|
|
},
|
|
},
|
|
|
options: [
|
|
options: [
|
|
|
- { content: '健康档案', status: 'primary', name: 'previewPatientHistoryRecord' },
|
|
|
|
|
- { content: '充值', status: 'warning', name: 'resetPatientAnalysisCount' },
|
|
|
|
|
|
|
+ { content: '查看', status: 'primary', name: 'previewPatientHistoryRecord' },
|
|
|
|
|
+ { content: '充值', status: 'primary', name: 'resetPatientAnalysisCount' },
|
|
|
|
|
+ { content: '标签', status: 'primary', name: 'editPatientTags' },
|
|
|
],
|
|
],
|
|
|
events: {
|
|
events: {
|
|
|
click({ row, rowIndex }, { name }) {
|
|
click({ row, rowIndex }, { name }) {
|
|
|
let method;
|
|
let method;
|
|
|
- if ( name === 'previewPatientHistoryRecord' ) { method = openHistoryPreviewHandle; }
|
|
|
|
|
- else if ( name === 'resetPatientAnalysisCount' ) { method = openPatientAnalysisCountResetHandle; }
|
|
|
|
|
|
|
+ if (name === 'previewPatientHistoryRecord') {
|
|
|
|
|
+ method = openHistoryPreviewHandle;
|
|
|
|
|
+ } else if (name === 'resetPatientAnalysisCount') {
|
|
|
|
|
+ method = openPatientAnalysisCountResetHandle;
|
|
|
|
|
+ } else if (name === 'editPatientTags') {
|
|
|
|
|
+ method = openPatientTagsEditHandle;
|
|
|
|
|
+ }
|
|
|
method?.(row, rowIndex);
|
|
method?.(row, rowIndex);
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -155,8 +176,8 @@ function openHistoryPreviewHandle({ report, ...patient }: PatientReportModel, in
|
|
|
width: window.innerWidth - 256,
|
|
width: window.innerWidth - 256,
|
|
|
slots: {
|
|
slots: {
|
|
|
default() {
|
|
default() {
|
|
|
- return h(ReportHistoryPreview, {
|
|
|
|
|
- patient, report, onDestroy,
|
|
|
|
|
|
|
+ return h(PatientHealthRecordPreview, {
|
|
|
|
|
+ patient, report, onDestroy, onRefresh() { refresh(page.value); }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -182,7 +203,50 @@ function openPatientAnalysisCountResetHandle({ report, ...patient }: PatientRepo
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function openPatientTagsEditHandle({ report, ...patient }: PatientReportModel) {
|
|
|
|
|
+ const id = `modal:patient-tags:edit`;
|
|
|
|
|
+ const onDestroy = (tags?: PatientTagVO[]) => {
|
|
|
|
|
+ if (tags) refresh(page.value);
|
|
|
|
|
+ VxeUI.modal.close(id);
|
|
|
|
|
+ };
|
|
|
|
|
+ onDestroy();
|
|
|
|
|
+ VxeUI.modal.open({
|
|
|
|
|
+ id,
|
|
|
|
|
+ title: `${patient.name} 标签`,
|
|
|
|
|
+ maskClosable: true,
|
|
|
|
|
+ escClosable: true,
|
|
|
|
|
+ slots: {
|
|
|
|
|
+ default() {
|
|
|
|
|
+ return h(PatientTagEdit, {
|
|
|
|
|
+ id: patient.id,
|
|
|
|
|
+ onDestroy,
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function openPatientEditHandle() {
|
|
|
|
|
+ const id = `modal:patient-info-handle:edit`;
|
|
|
|
|
+ const onDestroy = (_refresh?: boolean) => {
|
|
|
|
|
+ VxeUI.modal.close(id);
|
|
|
|
|
+ if (_refresh) refresh(1);
|
|
|
|
|
+ };
|
|
|
|
|
+ onDestroy();
|
|
|
|
|
+ VxeUI.modal.open({
|
|
|
|
|
+ id,
|
|
|
|
|
+ title: `新增患者`,
|
|
|
|
|
+ maskClosable: true,
|
|
|
|
|
+ escClosable: true,
|
|
|
|
|
+ slots: {
|
|
|
|
|
+ default() {
|
|
|
|
|
+ return h(PatientEdit, { onDestroy });
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
<template>
|
|
<template>
|
|
@@ -192,6 +256,9 @@ function openPatientAnalysisCountResetHandle({ report, ...patient }: PatientRepo
|
|
|
</header>
|
|
</header>
|
|
|
<main class="flex-auto overflow-hidden">
|
|
<main class="flex-auto overflow-hidden">
|
|
|
<vxe-grid ref="gridRef" v-bind="gridOptions" v-on="gridEvents" :loading="loading">
|
|
<vxe-grid ref="gridRef" v-bind="gridOptions" v-on="gridEvents" :loading="loading">
|
|
|
|
|
+ <template #toolbar-buttons>
|
|
|
|
|
+ <vxe-button status="primary" @click="openPatientEditHandle()">新增</vxe-button>
|
|
|
|
|
+ </template>
|
|
|
<template #toolbar-extra>
|
|
<template #toolbar-extra>
|
|
|
<vxe-button style="margin-right: 12px;" icon="vxe-icon-repeat" circle @click="refresh(page)"></vxe-button>
|
|
<vxe-button style="margin-right: 12px;" icon="vxe-icon-repeat" circle @click="refresh(page)"></vxe-button>
|
|
|
</template>
|
|
</template>
|