bloodPresssWatch.vue 38KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180
  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 || this.template_id == 33">
  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 || this.template_id == 48 || this.template_id == 0">
  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. </template>
  102. <template v-if="this.template_id == 7">
  103. <el-button
  104. size="small"
  105. icon="el-icon-printer"
  106. :disabled="selecting_schs.length == 0"
  107. @click="batchPrintAction"
  108. type="primary"
  109. >批量打印</el-button
  110. >
  111. </template>
  112. <template v-if="this.template_id == 8">
  113. <el-button
  114. size="small"
  115. icon="el-icon-printer"
  116. :disabled="selecting_schs.length == 0"
  117. @click="batchPrintAction"
  118. type="primary"
  119. >批量打印</el-button
  120. >
  121. </template>
  122. <template v-if="this.template_id == 9">
  123. <el-button
  124. size="small"
  125. icon="el-icon-printer"
  126. :disabled="selecting_schs.length == 0"
  127. @click="batchPrintAction"
  128. type="primary"
  129. >批量打印</el-button
  130. >
  131. </template>
  132. <template v-if="this.template_id == 12">
  133. <el-button
  134. size="small"
  135. icon="el-icon-printer"
  136. :disabled="selecting_schs.length == 0"
  137. @click="batchPrintAction"
  138. type="primary"
  139. >批量打印</el-button
  140. >
  141. </template>
  142. <template v-if="this.template_id == 13">
  143. <el-button
  144. size="small"
  145. icon="el-icon-printer"
  146. :disabled="selecting_schs.length == 0"
  147. @click="batchPrintAction"
  148. type="primary"
  149. >批量打印</el-button
  150. >
  151. </template>
  152. <template v-if="this.template_id == 15">
  153. <el-button
  154. size="small"
  155. icon="el-icon-printer"
  156. :disabled="selecting_schs.length == 0"
  157. @click="batchPrintAction"
  158. type="primary"
  159. >批量打印</el-button
  160. >
  161. </template>
  162. <template v-if="this.template_id == 17">
  163. <el-button
  164. size="small"
  165. icon="el-icon-printer"
  166. :disabled="selecting_schs.length == 0"
  167. @click="batchPrintAction"
  168. type="primary"
  169. >批量打印</el-button
  170. >
  171. </template>
  172. <template v-if="this.template_id == 20">
  173. <el-button
  174. size="small"
  175. icon="el-icon-printer"
  176. :disabled="selecting_schs.length == 0"
  177. @click="batchPrintAction"
  178. type="primary"
  179. >批量打印</el-button
  180. >
  181. </template>
  182. <template v-if="this.template_id == 22">
  183. <div>
  184. <el-button
  185. :loading="loading"
  186. size="small"
  187. icon="el-icon-printer"
  188. @click="batchPrintAction"
  189. type="primary"
  190. >打印全部</el-button
  191. >
  192. <el-button
  193. :loading="loading"
  194. size="small"
  195. icon="el-icon-printer"
  196. @click="batchPrintActionOne"
  197. type="primary"
  198. style=""
  199. >打印记录单</el-button
  200. >
  201. <el-button
  202. :loading="loading"
  203. size="small"
  204. icon="el-icon-printer"
  205. @click="batchPrintActionTwo"
  206. type="primary"
  207. >打印医嘱单</el-button
  208. >
  209. </div>
  210. </template>
  211. <template v-if="this.template_id == 25">
  212. <el-button
  213. size="small"
  214. icon="el-icon-printer"
  215. :disabled="selecting_schs.length == 0"
  216. @click="batchPrintAction"
  217. type="primary"
  218. >批量打印</el-button
  219. >
  220. </template>
  221. <!-- <template v-if="this.template_id == 27">
  222. <el-button
  223. size="small"
  224. icon="el-icon-printer"
  225. :disabled="selecting_schs.length == 0"
  226. @click="batchPrintAction"
  227. type="primary"
  228. >批量打印</el-button
  229. >
  230. </template> -->
  231. <template v-if="this.template_id == 28">
  232. <el-button
  233. size="small"
  234. icon="el-icon-printer"
  235. :disabled="selecting_schs.length == 0"
  236. @click="batchPrintAction"
  237. type="primary"
  238. >批量打印</el-button
  239. >
  240. </template>
  241. <template v-if="this.template_id == 30">
  242. <el-button
  243. size="small"
  244. icon="el-icon-printer"
  245. :disabled="selecting_schs.length == 0"
  246. @click="batchPrintAction"
  247. type="primary"
  248. >批量打印</el-button
  249. >
  250. </template>
  251. <template v-if="this.template_id == 32">
  252. <el-button
  253. size="small"
  254. icon="el-icon-printer"
  255. :disabled="selecting_schs.length == 0"
  256. @click="batchPrintAction"
  257. type="primary"
  258. >批量打印</el-button
  259. >
  260. </template>
  261. <template v-if="this.template_id == 37">
  262. <el-button
  263. size="small"
  264. icon="el-icon-printer"
  265. :disabled="selecting_schs.length == 0"
  266. @click="batchPrintAction"
  267. type="primary"
  268. >批量打印</el-button
  269. >
  270. </template>
  271. <template v-if="this.template_id == 38">
  272. <el-button
  273. size="small"
  274. icon="el-icon-printer"
  275. :disabled="selecting_schs.length == 0"
  276. @click="batchPrintAction"
  277. type="primary"
  278. >批量打印</el-button
  279. >
  280. </template>
  281. <template v-if="this.template_id == 39">
  282. <el-button
  283. size="small"
  284. icon="el-icon-printer"
  285. :disabled="selecting_schs.length == 0"
  286. @click="batchPrintAction"
  287. type="primary"
  288. >批量打印</el-button
  289. >
  290. </template>
  291. <template v-if="this.template_id == 40">
  292. <el-button
  293. size="small"
  294. icon="el-icon-printer"
  295. :disabled="selecting_schs.length == 0"
  296. @click="batchPrintAction"
  297. type="primary"
  298. >批量打印</el-button
  299. >
  300. </template>
  301. <template v-if="this.template_id == 41">
  302. <el-button
  303. size="small"
  304. icon="el-icon-printer"
  305. :disabled="selecting_schs.length == 0"
  306. @click="batchPrintAction"
  307. type="primary"
  308. >批量打印</el-button
  309. >
  310. </template>
  311. <template v-if="this.template_id == 43">
  312. <el-button
  313. size="small"
  314. icon="el-icon-printer"
  315. :disabled="selecting_schs.length == 0"
  316. @click="batchPrintAction"
  317. type="primary"
  318. >批量打印</el-button
  319. >
  320. </template>
  321. <template v-if="this.template_id == 47">
  322. <el-button
  323. size="small"
  324. icon="el-icon-printer"
  325. :disabled="selecting_schs.length == 0"
  326. @click="batchPrintAction"
  327. type="primary"
  328. >批量打印</el-button
  329. >
  330. </template>
  331. <template v-if="this.template_id == 59">
  332. <el-button
  333. size="small"
  334. icon="el-icon-printer"
  335. :disabled="selecting_schs.length == 0"
  336. @click="batchPrintAction"
  337. type="primary"
  338. >打印</el-button>
  339. </template>
  340. <template v-if="this.template_id == 60">
  341. <el-button
  342. size="small"
  343. icon="el-icon-printer"
  344. :disabled="selecting_schs.length == 0"
  345. @click="batchPrintAction"
  346. type="primary"
  347. >批量打印</el-button>
  348. </template>
  349. <template v-if="this.template_id == 61">
  350. <el-button
  351. size="small"
  352. icon="el-icon-printer"
  353. :disabled="selecting_schs.length == 0"
  354. @click="batchPrintAction"
  355. type="primary"
  356. >批量打印</el-button>
  357. </template>
  358. </div>
  359. <div class="app-container">
  360. <!-- <div class="filter-container">
  361. <el-input style="width: 400px;" v-model="searchKey" class="filter-item"/>
  362. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  363. </div>-->
  364. <div class="cell clearfix">
  365. <label class="title">
  366. <span class="name">{{
  367. search_mode == 1 ? "日期查询" : "病人查询"
  368. }}</span>
  369. :
  370. </label>
  371. <el-date-picker
  372. v-show="search_mode == 1"
  373. v-model="time"
  374. prefix-icon="el-icon-date"
  375. @change="changeTime"
  376. :editable="false"
  377. style="width: 250px;"
  378. type="date"
  379. placeholder="选择日期时间"
  380. align="right"
  381. :picker-options="pickerOptions1"
  382. format="yyyy-MM-dd"
  383. value-format="timestamp"
  384. ></el-date-picker>
  385. <el-input
  386. v-show="search_mode == 2"
  387. v-model="patient_search_keyword"
  388. style="width: 250px;"
  389. placeholder="病人名字、透析号"
  390. @keyup.enter.native='searchPatientAction'
  391. >
  392. <el-button
  393. slot="append"
  394. style="background-color: #409EFF; color: white; border-radius: 0;"
  395. icon="el-icon-search"
  396. @click="searchPatientAction"
  397. ></el-button>
  398. </el-input>
  399. <el-button type="primary" @click="changeSearchMode">{{
  400. search_mode == 1 ? "改为病人查询" : "改为日期查询"
  401. }}</el-button>
  402. </div>
  403. <div class="cell clearfix" v-show="search_mode == 2">
  404. <label class="title">
  405. <span class="name">日期查询</span>:
  406. </label>
  407. <el-date-picker
  408. v-model="listQuery.start_time"
  409. prefix-icon="el-icon-date"
  410. @change="changeStartTime"
  411. style="width: 250px;"
  412. type="date"
  413. placeholder="选择日期时间"
  414. align="right"
  415. :picker-options="pickerOptions1"
  416. format="yyyy-MM-dd"
  417. value-format="timestamp"
  418. ></el-date-picker>
  419. -
  420. <el-date-picker
  421. v-model="listQuery.end_time"
  422. prefix-icon="el-icon-date"
  423. @change="changeEndTime"
  424. style="width: 250px;"
  425. type="date"
  426. placeholder="选择日期时间"
  427. align="right"
  428. :picker-options="pickerOptions1"
  429. format="yyyy-MM-dd"
  430. value-format="timestamp"
  431. ></el-date-picker>
  432. </div>
  433. <div class="cell clearfix">
  434. <label class="title"> <span class="name">排班班次</span> : </label>
  435. <div class="time">
  436. <ul class>
  437. <li
  438. :class="item.value == schedulType ? 'active' : ''"
  439. @click="selectSchedulType(item.value)"
  440. v-for="item in schedulArr"
  441. :key="item.value"
  442. >
  443. {{ item.label }}
  444. </li>
  445. </ul>
  446. </div>
  447. </div>
  448. <div class="cell clearfix">
  449. <label class="title"> <span class="name">分区</span> : </label>
  450. <div class="time">
  451. <ul class>
  452. <li
  453. :class="item.id == partitionType ? 'active' : ''"
  454. @click="selectPartitionType(item.id)"
  455. v-for="item in partitionArr"
  456. :key="item.id"
  457. >
  458. {{ item.name }}
  459. </li>
  460. </ul>
  461. </div>
  462. </div>
  463. <el-table
  464. :row-style="{ color: '#303133' }"
  465. :header-cell-style="{
  466. backgroundColor: 'rgb(245, 247, 250)',
  467. color: '#606266'
  468. }"
  469. :data="SchedualPatientsTableData"
  470. style="width: 100%"
  471. v-loading="loading"
  472. @current-change="clickCurrent"
  473. @selection-change="handleSelectionChange"
  474. >
  475. <el-table-column
  476. type="selection"
  477. width="45"
  478. align="center"
  479. ></el-table-column>
  480. <el-table-column
  481. prop="number"
  482. label="机号"
  483. align="center"
  484. ></el-table-column>
  485. <el-table-column
  486. label="排班日期"
  487. prop="sch_time"
  488. align="center"
  489. width="120"
  490. ></el-table-column>
  491. <el-table-column
  492. prop="start_time"
  493. label="上机时间"
  494. align="center"
  495. width="80"
  496. ></el-table-column>
  497. <el-table-column
  498. prop="dialysis_no"
  499. label="透析号"
  500. align="center"
  501. ></el-table-column>
  502. <el-table-column prop="name" label="姓名" align="center">
  503. <template slot-scope="scope">
  504. <span style="color: #579ef8;width:100%;display:block;">{{ scope.row.name }}</span>
  505. </template>
  506. </el-table-column>
  507. <el-table-column
  508. prop="mode_name"
  509. label="透析模式"
  510. align="center"
  511. width="100"
  512. ></el-table-column>
  513. <el-table-column
  514. prop="target_ultrafiltration"
  515. label="目标超滤量"
  516. align="center"
  517. width="100"
  518. ></el-table-column>
  519. <el-table-column
  520. prop="dialysis_before_weight"
  521. label="透前称重(kg)"
  522. align="center"
  523. width="120"
  524. ></el-table-column>
  525. <el-table-column
  526. prop="dialysis_after_weight"
  527. label="透后称重(kg)"
  528. align="center"
  529. width="120"
  530. ></el-table-column>
  531. <el-table-column label="透中血压(mmHg)" align="center">
  532. <el-table-column
  533. v-for="(item, index) in labelArr"
  534. :key="index"
  535. :label="item"
  536. align="center"
  537. >
  538. <!-- 数据的遍历 scope.row就代表数据的每一个对象-->
  539. <template slot-scope="scope">
  540. <span v-if="getValue(scope.row.bp[index])>=90 && getValue(scope.row.bp[index])<=140">{{getValue(scope.row.bp[index])}}</span>
  541. <span v-if="getValue(scope.row.bp[index])<90 || getValue(scope.row.bp[index]) >140" style="color:red">{{getValue(scope.row.bp[index])}}</span>
  542. <span v-if="getValueOne(scope.row.bp[index])>0">/</span>
  543. <span v-if="getValueOne(scope.row.bp[index])>=60 && getValueOne(scope.row.bp[index])<=90">{{getValueOne(scope.row.bp[index])}}</span>
  544. <span v-if="getValueOne(scope.row.bp[index]) <60 || getValueOne(scope.row.bp[index])>90" style="color:red">{{getValueOne(scope.row.bp[index])}}</span>
  545. </template>
  546. </el-table-column>
  547. </el-table-column>
  548. </el-table>
  549. <el-pagination
  550. align="right"
  551. @size-change="handleSizeChange"
  552. @current-change="handleCurrentChange"
  553. :page-sizes="[20, 40, 60, 80,100]"
  554. :page-size="10"
  555. background
  556. style="margin-top:20px;"
  557. layout="total, sizes, prev, pager, next, jumper"
  558. :total="total"
  559. ></el-pagination>
  560. </div>
  561. </div>
  562. </template>
  563. <script>
  564. import { getSchedualPatient, GetAllZone } from "@/api/dialysis";
  565. import { parseTime } from "@/utils";
  566. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  567. import { getPrintTemplate } from "@/api/data";
  568. const moment = require('moment')
  569. export default {
  570. name: "Patient",
  571. data() {
  572. return {
  573. crumbs: [
  574. { path: false, name: "透析管理" },
  575. { path: false, name: "透析监测" }
  576. ],
  577. loading: false,
  578. time: "",
  579. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  580. patient_search_keyword: "",
  581. SchedualPatientsTableData: [],
  582. active: true,
  583. schedulType: 0,
  584. schedulArr: [
  585. { value: 0, label: "全部" },
  586. { value: 1, label: "上午" },
  587. { value: 2, label: "下午" },
  588. { value: 3, label: "晚上" }
  589. ],
  590. template_id: 0,
  591. partitionType: 0,
  592. labelArr: ["第1次", "第2次", "第3次", "第4次", "第5次", "第6次", "第7次"],
  593. pickerOptions1: {
  594. shortcuts: [
  595. {
  596. text: "今天",
  597. onClick(picker) {
  598. var date = new Date();
  599. var year = date.getFullYear();
  600. var month = date.getMonth() + 1;
  601. var day = date.getDate();
  602. if (month < 10) {
  603. month = "0" + month;
  604. }
  605. if (day < 10) {
  606. day = "0" + day;
  607. }
  608. var nowDate = year + "-" + month + "-" + day;
  609. var date1 = new Date(nowDate + " 00:00:00");
  610. picker.$emit("pick", date1.getTime());
  611. }
  612. },
  613. {
  614. text: "昨天",
  615. onClick(picker) {
  616. var d = new Date();
  617. d.setTime(d.getTime() - 3600 * 1000 * 24);
  618. var date = d;
  619. var year = date.getFullYear();
  620. var month = date.getMonth() + 1;
  621. var day = date.getDate();
  622. if (month < 10) {
  623. month = "0" + month;
  624. }
  625. if (day < 10) {
  626. day = "0" + day;
  627. }
  628. var nowDate = year + "-" + month + "-" + day;
  629. var date1 = new Date(nowDate + " 00:00:00");
  630. picker.$emit("pick", date1.getTime());
  631. }
  632. },
  633. {
  634. text: "一周前",
  635. onClick(picker) {
  636. var d = new Date();
  637. d.setTime(d.getTime() - 3600 * 1000 * 24 * 7);
  638. var date = d;
  639. var year = date.getFullYear();
  640. var month = date.getMonth() + 1;
  641. var day = date.getDate();
  642. if (month < 10) {
  643. month = "0" + month;
  644. }
  645. if (day < 10) {
  646. day = "0" + day;
  647. }
  648. var nowDate = year + "-" + month + "-" + day;
  649. var date1 = new Date(nowDate + " 00:00:00");
  650. picker.$emit("pick", date1.getTime());
  651. }
  652. },
  653. {
  654. text: "清空",
  655. onClick(picker) {
  656. picker.$emit("pick");
  657. }
  658. }
  659. ]
  660. },
  661. total: 0,
  662. listQuery: {
  663. page: 1,
  664. limit: 20,
  665. schedul_type: 0,
  666. partition_type: 0,
  667. schedul_time: "",
  668. keywords: "",
  669. start_time:"",
  670. end_time:"",
  671. },
  672. selecting_schs: [],
  673. partitionArr: [],
  674. };
  675. },
  676. created() {
  677. var search_mode = this.$store.getters.search_mode
  678. var search_value = this.$store.getters.search_value
  679. console.log('search_mode',search_mode)
  680. if(search_mode == 2){
  681. this.search_mode = search_mode
  682. if(search_value != ''){
  683. this.patient_search_keyword = search_value
  684. this.listQuery.keywords = search_value
  685. this.getSchedualPatientList();
  686. var date = new Date();
  687. this.time = date;
  688. var year = date.getFullYear();
  689. var month = date.getMonth() + 1;
  690. var day = date.getDate();
  691. if (month < 10) {
  692. month = "0" + month;
  693. }
  694. if (day < 10) {
  695. day = "0" + day;
  696. }
  697. var nowDate = year + "-" + month + "-" + day;
  698. var date = new Date(nowDate + " 00:00:00");
  699. this.listQuery.schedul_time = date.getTime();
  700. this.getAllZone();
  701. this.getTemplateInfo();
  702. }else {
  703. var start_month = moment().startOf('month').format('YYYY-MM-DD')
  704. var start_time = this.getTimestamp(start_month)
  705. this.listQuery.start_time = start_time
  706. var end_month = moment(new Date()).add('year',0).format("YYYY-MM-DD")
  707. var end_time = this.getTimestamp(end_month)
  708. this.listQuery.end_time = end_time
  709. this.getSchedualPatientList()
  710. this.getAllZone();
  711. this.getTemplateInfo();
  712. }
  713. }else {
  714. var date = new Date();
  715. this.time = date;
  716. var year = date.getFullYear();
  717. var month = date.getMonth() + 1;
  718. var day = date.getDate();
  719. if (month < 10) {
  720. month = "0" + month;
  721. }
  722. if (day < 10) {
  723. day = "0" + day;
  724. }
  725. var nowDate = year + "-" + month + "-" + day;
  726. var date = new Date(nowDate + " 00:00:00");
  727. this.listQuery.schedul_time = date.getTime();
  728. var start_month = moment().startOf('month').format('YYYY-MM-DD')
  729. var start_time = this.getTimestamp(start_month)
  730. this.listQuery.start_time = start_time
  731. var end_month = moment(new Date()).add('year',0).format("YYYY-MM-DD")
  732. var end_time = this.getTimestamp(end_month)
  733. this.listQuery.end_time = end_time
  734. this.getAllZone();
  735. this.getSchedualPatientList();
  736. this.getTemplateInfo();
  737. }
  738. // this.template_id = this.$store.getters.xt_user.template_info.template_id;
  739. },
  740. methods: {
  741. getTemplateInfo() {
  742. getPrintTemplate().then(response => {
  743. if (response.data.state == 0) {
  744. this.$message.error(response.data.msg);
  745. return false;
  746. } else {
  747. var template = response.data.data.template;
  748. this.template_id = template.template_id;
  749. console.log("templage-i233232323232322323233232323223",this.template_id)
  750. }
  751. });
  752. },
  753. clickCurrent(val) {
  754. console.log(val);
  755. this.$router.push({
  756. path: "/dialysis/details",
  757. query: { patient_id: val.patient_id, date: val.sch_time_int,mode_id:val.mode_id }
  758. });
  759. },
  760. handleSelectionChange(val) {
  761. this.selecting_schs = val;
  762. },
  763. selectSchedulType(scheduleType) {
  764. // alert(scheduleType);/
  765. this.schedulType = scheduleType;
  766. this.listQuery.schedul_type = scheduleType;
  767. this.getSchedualPatientList();
  768. },
  769. selectPartitionType(partitionType) {
  770. this.partitionType = partitionType;
  771. this.listQuery.partition_type = partitionType;
  772. this.getSchedualPatientList();
  773. },
  774. changeTime() {
  775. this.listQuery.schedul_time = this.time;
  776. this.getSchedualPatientList();
  777. },
  778. changeStartTime(){
  779. this.getSchedualPatientList()
  780. },
  781. changeEndTime(){
  782. this.getSchedualPatientList()
  783. },
  784. getAllZone: function() {
  785. GetAllZone().then(response => {
  786. if (response.data.state == 0) {
  787. this.$message.error(response.data.msg);
  788. return false;
  789. } else {
  790. this.partitionArr = response.data.data.zone;
  791. this.partitionArr.unshift({ id: 0, name: "全部" });
  792. }
  793. });
  794. },
  795. getTimestamp(time) { //把时间日期转成时间戳
  796. return (new Date(time)).getTime()
  797. },
  798. getSchedualPatientList: function() {
  799. this.loading = true;
  800. if (this.search_mode == 1) {
  801. this.listQuery.keywords = "";
  802. } else {
  803. this.listQuery.schedul_time = "";
  804. }
  805. console.log("params332322332323232",this.listQuery)
  806. this.SchedualPatientsTableData = [];
  807. getSchedualPatient(this.listQuery).then(response => {
  808. if (response.data.state == 0) {
  809. this.loading = false;
  810. this.$message.error(response.data.msg);
  811. return false;
  812. } else {
  813. this.loading = false;
  814. this.total = response.data.data.total;
  815. // console.log(response.data.data)
  816. for (let i = 0; i < response.data.data.schedule.length; i++) {
  817. if (response.data.data.schedule[i].patient&&response.data.data.schedule[i].patient.id > 0) {
  818. const SchedualPatientsTable = {
  819. bp: []
  820. };
  821. if(response.data.data.schedule[i].dialysis_order!=null){
  822. SchedualPatientsTable["start_time"] = response.data.data.schedule[i].dialysis_order.start_time ? parseTime(response.data.data.schedule[i].dialysis_order.start_time,"{h}:{i}") : '';
  823. }
  824. SchedualPatientsTable["sch_id"] = response.data.data.schedule[i].id;
  825. SchedualPatientsTable["sch_time_int"] = response.data.data.schedule[i].schedule_date;
  826. SchedualPatientsTable["sch_time"] = parseTime(response.data.data.schedule[i].schedule_date,"{y}-{m}-{d}");
  827. SchedualPatientsTable["mode_id"] = response.data.data.schedule[i].mode_id
  828. if(response.data.data.schedule[i].patient!=null){
  829. SchedualPatientsTable["dialysis_no"] = response.data.data.schedule[i].patient.dialysis_no;
  830. SchedualPatientsTable["name"] = response.data.data.schedule[i].patient.name;
  831. SchedualPatientsTable["gender"] = response.data.data.schedule[i].patient.gender;
  832. SchedualPatientsTable["source"] = response.data.data.schedule[i].patient.source;
  833. SchedualPatientsTable["patient_id"] = response.data.data.schedule[i].patient_id;
  834. }
  835. SchedualPatientsTable["number"] = response.data.data.schedule[i].device_number.number;
  836. if(response.data.data.schedule[i].treatment_mode!=null){
  837. SchedualPatientsTable["mode_name"] = response.data.data.schedule[i].treatment_mode.name;
  838. }
  839. if(response.data.data.schedule[i].prescription!=null){
  840. SchedualPatientsTable["target_ultrafiltration"] = response.data.data.schedule[i].prescription.target_ultrafiltration;
  841. }
  842. if (response.data.data.schedule[i].assessment_before_dislysis != null) {
  843. SchedualPatientsTable["dialysis_before_weight"] =response.data.data.schedule[i].assessment_before_dislysis.weight_before;
  844. }
  845. if (response.data.data.schedule[i].assessment_after_dislysis !=null) {
  846. SchedualPatientsTable["dialysis_after_weight"] =response.data.data.schedule[i].assessment_after_dislysis.weight_after;
  847. }
  848. SchedualPatientsTable.bp = [];
  849. if(response.data.data.schedule[i].monitoring_record && response.data.data.schedule[i].monitoring_record.length > 0){
  850. for (let a = 0;a < response.data.data.schedule[i].monitoring_record.length;a++) {
  851. const bp = {};
  852. bp["value"] =response.data.data.schedule[i].monitoring_record[a].systolic_blood_pressure.toString()+"/" +response.data.data.schedule[i].monitoring_record[a].diastolic_blood_pressure.toString();
  853. SchedualPatientsTable.bp.push(bp);
  854. }
  855. }
  856. this.SchedualPatientsTableData.push(SchedualPatientsTable);
  857. }
  858. }
  859. }
  860. });
  861. },
  862. getValue: function(val) {
  863. if (val != undefined) {
  864. var str = val.value.split("/")
  865. return str[0];
  866. } else {
  867. return "";
  868. }
  869. },
  870. getValueOne: function(val) {
  871. if (val != undefined) {
  872. var str = val.value.split("/")
  873. return str[1];
  874. } else {
  875. return "";
  876. }
  877. },
  878. handleCurrentChange(val) {
  879. this.listQuery.page = val;
  880. this.getSchedualPatientList();
  881. },
  882. changeSearchMode: function() {
  883. if (this.search_mode == 1) {
  884. this.search_mode = 2;
  885. } else {
  886. this.search_mode = 1;
  887. var date = new Date();
  888. this.time = date;
  889. var year = date.getFullYear();
  890. var month = date.getMonth() + 1;
  891. var day = date.getDate();
  892. if (month < 10) {
  893. month = "0" + month;
  894. }
  895. if (day < 10) {
  896. day = "0" + day;
  897. }
  898. var nowDate = year + "-" + month + "-" + day;
  899. var date = new Date(nowDate + " 00:00:00");
  900. this.listQuery.schedul_time = date.getTime();
  901. this.getAllZone();
  902. this.getSchedualPatientList();
  903. this.getTemplateInfo();
  904. }
  905. this.$store.dispatch('SetSearchMode', this.search_mode)
  906. },
  907. searchPatientAction: function() {
  908. this.listQuery.keywords = this.patient_search_keyword;
  909. this.$store.dispatch('SetSearchValue', this.patient_search_keyword)
  910. console.log(this.patient_search_keyword);
  911. if (this.patient_search_keyword.length == 0) {
  912. return;
  913. }
  914. this.getSchedualPatientList();
  915. },
  916. handleSizeChange(val) {
  917. this.listQuery.limit = val;
  918. this.getSchedualPatientList();
  919. },
  920. batchPrintAction: function() {
  921. if (this.selecting_schs.length === 0) {
  922. this.$message.error("请至少选择一条需要打印的内容");
  923. return false;
  924. }
  925. // 模板ID为6
  926. var sch_ids = [];
  927. for (let index = 0; index < this.selecting_schs.length; index++) {
  928. sch_ids.push(this.selecting_schs[index].sch_id);
  929. }
  930. console.log("sch_ids",sch_ids)
  931. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  932. if (this.template_id == 2 || this.template_id == 0) {
  933. this.$router.push({ path: "/dialysis/print/batch/other" });
  934. } else if (this.template_id == 1) {
  935. this.$router.push({ path: "/dialysis/print/batch" });
  936. } else if (this.template_id == 3) {
  937. this.$router.push({ path: "/dialysis/print/batch/three" });
  938. } else if (this.template_id == 4) {
  939. this.$router.push({ path: "/dialysis/print/batch/four" });
  940. } else if (this.template_id == 5) {
  941. this.$router.push({ path: "/dialysis/print/batch/five" });
  942. } else if (this.template_id == 6) {
  943. this.$router.push({ path: "/dialysis/print/batch/six" });
  944. } else if (this.template_id == 7) {
  945. this.$router.push({ path: "/dialysis/print/batch/seven" });
  946. } else if (this.template_id == 8) {
  947. this.$router.push({ path: "/dialysis/print/batch/eight" });
  948. } else if (this.template_id == 9) {
  949. this.$router.push({ path: "/dialysis/print/batch/nine" });
  950. } else if (this.template_id == 12) {
  951. this.$router.push({ path: "/dialysis/print/batch/twelve" });
  952. } else if (this.template_id == 13) {
  953. this.$router.push({ path: "/dialysis/print/batch/thirteen" });
  954. } else if (this.template_id == 15) {
  955. this.$router.push({ path: "/dialysis/print/batch/fifteen" });
  956. } else if (this.template_id == 17) {
  957. this.$router.push({ path: "/dialysis/print/batch/seventeen" });
  958. } else if (this.template_id == 20) {
  959. this.$router.push({ path: "/dialysis/print/batch/twenty" });
  960. } else if (this.template_id == 22) {
  961. this.$router.push({ path: "/dialysis/print/batch/twentyTwo" });
  962. } else if (this.template_id == 25) {
  963. this.$router.push({ path: "/dialysis/print/batch/twentyFive" });
  964. }else if (this.template_id == 27) {
  965. this.$router.push({ path: "/dialysis/print/batch/twentySeven" });
  966. } else if(this.template_id == 28){
  967. this.$router.push({path:"/dialysis/print/batch/twentyEight"})
  968. } else if (this.template_id == 30) {
  969. this.$router.push({ path: "/dialysis/print/batch/thirty" });
  970. } else if (this.template_id == 32) {
  971. this.$router.push({ path: "/dialysis/print/batch/thirtyTwo" });
  972. } else if (this.template_id == 33) {
  973. this.$router.push({ path: "/dialysis/print/batch/thirtyThree" });
  974. } else if (this.template_id == 37) {
  975. this.$router.push({ path: "/dialysis/print/batch/thirtySeven" });
  976. } else if (this.template_id == 38) {
  977. this.$router.push({ path: "/dialysis/print/batch/thirtyEight" });
  978. } else if (this.template_id == 39) {
  979. this.$router.push({ path: "/dialysis/print/batch/thirtyNine" });
  980. } else if (this.template_id == 40) {
  981. this.$router.push({ path: "/dialysis/print/batch/forty" });
  982. } else if (this.template_id == 41) {
  983. this.$router.push({ path: "/dialysis/print/batch/fortyOne" });
  984. } else if (this.template_id == 43) {
  985. this.$router.push({ path: "/dialysis/print/batch/fortyThree" });
  986. } else if (this.template_id == 47) {
  987. this.$router.push({ path: "/dialysis/print/batch/fortyThree" });
  988. } else if (this.template_id == 48) {
  989. this.$router.push({ path: "/dialysis/print/batch/six" });
  990. }else if (this.template_id == 59) {
  991. this.$router.push({ path: "/dialysis/print/batch/fiftynine" });
  992. }else if (this.template_id == 60) {
  993. this.$router.push({ path: "/dialysis/print/batch/sixty" });
  994. }else if (this.template_id == 61) {
  995. this.$router.push({ path: "/dialysis/print/batch/sixtyOne" });
  996. }
  997. },
  998. batchPrintActionOne: function() {
  999. if (this.selecting_schs.length === 0) {
  1000. this.$message.error("请至少选择一条需要打印的内容");
  1001. return false;
  1002. }
  1003. var sch_ids = [];
  1004. for (let index = 0; index < this.selecting_schs.length; index++) {
  1005. sch_ids.push(this.selecting_schs[index].sch_id);
  1006. }
  1007. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1008. if (this.template_id == 2 || this.template_id == 0) {
  1009. this.$router.push({ path: "/dialysis/print/batch/otherone" });
  1010. } else if (this.template_id == 1) {
  1011. this.$router.push({ path: "/dialysis/print/batch" });
  1012. } else if (this.template_id == 5) {
  1013. this.$router.push({ path: "/dialysis/print/batch/fiveone" });
  1014. } else if (this.template_id == 22) {
  1015. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_one" });
  1016. } else if(this.template_id == 33){
  1017. this.$router.push({ path: "/dialysis/print/batch/thirtyThree_one" });
  1018. }
  1019. },
  1020. batchPrintActionTwo: function() {
  1021. if (this.selecting_schs.length === 0) {
  1022. this.$message.error("请至少选择一条需要打印的内容");
  1023. return false;
  1024. }
  1025. var sch_ids = [];
  1026. for (let index = 0; index < this.selecting_schs.length; index++) {
  1027. sch_ids.push(this.selecting_schs[index].sch_id);
  1028. }
  1029. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1030. if (this.template_id == 2 || this.template_id == 0) {
  1031. this.$router.push({ path: "/dialysis/print/batch/othertwo" });
  1032. } else if (this.template_id == 1) {
  1033. this.$router.push({ path: "/dialysis/print/batch" });
  1034. } else if (this.template_id == 5) {
  1035. this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
  1036. } else if (this.template_id == 22) {
  1037. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_two" });
  1038. } else if (this.template_id == 33) {
  1039. this.$router.push({ path: "/dialysis/print/batch/thirtyThree_two" });
  1040. }
  1041. }
  1042. },
  1043. components: {
  1044. BreadCrumb
  1045. }
  1046. };
  1047. </script>
  1048. <style rel="stylesheet/scss" lang="scss" scoped>
  1049. .app-container {
  1050. // margin: 20px;
  1051. font-size: 15px;
  1052. .filter-container {
  1053. padding-bottom: 5px;
  1054. }
  1055. .cqd-dataTitle {
  1056. color: #303133;
  1057. font-size: 14px;
  1058. border-bottom: 2px #e4e7ed solid;
  1059. height: 36px;
  1060. line-height: 36px;
  1061. margin: 0 0 25px 0;
  1062. position: relative;
  1063. }
  1064. .cqd-dataTitle::before {
  1065. position: absolute;
  1066. left: 0;
  1067. bottom: -2px;
  1068. content: "";
  1069. width: 42px;
  1070. height: 2px;
  1071. background: #409eff;
  1072. }
  1073. .search-component {
  1074. width: 500px;
  1075. .searchBox {
  1076. width: 300px;
  1077. height: 36px;
  1078. line-height: 36px;
  1079. padding-left: 15px;
  1080. border: 1px #dcdfe6 solid;
  1081. border-right: none;
  1082. outline: none;
  1083. float: left;
  1084. border-radius: 6px 0 0 6px;
  1085. font-size: 14px;
  1086. color: #333;
  1087. background: #fff;
  1088. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  1089. }
  1090. .searchBtn {
  1091. background-color: #409eff;
  1092. color: #fff;
  1093. font-size: 15px;
  1094. text-align: center;
  1095. height: 36px;
  1096. line-height: 36px;
  1097. float: left;
  1098. outline: none;
  1099. width: 70px;
  1100. border: none;
  1101. border-radius: 0 6px 6px 0;
  1102. font-family: "Microsoft Yahei";
  1103. cursor: pointer;
  1104. }
  1105. }
  1106. .amount {
  1107. font-weight: normal;
  1108. padding: 10px 0 0 0;
  1109. color: #606266;
  1110. font-size: 14px;
  1111. span {
  1112. color: #ef2525;
  1113. font-family: "Arial";
  1114. padding: 0 2px;
  1115. }
  1116. }
  1117. }
  1118. .el-table td,
  1119. .el-table th.is-leaf,
  1120. .el-table--border,
  1121. .el-table--group {
  1122. border-color: #d0d3da;
  1123. }
  1124. .el-table--border::after,
  1125. .el-table--group::after,
  1126. .el-table::before {
  1127. background-color: #d0d3da;
  1128. }
  1129. .el-checkbox__inner::after {
  1130. height: 10px;
  1131. left: 7px;
  1132. }
  1133. .el-checkbox__inner {
  1134. width: 20px;
  1135. height: 20px;
  1136. }
  1137. </style>