bloodPresssWatch.1.vue 14KB

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