|
|
@@ -0,0 +1,238 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- 搜索栏 -->
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
|
|
|
+ <el-form-item label="患者姓名" prop="patientName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.patientName"
|
|
|
+ placeholder="请输入患者姓名"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="电话" prop="phone">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.phone"
|
|
|
+ placeholder="请输入电话"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接诊医生" prop="receptionDoctor">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.receptionDoctor"
|
|
|
+ placeholder="请输入接诊医生"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接诊时间">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="dateRange"
|
|
|
+ size="small"
|
|
|
+ style="width: 240px"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :default-time="['00:00:00', '23:59:59']"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- 工具栏(仅保留搜索开关) -->
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ @click="showSearch = !showSearch"
|
|
|
+ >搜索</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 患者列表表格 -->
|
|
|
+ <el-table v-loading="loading" :data="patientList">
|
|
|
+ <el-table-column label="患者姓名" align="center" prop="patientName" />
|
|
|
+ <el-table-column label="性别" align="center" prop="sex" :formatter="sexFormat" />
|
|
|
+ <el-table-column label="年龄" align="center" prop="age" />
|
|
|
+ <el-table-column label="电话" align="center" prop="phone" />
|
|
|
+ <el-table-column label="接诊时间" align="center" prop="receptionTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ parseTime(scope.row.receptionTime) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="接诊医生" align="center" prop="receptionDoctor" />
|
|
|
+ <el-table-column label="所在市" align="center" prop="city" />
|
|
|
+ <el-table-column label="诊断" align="center" prop="diagnosis" show-overflow-tooltip />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-view"
|
|
|
+ @click="handleView(scope.row)"
|
|
|
+ >查看详情</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 分页组件 -->
|
|
|
+ <pagination
|
|
|
+ v-show="total > 0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 查看详情弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ title="患者详情"
|
|
|
+ :visible.sync="detailOpen"
|
|
|
+ width="800px"
|
|
|
+ append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <div v-if="detailData">
|
|
|
+ <el-descriptions :column="2" border>
|
|
|
+ <el-descriptions-item label="患者姓名">{{ detailData.patientName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="性别">{{ sexFormat(detailData) }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="年龄">{{ detailData.age }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="电话">{{ detailData.phone }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="接诊时间">{{ parseTime(detailData.receptionTime) }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="接诊医生">{{ detailData.receptionDoctor }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="所在市">{{ detailData.city }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="诊断">{{ detailData.diagnosis }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="现病史" :span="2">{{ detailData.presentIllness }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="既往史" :span="2">{{ detailData.pastHistory }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="过敏史" :span="2">{{ detailData.allergyHistory }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="证型">{{ detailData.syndromeType }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="证型调理" :span="2">{{ detailData.syndromeRegulation }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="诊疗意见" :span="2">{{ detailData.treatmentOpinion }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="注意禁忌" :span="2">{{ detailData.precautions }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="医师签名">
|
|
|
+ <img
|
|
|
+ v-if="detailData.doctorSignature"
|
|
|
+ :src="detailData.doctorSignature"
|
|
|
+ style="max-height: 40px;"
|
|
|
+ />
|
|
|
+ <span v-else>暂无</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="执业证编号">{{ detailData.practiceCertificateNo }}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="detailOpen = false">关 闭</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { doctorPatientList, getDoctorPatientInfo } from '@/api/qw/patientInfo'
|
|
|
+import { parseTime } from '@/utils/common'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'DoctorPatientList',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ showSearch: true,
|
|
|
+ total: 0,
|
|
|
+ patientList: [],
|
|
|
+ dateRange: [],
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ patientName: null,
|
|
|
+ phone: null,
|
|
|
+ receptionDoctor: null
|
|
|
+ },
|
|
|
+ detailOpen: false,
|
|
|
+ detailData: null,
|
|
|
+ sexOptions: [
|
|
|
+ { label: '女', value: '0' },
|
|
|
+ { label: '男', value: '1' },
|
|
|
+ { label: '未知', value: '2' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ parseTime,
|
|
|
+ sexFormat(row) {
|
|
|
+ return this.sexOptions.find(o => o.value === row.sex)?.label ?? row.sex
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 查询分页列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true
|
|
|
+ const params = this.addDateRange(this.queryParams, this.dateRange)
|
|
|
+
|
|
|
+ doctorPatientList(params)
|
|
|
+ .then(res => {
|
|
|
+ // 关键修正:后端返回的是 TableDataInfo,字段为 rows 和 total
|
|
|
+ // res 结构:{ code:200, msg:"查询成功", rows:[...], total:1, ... }
|
|
|
+ this.patientList = res.rows || []
|
|
|
+ this.total = res.total || 0
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+
|
|
|
+ resetQuery() {
|
|
|
+ this.dateRange = []
|
|
|
+ if (this.$refs.queryForm) {
|
|
|
+ this.$refs.queryForm.resetFields()
|
|
|
+ }
|
|
|
+ this.handleQuery()
|
|
|
+ },
|
|
|
+
|
|
|
+ handleView(row) {
|
|
|
+ getDoctorPatientInfo(row.id)
|
|
|
+ .then(res => {
|
|
|
+ // 假设详情接口返回 AjaxResult.success(对象),res 是AjaxResult对象,data字段装载具体信息
|
|
|
+ this.detailData = res.data
|
|
|
+ this.detailOpen = true
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message.error('获取患者详情失败')
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ addDateRange(params, dateRange) {
|
|
|
+ if (dateRange && dateRange.length === 2) {
|
|
|
+ params.beginTime = dateRange[0]
|
|
|
+ params.endTime = dateRange[1]
|
|
|
+ }
|
|
|
+ return params
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.mb8 {
|
|
|
+ margin-bottom: 8px;
|
|
|
+}
|
|
|
+</style>
|