血透系统pad前端

TodayTab.vue 54KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612
  1. <template>
  2. <div v-loading="loading" id="today_panel">
  3. <div class="grid">
  4. <div class="list">
  5. <ul>
  6. <li @click="menuClick(1)">
  7. <img src="@/assets/record/2.png" />
  8. <p>透析处方</p>
  9. </li>
  10. <li @click="menuClick(2)">
  11. <img src="@/assets/record/3.png" />
  12. <p>接诊评估</p>
  13. </li>
  14. <li @click="menuClick(3)">
  15. <img src="@/assets/record/4.png" />
  16. <p>透前评估</p>
  17. </li>
  18. <li style="position: relative;" @click="menuClick(4)">
  19. <img src="@/assets/record/5.png" />
  20. <span class="redpoint" v-if="getUnReadNum()">{{getUnReadNum()}}</span>
  21. <p>临时医嘱</p>
  22. </li>
  23. <li @click="menuClick(5)">
  24. <img src="@/assets/record/6.png" />
  25. <p>双人核对</p>
  26. </li>
  27. </ul>
  28. </div>
  29. <div class="list">
  30. <ul>
  31. <li @click="menuClick(0)">
  32. <img src="@/assets/record/1.png" />
  33. <p>透析上机</p>
  34. </li>
  35. <li @click="menuClick(6)">
  36. <img src="@/assets/record/7.png" />
  37. <p>透析监测</p>
  38. </li>
  39. <li @click="menuClick(7)">
  40. <img src="@/assets/record/8.png" />
  41. <p>透析下机</p>
  42. </li>
  43. <li @click="menuClick(8)">
  44. <img src="@/assets/record/9.png" />
  45. <p>透后评估</p>
  46. </li>
  47. <li @click="menuClick(9)">
  48. <img src="@/assets/record/10.png" />
  49. <p>治疗小结</p>
  50. </li>
  51. </ul>
  52. </div>
  53. </div>
  54. <div class="blueBorder"></div>
  55. <details-info
  56. title="基本信息"
  57. :patient="patient"
  58. :device_number="getDeviceNumber()"
  59. :step_data="stepData"
  60. ></details-info>
  61. <div class="blueBorder"></div>
  62. <dialysis-prescription
  63. id="prescription"
  64. :prescription="prescription"
  65. :solution="solution"
  66. title="透析处方"
  67. :device_number_map="device_map"
  68. ></dialysis-prescription>
  69. <div class="blueBorder"></div>
  70. <accepts-assessment id="accepts_assessment" :record="receiver_treatment_access" title="接诊评估"></accepts-assessment>
  71. <div class="blueBorder"></div>
  72. <assessment-before
  73. id="assessment_before"
  74. :record="predialysis_evaluation"
  75. ref="assessment_before"
  76. title="透前评估"
  77. :dry_weights="dryWeight"
  78. :last_predialysis="last_predialysis_evaluation"
  79. ></assessment-before>
  80. <div class="blueBorder"></div>
  81. <stat-order
  82. id="stat_order"
  83. ref="stat_order"
  84. title="临时医嘱"
  85. :doctor_map="admin_user_map"
  86. :advice_groups="advice_groups"
  87. ></stat-order>
  88. <div class="blueBorder"></div>
  89. <dialysis-computer
  90. id="dialysis_computer"
  91. ref="dialysis_computer"
  92. title="透析上机 "
  93. :record="dialysis_order"
  94. :admin_map="admin_user_map"
  95. :device_number_map="device_number_map"
  96. ></dialysis-computer>
  97. <div class="blueBorder"></div>
  98. <double-check id="double_check" ref="double_check" title="双人核对 " :record="double_check"></double-check>
  99. <div class="blueBorder"></div>
  100. <dialysis-monitoring id="monitoring" ref="monitoring" title="透析监测"></dialysis-monitoring>
  101. <div class="blueBorder"></div>
  102. <dialysis-off
  103. id="dialysis_off"
  104. ref="dialysis_off"
  105. title="透析下机 "
  106. :record="dialysis_order"
  107. :admin_map="admin_user_map"
  108. ></dialysis-off>
  109. <div class="blueBorder"></div>
  110. <assessment-after
  111. id="assessment_after"
  112. ref="assessment_after"
  113. title="透后评估"
  114. :record="assessment_after_dislysis"
  115. ></assessment-after>
  116. <div class="blueBorder"></div>
  117. <treatment-of id="treatment_of" ref="treatment_of" title="治疗小结" :record="treatment_summary"></treatment-of>
  118. <!-- <div class="blueBorder"></div>
  119. <operation-staff title="操作人员 "></operation-staff>-->
  120. <!-- 弹框 -->
  121. <!-- <van-popup v-show="false" title="长期处方" :overlay="true" @click-overlay="popupDidHide(0)" :close-on-click-overlay="false">
  122. <long-dialog @longSolution="closeDialog(0)" @closeLongDialog="closeDialog(0)" :patient_prop="patient" :solution_prop="solution" :machines_prop="devices" ref="long_dialog" ></long-dialog>
  123. </van-popup>-->
  124. <van-popup
  125. title="透析处方"
  126. v-model="menuList[1].showPopup"
  127. :overlay="true"
  128. :close-on-click-overlay="false"
  129. >
  130. <prescription-dialog
  131. :patient_prop="patient"
  132. :solution_prop="solution"
  133. :machines_prop="devices"
  134. :config="config"
  135. :prescription_prop="prescription"
  136. @finish="closePrescriptionDialog"
  137. :operators="operators"
  138. :types="goodTypes"
  139. :info="goodInfos"
  140. :status="status"
  141. :targetAdvices="longAdvices"
  142. :waitUploadAdvices="waitUploadAdvices"
  143. :is_open="is_open"
  144. @close="closePrescriptionDialog"
  145. @prescription="prescriptionFunc"
  146. :admin_users_prop="admin_users"
  147. @advice="adviceFunc"
  148. :predialysis="predialysis_evaluation"
  149. :last_predialysis="last_predialysis_evaluation"
  150. :record="assessment_after_dislysis"
  151. :last_record="last_assessment_after_dislysis"
  152. @longSolution="longSolutionFunc"
  153. ref="prescription_dialog"
  154. ></prescription-dialog>
  155. </van-popup>
  156. <van-popup
  157. title="接诊评估"
  158. v-model="menuList[2].showPopup"
  159. :overlay="true"
  160. :close-on-click-overlay="false"
  161. >
  162. <accepts-dialog
  163. :accepts="receiver_treatment_access"
  164. :patient_prop="patient"
  165. @finish="closeAcceptsAssessment"
  166. @close="closeAcceptsAssessment"
  167. ></accepts-dialog>
  168. </van-popup>
  169. <van-popup
  170. title="透前评估"
  171. v-model="menuList[3].showPopup"
  172. :overlay="true"
  173. :close-on-click-overlay="false"
  174. >
  175. <assessment-dialog
  176. :predialysis="predialysis_evaluation"
  177. :last_predialysis="last_predialysis_evaluation"
  178. :dry_weight="dryWeight"
  179. :patient_prop="patient"
  180. @evaluation="update_evaluation"
  181. @close="closeAssessmentBefore"
  182. :admin_users_prop="admin_users"
  183. ref="assessment_dialog"
  184. @weight_update="weightFunc"
  185. ></assessment-dialog>
  186. </van-popup>
  187. <van-popup
  188. title="临时医嘱"
  189. v-model="menuList[4].showPopup"
  190. :overlay="true"
  191. :close-on-click-overlay="false"
  192. >
  193. <orders-dialog
  194. :patient_prop="patient"
  195. :advice_groups="advice_groups"
  196. :advice_list_prop="doctor_advices"
  197. :admin_users_prop="admin_users"
  198. :special_premission="special_premission"
  199. @orderDialog="closeStatOrder"
  200. ref="orders_dialog"
  201. ></orders-dialog>
  202. </van-popup>
  203. <van-popup
  204. title="双人查对"
  205. v-model="menuList[5].showPopup"
  206. :overlay="true"
  207. :close-on-click-overlay="false"
  208. >
  209. <double-dialog
  210. :patient_prop="patient"
  211. :record="double_check"
  212. :admin_users_prop="admin_users"
  213. @did_update="closeDoubleCheck"
  214. @close="closeDoubleCheck"
  215. ></double-dialog>
  216. </van-popup>
  217. <van-popup
  218. title="透析上机"
  219. v-model="menuList[0].showPopup"
  220. :overlay="true"
  221. :close-on-click-overlay="false"
  222. >
  223. <computer-dialog
  224. :schedule="schedual"
  225. :patient_prop="patient"
  226. :record="dialysis_order"
  227. :admins="admin_users"
  228. :device_numbers="device_numbers"
  229. :admin_map="admin_user_map"
  230. :special_premission="special_premission"
  231. :device_number_map="device_number_map"
  232. @did_start="closeDialysisComputer"
  233. @did_add_monitor="didAddMonitor"
  234. @close="closeDialysisComputerclose"
  235. ref="computer_dialog"
  236. ></computer-dialog>
  237. </van-popup>
  238. <van-popup
  239. title="透析监测"
  240. v-model="menuList[6].showPopup"
  241. :overlay="true"
  242. :close-on-click-overlay="false"
  243. >
  244. <monit-dialog
  245. :monitor_records="monitor_records"
  246. :last_monitor_record="last_monitor_record"
  247. :patient="patient"
  248. :order="dialysis_order"
  249. @did_add_monitor="didAddMonitor"
  250. @did_edit_monitor="didEditMonitor"
  251. @did_delete_monitor="didDelMonitor"
  252. @close="closeMonitoring"
  253. ref="monit_dialog"
  254. ></monit-dialog>
  255. </van-popup>
  256. <van-popup
  257. title="透析下机"
  258. v-model="menuList[7].showPopup"
  259. :overlay="true"
  260. :close-on-click-overlay="false"
  261. >
  262. <plane-dialog
  263. :patient_prop="patient"
  264. :record="dialysis_order"
  265. :last_monitor_record="last_monitor_record"
  266. :admins="admin_users"
  267. :admin_map="admin_user_map"
  268. :special_premission="special_premission"
  269. @did_off="closeDialysisOff"
  270. @close="closeDialysisOffclose"
  271. ref="plane_dialog"
  272. ></plane-dialog>
  273. </van-popup>
  274. <van-popup
  275. title="透后评估"
  276. v-model="menuList[8].showPopup"
  277. :overlay="true"
  278. :close-on-click-overlay="false"
  279. >
  280. <thoroug-dialog
  281. :patient_prop="patient"
  282. :record="assessment_after_dislysis"
  283. :last_record="last_assessment_after_dislysis"
  284. @did_update="closeAssessmentAfter"
  285. @close="closeAssessmentAfter"
  286. ref="thoroug_dialog"
  287. ></thoroug-dialog>
  288. </van-popup>
  289. <van-popup
  290. title="治疗小结"
  291. v-model="menuList[9].showPopup"
  292. :overlay="true"
  293. :close-on-click-overlay="false"
  294. >
  295. <treatment-dialog
  296. :patient_prop="patient"
  297. :record="treatment_summary"
  298. @did_update="closeTreatmentOf"
  299. @close="closeTreatmentOf"
  300. ref="treatment_dialog"
  301. ></treatment-dialog>
  302. </van-popup>
  303. <!-- <div class="fixedNav" ref="fixed_nav" v-show="show_fixed_nav">
  304. <ul>
  305. <li @click="menuClick(1)">透析处方</li>
  306. <li @click="menuClick(2)">接诊评估</li>
  307. <li @click="menuClick(3)">透前评估</li>
  308. <li @click="menuClick(4)">临时医嘱</li>
  309. <li @click="menuClick(0)">透析上机</li>
  310. <li @click="menuClick(5)">双人核对</li>
  311. <li @click="menuClick(6)">透析监测</li>
  312. <li @click="menuClick(7)">透析下机</li>
  313. <li @click="menuClick(8)">透后评估</li>
  314. <li @click="menuClick(9)">治疗小结</li>
  315. </ul>
  316. </div>-->
  317. <el-button
  318. class="goTop"
  319. v-show="goTopShow"
  320. @click="goTop"
  321. type="primary"
  322. icon="el-icon-arrow-up"
  323. circle
  324. style="position:fixed;right:50px;bottom:50px;"
  325. ></el-button>
  326. </div>
  327. </template>
  328. <script>
  329. import DetailsInfo from "./detailsInfo";
  330. import DialysisPrescription from "./dialysisPrescription";
  331. import PastData from "./pastData";
  332. import AcceptsAssessment from "./acceptsAssessment";
  333. import AssessmentBefore from "./assessmentBefore";
  334. import StatOrder from "./statOrder";
  335. import DialysisComputer from "./dialysisComputer";
  336. import DoubleCheck from "./doubleCheck";
  337. import DialysisMonitoring from "./dialysisMonitoring";
  338. import DialysisOff from "./dialysisOff";
  339. import AssessmentAfter from "./assessmentAfter";
  340. import TreatmentOf from "./treatmentOf";
  341. import OperationStaff from "./operationStaff";
  342. import LongDialog from "../dialog/LongDialog";
  343. import PrescriptionDialog from "../dialog/PrescriptionDialog";
  344. import AssessmentDialog from "../dialog/AssessmentDialog";
  345. import ThorougDialog from "../dialog/ThorougDialog";
  346. import AcceptsDialog from "../dialog/AcceptsDialog";
  347. import PlaneDialog from "../dialog/PlaneDialog";
  348. import TreatmentDialog from "../dialog/TreatmentDialog";
  349. import DoubleDialog from "../dialog/DoubleDialog";
  350. import OrdersDialog from "../dialog/OrdersDialog";
  351. import MonitDialog from "../dialog/MonitDialog";
  352. import ComputerDialog from "../dialog/ComputerDialog";
  353. import {
  354. CreateGroupAdvice,
  355. dialysisGlobalConfig,
  356. getDialysisRecord
  357. } from "@/api/dialysis";
  358. import { GetRemindLongAdvice } from "@/api/advice";
  359. import { parseTime } from "@/utils";
  360. export default {
  361. name: "TodayTab",
  362. components: {
  363. DetailsInfo,
  364. DialysisPrescription,
  365. PastData,
  366. AcceptsAssessment,
  367. AssessmentBefore,
  368. StatOrder,
  369. DialysisComputer,
  370. DoubleCheck,
  371. DialysisMonitoring,
  372. DialysisOff,
  373. AssessmentAfter,
  374. TreatmentOf,
  375. OperationStaff,
  376. LongDialog,
  377. PrescriptionDialog,
  378. AssessmentDialog,
  379. ThorougDialog,
  380. AcceptsDialog,
  381. PlaneDialog,
  382. TreatmentDialog,
  383. DoubleDialog,
  384. OrdersDialog,
  385. MonitDialog,
  386. ComputerDialog
  387. },
  388. data() {
  389. return {
  390. loading: true,
  391. // show_fixed_nav: false,
  392. patient_id: 0,
  393. date: 0,
  394. menuList: [
  395. { value: "2", label: " 透析处方", showPopup: false },
  396. { value: "3", label: " 接诊评估", showPopup: false },
  397. { value: "4", label: " 透前评估", showPopup: false },
  398. { value: "5", label: " 临时医嘱", showPopup: false },
  399. { value: "6", label: " 透析上机", showPopup: false },
  400. { value: "1", label: " 双人核对", showPopup: false },
  401. { value: "7", label: " 透析监测", showPopup: false },
  402. { value: "8", label: " 透析下机", showPopup: false },
  403. { value: "9", label: " 透后评估", showPopup: false },
  404. { value: "10", label: " 治疗小结", showPopup: false }
  405. ],
  406. isPullData: 1,
  407. config: {}, // 库存自动扣减
  408. operators: [], // 操作人
  409. patient: {}, // 患者信息
  410. schedual: {}, // 患者排班信息
  411. prescription: {}, // 透析处方
  412. solution: {}, // 透析方案
  413. receiver_treatment_access: {}, // 接诊评估
  414. predialysis_evaluation: {}, // 透前评估
  415. last_predialysis_evaluation: {}, // 上次透前评估
  416. doctor_advices: [], // 临时医嘱
  417. advice_groups: [], // 对 doctor_advices 进行分组后的组列表,元素为 { group_no, start_time, advices:[advice object] }
  418. double_check: {}, // 双人核对
  419. assessment_after_dislysis: {}, // 透后评估
  420. last_assessment_after_dislysis: {}, // 上次透后评估
  421. treatment_summary: {}, // 治疗小结
  422. monitor_records: [], // 透析监测
  423. special_premission: [],
  424. last_monitor_record: {
  425. id: 0,
  426. operate_time: new Date().getTime(),
  427. sodium_concentration: "",
  428. dialysate_temperature: ""
  429. }, // 上一次透析的监测记录
  430. dialysis_order: {}, // 透析记录
  431. admin_users: [], // 系统用户列表
  432. devices: [], // 设备
  433. device_numbers: [], // 床位号
  434. admin_user_map: {}, // {user_id: admin_user object}
  435. device_map: {}, // {device_id: device}
  436. device_number_map: {}, // {device_number_id: device_number}
  437. scrollTop: "",
  438. goTopShow: false,
  439. goodTypes: [],
  440. goodInfos: [],
  441. dryWeight: {},
  442. longAdvices: [],
  443. waitUploadAdvices: [],
  444. is_open: 0,
  445. targetAdvices: [],
  446. status: ""
  447. };
  448. },
  449. computed: {
  450. stepData: function() {
  451. var steps = [
  452. { title: "透析处方", name: "prescription", value: 0 },
  453. { title: "接诊评估", name: "accepts_assessment", value: 0 },
  454. { title: "透前评估", name: "assessment_before", value: 0 },
  455. { title: "临时医嘱", name: "stat_order", value: 0 },
  456. { title: "双人核对", name: "double_check", value: 0 },
  457. { title: "透析上机", name: "dialysis_computer", value: 0 },
  458. { title: "透析监测", name: "dialysis_monitoring", value: 0 },
  459. { title: "透析下机", name: "dialysis_off", value: 0 },
  460. { title: "透后评估", name: "assessment_after", value: 0 },
  461. { title: "治疗小结", name: "treatment_of", value: 0 }
  462. ];
  463. if (
  464. !isNaN(this.prescription.id) &&
  465. this.prescription.id > 0 &&
  466. this.prescription.creater > 0
  467. ) {
  468. steps[0].value = 1;
  469. }
  470. if (
  471. !isNaN(this.receiver_treatment_access.id) &&
  472. this.receiver_treatment_access.id > 0
  473. ) {
  474. steps[1].value = 1;
  475. }
  476. if (
  477. typeof this.predialysis_evaluation.id !== "undefined" &&
  478. !isNaN(this.predialysis_evaluation.id) &&
  479. this.predialysis_evaluation.id > 0 &&
  480. this.predialysis_evaluation.creater > 0
  481. ) {
  482. steps[2].value = 1;
  483. }
  484. if (this.advice_groups.length > 0) {
  485. steps[3].value = 1;
  486. }
  487. if (!isNaN(this.dialysis_order.id) && this.dialysis_order.id > 0) {
  488. steps[5].value = 1;
  489. if (this.dialysis_order.stage == 2) {
  490. steps[7].value = 1;
  491. }
  492. }
  493. if (
  494. !isNaN(this.double_check.creater) &&
  495. this.double_check.creater > 0 &&
  496. !isNaN(this.double_check.modifier) &&
  497. this.double_check.modifier > 0
  498. ) {
  499. steps[4].value = 1;
  500. }
  501. if (this.monitor_records.length > 0) {
  502. steps[6].value = 1;
  503. }
  504. if (
  505. !isNaN(this.assessment_after_dislysis.id) &&
  506. this.assessment_after_dislysis.id > 0
  507. ) {
  508. steps[8].value = 1;
  509. }
  510. if (!isNaN(this.treatment_summary.id) && this.treatment_summary.id > 0) {
  511. steps[9].value = 1;
  512. }
  513. return steps;
  514. }
  515. },
  516. created() {
  517. var patient_id = this.$route.query.patient_id;
  518. var date = this.$route.query.date;
  519. this.patient_id = patient_id;
  520. this.date = date;
  521. this.requestDialysisRecord();
  522. this.requestLongAdvice();
  523. this.goTop();
  524. },
  525. mounted() {
  526. window.addEventListener("scroll", this.handleScroll);
  527. },
  528. watch: {
  529. doctor_advices: function() {
  530. this.$refs.stat_order.setAdvices(this.doctor_advices);
  531. },
  532. monitor_records: function() {
  533. this.$refs.monitoring.setRecords(this.monitor_records);
  534. },
  535. $route: "requestDialysisRecord"
  536. },
  537. methods: {
  538. // handleScroll: function() {
  539. // var scrollTop =
  540. // window.pageYOffset ||
  541. // document.documentElement.scrollTop ||
  542. // document.body.scrollTop;
  543. // this.show_fixed_nav = scrollTop > 160;
  544. // },
  545. didAddMonitor(monitor) {
  546. this.monitor_records.push(monitor);
  547. this.monitor_records.sort((a, b) => b.operate_time - a.operate_time);
  548. // for (let index = 0; index < this.monitor_records.length; index++) {
  549. // const record = this.monitor_records[index];
  550. // if (record.operate_time <= monitor.operate_time) {
  551. // this.monitor_records.splice(index, 0, monitor)
  552. // break
  553. // }
  554. // }
  555. this.monitor_records.reverse();
  556. this.last_monitor_record = monitor;
  557. this.$refs.plane_dialog.set_last_monitor_record(monitor);
  558. },
  559. didEditMonitor(monitor) {
  560. var mrl = this.monitor_records.length;
  561. var monitor_index = -1;
  562. for (let index = 0; index < mrl; index++) {
  563. if (this.monitor_records[index].id == monitor.id) {
  564. monitor_index = index;
  565. break;
  566. }
  567. }
  568. console.log(monitor);
  569. console.log(this.monitor_records[monitor_index]);
  570. this.monitor_records[monitor_index].arterial_pressure =
  571. monitor.arterial_pressure;
  572. this.monitor_records[monitor_index].blood_flow_volume =
  573. monitor.blood_flow_volume;
  574. this.monitor_records[monitor_index].breathing_rate =
  575. monitor.breathing_rate;
  576. this.monitor_records[monitor_index].dialysate_temperature =
  577. monitor.dialysate_temperature;
  578. this.monitor_records[monitor_index].temperature = monitor.temperature;
  579. this.monitor_records[monitor_index].diastolic_bp = monitor.diastolic_bp;
  580. this.monitor_records[monitor_index].displacement_quantity =
  581. monitor.displacement_quantity;
  582. this.monitor_records[monitor_index].dispose = monitor.dispose;
  583. this.monitor_records[monitor_index].ktv = monitor.ktv;
  584. this.monitor_records[monitor_index].monitor_date = monitor.monitor_date;
  585. this.monitor_records[monitor_index].monitoring_nurse =
  586. monitor.monitoring_nurse;
  587. this.monitor_records[monitor_index].operate_time = monitor.operate_time;
  588. this.monitor_records[monitor_index].pulse_frequency =
  589. monitor.pulse_frequency;
  590. this.monitor_records[monitor_index].replacement_rate =
  591. monitor.replacement_rate;
  592. this.monitor_records[monitor_index].result = monitor.result;
  593. this.monitor_records[monitor_index].sodium_concentration =
  594. monitor.sodium_concentration;
  595. this.monitor_records[monitor_index].symptom = monitor.symptom;
  596. this.monitor_records[monitor_index].systolic_bp = monitor.systolic_bp;
  597. this.monitor_records[monitor_index].transmembrane_pressure =
  598. monitor.transmembrane_pressure;
  599. this.monitor_records[monitor_index].ultrafiltration_rate =
  600. monitor.ultrafiltration_rate;
  601. this.monitor_records[monitor_index].ultrafiltration_volume =
  602. monitor.ultrafiltration_volume;
  603. this.monitor_records[monitor_index].venous_pressure =
  604. monitor.venous_pressure;
  605. this.monitor_records[monitor_index].diastolic_blood_pressure =
  606. monitor.diastolic_blood_pressure;
  607. this.monitor_records[monitor_index].systolic_blood_pressure =
  608. monitor.systolic_blood_pressure;
  609. this.monitor_records[monitor_index].conductivity = monitor.conductivity;
  610. this.monitor_records[monitor_index].displacement_flow_quantity =
  611. monitor.displacement_flow_quantity;
  612. this.monitor_records.sort((a, b) => a.operate_time - b.operate_time);
  613. // if (monitor_index >= 0) {
  614. // var record = this.monitor_records[monitor_index]
  615. //
  616. // this.monitor_records.splice(monitor_index, 1)
  617. // if(this.monitor_records.length == 0){
  618. // this.monitor_records.splice(0, 0, monitor)
  619. // }else {
  620. //
  621. // for (let index = 0; index < this.monitor_records.length; index++) {
  622. // const temp = this.monitor_records[index];
  623. // if (temp.operate_time <= monitor.operate_time) {
  624. // this.monitor_records.splice(index, 0, monitor)
  625. // break
  626. // }
  627. // }
  628. // }
  629. // }
  630. },
  631. didDelMonitor(record_id) {
  632. var mrl = this.monitor_records.length;
  633. for (let index = 0; index < mrl; index++) {
  634. if (this.monitor_records[index].id == record_id) {
  635. this.monitor_records.splice(index, 1);
  636. break;
  637. }
  638. }
  639. },
  640. menuClick: function(popupIndex) {
  641. this.index = popupIndex;
  642. if (popupIndex >= 0) {
  643. this.menuList[popupIndex].showPopup = true;
  644. }
  645. if (
  646. popupIndex == 1 &&
  647. typeof this.$refs.prescription_dialog !== "undefined"
  648. ) {
  649. this.$refs.prescription_dialog.open();
  650. } else if (
  651. popupIndex == 3 &&
  652. typeof this.$refs.assessment_dialog !== "undefined"
  653. ) {
  654. this.$refs.assessment_dialog.open();
  655. } else if (
  656. popupIndex == 4 &&
  657. typeof this.$refs.orders_dialog !== "undefined"
  658. ) {
  659. // this.$refs.orders_dialog.open();
  660. } else if (
  661. popupIndex == 0 &&
  662. typeof this.$refs.computer_dialog !== "undefined"
  663. ) {
  664. this.$refs.computer_dialog.open();
  665. } else if (
  666. popupIndex == 6 &&
  667. typeof this.$refs.monit_dialog !== "undefined"
  668. ) {
  669. this.$refs.monit_dialog.open();
  670. } else if (
  671. popupIndex == 7 &&
  672. typeof this.$refs.plane_dialog !== "undefined"
  673. ) {
  674. this.$refs.plane_dialog.open();
  675. } else if (
  676. popupIndex == 8 &&
  677. typeof this.$refs.thoroug_dialog !== "undefined"
  678. ) {
  679. this.$refs.thoroug_dialog.open();
  680. } else if (
  681. popupIndex == 9 &&
  682. typeof this.$refs.treatment_dialog !== "undefined"
  683. ) {
  684. this.$refs.treatment_dialog.open();
  685. }
  686. },
  687. popupDidHide: function(popupIndex) {
  688. this.index = -1;
  689. },
  690. closeDialog(index) {
  691. this.index = -1;
  692. this.menuList[index].showPopup = false;
  693. },
  694. refresh() {
  695. var dateStr = parseTime(this.$route.query.date, "{y}-{m}-{d}");
  696. var params = {
  697. patient_id: this.$route.query.patient_id,
  698. date: dateStr
  699. };
  700. getDialysisRecord(params).then(rs => {
  701. var resp = rs.data;
  702. console.log(resp);
  703. if (resp.state == 1) {
  704. var patient = resp.data.patient; // 患者信息
  705. var schedual = resp.data.schedual; // 患者排班信息
  706. var prescription = resp.data.prescription; // 透析处方
  707. var solution = resp.data.solution; // 透析方案
  708. var receiver_treatment_access = resp.data.receiver_treatment_access; // 接诊评估
  709. var predialysis_evaluation = resp.data.predialysis_evaluation; // 透前评估
  710. var doctor_advices = resp.data.doctor_advices; // 临时医嘱
  711. this.dryWeight = resp.data.dry_weight;
  712. for (let i = 0; i < doctor_advices.length; i++) {
  713. doctor_advices[i]["is_selected"] = 0;
  714. }
  715. console.log(doctor_advices);
  716. var double_check = resp.data.double_check; // 双人核对
  717. var assessment_after_dislysis = resp.data.assessment_after_dislysis; // 透后评估
  718. var treatment_summary = resp.data.treatment_summary; // 治疗小结
  719. var monitor_records = resp.data.monitor_records; // 透析监测
  720. var dialysis_order = resp.data.dialysis_order; // 透析记录
  721. var operators = resp.data.operators; // 操作人
  722. var last_predialysis_evaluation =
  723. resp.data.last_predialysis_evaluation; // 上一次透前评估
  724. var last_assessment_after_dislysis =
  725. resp.data.last_assessment_after_dislysis; // 上一次透前评估
  726. var last_monitor_record = resp.data.last_monitor_record;
  727. this.patient = patient;
  728. this.schedual = schedual == null ? {} : schedual;
  729. this.prescription = prescription == null ? { id: "" } : prescription;
  730. this.solution = solution == null ? { id: "" } : solution;
  731. this.receiver_treatment_access =
  732. receiver_treatment_access == null
  733. ? { id: "" }
  734. : receiver_treatment_access;
  735. this.predialysis_evaluation =
  736. predialysis_evaluation == null ? {} : predialysis_evaluation;
  737. this.last_predialysis_evaluation =
  738. last_predialysis_evaluation == null
  739. ? {}
  740. : last_predialysis_evaluation;
  741. this.doctor_advices = doctor_advices == null ? [] : doctor_advices;
  742. if (this.doctor_advices.length > 0) {
  743. var group = this.newAdviceGroupObject();
  744. var initGroupBlock = function(group, advice) {
  745. group.group_no = advice.groupno;
  746. // group.start_time = advice.start_time
  747. // group.advice_doctor = advice.advice_doctor
  748. // group.exec_staff = advice.execution_staff
  749. // group.exec_time = advice.execution_time
  750. // group.checker = advice.checker
  751. };
  752. for (let index = 0; index < this.doctor_advices.length; index++) {
  753. const advice = this.doctor_advices[index];
  754. if (advice.groupno == 0) {
  755. // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
  756. if (advice.parent_id > 0) {
  757. if (this.advice_groups.length > 0) {
  758. var parent_group = this.advice_groups[
  759. this.advice_groups.length - 1
  760. ];
  761. if (parent_group.advices.length > 0) {
  762. if (parent_group.advices[0].id == advice.parent_id) {
  763. parent_group.advices.push(advice);
  764. }
  765. }
  766. }
  767. continue;
  768. } else {
  769. if (group.group_no > 0) {
  770. this.advice_groups.push(group);
  771. group = this.newAdviceGroupObject();
  772. }
  773. initGroupBlock(group, advice);
  774. group.advices.push(advice);
  775. this.advice_groups.push(group);
  776. group = this.newAdviceGroupObject();
  777. continue;
  778. }
  779. }
  780. if (group.group_no > 0 && group.group_no != advice.groupno) {
  781. this.advice_groups.push(group);
  782. group = this.newAdviceGroupObject();
  783. }
  784. if (group.group_no == 0) {
  785. initGroupBlock(group, advice);
  786. }
  787. if (group.group_no == advice.groupno) {
  788. group.advices.push(advice);
  789. }
  790. }
  791. if (group.group_no > 0) {
  792. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
  793. this.advice_groups.push(group);
  794. }
  795. // console.log(this.advice_groups)
  796. }
  797. this.double_check = double_check == null ? { id: "" } : double_check;
  798. this.assessment_after_dislysis =
  799. assessment_after_dislysis == null
  800. ? { id: "" }
  801. : assessment_after_dislysis;
  802. this.last_assessment_after_dislysis =
  803. last_assessment_after_dislysis == null
  804. ? { id: "" }
  805. : last_assessment_after_dislysis;
  806. this.treatment_summary =
  807. treatment_summary == null ? { id: "" } : treatment_summary;
  808. this.monitor_records = monitor_records == null ? [] : monitor_records;
  809. this.last_monitor_record =
  810. last_monitor_record == null
  811. ? this.last_monitor_record
  812. : last_monitor_record;
  813. this.dialysis_order =
  814. dialysis_order == null ? { id: "" } : dialysis_order;
  815. this.operators = operators;
  816. this.$refs.stat_order.setAdvices(this.doctor_advices);
  817. this.$refs.monitoring.setRecords(this.monitor_records);
  818. this.title = patient.name;
  819. dialysisGlobalConfig().then(rs => {
  820. var res = rs.data;
  821. if (res.state == 1) {
  822. // console.log(res)
  823. // this.$refs.detail_menu.setGlobalConfig(res.data)
  824. this.admin_users = res.data.admin_users;
  825. this.devices = res.data.devices;
  826. this.device_numbers = res.data.device_numbers;
  827. var device_map = {};
  828. for (let index = 0; index < this.devices.length; index++) {
  829. const device = this.devices[index];
  830. device_map[device.id] = device;
  831. }
  832. this.device_map = device_map;
  833. var admin_map = {};
  834. for (let index = 0; index < this.admin_users.length; index++) {
  835. const admin = this.admin_users[index];
  836. admin_map[admin.id] = admin;
  837. }
  838. this.admin_user_map = admin_map;
  839. var device_number_map = {};
  840. for (let index = 0; index < this.device_numbers.length; index++) {
  841. const device_number = this.device_numbers[index];
  842. device_number_map[device_number.id] = device_number;
  843. }
  844. this.device_number_map = device_number_map;
  845. }
  846. this.loading = false;
  847. });
  848. } else {
  849. this.$toast({
  850. message: resp.msg
  851. });
  852. this.loading = false;
  853. }
  854. });
  855. },
  856. weightFunc(val) {
  857. this.dryWeight = val;
  858. },
  859. requestDialysisRecord() {
  860. var dateStr = parseTime(this.date, "{y}-{m}-{d}");
  861. var params = {
  862. patient_id: this.patient_id,
  863. date: dateStr
  864. };
  865. this.advice_groups = [];
  866. this.doctor_advices = [];
  867. getDialysisRecord(params).then(rs => {
  868. var resp = rs.data;
  869. console.log(resp);
  870. if (resp.state == 1) {
  871. var waitstoredata = this.$store.getters.waitscheduals;
  872. var waitscheduals = waitstoredata.waitscheduals;
  873. var storedata = this.$store.getters.scheduals;
  874. var scheduals = storedata.scheduals;
  875. var patient = resp.data.patient; // 患者信息
  876. var schedual = resp.data.schedual; // 患者排班信息
  877. var prescription = resp.data.prescription; // 透析处方
  878. var solution = resp.data.solution; // 透析方案
  879. var receiver_treatment_access = resp.data.receiver_treatment_access; // 接诊评估
  880. var predialysis_evaluation = resp.data.predialysis_evaluation; // 透前评估
  881. var doctor_advices = resp.data.doctor_advices; // 临时医嘱
  882. this.dryWeight = resp.data.dry_weight;
  883. if (prescription == null || prescription.creater == 0) {
  884. this.isPullData = 1;
  885. } else {
  886. this.isPullData = 2;
  887. }
  888. this.goodInfos = resp.data.goodInfos;
  889. for (let i = 0; i < doctor_advices.length; i++) {
  890. doctor_advices[i]["is_selected"] = 0;
  891. }
  892. console.log(doctor_advices);
  893. var double_check = resp.data.double_check; // 双人核对
  894. var assessment_after_dislysis = resp.data.assessment_after_dislysis; // 透后评估
  895. var treatment_summary = resp.data.treatment_summary; // 治疗小结
  896. var monitor_records = resp.data.monitor_records; // 透析监测
  897. var dialysis_order = resp.data.dialysis_order; // 透析记录
  898. var operators = resp.data.operators; // 操作人
  899. var special_premission = resp.data.special_premission; // 特殊权限
  900. var config = resp.data.config; // 库存自动扣减配置
  901. var types = resp.data.types; // 所有系统库存商品类型
  902. var last_predialysis_evaluation =
  903. resp.data.last_predialysis_evaluation; // 上一次透前评估
  904. var last_assessment_after_dislysis =
  905. resp.data.last_assessment_after_dislysis; // 上一次透前评估
  906. var last_monitor_record = resp.data.last_monitor_record;
  907. if (Object.keys(waitstoredata).length > 0) {
  908. for (let index = 0; index < waitscheduals.length; index++) {
  909. if (waitscheduals[index].patient_id == patient.id) {
  910. waitscheduals[index].patient = patient;
  911. waitscheduals[
  912. index
  913. ].assessment_before_dislysis = predialysis_evaluation;
  914. waitscheduals[index].prescription = prescription;
  915. waitscheduals[index].doctor_advice = doctor_advices;
  916. waitscheduals[index].dialysis_order = dialysis_order;
  917. }
  918. }
  919. this.$store.dispatch("SetWaitScheduals", {
  920. waitscheduals: waitscheduals
  921. });
  922. }
  923. if (Object.keys(storedata).length > 0) {
  924. for (let index = 0; index < scheduals.length; index++) {
  925. if (scheduals[index].patient_id == patient.id) {
  926. scheduals[index].patient = patient;
  927. scheduals[
  928. index
  929. ].assessment_before_dislysis = predialysis_evaluation;
  930. scheduals[index].prescription = prescription;
  931. scheduals[index].doctor_advice = doctor_advices;
  932. scheduals[index].dialysis_order = dialysis_order;
  933. }
  934. }
  935. this.$store.dispatch("SetScheduals", { scheduals: scheduals });
  936. }
  937. this.patient = patient;
  938. this.schedual = schedual == null ? {} : schedual;
  939. this.prescription = prescription == null ? { id: "" } : prescription;
  940. this.solution = solution == null ? { id: "" } : solution;
  941. this.receiver_treatment_access =
  942. receiver_treatment_access == null
  943. ? { id: "" }
  944. : receiver_treatment_access;
  945. this.predialysis_evaluation =
  946. predialysis_evaluation == null ? {} : predialysis_evaluation;
  947. this.last_predialysis_evaluation =
  948. last_predialysis_evaluation == null
  949. ? {}
  950. : last_predialysis_evaluation;
  951. this.doctor_advices = doctor_advices == null ? [] : doctor_advices;
  952. this.special_premission = special_premission;
  953. this.config = config;
  954. this.goodTypes = types;
  955. if (this.doctor_advices.length > 0) {
  956. var group = this.newAdviceGroupObject();
  957. var initGroupBlock = function(group, advice) {
  958. group.group_no = advice.groupno;
  959. // group.start_time = advice.start_time
  960. // group.advice_doctor = advice.advice_doctor
  961. // group.exec_staff = advice.execution_staff
  962. // group.exec_time = advice.execution_time
  963. // group.checker = advice.checker
  964. };
  965. for (let index = 0; index < this.doctor_advices.length; index++) {
  966. const advice = this.doctor_advices[index];
  967. if (advice.groupno == 0) {
  968. // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
  969. if (advice.parent_id > 0) {
  970. if (this.advice_groups.length > 0) {
  971. var parent_group = this.advice_groups[
  972. this.advice_groups.length - 1
  973. ];
  974. if (parent_group.advices.length > 0) {
  975. if (parent_group.advices[0].id == advice.parent_id) {
  976. parent_group.advices.push(advice);
  977. }
  978. }
  979. }
  980. continue;
  981. } else {
  982. if (group.group_no > 0) {
  983. this.advice_groups.push(group);
  984. group = this.newAdviceGroupObject();
  985. }
  986. initGroupBlock(group, advice);
  987. group.advices.push(advice);
  988. this.advice_groups.push(group);
  989. group = this.newAdviceGroupObject();
  990. continue;
  991. }
  992. }
  993. if (group.group_no > 0 && group.group_no != advice.groupno) {
  994. this.advice_groups.push(group);
  995. group = this.newAdviceGroupObject();
  996. }
  997. if (group.group_no == 0) {
  998. initGroupBlock(group, advice);
  999. }
  1000. if (group.group_no == advice.groupno) {
  1001. group.advices.push(advice);
  1002. }
  1003. }
  1004. if (group.group_no > 0) {
  1005. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
  1006. this.advice_groups.push(group);
  1007. }
  1008. // console.log(this.advice_groups)
  1009. }
  1010. this.double_check = double_check == null ? { id: "" } : double_check;
  1011. this.assessment_after_dislysis =
  1012. assessment_after_dislysis == null
  1013. ? { id: "" }
  1014. : assessment_after_dislysis;
  1015. this.last_assessment_after_dislysis =
  1016. last_assessment_after_dislysis == null
  1017. ? { id: "" }
  1018. : last_assessment_after_dislysis;
  1019. this.treatment_summary =
  1020. treatment_summary == null ? { id: "" } : treatment_summary;
  1021. this.monitor_records = monitor_records == null ? [] : monitor_records;
  1022. this.last_monitor_record =
  1023. last_monitor_record == null
  1024. ? this.last_monitor_record
  1025. : last_monitor_record;
  1026. this.dialysis_order =
  1027. dialysis_order == null ? { id: "" } : dialysis_order;
  1028. this.operators = operators;
  1029. this.$refs.stat_order.setAdvices(this.doctor_advices);
  1030. this.$refs.monitoring.setRecords(this.monitor_records);
  1031. this.title = patient.name;
  1032. dialysisGlobalConfig().then(rs => {
  1033. var res = rs.data;
  1034. if (res.state == 1) {
  1035. // console.log(res)
  1036. // this.$refs.detail_menu.setGlobalConfig(res.data)
  1037. this.admin_users = res.data.admin_users;
  1038. this.devices = res.data.devices;
  1039. this.device_numbers = res.data.device_numbers;
  1040. var device_map = {};
  1041. for (let index = 0; index < this.devices.length; index++) {
  1042. const device = this.devices[index];
  1043. device_map[device.id] = device;
  1044. }
  1045. this.device_map = device_map;
  1046. var admin_map = {};
  1047. for (let index = 0; index < this.admin_users.length; index++) {
  1048. const admin = this.admin_users[index];
  1049. admin_map[admin.id] = admin;
  1050. }
  1051. this.admin_user_map = admin_map;
  1052. var device_number_map = {};
  1053. for (let index = 0; index < this.device_numbers.length; index++) {
  1054. const device_number = this.device_numbers[index];
  1055. device_number_map[device_number.id] = device_number;
  1056. }
  1057. this.device_number_map = device_number_map;
  1058. }
  1059. this.loading = false;
  1060. });
  1061. } else {
  1062. this.$toast({
  1063. message: resp.msg
  1064. });
  1065. this.loading = false;
  1066. }
  1067. });
  1068. },
  1069. requestLongAdvice() {
  1070. var dateStr = parseTime(this.date, "{y}-{m}-{d}");
  1071. var params = {
  1072. id: this.patient_id
  1073. };
  1074. GetRemindLongAdvice(params).then(rs => {
  1075. var resp = rs.data;
  1076. if (resp.state == 1) {
  1077. var status = parseInt(resp.data.status);
  1078. this.status = status;
  1079. switch (status) {
  1080. case 2:
  1081. var totalAdvice = resp.data.advices;
  1082. var longAdvicesTwo = resp.data.advices_two;
  1083. var waitUploadAdvices = [];
  1084. for (let i = 0; i < totalAdvice.length; i++) {
  1085. totalAdvice[i]["isCheck"] = 1;
  1086. }
  1087. for (let i = 0; i < totalAdvice.length; i++) {
  1088. for (let a = 0; a < longAdvicesTwo.length; a++) {
  1089. if (
  1090. totalAdvice[i].template_id ==
  1091. longAdvicesTwo[a].template_id &&
  1092. totalAdvice[i].frequency_type ==
  1093. longAdvicesTwo[a].frequency_type
  1094. ) {
  1095. totalAdvice[i]["isCheck"] = 0;
  1096. }
  1097. }
  1098. }
  1099. for (let i = 0; i < totalAdvice.length; i++) {
  1100. if (totalAdvice[i].isCheck == 1) {
  1101. waitUploadAdvices.push(totalAdvice[i]);
  1102. }
  1103. }
  1104. this.is_open = resp.data.is_open_remind;
  1105. this.longAdvices = totalAdvice;
  1106. this.waitUploadAdvices = waitUploadAdvices;
  1107. break;
  1108. }
  1109. } else {
  1110. }
  1111. });
  1112. },
  1113. getNowFormatDate() {
  1114. var date = new Date();
  1115. var seperator1 = "-";
  1116. var year = date.getFullYear();
  1117. var month = date.getMonth() + 1;
  1118. var strDate = date.getDate();
  1119. if (month >= 1 && month <= 9) {
  1120. month = "0" + month;
  1121. }
  1122. if (strDate >= 0 && strDate <= 9) {
  1123. strDate = "0" + strDate;
  1124. }
  1125. var currentdate = year + seperator1 + month + seperator1 + strDate;
  1126. return currentdate;
  1127. },
  1128. newAdviceGroupObject: function() {
  1129. return Object.assign(
  1130. {},
  1131. {
  1132. group_no: 0,
  1133. // advice_doctor: 0,
  1134. // start_time: 0,
  1135. advices: []
  1136. // exec_staff: 0,
  1137. // exec_time: 0,
  1138. // checker: 0,
  1139. }
  1140. );
  1141. },
  1142. adviceFunc: function() {},
  1143. prescriptionFunc: function(val, advices) {
  1144. this.prescription = val;
  1145. this.requestDialysisRecord();
  1146. // if (advices.length > 0){
  1147. //
  1148. // // if (advices.length > 0) {
  1149. // // var group = this.newAdviceGroupObject()
  1150. // // var initGroupBlock = function (group, advice) {
  1151. // // group.group_no = advice.groupno
  1152. // // // group.start_time = advice.start_time
  1153. // // // group.advice_doctor = advice.advice_doctor
  1154. // // // group.exec_staff = advice.execution_staff
  1155. // // // group.exec_time = advice.execution_time
  1156. // // // group.checker = advice.checker
  1157. // // }
  1158. // // for (let index = 0; index < advices.length; index++) {
  1159. // // const advice = advices[index]
  1160. // // if (advice.groupno == 0) {
  1161. // // // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
  1162. // // if (advice.parent_id > 0) {
  1163. // // if (this.advice_groups.length > 0) {
  1164. // // var parent_group = this.advice_groups[
  1165. // // this.advice_groups.length - 1
  1166. // // ]
  1167. // // if (parent_group.advices.length > 0) {
  1168. // // if (parent_group.advices[0].id == advice.parent_id) {
  1169. // // parent_group.advices.push(advice)
  1170. // // }
  1171. // // }
  1172. // // }
  1173. // // continue
  1174. // // } else {
  1175. // // if (group.group_no > 0) {
  1176. // // this.advice_groups.push(group)
  1177. // // group = this.newAdviceGroupObject()
  1178. // // }
  1179. // //
  1180. // // initGroupBlock(group, advice)
  1181. // // group.advices.push(advice)
  1182. // // this.advice_groups.push(group)
  1183. // // group = this.newAdviceGroupObject()
  1184. // // continue
  1185. // // }
  1186. // // }
  1187. // //
  1188. // // if (group.group_no > 0 && group.group_no != advice.groupno) {
  1189. // // this.advice_groups.push(group)
  1190. // // group = this.newAdviceGroupObject()
  1191. // // }
  1192. // // if (group.group_no == 0) {
  1193. // // initGroupBlock(group, advice)
  1194. // // }
  1195. // // if (group.group_no == advice.groupno) {
  1196. // // group.advices.push(advice)
  1197. // // }
  1198. // // }
  1199. // // if (group.group_no > 0) {
  1200. // // // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
  1201. // // this.advice_groups.push(group)
  1202. // // }
  1203. // //
  1204. // // }
  1205. //
  1206. //
  1207. // }
  1208. },
  1209. longSolutionFunc: function(val) {
  1210. this.solution = val;
  1211. this.requestDialysisRecord();
  1212. // if (advices.length > 0){
  1213. //
  1214. // if (advices.length > 0) {
  1215. // var group = this.newAdviceGroupObject()
  1216. // var initGroupBlock = function (group, advice) {
  1217. // group.group_no = advice.groupno
  1218. // // group.start_time = advice.start_time
  1219. // // group.advice_doctor = advice.advice_doctor
  1220. // // group.exec_staff = advice.execution_staff
  1221. // // group.exec_time = advice.execution_time
  1222. // // group.checker = advice.checker
  1223. // }
  1224. // for (let index = 0; index < advices.length; index++) {
  1225. // const advice = advices[index]
  1226. // if (advice.groupno == 0) {
  1227. // // 老版本的医嘱没有分组的概念,所以这一个 if 是解决这个问题的,将每个无分组的医嘱各自归为一组
  1228. // if (advice.parent_id > 0) {
  1229. // if (this.advice_groups.length > 0) {
  1230. // var parent_group = this.advice_groups[
  1231. // this.advice_groups.length - 1
  1232. // ]
  1233. // if (parent_group.advices.length > 0) {
  1234. // if (parent_group.advices[0].id == advice.parent_id) {
  1235. // parent_group.advices.push(advice)
  1236. // }
  1237. // }
  1238. // }
  1239. // continue
  1240. // } else {
  1241. // if (group.group_no > 0) {
  1242. // this.advice_groups.push(group)
  1243. // group = this.newAdviceGroupObject()
  1244. // }
  1245. //
  1246. // initGroupBlock(group, advice)
  1247. // group.advices.push(advice)
  1248. // this.advice_groups.push(group)
  1249. // group = this.newAdviceGroupObject()
  1250. // continue
  1251. // }
  1252. // }
  1253. //
  1254. // if (group.group_no > 0 && group.group_no != advice.groupno) {
  1255. // this.advice_groups.push(group)
  1256. // group = this.newAdviceGroupObject()
  1257. // }
  1258. // if (group.group_no == 0) {
  1259. // initGroupBlock(group, advice)
  1260. // }
  1261. // if (group.group_no == advice.groupno) {
  1262. // group.advices.push(advice)
  1263. // }
  1264. // }
  1265. // if (group.group_no > 0) {
  1266. // // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加上
  1267. // this.advice_groups.push(group)
  1268. // }
  1269. //
  1270. // }
  1271. //
  1272. //
  1273. // }
  1274. },
  1275. closePrescriptionDialog: function() {
  1276. this.closeDialog(1);
  1277. // this.scrollToView('prescription')
  1278. },
  1279. closeAcceptsAssessment: function() {
  1280. this.closeDialog(2);
  1281. // this.scrollToView('accepts_assessment')
  1282. },
  1283. closeAssessmentBefore: function() {
  1284. this.closeDialog(3);
  1285. // this.scrollToView('assessment_before')
  1286. },
  1287. update_evaluation: function(evaluation) {
  1288. this.predialysis_evaluation = evaluation;
  1289. this.closeAssessmentBefore();
  1290. this.requestDialysisRecord();
  1291. },
  1292. closeStatOrder: function() {
  1293. this.closeDialog(4);
  1294. // this.scrollToView('stat_order')
  1295. },
  1296. closeDialysisComputer: function(dialysis_order) {
  1297. this.closeDialog(0);
  1298. this.dialysis_order = dialysis_order;
  1299. this.requestDialysisRecord();
  1300. // this.scrollToView('dialysis_computer')
  1301. },
  1302. closeDialysisComputerclose: function(dialysis_order) {
  1303. this.closeDialog(0);
  1304. // this.dialysis_order = dialysis_order
  1305. // this.scrollToView('dialysis_computer')
  1306. },
  1307. closeDoubleCheck: function() {
  1308. this.closeDialog(5);
  1309. // this.scrollToView('double_check')
  1310. },
  1311. closeMonitoring: function() {
  1312. this.closeDialog(6);
  1313. // this.scrollToView('monitoring')
  1314. },
  1315. closeDialysisOff: function(assessment_after_dislysis) {
  1316. this.closeDialog(7);
  1317. if (assessment_after_dislysis != undefined) {
  1318. this.assessment_after_dislysis = assessment_after_dislysis;
  1319. }
  1320. },
  1321. closeDialysisOffclose: function() {
  1322. this.closeDialog(7);
  1323. // this.scrollToView('dialysis_off')
  1324. },
  1325. closeAssessmentAfter: function(assessment_after_dislysis) {
  1326. this.closeDialog(8);
  1327. // this.scrollToView('assessment_after')
  1328. if (assessment_after_dislysis != undefined) {
  1329. this.assessment_after_dislysis = assessment_after_dislysis;
  1330. }
  1331. },
  1332. closeTreatmentOf: function() {
  1333. this.closeDialog(9);
  1334. // this.scrollToView('treatment_of')
  1335. },
  1336. scrollToView: function(id) {
  1337. document.body.scrollTop =
  1338. document.querySelector("#" + id).offsetTop - 100;
  1339. document.documentElement.scrollTop =
  1340. document.querySelector("#" + id).offsetTop - 100;
  1341. },
  1342. handleScroll() {
  1343. this.scrollTop =
  1344. window.pageYOffset ||
  1345. document.documentElement.scrollTop ||
  1346. document.body.scrollTop;
  1347. if (this.scrollTop > 50) {
  1348. this.goTopShow = true;
  1349. } else {
  1350. this.goTopShow = false;
  1351. }
  1352. },
  1353. goTop() {
  1354. let timer = null,
  1355. _that = this;
  1356. cancelAnimationFrame(timer);
  1357. timer = requestAnimationFrame(function fn() {
  1358. if (_that.scrollTop > 0) {
  1359. _that.scrollTop -= 50;
  1360. document.body.scrollTop = document.documentElement.scrollTop =
  1361. _that.scrollTop;
  1362. timer = requestAnimationFrame(fn);
  1363. } else {
  1364. cancelAnimationFrame(timer);
  1365. _that.goTopShow = false;
  1366. }
  1367. });
  1368. },
  1369. destroyed() {
  1370. window.removeEventListener("scroll", this.handleScroll);
  1371. },
  1372. getUnReadNum() {
  1373. let doctorAdvice = [];
  1374. for (let y = 0; y < this.doctor_advices.length; y++) {
  1375. if (this.doctor_advices[y].execution_state == 2) {
  1376. doctorAdvice.push(this.doctor_advices[y]);
  1377. }
  1378. }
  1379. const sorted = this.groupBy(doctorAdvice, function(item) {
  1380. return [item.groupno];
  1381. });
  1382. return sorted.length;
  1383. },
  1384. groupBy(array, f) {
  1385. const groups = {};
  1386. array.forEach(function(o) {
  1387. const group = JSON.stringify(f(o));
  1388. groups[group] = groups[group] || [];
  1389. groups[group].push(o);
  1390. });
  1391. return Object.keys(groups).map(function(group) {
  1392. return groups[group];
  1393. });
  1394. },
  1395. getDeviceNumber() {
  1396. if (
  1397. this.dialysis_order.id &&
  1398. this.dialysis_order.DeviceNumber &&
  1399. this.dialysis_order.DeviceNumber.number.length > 0
  1400. ) {
  1401. return this.dialysis_order.DeviceNumber.number;
  1402. } else {
  1403. if (this.schedual.device_number == null) {
  1404. return "";
  1405. } else {
  1406. return this.schedual.device_number.number;
  1407. }
  1408. }
  1409. },
  1410. dateDiff(firstDate, secondDate) {
  1411. var firstDate = new Date(firstDate);
  1412. var secondDate = new Date(secondDate);
  1413. var diff = Math.abs(firstDate.getTime() - secondDate.getTime());
  1414. var result = parseInt(diff / (1000 * 60 * 60 * 24));
  1415. return result;
  1416. }
  1417. }
  1418. };
  1419. </script>
  1420. <style style="stylesheet/scss" lang="scss" scoped>
  1421. .today_panel {
  1422. height: calc(100% - 63px);
  1423. }
  1424. .mainContent {
  1425. position: relative;
  1426. .grid {
  1427. padding: 0.1rem 0 0.25rem 0;
  1428. margin: 0.2rem 0 0 0;
  1429. background: #fff;
  1430. .list {
  1431. ul {
  1432. @include display-flex;
  1433. @include align-items-center;
  1434. @include text-align;
  1435. @include justify-content-around;
  1436. li {
  1437. font-size: 0.24rem;
  1438. color: #5d6b7a;
  1439. margin-top: 0.35rem;
  1440. p {
  1441. line-height: 0.6rem;
  1442. color: #34495e;
  1443. font-size: 0.3rem;
  1444. }
  1445. img {
  1446. width: 1rem;
  1447. height: 1rem;
  1448. }
  1449. }
  1450. }
  1451. }
  1452. }
  1453. }
  1454. .el-button.is-circle {
  1455. padding: 18px !important;
  1456. .el-icon-arrow-up {
  1457. font-size: 20px !important;
  1458. }
  1459. }
  1460. .redpoint {
  1461. display: inline-block;
  1462. height: 20px;
  1463. width: 20px;
  1464. line-height: 18px;
  1465. text-align: center;
  1466. font-size: 0.45rem;
  1467. border-radius: 20px;
  1468. color: #fff;
  1469. background: #f56c6c;
  1470. position: absolute;
  1471. border: 1px solid #fff;
  1472. top: -8px;
  1473. right: -8px;
  1474. }
  1475. .goTop {
  1476. z-index: 999;
  1477. }
  1478. </style>
  1479. <style lang="scss">
  1480. .el-table::before {
  1481. z-index: 0;
  1482. }
  1483. </style>