血透系统PC前端

bloodPresssWatch.vue 14KB

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