shouldDefectNumber.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <div class="dashboard-container">
  3. <div class="tableBox">
  4. <div style="overflow: hidden; margin-bottom: 16px;">
  5. <el-button @click="toBack" style="float: right;">返回</el-button>
  6. </div>
  7. <el-form :inline="true" :model="formData" class="demo-form-inline">
  8. <el-form-item label="">
  9. <el-date-picker v-model="formData.startTime" class="selects" type="date" format="yyyy年MM月dd日" value-format="yyyyMMdd" placeholder="就诊时间-开始" style="width: 180px;"></el-date-picker>
  10. </el-form-item>
  11. <el-form-item label="">
  12. <el-date-picker
  13. v-model="formData.endTime"
  14. type="date"
  15. class="selects"
  16. format="yyyy年MM月dd日"
  17. value-format="yyyyMMdd"
  18. placeholder="就诊时间-结束"
  19. style="width: 180px;"
  20. ></el-date-picker>
  21. </el-form-item>
  22. <el-form-item label="">
  23. <el-select v-model="formData.dep_id" class="selects" filterable clearable placeholder="科室" style="width: 180px;">
  24. <el-option v-for="(item, index) in departmentList" :label="item.name" :value="item.id" :key="index"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="">
  28. <el-input v-model="formData.sfzh" placeholder="身份证号" style="width: 180px;"></el-input>
  29. </el-form-item>
  30. <el-form-item label="">
  31. <el-input v-model="formData.mzh" placeholder="门诊号" style="width: 180px;"></el-input>
  32. </el-form-item>
  33. <el-form-item label="">
  34. <el-select v-model="formData.doctor_id" class="selects" filterable clearable placeholder="医生签名" style="width: 180px;">
  35. <el-option v-for="(item, index) in doctors" :label="item.name" :value="item.id" :key="index"></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item>
  39. <el-button class="sc" @click="funQuery">查询</el-button>
  40. </el-form-item>
  41. <el-form-item style="margin-right: 0; float: right;">
  42. <el-button type="primary" plain @click="onReset">重置条件</el-button>
  43. </el-form-item>
  44. </el-form>
  45. <div>
  46. <el-button @click="onExport" type="primary" plain style="float: right; margin-bottom: 16px;">导出Excel</el-button>
  47. <el-table :data="tableData" style="width: 100%">
  48. <el-table-column type="index" label="序号"></el-table-column>
  49. <el-table-column prop="jzsj" label="就诊时间"></el-table-column>
  50. <el-table-column prop="" label="门诊号">
  51. <template slot-scope="scope">
  52. <span v-if="scope.row.BLBH && scope.row.BLBH > 1000000000">{{ scope.row.mzh }}</span>
  53. <span v-else class="blue" @click="funGoto(scope.row.BLBH)">
  54. {{ scope.row.mzh }}
  55. </span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="xm" label="患者姓名"></el-table-column>
  59. <el-table-column prop="dep_name" label="科室"></el-table-column>
  60. <el-table-column prop="xb" label="性别"></el-table-column>
  61. <el-table-column prop="nl" label="年龄"></el-table-column>
  62. <el-table-column prop="cbzd" label="初步诊断"></el-table-column>
  63. <el-table-column prop="SFZH" label="身份证号"></el-table-column>
  64. <el-table-column prop="SXYS_NAME" label="医生签名"></el-table-column>
  65. </el-table>
  66. </div>
  67. <!-- 分页控制 -->
  68. <mPagination v-if="tableData && tableData.length !== 0" layout="sizes, prev, pager, next, slot" :data="paginationData" @pageChangeEvent="pageHasChanged" @sizeChange="handleSizeChange"></mPagination>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import Title from '@/components/Title';
  74. import { mapGetters } from 'vuex';
  75. import mPagination from '@/components/m-pagination';
  76. import { outHospitalShouldExport } from '@/api/excel'
  77. export default {
  78. name: 'Dashboard',
  79. components: {
  80. Title,
  81. mPagination,
  82. },
  83. computed: {
  84. ...mapGetters(['name']),
  85. },
  86. data() {
  87. return {
  88. formData: {
  89. dep_id: '',
  90. startTime:'',
  91. endTime:'',
  92. sfzh: '',
  93. doctor_id: '',
  94. mzh: ''
  95. },
  96. rule_id: '',
  97. tableData: [],
  98. // 分页数据
  99. paginationData: {
  100. total: 0,
  101. currentPage: 1,
  102. pageSize: 10,
  103. },
  104. departmentList: [],
  105. doctors: []
  106. };
  107. },
  108. mounted() {
  109. this.rule_id = this.$route.query.rule_id
  110. this.formData.startTime = this.storageGet('start_time');
  111. this.formData.endTime = this.storageGet('end_time');
  112. this.selectInfo();
  113. this.funQuery();
  114. },
  115. watch: {
  116. $route(to, from) {
  117. if (to.path === '/outpatientMedicalShouldDefectNumber' && from.path === '/outpatientControl') {
  118. this.formData = {
  119. dep_id: '',
  120. startTime:'',
  121. endTime:'',
  122. sfzh: '',
  123. doctor_id: '',
  124. mzh: ''
  125. }
  126. this.rule_id = this.$route.query.rule_id
  127. this.formData.startTime = this.storageGet('start_time');
  128. this.formData.endTime = this.storageGet('end_time');
  129. this.paginationData.currentPage = 1
  130. this.paginationData.pageSize = 10
  131. this.funQuery();
  132. }
  133. }
  134. },
  135. methods: {
  136. // 导出
  137. onExport() {
  138. const { dep_id, startTime, endTime, sfzh, doctor_id, mzh } = this.formData
  139. const params = {
  140. dep_id,
  141. start_time: startTime,
  142. end_time: endTime,
  143. sfzh,
  144. doctor_id,
  145. rule_id: this.rule_id,
  146. mzh
  147. }
  148. outHospitalShouldExport(params).then(res => {
  149. const content = res.data // 后台返回二进制数据
  150. const blob = new Blob([content])
  151. const fileName = `门诊应有病例.csv`
  152. if ('download' in document.createElement('a')) { // 非IE下载
  153. const elink = document.createElement('a')
  154. elink.download = fileName
  155. elink.style.display = 'none'
  156. elink.href = URL.createObjectURL(blob)
  157. document.body.appendChild(elink)
  158. elink.click()
  159. URL.revokeObjectURL(elink.href) // 释放URL 对象
  160. document.body.removeChild(elink)
  161. } else { // IE10+下载
  162. navigator.msSaveBlob(blob, fileName)
  163. }
  164. })
  165. },
  166. // 重置
  167. onReset() {
  168. this.formData = {
  169. dep_id: '',
  170. startTime:'',
  171. endTime:'',
  172. sfzh: '',
  173. doctor_id: '',
  174. mzh: ''
  175. }
  176. this.funQuery();
  177. },
  178. // 返回
  179. toBack() {
  180. this.$router.history.go(-1)
  181. },
  182. // 跳转详情
  183. funGoto(blbh) {
  184. this.$router.push({ path: '/outpatientMedicalRecordDetail', query: { blbh } })
  185. },
  186. // 获取部门和医生select
  187. selectInfo() {
  188. this.$axios.post('/omr_zk/department_list').then(res => {
  189. this.departmentList = res.data;
  190. });
  191. this.$axios.post('/omr_zk/docker_list').then(res => {
  192. this.doctors = res.data;
  193. });
  194. },
  195. pageHasChanged() {
  196. this.funQuery();
  197. },
  198. handleSizeChange(size) {
  199. this.paginationData.currentPage = 1
  200. this.paginationData.pageSize = size
  201. this.funQuery();
  202. },
  203. funQuery() {
  204. //查询
  205. let pramse = {
  206. start_time: this.formData.startTime || '',
  207. end_time: this.formData.endTime || '',
  208. page: this.paginationData.currentPage,
  209. page_size: this.paginationData.pageSize,
  210. is_error: this.$route.query.is_error
  211. };
  212. if (this.rule_id) {
  213. pramse.rule_id = this.rule_id;
  214. }
  215. if (this.formData.dep_id) {
  216. pramse.dep_id = this.formData.dep_id
  217. }
  218. if (this.formData.sfzh) {
  219. pramse.sfzh = this.formData.sfzh
  220. }
  221. if (this.formData.doctor_id) {
  222. pramse.doctor_id = this.formData.doctor_id
  223. }
  224. if (this.formData.mzh) {
  225. pramse.mzh = this.formData.mzh
  226. }
  227. this.$axios.post('/omr_zk/get_should_be_bl_list', pramse).then(res => {
  228. this.paginationData.total = res.data.count;
  229. this.tableData = res.data.list;
  230. });
  231. }
  232. },
  233. };
  234. </script>
  235. <style scoped>
  236. ::v-deep.el-pagination.is-background .btn-next,
  237. ::v-deep.el-pagination.is-background .btn-prev,
  238. ::v-deep.el-pagination.is-background .el-pager li {
  239. margin: 0 5px;
  240. background-color: #fff;
  241. color: #606266;
  242. min-width: 30px;
  243. border-radius: 2px;
  244. border: 1px solid #dfe3f3;
  245. line-height: 27px;
  246. }
  247. ::v-deep.el-pagination.is-background .el-pager li:not(.disabled).active {
  248. background: #7e8bab;
  249. }
  250. ::v-deep.el-table .el-table__row td {
  251. color: #7e8bab;
  252. border-bottom: 1px solid #f4f4f4;
  253. }
  254. ::v-deep.el-table .el-table__header tr th:first-child {
  255. border-radius: 10px 0px 0px 10px;
  256. }
  257. ::v-deep.el-table .el-table__header tr th:last-child {
  258. border-radius: 0px 10px 10px 0px;
  259. }
  260. ::v-deep.el-table .el-table__header tr th {
  261. background: #f1f6ff;
  262. color: #13171e;
  263. border-bottom: 0px;
  264. }
  265. </style>
  266. <style lang="scss" scoped>
  267. .tableBox {
  268. background: #fff;
  269. padding: 19px;
  270. border-radius: 5px;
  271. font-size: 12px;
  272. }
  273. .block {
  274. background: #fff;
  275. border-radius: 5px;
  276. margin-bottom: 16px;
  277. padding: 0;
  278. margin-bottom: 20px;
  279. .fBtn {
  280. display: flex;
  281. align-items: center;
  282. justify-content: center;
  283. .btn1 {
  284. background: #185da6;
  285. color: #fff;
  286. }
  287. .btn2 {
  288. color: #185da6;
  289. background: #d5e4ff;
  290. }
  291. }
  292. .bnh {
  293. margin-bottom: 20px;
  294. }
  295. .barBtn {
  296. display: flex;
  297. align-items: center;
  298. justify-content: center;
  299. }
  300. .selects {
  301. width: 100%;
  302. }
  303. .rowsa {
  304. margin-bottom: 20px;
  305. }
  306. }
  307. .tableBox {
  308. background: #fff;
  309. padding: 19px;
  310. border-radius: 5px;
  311. }
  312. .dashboard {
  313. &-container {
  314. margin: 30px;
  315. }
  316. &-text {
  317. font-size: 30px;
  318. line-height: 46px;
  319. }
  320. }
  321. .pind {
  322. padding: 0 20px;
  323. }
  324. .pind10 {
  325. padding: 0 5px;
  326. }
  327. .width300 {
  328. width: 295px;
  329. }
  330. .width500 {
  331. width: 645px;
  332. }
  333. .width90 {
  334. width: 90px;
  335. }
  336. .blue {
  337. color: #185da6;
  338. cursor: pointer;
  339. }
  340. .block {
  341. background: #fff;
  342. align-items: center;
  343. border-radius: 5px;
  344. height: 75px;
  345. margin-bottom: 16px;
  346. margin-bottom: 20px;
  347. margin-bottom: 20px;
  348. display: flex;
  349. box-sizing: border-box;
  350. .blockCon {
  351. display: flex;
  352. align-items: center;
  353. .selectDns {
  354. span {
  355. margin-right: 5px;
  356. }
  357. }
  358. .demonstration {
  359. margin-left: 10px;
  360. }
  361. .pickers {
  362. margin-left: 5px;
  363. }
  364. .lsxd {
  365. margin-left: 20px;
  366. }
  367. .ins {
  368. width: 150px;
  369. margin: 0 10px;
  370. }
  371. }
  372. .sc {
  373. background: #185da6;
  374. color: #fff;
  375. }
  376. }
  377. .kong {
  378. padding: 0 10px;
  379. }
  380. .demo-form-inline {
  381. overflow: hidden;
  382. }
  383. </style>