血透系统PC前端

bloodPresssWatch.vue 21KB

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