血透系统PC前端

bloodPresssWatch.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="cell">
  8. <label class="title"><span class="name">{{ search_mode == 1 ? "日期查询" : "病人查询" }}</span> : </label>
  9. <el-date-picker v-show="search_mode == 1" v-model="time" prefix-icon="el-icon-date" @change="changeTime" :editable="false"
  10. style="width: 250px;" type="date" placeholder="选择日期时间" align="right"
  11. format="yyyy-MM-dd" size="small" value-format="timestamp"></el-date-picker>
  12. <el-input v-show="search_mode == 2" v-model="patient_search_keyword" style="width: 250px;" placeholder="病人名字、透析号">
  13. <el-button size="small" slot="append" style="background-color: #409EFF; color: white; border-radius: 0;" icon="el-icon-search" @click="searchPatientAction"></el-button>
  14. </el-input>
  15. <el-button size="small" type="primary" @click="changeSearchMode">{{ search_mode == 1 ? "改为病人查询" : "改为日期查询" }}</el-button>
  16. </div>
  17. <div class="cell clearfix">
  18. <label class="title"><span class="name">排班班次</span> : </label>
  19. <div class="time ">
  20. <ul class="">
  21. <li :class="item.value==schedulType?'active':''" @click='selectSchedulType(item.value)'
  22. v-for="item in schedulArr" :key="item.value">{{item.label}}
  23. </li>
  24. </ul>
  25. </div>
  26. </div>
  27. <div class="cell clearfix">
  28. <label class="title"><span class="name">分区</span> : </label>
  29. <div class="time ">
  30. <ul class="">
  31. <li :class="item.id==partitionType?'active':''" @click='selectPartitionType(item.id)'
  32. v-for="item in partitionArr" :key="item.id">{{item.name}}
  33. </li>
  34. </ul>
  35. </div>
  36. </div>
  37. <el-table
  38. :data="SchedualPatientsTableData"
  39. style="width: 100%"
  40. v-loading="loading"
  41. @current-change="clickCurrent"
  42. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  43. >
  44. <el-table-column
  45. prop="number"
  46. label="机号"
  47. align="center"
  48. >
  49. </el-table-column>
  50. <el-table-column
  51. label="排班日期"
  52. prop="sch_time"
  53. align="center"
  54. width="120"
  55. >
  56. </el-table-column>
  57. <el-table-column
  58. prop="dialysis_no"
  59. label="透析号"
  60. align="center"
  61. >
  62. </el-table-column>
  63. <el-table-column
  64. prop="name"
  65. label="姓名"
  66. align="center"
  67. >
  68. </el-table-column>
  69. <el-table-column
  70. prop="mode_name"
  71. label="透析模式"
  72. align="center"
  73. >
  74. </el-table-column>
  75. <el-table-column
  76. prop="dialysis_before_weight"
  77. label="透前体重 (kg)"
  78. align="center"
  79. >
  80. </el-table-column>
  81. <el-table-column
  82. prop="dialysis_after_weight"
  83. label="透后体重 (kg)"
  84. align="center"
  85. >
  86. </el-table-column>
  87. <el-table-column label="透中血压">
  88. <el-table-column v-for="(item, index) in labelArr" :key="index" :label="item" >
  89. <!-- 数据的遍历 scope.row就代表数据的每一个对象-->
  90. <template slot-scope="scope">
  91. <!--<span>{{scope.row.bp[index].value}}</span>-->
  92. <span>{{getValue(scope.row.bp[index])}}</span>
  93. </template>
  94. </el-table-column>
  95. </el-table-column>
  96. </el-table>
  97. <el-pagination
  98. @current-change="handleCurrentChange"
  99. :page-sizes="[10]"
  100. :page-size="10"
  101. background
  102. align="right"
  103. style="margin-top:20px;"
  104. layout="total, sizes, prev, pager, next, jumper"
  105. :total="total">
  106. </el-pagination>
  107. </div>
  108. </div>
  109. </template>
  110. <script>
  111. import {
  112. getSchedualPatient,
  113. GetAllZone,
  114. } from "@/api/dialysis"
  115. import { parseTime } from '@/utils'
  116. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  117. export default {
  118. name: "Patient",
  119. data() {
  120. return {
  121. loading: false,
  122. time: '',
  123. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  124. patient_search_keyword: "",
  125. // checkAll: false,
  126. // isIndeterminate: true,
  127. // wechatbindimg: "",
  128. SchedualPatientsTableData:[],
  129. active: true,
  130. schedulType: 0,
  131. schedulArr: [
  132. {value: 0, label: "全部"},
  133. {value: 1, label: "上午"},
  134. {value: 2, label: "下午"},
  135. {value: 3, label: "晚上"}
  136. ],
  137. partitionType: 0,
  138. // sourceType: 0,
  139. // sourceID: 0,
  140. // lapsetoType: 0,
  141. // sourceArr: [
  142. // {value: 0, label: "全部", source: 0, lapseto: 0},
  143. // {value: 1, label: "门诊", source: 0, lapseto: 0},
  144. // {value: 2, label: "住院", source: 0, lapseto: 0}
  145. // ],
  146. // warnArr: [
  147. // {value: 0, label: "全部", source: 0, lapseto: 0},
  148. // {value: 1, label: "正常", source: 0, lapseto: 0},
  149. // {value: 2, label: "异常", source: 0, lapseto: 0}
  150. // ],
  151. labelArr: ['第1次','第2次','第3次','第4次','第5次','第6次','第7次'],
  152. // tableData: null,
  153. // pickerOptions1: {
  154. // shortcuts: [
  155. // {
  156. // text: "今天",
  157. // onClick(picker) {
  158. // picker.$emit("pick", new Date());
  159. // }
  160. // },
  161. // {
  162. // text: "昨天",
  163. // onClick(picker) {
  164. // const date = new Date();
  165. // date.setTime(date.getTime() - 3600 * 1000 * 24);
  166. // picker.$emit("pick", date);
  167. // }
  168. // },
  169. // {
  170. // text: "一周前",
  171. // onClick(picker) {
  172. // const date = new Date();
  173. // date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  174. // picker.$emit("pick", date);
  175. // }
  176. // },
  177. // {
  178. // text: "清空",
  179. // onClick(picker) {
  180. // picker.$emit("pick");
  181. // }
  182. // }
  183. // ]
  184. // },
  185. // searchKey: "",
  186. total: 0,
  187. listQuery: {
  188. page: 1,
  189. limit: 10,
  190. schedul_type: 0,
  191. partition_type: 0,
  192. schedul_time: "",
  193. keywords: "",
  194. },
  195. multipleSelection: [],
  196. partitionArr: [],
  197. };
  198. },
  199. components:{
  200. BreadCrumb
  201. },
  202. created() {
  203. var date = new Date()
  204. this.time = date
  205. var year = date.getFullYear()
  206. var month = date.getMonth() + 1
  207. var day = date.getDate()
  208. if (month < 10) {
  209. month = "0" + month
  210. }
  211. if (day < 10) {
  212. day = "0" + day
  213. }
  214. var nowDate = year + "-" + month + "-" + day
  215. var date = new Date(nowDate + " 00:00:00")
  216. this.listQuery.schedul_time = date.getTime()
  217. this.getAllZone()
  218. this.getSchedualPatientList();
  219. },
  220. methods: {
  221. clickCurrent(val){
  222. console.log(val)
  223. this.$router.push({ path: "/dialysis/details", query: {patient_id: val.patient_id, date: val.sch_time_int}})
  224. },
  225. handleSelectionChange(val) {
  226. this.multipleSelection = val;
  227. this.pageSelect = this.multipleSelection.length;
  228. },
  229. selectSchedulType(scheduleType) {
  230. // alert(scheduleType);/
  231. this.schedulType = scheduleType;
  232. this.listQuery.schedul_type = scheduleType;
  233. this.getSchedualPatientList();
  234. },
  235. selectPartitionType(partitionType) {
  236. this.partitionType = partitionType;
  237. this.listQuery.partition_type = partitionType;
  238. this.getSchedualPatientList();
  239. },
  240. changeTime() {
  241. console.log(this.time)
  242. this.listQuery.schedul_time = this.time;
  243. this.getSchedualPatientList();
  244. },
  245. // search() {
  246. // this.listQuery.keywords = this.searchKey;
  247. // this.getSchedualPatientList();
  248. // },
  249. // changeOtherSearch() {
  250. // this.getList();
  251. // },
  252. getAllZone: function () {
  253. GetAllZone().then(response => {
  254. if (response.data.state == 0) {
  255. this.$message.error(response.data.msg);
  256. return false;
  257. } else {
  258. this.partitionArr = response.data.data.zone
  259. this.partitionArr.unshift({"id": 0, "name": '全部'})
  260. }
  261. });
  262. },
  263. getSchedualPatientList: function () {
  264. this.loading = true
  265. if (this.search_mode == 1) {
  266. this.listQuery.keywords = ""
  267. } else {
  268. this.listQuery.schedul_time = ""
  269. }
  270. this.SchedualPatientsTableData = []
  271. getSchedualPatient(this.listQuery).then(response => {
  272. if (response.data.state == 0) {
  273. this.loading = false
  274. this.$message.error(response.data.msg);
  275. return false;
  276. } else {
  277. this.loading = false
  278. this.total = response.data.data.total
  279. // console.log(response.data.data)
  280. for (let i = 0; i < response.data.data.schedule.length; i++) {
  281. if (response.data.data.schedule[i].patient.id > 0) {
  282. let SchedualPatientsTable = {
  283. bp: []
  284. }
  285. SchedualPatientsTable['sch_time_int'] = response.data.data.schedule[i].schedule_date
  286. SchedualPatientsTable['sch_time'] = parseTime(response.data.data.schedule[i].schedule_date, "{y}-{m}-{d}")
  287. SchedualPatientsTable['dialysis_no'] = response.data.data.schedule[i].patient.dialysis_no
  288. SchedualPatientsTable['name'] = response.data.data.schedule[i].patient.name
  289. SchedualPatientsTable['number'] = response.data.data.schedule[i].device_number.number
  290. SchedualPatientsTable['gender'] = response.data.data.schedule[i].patient.gender
  291. SchedualPatientsTable['source'] = response.data.data.schedule[i].patient.source
  292. SchedualPatientsTable['patient_id'] = response.data.data.schedule[i].patient_id
  293. SchedualPatientsTable['mode_name'] = response.data.data.schedule[i].treatment_mode.name
  294. if(response.data.data.schedule[i].assessment_before_dislysis.id > 0) {
  295. SchedualPatientsTable['dialysis_before_weight'] = response.data.data.schedule[i].assessment_before_dislysis.weight_before
  296. }
  297. if(response.data.data.schedule[i].assessment_after_dislysis.id > 0) {
  298. SchedualPatientsTable['dialysis_after_weight'] = response.data.data.schedule[i].assessment_after_dislysis.weight_after
  299. }
  300. SchedualPatientsTable.bp=[]
  301. for (let a = 0; a < response.data.data.schedule[i].monitoring_record.length; a++) {
  302. let bp = {}
  303. bp['value'] = response.data.data.schedule[i].monitoring_record[a].systolic_blood_pressure.toString()
  304. +"/"+response.data.data.schedule[i].monitoring_record[a].diastolic_blood_pressure.toString()
  305. SchedualPatientsTable.bp.unshift(bp)
  306. }
  307. this.SchedualPatientsTableData.push(SchedualPatientsTable)
  308. }
  309. }
  310. }
  311. });
  312. },getValue:function (val) {
  313. if(val != undefined){
  314. return val.value
  315. }else{
  316. return ''
  317. }
  318. },
  319. handleCurrentChange(val) {
  320. this.listQuery.page = val;
  321. this.getSchedualPatientList();
  322. },
  323. changeSearchMode: function() {
  324. if (this.search_mode == 1) {
  325. this.search_mode = 2
  326. } else {
  327. this.search_mode = 1
  328. }
  329. },
  330. searchPatientAction: function() {
  331. this.listQuery.keywords = this.patient_search_keyword
  332. console.log(this.patient_search_keyword)
  333. if (this.patient_search_keyword.length == 0) {
  334. return
  335. }
  336. this.getSchedualPatientList()
  337. },
  338. }
  339. }
  340. </script>
  341. <style rel="stylesheet/scss" lang="scss" scoped>
  342. .app-container {
  343. // margin: 20px;
  344. font-size: 15px;
  345. .filter-container {
  346. padding-bottom: 5px;
  347. }
  348. .search-component {
  349. width: 500px;
  350. .searchBox {
  351. width: 300px;
  352. height: 36px;
  353. line-height: 36px;
  354. padding-left: 15px;
  355. border: 1px #dcdfe6 solid;
  356. border-right: none;
  357. outline: none;
  358. float: left;
  359. border-radius: 6px 0 0 6px;
  360. font-size: 14px;
  361. color: #333;
  362. background: #fff;
  363. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  364. }
  365. .searchBtn {
  366. background-color: #409eff;
  367. color: #fff;
  368. font-size: 15px;
  369. text-align: center;
  370. height: 36px;
  371. line-height: 36px;
  372. float: left;
  373. outline: none;
  374. width: 70px;
  375. border: none;
  376. border-radius: 0 6px 6px 0;
  377. font-family: "Microsoft Yahei";
  378. cursor: pointer;
  379. }
  380. }
  381. .amount {
  382. font-weight: normal;
  383. padding: 10px 0 0 0;
  384. color: #606266;
  385. font-size: 14px;
  386. span {
  387. color: #ef2525;
  388. font-family: "Arial";
  389. padding: 0 2px;
  390. }
  391. }
  392. }
  393. </style>