index.vue 12 KB

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