index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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" label-width="100px">
  7. <el-form-item label="" v-for="(item, index) of form.field" :key="index">
  8. <!-- 关系 -->
  9. <el-select
  10. v-if="index != 0"
  11. v-model="item.select_type"
  12. filterable
  13. placeholder=""
  14. :disabled="item.lock"
  15. style="width: 90px; position: absolute; left: -100px;"
  16. >
  17. <el-option label="且" :value="0" />
  18. <el-option label="或者" :value="1" />
  19. <el-option label="不包含" :value="2" />
  20. </el-select>
  21. <!-- 检索字段 -->
  22. <el-select
  23. v-model="item.key"
  24. filterable
  25. placeholder="请选择"
  26. :disabled="item.lock"
  27. style="margin-right: 10px; width: 237px;"
  28. >
  29. <el-option
  30. v-for="(fitem, findex) in fieldList"
  31. :key="findex"
  32. :label="fitem.value"
  33. :value="fitem.key"
  34. :disabled="item.lock"
  35. />
  36. </el-select>
  37. <!-- 检索内容 -->
  38. <el-select v-if="item.key === 'ks'" v-model="item.value" filterable clearable placeholder="请选择" style="width: 237px;">
  39. <el-option v-for="(item, index) in departmentList" :label="item.name" :value="item.id" :key="index"></el-option>
  40. </el-select>
  41. <el-input v-else v-model="item.value" :disabled="item.lock" placeholder="请输入" style="width: 237px;" />
  42. <span class="btn-group" :class="{'btn-group1': form.field.length !== 1 && index == form.field.length - 1, 'btn-group2': index != form.field.length - 1 && searchNum, 'btn-group3': index == form.field.length - 1 && searchNum }">
  43. <el-button
  44. v-if="index != 0 && !item.lock"
  45. :disabled="form.field.length == 1"
  46. type="primary"
  47. icon="el-icon-minus"
  48. @click="funDel(index)"
  49. />
  50. <el-button
  51. v-if="index == form.field.length - 1"
  52. type="primary"
  53. icon="el-icon-plus"
  54. @click="funAdd"
  55. />
  56. <el-button v-if="index === form.field.length - 1 && searchNum" @click="onLockResult">结果中检索</el-button>
  57. </span>
  58. </el-form-item>
  59. <el-form-item label="患者年龄">
  60. <el-input-number
  61. v-model="form.start_nl"
  62. :min="1"
  63. :step="1"
  64. :controls="false"
  65. placeholder="起始年龄"
  66. style="width: 220px"
  67. ></el-input-number>
  68. <span class="pind5" />
  69. <span class="pind5" />
  70. <el-input-number
  71. v-model="form.end_nl"
  72. :min="1"
  73. :step="1"
  74. :controls="false"
  75. placeholder="终止年龄"
  76. style="width: 220px"
  77. >
  78. </el-input-number>
  79. </el-form-item>
  80. <el-form-item label="就诊时间">
  81. <el-date-picker
  82. v-model="form.start_time"
  83. type="date"
  84. :picker-options="pickerOptions1"
  85. placeholder="开始日期"
  86. />
  87. <span class="pind5" />
  88. <span class="pind5" />
  89. <el-date-picker
  90. v-model="form.end_time"
  91. type="date"
  92. :picker-options="pickerOptions2"
  93. placeholder="结束日期"
  94. />
  95. </el-form-item>
  96. <el-form-item label="" style="text-align: center;">
  97. <el-button type="primary" style="width: 360px;" @click="onSearch(0)">检索</el-button>
  98. <el-button @click="onReset" style="position: absolute; right: -90px;">重置</el-button>
  99. </el-form-item>
  100. </el-form>
  101. <!-- 列表部分 -->
  102. <div class="table_wrapper">
  103. <div class="table_header">
  104. <Title :title="'检索结果'" style="float: left; margin-right: 15px;" />
  105. <span>例数:<span class="total"> {{ paginationData.total }} </span>例</span>
  106. <el-button-group style="float: right; margin-top: -15px;">
  107. <el-button :type="active? 'primary' : ''" @click="onTab(1)">列表</el-button>
  108. <el-button :type="!active? 'primary' : ''" @click="onTab(0)">详情</el-button>
  109. </el-button-group>
  110. </div>
  111. <div class="table_box">
  112. <el-table
  113. v-if="active"
  114. :data="tableData"
  115. style="width: 100%">
  116. <el-table-column
  117. type="index"
  118. label="序号"
  119. width="80"
  120. align="center">
  121. </el-table-column>
  122. <el-table-column prop="" label="门诊号">
  123. <template slot-scope="scope">
  124. <span class="blue" @click="funGoto(scope.row.BLBH)">
  125. {{ scope.row.mzh }}
  126. </span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column
  130. prop="xm"
  131. label="姓名">
  132. </el-table-column>
  133. <el-table-column
  134. prop="nl"
  135. label="年龄">
  136. </el-table-column>
  137. <el-table-column
  138. prop="xb"
  139. label="性别">
  140. </el-table-column>
  141. <el-table-column
  142. prop="ks"
  143. label="科室">
  144. </el-table-column>
  145. <el-table-column
  146. prop="SFZH"
  147. label="身份证号">
  148. </el-table-column>
  149. <el-table-column
  150. prop="CJSJ"
  151. label="就诊时间">
  152. </el-table-column>
  153. </el-table>
  154. <div v-if="!active">
  155. <InfoCard v-for="(item, index) of infoData" :key="index" :item="item" :index="index" />
  156. <el-empty v-if="!infoData.length" description="暂无数据"></el-empty>
  157. </div>
  158. <!-- 分页 -->
  159. <el-pagination
  160. v-if="tableData && tableData.length !== 0"
  161. @size-change="SizeChangeEvent"
  162. @current-change="pageHasChanged"
  163. :total="paginationData.total"
  164. background
  165. class="table-pagination"
  166. style="margin: 30px 0 ; float: right;"
  167. :page-size="paginationData.pageSize"
  168. :current-page.sync="paginationData.currentPage"
  169. layout="total, sizes, prev, pager, next, jumper"
  170. >
  171. </el-pagination>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </template>
  177. <script>
  178. import Title from '@/components/Title';
  179. import InfoCard from './components/InfoCard'
  180. import { dateFormat } from '@/utils/index'
  181. export default {
  182. components: {
  183. Title,
  184. InfoCard
  185. },
  186. data() {
  187. return {
  188. pickerOptions1: {
  189. disabledDate: (time) => {
  190. if (this.form.end_time) {
  191. return time.getTime() > new Date(this.form.end_time).getTime()
  192. } else {
  193. return time.getTime() > Date.now()
  194. }
  195. }
  196. },
  197. pickerOptions2: {
  198. disabledDate: (time) => {
  199. if (this.form.start_time) {
  200. return time.getTime() < new Date(this.form.start_time).getTime()
  201. } else {
  202. return time.getTime() > Date.now()
  203. }
  204. }
  205. },
  206. fieldList: [],
  207. form: {
  208. start_nl: undefined,
  209. end_nl: undefined,
  210. start_time: '',
  211. end_time: '',
  212. field: [
  213. {
  214. select_type: '',
  215. key: 'BLNR_TXT',
  216. value: '',
  217. lock: false
  218. }
  219. ]
  220. },
  221. // 1:列表 0:详情
  222. active: 1,
  223. tableData: [],
  224. infoData: [],
  225. paginationData: {
  226. total: 0,
  227. currentPage: 1,
  228. pageSize: 10,
  229. },
  230. resultSearch: 0,
  231. searchNum: 0,
  232. departmentList: []
  233. }
  234. },
  235. created() {
  236. this.selectInfo()
  237. this.getList(0)
  238. },
  239. methods: {
  240. funGoto(blbh) {
  241. this.$router.push({ path: '/outpatientMedicalRecordDetail', query: { blbh, from: 'search' } })
  242. },
  243. selectInfo() {
  244. this.$axios.post('/get_omr_department_list').then(res => {
  245. this.departmentList = res.data;
  246. });
  247. this.$axios.post('/omr_zk/serach_type_list').then(res => {
  248. this.fieldList = res.data;
  249. });
  250. },
  251. // 获取列表
  252. getList(index) {
  253. this.searchNum = index
  254. const { currentPage, pageSize } = this.paginationData
  255. const { start_nl, end_nl, start_time, end_time, field } = this.form
  256. const params = {
  257. start_nl,
  258. end_nl,
  259. start_time: start_time ? dateFormat(start_time, 'YYYYMMDD') : '',
  260. end_time: end_time ? dateFormat(end_time, 'YYYYMMDD') : '',
  261. page: currentPage,
  262. page_size: pageSize,
  263. }
  264. if (this.$route.query.code) {
  265. params.user_code = this.$route.query.code
  266. }
  267. if (field[0].key) {
  268. params.field = field
  269. }
  270. this.$axios.post('/get_omr_bl01_list', params).then(res => {
  271. this.tableData = res.data.list
  272. this.infoData = res.data.detail
  273. this.paginationData.total = res.data.total
  274. })
  275. },
  276. // 列表 详情
  277. onTab(index) {
  278. this.active = index
  279. },
  280. // 分页
  281. SizeChangeEvent(val) {
  282. this.paginationData.pageSize = val;
  283. this.getList(this.resultSearch);
  284. },
  285. pageHasChanged() {
  286. this.getList(this.resultSearch);
  287. },
  288. // 搜索
  289. onSearch() {
  290. this.paginationData.currentPage = 1;
  291. this.getList(1);
  292. },
  293. // 重置
  294. onReset() {
  295. this.$set(this, 'form', {
  296. start_nl: undefined,
  297. end_nl: undefined,
  298. start_time: '',
  299. end_time: '',
  300. field: [
  301. {
  302. select_type: '',
  303. key: 'BLNR_TXT',
  304. value: '',
  305. lock: false
  306. }
  307. ]}
  308. )
  309. this.resultSearch = 0,
  310. this.searchNum = 0
  311. this.paginationData.currentPage = 1;
  312. this.getList(0);
  313. },
  314. funDel(i) {
  315. const index = i;
  316. if (index == 0) {
  317. return;
  318. }
  319. const list = this.form.field;
  320. list.splice(index, 1);
  321. this.form.field = list;
  322. },
  323. funAdd() {
  324. this.form.field.push({
  325. key: '',
  326. select_type: 0,
  327. value: '',
  328. lock: false
  329. });
  330. },
  331. onLockResult() {
  332. this.resultSearch = 1
  333. this.form.field.map(item => {
  334. if (!!item.key && !!item.value) {
  335. item.lock = true
  336. } else {
  337. item.lock = false
  338. }
  339. })
  340. this.funAdd()
  341. },
  342. }
  343. }
  344. </script>
  345. <style lang="scss" scoped>
  346. .blue {
  347. color: #185da6;
  348. cursor: pointer;
  349. }
  350. .pind5 {
  351. padding: 0 5px;
  352. }
  353. .btn-group {
  354. position: absolute;
  355. right: -78px;
  356. &.btn-group1 {
  357. right: -144px;
  358. }
  359. &.btn-group2 {
  360. right: -78px;
  361. }
  362. &.btn-group3 {
  363. right: -264px;
  364. }
  365. }
  366. .box {
  367. padding: 16px;
  368. .box_wrapper {
  369. padding: 16px;
  370. background: #fff;
  371. border-radius: 5px;
  372. overflow: hidden;
  373. .title {
  374. font-size: 24px;
  375. text-align: center;
  376. font-weight: 600;
  377. padding-top: 20px;
  378. padding-bottom: 20px;
  379. }
  380. }
  381. .search_wrapper {
  382. width: 584px;
  383. margin: 0 auto 30px;
  384. }
  385. .table_wrapper {
  386. .table_header {
  387. padding-top: 15px;
  388. overflow: hidden;
  389. .total {
  390. color: #F56C6C;
  391. }
  392. span {
  393. font-weight: 600;
  394. padding-top: 2px;
  395. }
  396. }
  397. }
  398. }
  399. ::v-deep .el-input-number .el-input__inner {
  400. text-align: left;
  401. }
  402. ::v-deep.el-table .el-table__header tr th {
  403. background: #f1f6ff;
  404. color: #13171e;
  405. border-bottom: 0px;
  406. }
  407. ::v-deep.el-table .el-table__row td {
  408. color: #7e8bab;
  409. border-bottom: 1px solid #f4f4f4;
  410. }
  411. ::v-deep.el-table .el-table__header tr th:first-child {
  412. border-radius: 5px 0px 0px 5px;
  413. }
  414. ::v-deep.el-table .el-table__header tr th:nth-child(3) {
  415. border-radius: 0px 5px 5px 0px;
  416. }
  417. </style>