defectNumber.vue 8.9 KB

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