血透系统PC前端

bloodPresssWatch.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <template v-if="this.template_id == 1">
  6. <el-button
  7. size="small"
  8. icon="el-icon-printer"
  9. :disabled="selecting_schs.length == 0"
  10. @click="batchPrintAction"
  11. type="primary"
  12. >打印</el-button
  13. >
  14. </template>
  15. <template v-if="this.template_id == 2 || this.template_id == 0">
  16. <div>
  17. <el-button
  18. :loading="loading"
  19. size="small"
  20. icon="el-icon-printer"
  21. @click="batchPrintAction"
  22. type="primary"
  23. >打印全部</el-button
  24. >
  25. <el-button
  26. :loading="loading"
  27. size="small"
  28. icon="el-icon-printer"
  29. @click="batchPrintActionOne"
  30. type="primary"
  31. style=""
  32. >打印纪录单</el-button
  33. >
  34. <el-button
  35. :loading="loading"
  36. size="small"
  37. icon="el-icon-printer"
  38. @click="batchPrintActionTwo"
  39. type="primary"
  40. >打印医嘱单</el-button
  41. >
  42. </div>
  43. </template>
  44. <template v-if="this.template_id == 3">
  45. <el-button
  46. size="small"
  47. icon="el-icon-printer"
  48. :disabled="selecting_schs.length == 0"
  49. @click="batchPrintAction"
  50. type="primary"
  51. >打印</el-button
  52. >
  53. </template>
  54. <template v-if="this.template_id == 4">
  55. <el-button
  56. size="small"
  57. icon="el-icon-printer"
  58. :disabled="selecting_schs.length == 0"
  59. @click="batchPrintAction"
  60. type="primary"
  61. >打印</el-button
  62. >
  63. </template>
  64. <template v-if="this.template_id == 5">
  65. <div>
  66. <el-button
  67. :loading="loading"
  68. size="small"
  69. icon="el-icon-printer"
  70. @click="batchPrintAction"
  71. type="primary"
  72. >打印全部</el-button
  73. >
  74. <el-button
  75. :loading="loading"
  76. size="small"
  77. icon="el-icon-printer"
  78. @click="batchPrintActionOne"
  79. type="primary"
  80. style=""
  81. >打印纪录单</el-button
  82. >
  83. <el-button
  84. :loading="loading"
  85. size="small"
  86. icon="el-icon-printer"
  87. @click="batchPrintActionTwo"
  88. type="primary"
  89. >打印医嘱单</el-button
  90. >
  91. </div>
  92. </template>
  93. <template v-if="this.template_id == 6">
  94. <el-button
  95. size="small"
  96. icon="el-icon-printer"
  97. :disabled="selecting_schs.length == 0"
  98. @click="batchPrintAction"
  99. type="primary"
  100. >打印</el-button
  101. >
  102. </template>
  103. <template v-if="this.template_id == 7">
  104. <el-button
  105. size="small"
  106. icon="el-icon-printer"
  107. :disabled="selecting_schs.length == 0"
  108. @click="batchPrintAction"
  109. type="primary"
  110. >批量打印</el-button
  111. >
  112. </template>
  113. <template v-if="this.template_id == 8">
  114. <el-button
  115. size="small"
  116. icon="el-icon-printer"
  117. :disabled="selecting_schs.length == 0"
  118. @click="batchPrintAction"
  119. type="primary"
  120. >批量打印</el-button
  121. >
  122. </template>
  123. </div>
  124. <div class="app-container">
  125. <!-- <div class="filter-container">
  126. <el-input style="width: 400px;" v-model="searchKey" class="filter-item"/>
  127. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  128. </div>-->
  129. <div class="cell clearfix">
  130. <label class="title">
  131. <span class="name">{{
  132. search_mode == 1 ? "日期查询" : "病人查询"
  133. }}</span>
  134. :
  135. </label>
  136. <el-date-picker
  137. v-show="search_mode == 1"
  138. v-model="time"
  139. prefix-icon="el-icon-date"
  140. @change="changeTime"
  141. :editable="false"
  142. style="width: 250px;"
  143. type="date"
  144. placeholder="选择日期时间"
  145. align="right"
  146. :picker-options="pickerOptions1"
  147. format="yyyy-MM-dd"
  148. value-format="timestamp"
  149. ></el-date-picker>
  150. <el-input
  151. v-show="search_mode == 2"
  152. v-model="patient_search_keyword"
  153. style="width: 250px;"
  154. placeholder="病人名字、透析号"
  155. >
  156. <el-button
  157. slot="append"
  158. style="background-color: #409EFF; color: white; border-radius: 0;"
  159. icon="el-icon-search"
  160. @click="searchPatientAction"
  161. ></el-button>
  162. </el-input>
  163. <el-button type="primary" @click="changeSearchMode">{{
  164. search_mode == 1 ? "改为病人查询" : "改为日期查询"
  165. }}</el-button>
  166. <!-- <el-button type="primary" :disabled="selecting_schs.length == 0" @click="batchPrintAction">打印</el-button> -->
  167. </div>
  168. <div class="cell clearfix">
  169. <label class="title"> <span class="name">排班班次</span> : </label>
  170. <div class="time">
  171. <ul class>
  172. <li
  173. :class="item.value == schedulType ? 'active' : ''"
  174. @click="selectSchedulType(item.value)"
  175. v-for="item in schedulArr"
  176. :key="item.value"
  177. >
  178. {{ item.label }}
  179. </li>
  180. </ul>
  181. </div>
  182. </div>
  183. <div class="cell clearfix">
  184. <label class="title"> <span class="name">分区</span> : </label>
  185. <div class="time">
  186. <ul class>
  187. <li
  188. :class="item.id == partitionType ? 'active' : ''"
  189. @click="selectPartitionType(item.id)"
  190. v-for="item in partitionArr"
  191. :key="item.id"
  192. >
  193. {{ item.name }}
  194. </li>
  195. </ul>
  196. </div>
  197. </div>
  198. <el-table
  199. :row-style="{ color: '#303133' }"
  200. :header-cell-style="{
  201. backgroundColor: 'rgb(245, 247, 250)',
  202. color: '#606266'
  203. }"
  204. :data="SchedualPatientsTableData"
  205. style="width: 100%"
  206. v-loading="loading"
  207. @current-change="clickCurrent"
  208. @selection-change="handleSelectionChange"
  209. >
  210. <el-table-column
  211. type="selection"
  212. width="45"
  213. align="center"
  214. ></el-table-column>
  215. <el-table-column
  216. prop="number"
  217. label="机号"
  218. align="center"
  219. ></el-table-column>
  220. <el-table-column
  221. label="排班日期"
  222. prop="sch_time"
  223. align="center"
  224. width="120"
  225. ></el-table-column>
  226. <el-table-column
  227. prop="dialysis_no"
  228. label="透析号"
  229. align="center"
  230. ></el-table-column>
  231. <el-table-column prop="name" label="姓名" align="center">
  232. <template slot-scope="scope">
  233. <span style="color: #579ef8">{{ scope.row.name }}</span>
  234. </template>
  235. </el-table-column>
  236. <el-table-column
  237. prop="mode_name"
  238. label="透析模式"
  239. align="center"
  240. width="100"
  241. ></el-table-column>
  242. <el-table-column
  243. prop="dialysis_before_weight"
  244. label="透前称重(kg)"
  245. align="center"
  246. width="120"
  247. ></el-table-column>
  248. <el-table-column
  249. prop="dialysis_after_weight"
  250. label="透后称重(kg)"
  251. align="center"
  252. width="120"
  253. ></el-table-column>
  254. <el-table-column label="透中血压(Hgmm)" align="center">
  255. <el-table-column
  256. v-for="(item, index) in labelArr"
  257. :key="index"
  258. :label="item"
  259. align="center"
  260. >
  261. <!-- 数据的遍历 scope.row就代表数据的每一个对象-->
  262. <template slot-scope="scope">
  263. <!--<span>{{scope.row.bp[index].value}}</span>-->
  264. <span>{{ getValue(scope.row.bp[index]) }}</span>
  265. </template>
  266. </el-table-column>
  267. </el-table-column>
  268. </el-table>
  269. <el-pagination
  270. align="right"
  271. @size-change="handleSizeChange"
  272. @current-change="handleCurrentChange"
  273. :page-sizes="[10, 20, 30, 50]"
  274. :page-size="10"
  275. background
  276. style="margin-top:20px;"
  277. layout="total, sizes, prev, pager, next, jumper"
  278. :total="total"
  279. ></el-pagination>
  280. </div>
  281. </div>
  282. </template>
  283. <script>
  284. import { getSchedualPatient, GetAllZone } from "@/api/dialysis";
  285. import { parseTime } from "@/utils";
  286. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  287. import { getPrintTemplate } from "@/api/data";
  288. export default {
  289. name: "Patient",
  290. data() {
  291. return {
  292. crumbs: [
  293. { path: false, name: "透析管理" },
  294. { path: false, name: "透析监测" }
  295. ],
  296. loading: false,
  297. time: "",
  298. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  299. patient_search_keyword: "",
  300. SchedualPatientsTableData: [],
  301. active: true,
  302. schedulType: 0,
  303. schedulArr: [
  304. { value: 0, label: "全部" },
  305. { value: 1, label: "上午" },
  306. { value: 2, label: "下午" },
  307. { value: 3, label: "晚上" }
  308. ],
  309. template_id: 0,
  310. partitionType: 0,
  311. labelArr: ["第1次", "第2次", "第3次", "第4次", "第5次", "第6次", "第7次"],
  312. pickerOptions1: {
  313. shortcuts: [
  314. {
  315. text: "今天",
  316. onClick(picker) {
  317. picker.$emit("pick", new Date());
  318. }
  319. },
  320. {
  321. text: "昨天",
  322. onClick(picker) {
  323. const date = new Date();
  324. date.setTime(date.getTime() - 3600 * 1000 * 24);
  325. picker.$emit("pick", date);
  326. }
  327. },
  328. {
  329. text: "一周前",
  330. onClick(picker) {
  331. const date = new Date();
  332. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  333. picker.$emit("pick", date);
  334. }
  335. },
  336. {
  337. text: "清空",
  338. onClick(picker) {
  339. picker.$emit("pick");
  340. }
  341. }
  342. ]
  343. },
  344. total: 0,
  345. listQuery: {
  346. page: 1,
  347. limit: 10,
  348. schedul_type: 0,
  349. partition_type: 0,
  350. schedul_time: "",
  351. keywords: ""
  352. },
  353. selecting_schs: [],
  354. partitionArr: []
  355. };
  356. },
  357. created() {
  358. var date = new Date();
  359. this.time = date;
  360. var year = date.getFullYear();
  361. var month = date.getMonth() + 1;
  362. var day = date.getDate();
  363. if (month < 10) {
  364. month = "0" + month;
  365. }
  366. if (day < 10) {
  367. day = "0" + day;
  368. }
  369. var nowDate = year + "-" + month + "-" + day;
  370. var date = new Date(nowDate + " 00:00:00");
  371. this.listQuery.schedul_time = date.getTime();
  372. this.getAllZone();
  373. this.getSchedualPatientList();
  374. this.getTemplateInfo();
  375. // this.template_id = this.$store.getters.xt_user.template_info.template_id;
  376. },
  377. methods: {
  378. getTemplateInfo() {
  379. getPrintTemplate().then(response => {
  380. if (response.data.state == 0) {
  381. this.$message.error(response.data.msg);
  382. return false;
  383. } else {
  384. var template = response.data.data.template;
  385. this.template_id = template.template_id;
  386. }
  387. });
  388. },
  389. clickCurrent(val) {
  390. console.log(val);
  391. this.$router.push({
  392. path: "/dialysis/details",
  393. query: { patient_id: val.patient_id, date: val.sch_time_int }
  394. });
  395. },
  396. handleSelectionChange(val) {
  397. this.selecting_schs = val;
  398. },
  399. selectSchedulType(scheduleType) {
  400. // alert(scheduleType);/
  401. this.schedulType = scheduleType;
  402. this.listQuery.schedul_type = scheduleType;
  403. this.getSchedualPatientList();
  404. },
  405. selectPartitionType(partitionType) {
  406. this.partitionType = partitionType;
  407. this.listQuery.partition_type = partitionType;
  408. this.getSchedualPatientList();
  409. },
  410. changeTime() {
  411. this.listQuery.schedul_time = this.time;
  412. this.getSchedualPatientList();
  413. },
  414. getAllZone: function() {
  415. GetAllZone().then(response => {
  416. if (response.data.state == 0) {
  417. this.$message.error(response.data.msg);
  418. return false;
  419. } else {
  420. this.partitionArr = response.data.data.zone;
  421. this.partitionArr.unshift({ id: 0, name: "全部" });
  422. }
  423. });
  424. },
  425. getSchedualPatientList: function() {
  426. this.loading = true;
  427. if (this.search_mode == 1) {
  428. this.listQuery.keywords = "";
  429. } else {
  430. this.listQuery.schedul_time = "";
  431. }
  432. this.SchedualPatientsTableData = [];
  433. getSchedualPatient(this.listQuery).then(response => {
  434. if (response.data.state == 0) {
  435. this.loading = false;
  436. this.$message.error(response.data.msg);
  437. return false;
  438. } else {
  439. this.loading = false;
  440. this.total = response.data.data.total;
  441. // console.log(response.data.data)
  442. for (let i = 0; i < response.data.data.schedule.length; i++) {
  443. if (response.data.data.schedule[i].patient.id > 0) {
  444. const SchedualPatientsTable = {
  445. bp: []
  446. };
  447. SchedualPatientsTable["sch_id"] =
  448. response.data.data.schedule[i].id;
  449. SchedualPatientsTable["sch_time_int"] =
  450. response.data.data.schedule[i].schedule_date;
  451. SchedualPatientsTable["sch_time"] = parseTime(
  452. response.data.data.schedule[i].schedule_date,
  453. "{y}-{m}-{d}"
  454. );
  455. SchedualPatientsTable["dialysis_no"] =
  456. response.data.data.schedule[i].patient.dialysis_no;
  457. SchedualPatientsTable["name"] =
  458. response.data.data.schedule[i].patient.name;
  459. SchedualPatientsTable["number"] =
  460. response.data.data.schedule[i].device_number.number;
  461. SchedualPatientsTable["gender"] =
  462. response.data.data.schedule[i].patient.gender;
  463. SchedualPatientsTable["source"] =
  464. response.data.data.schedule[i].patient.source;
  465. SchedualPatientsTable["patient_id"] =
  466. response.data.data.schedule[i].patient_id;
  467. SchedualPatientsTable["mode_name"] =
  468. response.data.data.schedule[i].treatment_mode.name;
  469. if (
  470. response.data.data.schedule[i].assessment_before_dislysis.id > 0
  471. ) {
  472. SchedualPatientsTable["dialysis_before_weight"] =
  473. response.data.data.schedule[
  474. i
  475. ].assessment_before_dislysis.weight_before;
  476. }
  477. if (
  478. response.data.data.schedule[i].assessment_after_dislysis.id > 0
  479. ) {
  480. SchedualPatientsTable["dialysis_after_weight"] =
  481. response.data.data.schedule[
  482. i
  483. ].assessment_after_dislysis.weight_after;
  484. }
  485. SchedualPatientsTable.bp = [];
  486. for (
  487. let a = 0;
  488. a < response.data.data.schedule[i].monitoring_record.length;
  489. a++
  490. ) {
  491. const bp = {};
  492. bp["value"] =
  493. response.data.data.schedule[i].monitoring_record[
  494. a
  495. ].systolic_blood_pressure.toString() +
  496. "/" +
  497. response.data.data.schedule[i].monitoring_record[
  498. a
  499. ].diastolic_blood_pressure.toString();
  500. SchedualPatientsTable.bp.unshift(bp);
  501. }
  502. this.SchedualPatientsTableData.push(SchedualPatientsTable);
  503. }
  504. }
  505. }
  506. });
  507. },
  508. getValue: function(val) {
  509. if (val != undefined) {
  510. return val.value;
  511. } else {
  512. return "";
  513. }
  514. },
  515. handleCurrentChange(val) {
  516. this.listQuery.page = val;
  517. this.getSchedualPatientList();
  518. },
  519. changeSearchMode: function() {
  520. if (this.search_mode == 1) {
  521. this.search_mode = 2;
  522. } else {
  523. this.search_mode = 1;
  524. }
  525. },
  526. searchPatientAction: function() {
  527. this.listQuery.keywords = this.patient_search_keyword;
  528. console.log(this.patient_search_keyword);
  529. if (this.patient_search_keyword.length == 0) {
  530. return;
  531. }
  532. this.getSchedualPatientList();
  533. },
  534. handleSizeChange(val) {
  535. this.listQuery.limit = val;
  536. this.getSchedualPatientList();
  537. },
  538. batchPrintAction: function() {
  539. // 模板ID为6
  540. var sch_ids = [];
  541. for (let index = 0; index < this.selecting_schs.length; index++) {
  542. sch_ids.push(this.selecting_schs[index].sch_id);
  543. }
  544. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  545. if (this.template_id == 2 || this.template_id == 0) {
  546. this.$router.push({ path: "/dialysis/print/batch/other" });
  547. } else if (this.template_id == 1) {
  548. this.$router.push({ path: "/dialysis/print/batch" });
  549. } else if (this.template_id == 3) {
  550. this.$router.push({ path: "/dialysis/print/batch/three" });
  551. } else if (this.template_id == 4) {
  552. this.$router.push({ path: "/dialysis/print/batch/four" });
  553. } else if (this.template_id == 5) {
  554. this.$router.push({ path: "/dialysis/print/batch/five" });
  555. } else if (this.template_id == 6) {
  556. this.$router.push({ path: "/dialysis/print/batch/six" });
  557. } else if (this.template_id == 7) {
  558. this.$router.push({ path: "/dialysis/print/batch/seven" });
  559. } else if (this.template_id == 8) {
  560. this.$router.push({ path: "/dialysis/print/batch/eight" });
  561. }
  562. },
  563. batchPrintActionOne: function() {
  564. var sch_ids = [];
  565. for (let index = 0; index < this.selecting_schs.length; index++) {
  566. sch_ids.push(this.selecting_schs[index].sch_id);
  567. }
  568. console.log("第二个", sch_ids);
  569. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  570. if (this.template_id == 2 || this.template_id == 0) {
  571. this.$router.push({ path: "/dialysis/print/batch/otherone" });
  572. } else if (this.template_id == 1) {
  573. this.$router.push({ path: "/dialysis/print/batch" });
  574. } else if (this.template_id == 5) {
  575. this.$router.push({ path: "/dialysis/print/batch/fiveone" });
  576. }
  577. },
  578. batchPrintActionTwo: function() {
  579. var sch_ids = [];
  580. for (let index = 0; index < this.selecting_schs.length; index++) {
  581. sch_ids.push(this.selecting_schs[index].sch_id);
  582. }
  583. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  584. if (this.template_id == 2 || this.template_id == 0) {
  585. this.$router.push({ path: "/dialysis/print/batch/othertwo" });
  586. } else if (this.template_id == 1) {
  587. this.$router.push({ path: "/dialysis/print/batch" });
  588. } else if (this.template_id == 5) {
  589. this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
  590. }
  591. }
  592. },
  593. components: {
  594. BreadCrumb
  595. }
  596. };
  597. </script>
  598. <style rel="stylesheet/scss" lang="scss" scoped>
  599. .app-container {
  600. // margin: 20px;
  601. font-size: 15px;
  602. .filter-container {
  603. padding-bottom: 5px;
  604. }
  605. .cqd-dataTitle {
  606. color: #303133;
  607. font-size: 14px;
  608. border-bottom: 2px #e4e7ed solid;
  609. height: 36px;
  610. line-height: 36px;
  611. margin: 0 0 25px 0;
  612. position: relative;
  613. }
  614. .cqd-dataTitle::before {
  615. position: absolute;
  616. left: 0;
  617. bottom: -2px;
  618. content: "";
  619. width: 42px;
  620. height: 2px;
  621. background: #409eff;
  622. }
  623. .search-component {
  624. width: 500px;
  625. .searchBox {
  626. width: 300px;
  627. height: 36px;
  628. line-height: 36px;
  629. padding-left: 15px;
  630. border: 1px #dcdfe6 solid;
  631. border-right: none;
  632. outline: none;
  633. float: left;
  634. border-radius: 6px 0 0 6px;
  635. font-size: 14px;
  636. color: #333;
  637. background: #fff;
  638. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  639. }
  640. .searchBtn {
  641. background-color: #409eff;
  642. color: #fff;
  643. font-size: 15px;
  644. text-align: center;
  645. height: 36px;
  646. line-height: 36px;
  647. float: left;
  648. outline: none;
  649. width: 70px;
  650. border: none;
  651. border-radius: 0 6px 6px 0;
  652. font-family: "Microsoft Yahei";
  653. cursor: pointer;
  654. }
  655. }
  656. .amount {
  657. font-weight: normal;
  658. padding: 10px 0 0 0;
  659. color: #606266;
  660. font-size: 14px;
  661. span {
  662. color: #ef2525;
  663. font-family: "Arial";
  664. padding: 0 2px;
  665. }
  666. }
  667. }
  668. .el-table td,
  669. .el-table th.is-leaf,
  670. .el-table--border,
  671. .el-table--group {
  672. border-color: #d0d3da;
  673. }
  674. .el-table--border::after,
  675. .el-table--group::after,
  676. .el-table::before {
  677. background-color: #d0d3da;
  678. }
  679. .el-checkbox__inner::after {
  680. height: 10px;
  681. left: 7px;
  682. }
  683. .el-checkbox__inner {
  684. width: 20px;
  685. height: 20px;
  686. }
  687. </style>