index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <div class="box">
  3. <div class="box_wrapper">
  4. <div class="title">门诊病历搜索</div>
  5. <!-- 搜索部分 -->
  6. <el-form ref="form" :model="form" class="search_wrapper">
  7. <el-form-item label="" style="textAlign: center;">
  8. <el-input v-model="form.keyword" placeholder="请输入关键词" clearable style="width: 480px;"></el-input>
  9. </el-form-item>
  10. <el-form-item label="患者年龄">
  11. <el-input-number
  12. v-model="form.start_nl"
  13. :min="1"
  14. :step="1"
  15. :controls="false"
  16. placeholder="起始年龄"
  17. style="width: 220px"
  18. ></el-input-number>
  19. <span class="pind5" />
  20. <span class="pind5" />
  21. <el-input-number
  22. v-model="form.end_nl"
  23. :min="1"
  24. :step="1"
  25. :controls="false"
  26. placeholder="终止年龄"
  27. style="width: 220px"
  28. >
  29. </el-input-number>
  30. </el-form-item>
  31. <el-form-item label="就诊时间">
  32. <el-date-picker
  33. v-model="form.start_time"
  34. type="date"
  35. :picker-options="pickerOptions1"
  36. placeholder="开始日期"
  37. />
  38. <span class="pind5" />
  39. <span class="pind5" />
  40. <el-date-picker
  41. v-model="form.end_time"
  42. type="date"
  43. :picker-options="pickerOptions2"
  44. placeholder="结束日期"
  45. />
  46. </el-form-item>
  47. <el-form-item label="" style="text-align: center;">
  48. <el-button type="primary" style="width: 360px;" @click="onSearch">检索</el-button>
  49. </el-form-item>
  50. </el-form>
  51. <!-- 列表部分 -->
  52. <div class="table_wrapper">
  53. <div class="table_header">
  54. <Title :title="'检索结果'" style="float: left; margin-right: 15px;" />
  55. <span>例数:<span class="total"> {{ paginationData.total }} </span>例</span>
  56. <el-button-group style="float: right; margin-top: -15px;">
  57. <el-button :type="active? 'primary' : ''" @click="onTab(1)">列表</el-button>
  58. <el-button :type="!active? 'primary' : ''" @click="onTab(0)">详情</el-button>
  59. </el-button-group>
  60. </div>
  61. <div class="table_box">
  62. <el-table
  63. v-if="active"
  64. :data="tableData"
  65. style="width: 100%">
  66. <el-table-column
  67. type="index"
  68. label="序号"
  69. width="80"
  70. align="center">
  71. </el-table-column>
  72. <el-table-column
  73. prop="mzh"
  74. label="门诊号">
  75. </el-table-column>
  76. <el-table-column
  77. prop="nl"
  78. label="年龄">
  79. </el-table-column>
  80. <el-table-column
  81. prop="xb"
  82. label="性别">
  83. </el-table-column>
  84. <el-table-column
  85. prop="ks"
  86. label="科室">
  87. </el-table-column>
  88. <el-table-column
  89. prop="CJSJ"
  90. label="就诊时间">
  91. </el-table-column>
  92. </el-table>
  93. <div v-if="!active">
  94. <InfoCard v-for="(item, index) of infoData" :key="index" :item="item" />
  95. <el-empty v-if="!infoData.length" description="暂无数据"></el-empty>
  96. </div>
  97. <!-- 分页 -->
  98. <el-pagination
  99. v-if="tableData && tableData.length !== 0"
  100. @size-change="SizeChangeEvent"
  101. @current-change="pageHasChanged"
  102. :total="paginationData.total"
  103. background
  104. class="table-pagination"
  105. style="margin: 30px 0 ; float: right;"
  106. :page-size="paginationData.pageSize"
  107. :current-page.sync="paginationData.currentPage"
  108. layout="total, sizes, prev, pager, next, jumper"
  109. >
  110. </el-pagination>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </template>
  116. <script>
  117. import Title from '@/components/Title';
  118. import InfoCard from './components/InfoCard'
  119. import { dateFormat } from '@/utils/index'
  120. export default {
  121. components: {
  122. Title,
  123. InfoCard
  124. },
  125. data() {
  126. return {
  127. pickerOptions1: {
  128. disabledDate: (time) => {
  129. if (this.form.end_time) {
  130. return time.getTime() > new Date(this.form.end_time).getTime()
  131. } else {
  132. return time.getTime() > Date.now()
  133. }
  134. }
  135. },
  136. pickerOptions2: {
  137. disabledDate: (time) => {
  138. if (this.form.start_time) {
  139. return time.getTime() < new Date(this.form.start_time).getTime()
  140. } else {
  141. return time.getTime() > Date.now()
  142. }
  143. }
  144. },
  145. form: {
  146. keyword: '',
  147. start_nl: undefined,
  148. end_nl: undefined,
  149. start_time: '',
  150. end_time: ''
  151. },
  152. // 1:列表 0:详情
  153. active: 1,
  154. tableData: [],
  155. infoData: [],
  156. paginationData: {
  157. total: 0,
  158. currentPage: 1,
  159. pageSize: 10,
  160. },
  161. }
  162. },
  163. created() {
  164. this.getList()
  165. },
  166. methods: {
  167. // 获取列表
  168. getList() {
  169. const { currentPage, pageSize } = this.paginationData
  170. const { start_nl, end_nl, start_time, end_time, keyword } = this.form
  171. const params = {
  172. keyword,
  173. start_nl,
  174. end_nl,
  175. start_time: start_time ? dateFormat(start_time, 'YYYYMMDD') : '',
  176. end_time: end_time ? dateFormat(end_time, 'YYYYMMDD') : '',
  177. page: currentPage,
  178. page_size: pageSize
  179. }
  180. this.$axios.post('/get_omr_bl01_list', params).then(res => {
  181. this.tableData = res.data.data.list
  182. this.infoData = res.data.data.detail
  183. this.paginationData.total = res.data.data.total
  184. })
  185. },
  186. // 列表 详情
  187. onTab(index) {
  188. this.active = index
  189. },
  190. // 分页
  191. SizeChangeEvent(val) {
  192. this.paginationData.pageSize = val;
  193. this.getList();
  194. },
  195. pageHasChanged() {
  196. this.getList();
  197. },
  198. // 搜索
  199. onSearch() {
  200. this.paginationData.currentPage = 1;
  201. this.getList();
  202. }
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .pind5 {
  208. padding: 0 5px;
  209. }
  210. .box {
  211. padding: 16px;
  212. .box_wrapper {
  213. padding: 16px;
  214. background: #fff;
  215. border-radius: 5px;
  216. overflow: hidden;
  217. .title {
  218. font-size: 24px;
  219. text-align: center;
  220. font-weight: 600;
  221. padding-top: 40px;
  222. padding-bottom: 20px;
  223. }
  224. }
  225. .search_wrapper {
  226. width: 616px;
  227. margin: 0 auto 30px;
  228. }
  229. .table_wrapper {
  230. .table_header {
  231. padding-top: 15px;
  232. overflow: hidden;
  233. .total {
  234. color: #F56C6C;
  235. }
  236. span {
  237. font-weight: 600;
  238. padding-top: 2px;
  239. }
  240. }
  241. }
  242. }
  243. ::v-deep .el-input-number .el-input__inner {
  244. text-align: left;
  245. }
  246. ::v-deep.el-table .el-table__header tr th {
  247. background: #f1f6ff;
  248. color: #13171e;
  249. border-bottom: 0px;
  250. }
  251. ::v-deep.el-table .el-table__row td {
  252. color: #7e8bab;
  253. border-bottom: 1px solid #f4f4f4;
  254. }
  255. ::v-deep.el-table .el-table__header tr th:first-child {
  256. border-radius: 5px 0px 0px 5px;
  257. }
  258. ::v-deep.el-table .el-table__header tr th:nth-child(3) {
  259. border-radius: 0px 5px 5px 0px;
  260. }
  261. </style>