yeg
2026-09-18 70ea0911ce7519ca802266078624e9fed3559a2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
import { Download, Refresh, Search } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { getServiceApplications } from '../api/admin'
import type { ServiceApplication } from '../types/admin'
import { TALENT_CARD_LEVELS } from '../utils/cardLevels'
import { downloadExcel } from '../utils/excel'
 
const loading = ref(false)
const router = useRouter()
const rows = ref<ServiceApplication[]>([])
 
const cardLevels = TALENT_CARD_LEVELS
const statusOptions = ['待处理', '已处理', '已取消']
 
const filters = reactive({
  talentKeyword: '',
  hospitalName: '',
  cardLevel: '',
  status: '',
  submittedTime: [] as string[],
})
 
const pagination = reactive({
  page: 1,
  size: 10,
  total: 0,
})
 
async function loadData() {
  loading.value = true
  try {
    const result = await getServiceApplications({
      page: pagination.page,
      size: pagination.size,
      applicationType: 'MEDICAL_APPLICATION',
      talentKeyword: filters.talentKeyword || undefined,
      hospitalName: filters.hospitalName || undefined,
      cardLevel: filters.cardLevel || undefined,
      status: filters.status || undefined,
      submittedStart: filters.submittedTime?.[0],
      submittedEnd: filters.submittedTime?.[1],
    })
    rows.value = result.records
    pagination.total = result.total
  } catch {
    rows.value = []
    pagination.total = 0
  } finally {
    loading.value = false
  }
}
 
function search() {
  pagination.page = 1
  loadData()
}
 
// 后端返回 ISO 时间(2026-09-01T11:29:35),列表统一显示成 "2026-09-01 11:29:35"。
function formatDateTime(value?: string) {
  return typeof value === 'string' && value ? value.replace('T', ' ').slice(0, 19) : ''
}
 
function resetFilters() {
  filters.talentKeyword = ''
  filters.hospitalName = ''
  filters.cardLevel = ''
  filters.status = ''
  filters.submittedTime = []
  pagination.page = 1
  search()
}
 
async function download() {
  const result = await getServiceApplications({ page: 1, size: 1000, applicationType: 'MEDICAL_APPLICATION', talentKeyword: filters.talentKeyword || undefined, hospitalName: filters.hospitalName || undefined, cardLevel: filters.cardLevel || undefined, status: filters.status || undefined, submittedStart: filters.submittedTime?.[0], submittedEnd: filters.submittedTime?.[1] })
  downloadExcel('就医申请', [{ title: '申请单号', value: row => row.applicationNo }, { title: '持卡人', value: row => row.talentName }, { title: '手机号', value: row => row.talentMobile }, { title: '人才等级', value: row => row.talentLevel }, { title: '医院', value: row => row.hospitalName }, { title: '申请项目', value: row => row.productName || row.packageName }, { title: '提交时间', value: row => row.submittedAt }, { title: '状态', value: row => row.status }, { title: '处理人', value: row => row.handlerName }], result.records)
  ElMessage.success(`已导出 ${result.records.length} 条申请`)
}
 
function viewDetail(row: ServiceApplication) {
  router.push(`/medical-applications/${row.id}`)
}
 
onMounted(loadData)
</script>
 
<template>
  <div class="page-stack prototype-page medical-application-page">
    <section class="panel">
      <div class="panel-header">
        <h3>查询表格</h3>
      </div>
 
      <el-form class="medical-reservation-filter-form" :model="filters" label-width="72px">
        <el-form-item label="持卡人">
          <el-input v-model="filters.talentKeyword" placeholder="持卡人姓名、手机号、卡号" clearable />
        </el-form-item>
        <el-form-item label="医院名称">
          <el-input v-model="filters.hospitalName" placeholder="请输入医院名称" clearable />
        </el-form-item>
        <el-form-item label="卡片等级">
          <el-select v-model="filters.cardLevel" placeholder="全部" clearable>
            <el-option label="全部" value="" />
            <el-option v-for="level in cardLevels" :key="level" :label="level" :value="level" />
          </el-select>
        </el-form-item>
        <el-form-item label="提交时间">
          <el-date-picker
            v-model="filters.submittedTime"
            type="daterange"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            range-separator="至"
            value-format="YYYY-MM-DD"
          />
        </el-form-item>
        <el-form-item label="状态">
          <el-select v-model="filters.status" placeholder="全部" clearable>
            <el-option label="全部" value="" />
            <el-option v-for="status in statusOptions" :key="status" :label="status" :value="status" />
          </el-select>
        </el-form-item>
        <div class="medical-reservation-filter-actions">
          <el-button type="primary" :icon="Search" @click="search">查询</el-button>
          <el-button :icon="Refresh" @click="resetFilters">重置</el-button>
        </div>
      </el-form>
 
      <div class="medical-reservation-table-tools">
        <el-button v-permission="'admin.medical-applications.export'" :icon="Download" @click="download">下载</el-button>
      </div>
 
      <el-table
        v-loading="loading"
        :data="rows"
        border
        class="medical-reservation-table"
        empty-text="暂无就医申请数据"
      >
        <el-table-column prop="applicationNo" label="申请单号" min-width="96" align="center" />
        <el-table-column prop="talentName" label="持卡人名称" min-width="100" align="center" />
        <el-table-column prop="talentMobile" label="持卡人电话" min-width="118" align="center" />
        <el-table-column prop="talentLevel" label="人才等级" min-width="102" align="center" />
        <el-table-column prop="hospitalName" label="医院名称" min-width="96" align="center" />
        <el-table-column prop="applicantName" label="就医人姓名" min-width="96" align="center" />
        <el-table-column prop="applicantMobile" label="手机号" min-width="112" align="center" />
        <el-table-column prop="expectedTime" label="就医期望时间" min-width="118" align="center">
          <template #default="{ row }">{{ formatDateTime(row.expectedTime) }}</template>
        </el-table-column>
        <el-table-column prop="submittedAt" label="提交时间" min-width="126" align="center">
          <template #default="{ row }">{{ formatDateTime(row.submittedAt) }}</template>
        </el-table-column>
        <el-table-column prop="status" label="状态" min-width="82" align="center" />
        <el-table-column label="操作" width="86" fixed="right" align="center">
          <template #default="{ row }">
            <el-button link type="primary" @click="viewDetail(row)">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
 
      <div class="pagination-row">
        <el-pagination
          v-model:current-page="pagination.page"
          v-model:page-size="pagination.size"
          background
          layout="total, sizes, prev, pager, next"
          :page-sizes="[10, 20, 50]"
          :pager-count="5"
          :total="pagination.total"
          @change="loadData"
        />
      </div>
    </section>
  </div>
</template>