index.vue 58KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <div class="print" style="float:left;">
  6. <el-button
  7. size="small"
  8. type="primary"
  9. @click="printOrder"
  10. icon="el-icon-printer"
  11. >打印</el-button
  12. >
  13. </div>
  14. </div>
  15. <div
  16. class="loadingBox"
  17. v-loading="loading"
  18. element-loading-text="拼命加载中"
  19. element-loading-spinner="el-icon-loading"
  20. element-loading-background="rgba(0, 0, 0, 0.8)"
  21. >
  22. <div class="patientBox" style="width:25%;padding-left:10px;">
  23. <el-tabs v-model="activeName" @tab-click="handleClick">
  24. <el-tab-pane label="候诊区" name="first">
  25. <div class="cell clearfix" style="margin-bottom:10px;">
  26. <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 45%;margin-right:10px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
  27. <el-input size="small" style="width:24%;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
  28. <el-button size="small" class="filter-item" type="primary" style="margin-right:20px;" @click="searchAction">搜索</el-button>
  29. </div>
  30. <div class="cell clearfix" style="margin-bottom:10px;display:flex;">
  31. <el-select v-model="patientStateVal" placeholder="全部患者状态" style="margin-right:10px;" @change="handleStateChange">
  32. <el-option
  33. v-for="item in patient_state"
  34. :key="item.value"
  35. :label="item.label"
  36. :value="item.value">
  37. </el-option>
  38. </el-select>
  39. <el-select v-model="treatStateVal" placeholder="全部治疗状态" style="margin-right:20px;" @change="handleTreatChange">
  40. <el-option
  41. v-for="item in treat_state"
  42. :key="item.value"
  43. :label="item.label"
  44. :value="item.value">
  45. </el-option>
  46. </el-select>
  47. </div>
  48. <div class="cell clearfix" style="margin-bottom:10px;display:flex;">
  49. <el-select v-model="scheduleStateVal" placeholder="班次" style="margin-right:10px;" @change="handletimeType">
  50. <el-option
  51. v-for="item in schedule_options"
  52. :key="item.value"
  53. :label="item.label"
  54. :value="item.value">
  55. </el-option>
  56. </el-select>
  57. <el-select v-model="zoneVal" placeholder="分区" style="margin-right:20px;" @change="handleZoneChange">
  58. <el-option
  59. v-for="item in zone_options"
  60. :key="item.id"
  61. :label="item.text"
  62. :value="item.id">
  63. </el-option>
  64. </el-select>
  65. </div>
  66. <div style="padding-right:20px;">
  67. <el-table
  68. ref="tab"
  69. @row-click="changePatient"
  70. highlight-current-row
  71. :data="tableData"
  72. height="500"
  73. border
  74. style="width: 100%">
  75. <el-table-column
  76. prop="date"
  77. label="患者"
  78. >
  79. <template slot-scope="scope">
  80. {{ scope.row.patient.name }}
  81. <span v-if="scope.row.assessment_before_dislysis && patientStateVal == 1">
  82. ({{ getTime(scope.row.assessment_before_dislysis.created_time) }})
  83. </span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. prop="name"
  88. label="状态"
  89. >
  90. <template slot-scope="scope">
  91. <div style="display:flex;align-items:center;justify-content:space-around;">
  92. <span class="tip1" v-if="scope.row.prescription == null || scope.row.prescription.creater == 0">
  93. 待开处方
  94. </span>
  95. <span class="tip2" v-if="scope.row.assessment_before_dislysis == null || scope.row.assessment_before_dislysis.weight_before == ''">
  96. 待称重
  97. </span>
  98. </div>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. </div>
  103. </el-tab-pane>
  104. <el-tab-pane label="透析区" name="second">
  105. <div class="cell clearfix" style="margin-bottom:10px;">
  106. <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 45%;margin-right:10px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
  107. <el-input size="small" style="width:24%;" v-model.trim="search_input" class="filter-item"/>
  108. <el-button size="small" class="filter-item" style="margin-right:20px;" type="primary" @click="searchAction">搜索</el-button>
  109. </div>
  110. <div class="cell clearfix" style="margin-bottom:10px;display:flex;">
  111. <el-select v-model="patientStateVal" placeholder="全部患者状态" style="margin-right:10px;" @change="handleStateChange">
  112. <el-option
  113. v-for="item in patient_state"
  114. :key="item.value"
  115. :label="item.label"
  116. :value="item.value">
  117. </el-option>
  118. </el-select>
  119. <el-select v-model="treatStateVal" placeholder="全部治疗状态" style="margin-right:20px;" @change="handleTreatChange">
  120. <el-option
  121. v-for="item in treat_state"
  122. :key="item.value"
  123. :label="item.label"
  124. :value="item.value">
  125. </el-option>
  126. </el-select>
  127. </div>
  128. <div class="cell clearfix" style="margin-bottom:10px;display:flex;">
  129. <el-select v-model="scheduleStateVal" placeholder="班次" style="margin-right:10px;" @change="handletimeType">
  130. <el-option
  131. v-for="item in schedule_options"
  132. :key="item.value"
  133. :label="item.label"
  134. :value="item.value">
  135. </el-option>
  136. </el-select>
  137. <el-select v-model="zoneVal" placeholder="分区" style="margin-right:20px;" @change="handleZoneChange">
  138. <el-option
  139. v-for="item in zone_options"
  140. :key="item.id"
  141. :label="item.text"
  142. :value="item.id">
  143. </el-option>
  144. </el-select>
  145. </div>
  146. <div style="padding-right:20px;">
  147. <el-table
  148. ref="tab1"
  149. @row-click="changePatient"
  150. highlight-current-row
  151. :data="tableData1"
  152. height="500"
  153. border
  154. style="width: 100%">
  155. <el-table-column
  156. prop="date"
  157. label="患者"
  158. >
  159. <template slot-scope="scope">
  160. {{ scope.row.patient.name }}
  161. <span v-if="scope.row.assessment_before_dislysis && patientStateVal == 1">
  162. ({{ getTime(scope.row.assessment_before_dislysis.created_time) }})
  163. </span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column
  167. prop="name"
  168. label="状态"
  169. >
  170. <template slot-scope="scope">
  171. <div style="display:flex;align-items:center;justify-content:space-around;">
  172. <span class="tip3" v-if="scope.row.dialysis_order ? scope.row.dialysis_order.stage == 1 : false">
  173. 已上机
  174. </span>
  175. <span class="tip4" v-if="scope.row.dialysis_order ? scope.row.dialysis_order.stage == 2 : false">
  176. 已下机
  177. </span>
  178. <span class="tip5" v-if="scope.row.treatment_summary == null || scope.row.treatment_summary.dialysis_summary == ''">
  179. 待开小结
  180. </span>
  181. </div>
  182. </template>
  183. </el-table-column>
  184. </el-table>
  185. </div>
  186. </el-tab-pane>
  187. </el-tabs>
  188. </div>
  189. <div style="width:75%">
  190. <div style="margin-left:60px;color:#34495e">
  191. <span>{{ patient.name }}({{ patient.dialysis_no }})</span>
  192. <span v-if="newTime != ''">&nbsp;&nbsp;|&nbsp;&nbsp;</span>
  193. <span v-if="newTime != ''">签到时间:{{ newTime }}</span>
  194. </div>
  195. <nav-igation
  196. ref="nav"
  197. title="弹窗导航"
  198. @advice="adviceFunc"
  199. :patient="patient"
  200. :schedual="schedual"
  201. :prescription="prescription"
  202. :solution="solution"
  203. :receiver_treatment_access="receiver_treatment_access"
  204. :predialysis_evaluation="predialysis_evaluation"
  205. :doctor_advices="doctor_advices"
  206. :double_check="double_check"
  207. :assessment_after_dislysis="assessment_after_dislysis"
  208. :treatment_summary="treatment_summary"
  209. :monitor_records="monitor_records"
  210. :dialysis_order="dialysis_order"
  211. :admin_users="admin_users"
  212. :devices="devices"
  213. :device_numbers="device_numbers"
  214. :admin_user_map="admin_user_map"
  215. :device_map="device_map"
  216. :device_number_map="device_number_map"
  217. :niprocart_info="niprocart_info"
  218. :jms_info="jms_info"
  219. :fistula_needle_set_info="fistula_needle_set_info"
  220. :fistula_needle_set_16_info="fistula_needle_set_16_info"
  221. :hemoperfusion_info="hemoperfusion_info"
  222. :dialyser_sterilised_info="dialyser_sterilised_info"
  223. :filtryzer_info="filtryzer_info"
  224. :dialyzers_info="dialyzers_info"
  225. :injector_info="injector_info"
  226. :bloodlines_info="bloodlines_info"
  227. :tubingHemodialysis_info="tubingHemodialysis_info"
  228. :safe_package_info="safe_package_info"
  229. :aliquid_info="aliquid_info"
  230. :config="config"
  231. :longAdvices="longAdvices"
  232. :waitUploadAdvices="waitUploadAdvices"
  233. :is_open="is_open"
  234. :last_predialysis_evaluation="lastPredialysisEvaluation"
  235. :last_monitor_record="lastMonitorRecord"
  236. :last_assessment_after_dislysis="lastAssessmentAfterDislysis"
  237. :last_dialysis_prescribe="lastDialysisPrescribe"
  238. :last_dryWeight_dislysis="lastDryWeightDislysis"
  239. :special_premission="headNurses"
  240. @assessmentAfterDislysis="assessmentAfterDislysisFunc"
  241. :system_prescribe="system_prescribe"
  242. >
  243. </nav-igation>
  244. <basic-infor
  245. :patient="patient"
  246. :device_number="schedual.id == 0 ? '' : schedual.device_number.number"
  247. :steps="steps"
  248. title="基本信息"
  249. ></basic-infor>
  250. <dialysis-prescription
  251. :prescription="prescription"
  252. :solution="solution"
  253. :device_map="device_map"
  254. title="透析处方"
  255. ></dialysis-prescription>
  256. <!-- <past-data class="往期数据"></past-data> -->
  257. <div style="height: 20px;background-color: #f6f8f9"></div>
  258. <accepts-assessment
  259. :record="receiver_treatment_access"
  260. title="接诊评估"
  261. ></accepts-assessment>
  262. <assessment-before
  263. :record="predialysis_evaluation"
  264. ref="assessment_before"
  265. title="透前评估"
  266. ></assessment-before>
  267. <stat-order
  268. ref="stat_order"
  269. :advices="doctor_advices"
  270. :doctor_map="admin_user_map"
  271. title="临时医嘱"
  272. ></stat-order>
  273. <double-check
  274. ref="double_check"
  275. :record="double_check"
  276. :admin_map="admin_user_map"
  277. title="双人核对 "
  278. ></double-check>
  279. <dialysis-computer
  280. ref="dialysis_computer"
  281. :record="dialysis_order"
  282. :admin_map="admin_user_map"
  283. :device_number_map="device_number_map"
  284. title="透析上机 "
  285. ></dialysis-computer>
  286. <dialysis-monitoring
  287. ref="monitoring"
  288. :monitores="monitor_records"
  289. title="透析监测"
  290. ></dialysis-monitoring>
  291. <el-dialog
  292. title="长期医嘱单"
  293. :visible.sync="dialogFormVisible"
  294. width="960px"
  295. >
  296. <div class="printForm">
  297. <h1 class="title">长期医嘱单</h1>
  298. <div class="info">
  299. <ul>
  300. <li>
  301. <span class="name">姓名:</span>
  302. <input type="text" class="InputBox" />
  303. </li>
  304. <li>
  305. <span class="name">性别:</span>
  306. <input type="text" class="InputBox" />
  307. </li>
  308. <li>
  309. <span class="name">年龄:</span>
  310. <input type="text" class="InputBox" />
  311. </li>
  312. <li>
  313. <span class="name">科别:</span>
  314. <input type="text" class="InputBox" />
  315. </li>
  316. <li>
  317. <span class="name">床号:</span>
  318. <input type="text" class="InputBox" />
  319. </li>
  320. <li>
  321. <span class="name">住院号:</span>
  322. <input type="text" class="InputBox" />
  323. </li>
  324. </ul>
  325. </div>
  326. <table
  327. border="1"
  328. style="border:1px #999 solid;margin-top:20px;"
  329. bordercolorlight="#fff"
  330. bordercolordark="#fff"
  331. width="100%"
  332. cellpadding="0"
  333. cellspacing="0"
  334. class="printTable"
  335. >
  336. <tbody>
  337. <tr align="center">
  338. <th style="width:20%;" colspan="2" align="center">起始</th>
  339. <th style="width:20%;" rowspan="2" align="center">医嘱</th>
  340. <th style="width:8%;" rowspan="2" align="center">医师签名</th>
  341. <th style="width:6%;" rowspan="2" align="center">执行护士签名</th>
  342. <th style="width:42%;" colspan="4" align="center">停止</th>
  343. </tr>
  344. <tr align="center">
  345. <th align="center">日期</th>
  346. <th align="center">时间</th>
  347. <th style="width:10%;" align="center">日期</th>
  348. <th style="width:10%;" align="center">时间</th>
  349. <th style="width:10%;" align="center">医师签名</th>
  350. <th style="width:6%;" align="center">执行护士签名</th>
  351. </tr>
  352. <tr align="center">
  353. <td>2018-90-09</td>
  354. <td>2018-90-09</td>
  355. <td>地方开发发地方开发发方发发发大渡岗</td>
  356. <td>张三</td>
  357. <td>张三</td>
  358. <td>张三</td>
  359. <td>张三</td>
  360. <td>张三</td>
  361. <td>张三</td>
  362. </tr>
  363. <tr align="center">
  364. <td>2018-90-09</td>
  365. <td>2018-90-09</td>
  366. <td>地方开发发地方开发发方发发发大渡岗</td>
  367. <td>张三</td>
  368. <td>张三</td>
  369. <td>张三</td>
  370. <td>张三</td>
  371. <td>张三</td>
  372. <td>张三</td>
  373. </tr>
  374. </tbody>
  375. </table>
  376. </div>
  377. </el-dialog>
  378. <el-dialog title="临时医嘱单" :visible.sync="orders" width="960px">
  379. <div class="printForm">
  380. <h1 class="title">临时医嘱单</h1>
  381. <div class="info">
  382. <ul>
  383. <li>
  384. <span class="name">姓名:</span>
  385. <input type="text" class="InputBox" />
  386. </li>
  387. <li>
  388. <span class="name">性别:</span>
  389. <input type="text" class="InputBox" />
  390. </li>
  391. <li>
  392. <span class="name">年龄:</span>
  393. <input type="text" class="InputBox" />
  394. </li>
  395. <li>
  396. <span class="name">科:</span>
  397. <input type="text" class="InputBox" />
  398. </li>
  399. <li>
  400. <span class="name">区:</span>
  401. <input type="text" class="InputBox" />
  402. </li>
  403. <li>
  404. <span class="name">房:</span>
  405. <input type="text" class="InputBox" />
  406. </li>
  407. <li>
  408. <span class="name">床:</span>
  409. <input type="text" class="InputBox" />
  410. </li>
  411. <li>
  412. <span class="name">住院号:</span>
  413. <input type="text" class="InputBox" />
  414. </li>
  415. </ul>
  416. </div>
  417. <table
  418. border="1"
  419. style="border:1px #999 solid;margin-top:20px;"
  420. bordercolorlight="#fff"
  421. bordercolordark="#fff"
  422. width="100%"
  423. cellpadding="0"
  424. cellspacing="0"
  425. class="printTable"
  426. >
  427. <tbody>
  428. <tr align="center">
  429. <th style="width:10%;" align="center">日期</th>
  430. <th style="width:10%;" align="center">时间</th>
  431. <th style="width:10%;" align="center">医生签名</th>
  432. <th style="width:40%;" align="center">医嘱内容</th>
  433. <th style="width:10%;" align="center">执行时间</th>
  434. <th style="width:10%;" align="center">护士签名</th>
  435. <th style="width:10%;" align="center">金额</th>
  436. </tr>
  437. <tr align="center">
  438. <td>2018-90-09</td>
  439. <td>2018-90-09</td>
  440. <td>张三</td>
  441. <td>张三</td>
  442. <td>张三</td>
  443. <td>张三</td>
  444. <td>888</td>
  445. </tr>
  446. <tr align="center">
  447. <td>2018-90-09</td>
  448. <td>2018-90-09</td>
  449. <td>张三</td>
  450. <td>张三</td>
  451. <td>2018-90-09</td>
  452. <td>张三</td>
  453. <td>888</td>
  454. </tr>
  455. </tbody>
  456. </table>
  457. </div>
  458. </el-dialog>
  459. <dialysis-off
  460. ref="dialysis_off"
  461. :record="dialysis_order"
  462. :admin_map="admin_user_map"
  463. title="透析下机 "
  464. ></dialysis-off>
  465. <assessment-after
  466. ref="assessment_after"
  467. :record="assessment_after_dislysis"
  468. title="透后评估"
  469. ></assessment-after>
  470. <treatment-of
  471. ref="treatment_of"
  472. :record="treatment_summary"
  473. title="治疗小结"
  474. ></treatment-of>
  475. </div>
  476. </div>
  477. </div>
  478. </template>
  479. <script>
  480. import NavIgation from './NavIgation'
  481. import BasicInfor from './BasicInfor'
  482. import DialysisPrescription from './DialysisPrescription'
  483. import PastData from './pastData'
  484. import AcceptsAssessment from './acceptsAssessment'
  485. import AssessmentBefore from './assessmentBefore'
  486. import StatOrder from './statOrder'
  487. import DialysisComputer from './dialysisComputer'
  488. import DoubleCheck from './doubleCheck'
  489. import DialysisMonitoring from './dialysisMonitoring'
  490. import DialysisOff from './dialysisOff'
  491. import AssessmentAfter from './assessmentAfter'
  492. import TreatmentOf from './treatmentOf'
  493. import OperationStaff from './operationStaff'
  494. import {
  495. getDialysisScheduleDetail,
  496. getLongAdvice,
  497. getDialysisRecordInitData,
  498. getDialysisSchedules
  499. } from '@/api/dialysis_record'
  500. import { parseTime } from '@/utils'
  501. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  502. export default {
  503. name: 'index',
  504. components: {
  505. NavIgation,
  506. BasicInfor,
  507. DialysisPrescription,
  508. PastData,
  509. AcceptsAssessment,
  510. AssessmentBefore,
  511. StatOrder,
  512. DialysisComputer,
  513. DoubleCheck,
  514. DialysisMonitoring,
  515. DialysisOff,
  516. AssessmentAfter,
  517. TreatmentOf,
  518. OperationStaff,
  519. BreadCrumb
  520. },
  521. data() {
  522. return {
  523. crumbs: [
  524. { path: false, name: '透析管理' },
  525. { path: false, name: '透析记录' },
  526. { path: false, name: '透析单' }
  527. ],
  528. dialogFormVisible: false,
  529. orders: false,
  530. loading: false,
  531. patient_id: 0,
  532. date: 0,
  533. longAdvices: [],
  534. waitUploadAdvices: [],
  535. is_open: 0,
  536. targetAdvices: [],
  537. patient: { id: 0 }, // 患者信息
  538. schedual: { id: 0 }, // 患者排班信息
  539. prescription: { id: 0 }, // 透析处方
  540. solution: { id: 0 }, // 透析方案
  541. system_prescribe: { id: 0 },
  542. receiver_treatment_access: { id: 0 }, // 接诊评估
  543. predialysis_evaluation: { id: 0 }, // 透前评估
  544. doctor_advices: [], // 临时医嘱
  545. double_check: { id: 0 }, // 双人核对
  546. assessment_after_dislysis: { id: 0 }, // 透后评估
  547. treatment_summary: { id: 0 }, // 治疗小结
  548. monitor_records: [], // 透析监测
  549. dialysis_order: { id: 0 }, // 透析记录
  550. admin_users: [], // 系统用户列表
  551. devices: [], // 设备
  552. device_numbers: [], // 床位号
  553. admin_user_map: {}, // {user_id: admin_user object}
  554. device_map: {}, // {device_id: device}
  555. device_number_map: {}, // {device_number_id: device_number}
  556. niprocart_info: [],
  557. jms_info: [],
  558. fistula_needle_set_info: [],
  559. fistula_needle_set_16_info: [],
  560. hemoperfusion_info: [],
  561. dialyser_sterilised_info: [],
  562. filtryzer_info: [],
  563. dialyzers_info: [],
  564. injector_info: [],
  565. bloodlines_info: [],
  566. tubingHemodialysis_info: [],
  567. safe_package_info: [],
  568. aliquid_info: [],
  569. config: {},
  570. lastPredialysisEvaluation: { id: 0 },
  571. lastMonitorRecord: { id: 0 },
  572. lastAssessmentAfterDislysis: { id: 0 },
  573. lastDryWeightDislysis: { id: 0 },
  574. headNurses: [],
  575. lastDialysisPrescribe: { id: 0 },
  576. //
  577. activeName: 'first',
  578. selected_date: new Date(),
  579. // search_input 和 search_keyword,使输入关键字时不会经常刷新 filtedSchedules
  580. search_keyword: '', // 确定用于搜索的关键字
  581. search_input: '', // 输入中的关键字
  582. patient_state: [
  583. { value: 0, label: '全部患者' },
  584. { value: 1, label: '已签到' },
  585. { value: 2, label: '未签到' },
  586. { value: 3, label: '已上机' },
  587. { value: 4, label: '已下机' }
  588. ],
  589. patientStateVal: 0,
  590. treat_state: [
  591. { value: 0, label: '全部治疗' },
  592. { value: 1, label: '待开处方' },
  593. { value: 2, label: '待开小结' }
  594. ],
  595. treatStateVal: 0,
  596. schedule_options: [
  597. { value: 0, label: '全部班' },
  598. { value: 1, label: '上午' },
  599. { value: 2, label: '下午' },
  600. { value: 3, label: '晚上' }
  601. ],
  602. scheduleStateVal: 0,
  603. zone_options: [
  604. { id: 0, text: '全部分区' }
  605. ],
  606. zoneVal: 0,
  607. tableData: [],
  608. tableData1: [],
  609. arr: [],
  610. newName: '',
  611. newTime: ''
  612. }
  613. },
  614. created() {
  615. if(sessionStorage.getItem("nameActive")){
  616. this.activeName = sessionStorage.getItem("nameActive")
  617. }
  618. var patient_id = this.$route.query.patient_id
  619. var date = this.$route.query.date
  620. this.patient_id = patient_id
  621. this.date = date
  622. this.getScheduleDetail()
  623. this.getLongAdvice()
  624. this.selected_date = this.$route.query.date * 1000
  625. var schedule_type_selected = this.$store.getters.schedule_type_selected
  626. var zone_selected = this.$store.getters.zone_selected
  627. var patient_state_selected = this.$store.getters.patient_state_selected
  628. var treat_state_selected = this.$store.getters.treat_state_selected
  629. var selected_date = this.$store.getters.selected_date
  630. if (schedule_type_selected) {
  631. this.scheduleStateVal = schedule_type_selected.schedule_type_selected
  632. }
  633. if (zone_selected) {
  634. this.zoneVal = zone_selected.zone_selected
  635. }
  636. if (patient_state_selected) {
  637. this.patientStateVal = patient_state_selected.patient_state_selected
  638. }
  639. if (treat_state_selected) {
  640. this.treatStateVal = treat_state_selected.treat_state_selected
  641. }
  642. if (selected_date.selected_date) {
  643. this.selected_date = selected_date.selected_date
  644. }
  645. this.getInitData()
  646. },
  647. mounted() {
  648. const timer = setInterval(() => {
  649. // this.getInitData();
  650. this.requestDialysisSchedules()
  651. }, 1000 * 60)
  652. // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
  653. this.$once('hook:beforeDestroy', () => {
  654. clearInterval(timer)
  655. })
  656. },
  657. computed: {
  658. steps: function() {
  659. var steps = [
  660. { title: '透析处方', finish: false },
  661. { title: '接诊评估', finish: false },
  662. { title: '透前评估', finish: false },
  663. { title: '临时医嘱', finish: false },
  664. { title: '双人核对', finish: false },
  665. { title: '透析上机', finish: false },
  666. { title: '透析监测', finish: false },
  667. { title: '透析下机', finish: false },
  668. { title: '透后评估', finish: false },
  669. { title: '治疗小结', finish: false }
  670. ]
  671. steps[0].finish = this.prescription.id && this.prescription.creater > 0
  672. steps[1].finish = this.receiver_treatment_access.id > 0
  673. steps[2].finish =
  674. this.predialysis_evaluation.id > 0 &&
  675. this.predialysis_evaluation.creater > 0
  676. steps[3].finish = this.doctor_advices.length > 0
  677. steps[5].finish = this.dialysis_order.id > 0
  678. steps[7].finish =
  679. this.dialysis_order.id > 0 && this.dialysis_order.stage == 2
  680. steps[4].finish =
  681. this.double_check.id > 0 &&
  682. this.double_check.creater > 0 &&
  683. this.double_check.modifier > 0
  684. steps[6].finish = this.monitor_records.length > 0
  685. steps[8].finish =
  686. this.assessment_after_dislysis.id > 0 &&
  687. this.assessment_after_dislysis.creater > 0
  688. steps[9].finish = this.treatment_summary.id > 0
  689. return steps
  690. },
  691. filtedSchedules: function() {
  692. var search_keyword = this.search_keyword
  693. if (search_keyword.length > 0) {
  694. var schedules = []
  695. for (let o_i = 0; o_i < this.zone_schedules.length; o_i++) {
  696. const scheduleInfo = this.zone_schedules[o_i]
  697. var originSchedules = scheduleInfo.schedules
  698. if (originSchedules.length == 0) {
  699. continue
  700. }
  701. var filtedSchedules = []
  702. for (let s_i = 0; s_i < originSchedules.length; s_i++) {
  703. const schedule = originSchedules[s_i]
  704. if (schedule.patient.name.indexOf(search_keyword) != -1) {
  705. filtedSchedules.push(schedule)
  706. // break
  707. }
  708. }
  709. if (filtedSchedules.length > 0) {
  710. schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
  711. }
  712. }
  713. return schedules
  714. }
  715. // var zone_selected = this.zoneVal
  716. // var timetype_selected = this.scheduleStateVal
  717. // if ((zone_selected == 0 && timetype_selected == 0) || this.zone_options.length <= 1) {
  718. // var schedules = []
  719. // for (let index = 0; index < this.zone_schedules.length; index++) {
  720. // const scheduleInfo = this.zone_schedules[index]
  721. // if (scheduleInfo.schedules.length != 0) {
  722. // schedules.push(scheduleInfo)
  723. // }
  724. // }
  725. // return schedules
  726. // }
  727. // var schedules = []
  728. // for (let o_i = 0; o_i < this.zone_schedules.length; o_i++) {
  729. // const scheduleInfo = this.zone_schedules[o_i]
  730. // if (zone_selected == scheduleInfo.zone_id && timetype_selected == 0) {
  731. // if (scheduleInfo.schedules.length == 0) {
  732. // return []
  733. // } else {
  734. // return [scheduleInfo]
  735. // }
  736. // }
  737. // var originSchedules = scheduleInfo.schedules
  738. // if (originSchedules.length == 0) {
  739. // continue
  740. // }
  741. // var filtedSchedules = []
  742. // for (let s_i = 0; s_i < originSchedules.length; s_i++) {
  743. // const schedule = originSchedules[s_i]
  744. // if (zone_selected != 0) {
  745. // if (zone_selected == schedule.device_number.zone.id) {
  746. // if (timetype_selected == 0 || schedule.schedule_type == timetype_selected) {
  747. // filtedSchedules.push(schedule)
  748. // }
  749. // }
  750. // } else {
  751. // if (timetype_selected == 0 || schedule.schedule_type == timetype_selected) {
  752. // filtedSchedules.push(schedule)
  753. // }
  754. // }
  755. // }
  756. // if (filtedSchedules.length > 0) {
  757. // schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
  758. // }
  759. // }
  760. // return schedules
  761. }
  762. },
  763. methods: {
  764. adviceFunc() {
  765. this.getScheduleDetail()
  766. },
  767. getLongAdvice() {
  768. const params = {
  769. patient_id: this.patient_id
  770. }
  771. getLongAdvice(params).then(rs => {
  772. var resp = rs.data
  773. if (resp.state == 1) {
  774. var status = parseInt(resp.data.status)
  775. switch (status) {
  776. case 2:
  777. var totalAdvice = resp.data.advices
  778. var longAdvicesTwo = resp.data.advices_two
  779. var waitUploadAdvices = []
  780. for (let i = 0; i < totalAdvice.length; i++) {
  781. totalAdvice[i]['isCheck'] = 1
  782. }
  783. for (let i = 0; i < totalAdvice.length; i++) {
  784. for (let a = 0; a < longAdvicesTwo.length; a++) {
  785. if (
  786. totalAdvice[i].template_id ==
  787. longAdvicesTwo[a].template_id &&
  788. totalAdvice[i].frequency_type ==
  789. longAdvicesTwo[a].frequency_type
  790. ) {
  791. totalAdvice[i]['isCheck'] = 0
  792. }
  793. }
  794. }
  795. for (let i = 0; i < totalAdvice.length; i++) {
  796. if (totalAdvice[i].isCheck == 1) {
  797. waitUploadAdvices.push(totalAdvice[i])
  798. }
  799. }
  800. this.is_open = resp.data.is_open_remind
  801. this.longAdvices = totalAdvice
  802. this.waitUploadAdvices = waitUploadAdvices
  803. break
  804. }
  805. } else {
  806. this.$message.error(resp.msg)
  807. }
  808. })
  809. },
  810. assessmentAfterDislysisFunc: function(val) {
  811. for (var index in val) {
  812. this.$set(this.assessment_after_dislysis, index, val[index])
  813. }
  814. },
  815. didDelMonitor(record_id) {
  816. var mrl = this.monitor_records.length
  817. for (let index = 0; index < mrl; index++) {
  818. if (this.monitor_records[index].id == record_id) {
  819. this.monitor_records.splice(index, 1)
  820. break
  821. }
  822. }
  823. },
  824. getScheduleDetail: function() {
  825. this.loading = true
  826. var dateStr = parseTime(this.date, '{y}-{m}-{d}')
  827. this.doctor_advices = []
  828. getDialysisScheduleDetail(this.patient_id, dateStr).then(rs => {
  829. var resp = rs.data
  830. if (resp.state == 1) {
  831. var patient = resp.data.patient // 患者信息
  832. var schedual = resp.data.schedual // 患者排班信息
  833. var prescription = resp.data.prescription // 透析处方
  834. if (prescription != null) {
  835. if (prescription.body_fluid == -2) {
  836. prescription.body_fluid = 0
  837. }
  838. }
  839. console.log('透析处方', prescription)
  840. var solution = resp.data.solution // 透析方案
  841. var receiver_treatment_access = resp.data.receiver_treatment_access // 接诊评估
  842. console.log('receiver_treatment_access', receiver_treatment_access)
  843. var predialysis_evaluation = resp.data.predialysis_evaluation // 透前评估
  844. console.log('透前评估', predialysis_evaluation)
  845. if (predialysis_evaluation != null) {
  846. if (predialysis_evaluation.blood_access_part_id == -2) {
  847. predialysis_evaluation.blood_access_part_id = 0
  848. }
  849. }
  850. var doctor_advices = resp.data.doctor_advices // 临时医嘱
  851. // console.log("力气-------", doctor_advices);
  852. var double_check = resp.data.double_check // 双人核对
  853. var assessment_after_dislysis = resp.data.assessment_after_dislysis // 透后评估
  854. // console.log("透后品谷数", assessment_after_dislysis);
  855. var treatment_summary = resp.data.treatment_summary // 治疗小结
  856. var monitor_records = resp.data.monitor_records // 透析监测
  857. var dialysis_order = resp.data.dialysis_order // 透析记录
  858. var niprocart_info = resp.data.niprocart_info
  859. var jms_info = resp.data.jms_info
  860. var fistula_needle_set_info = resp.data.fistula_needle_set_info
  861. var fistula_needle_set_16_info = resp.data.fistula_needle_set_16_info
  862. var hemoperfusion_info = resp.data.hemoperfusion_info
  863. var dialyser_sterilised_info = resp.data.dialyser_sterilised_info
  864. var filtryzer_info = resp.data.filtryzer_info
  865. var dialyzers_info = resp.data.dialyzers_info
  866. var injector_info = resp.data.injector_info
  867. var bloodlines_info = resp.data.bloodlines_info
  868. var tubingHemodialysis_info = resp.data.tubingHemodialysis_info
  869. var safe_package_info = resp.data.safe_package_info
  870. var aliquid_info = resp.data.aliquid_info
  871. var lastPredialysisEvaluation = resp.data.lastPredialysisEvaluation
  872. console.log('上次透前评估', lastPredialysisEvaluation)
  873. if (lastPredialysisEvaluation != null) {
  874. if (lastPredialysisEvaluation.blood_access_part_id == -2) {
  875. lastPredialysisEvaluation.blood_access_part_id = 0
  876. }
  877. }
  878. var lastMonitorRecord = resp.data.lastMonitorRecord
  879. var lastAssessmentAfterDislysis =
  880. resp.data.lastAssessmentAfterDislysis
  881. var lastDialysisPrescribe = resp.data.lastDialysisPrescribe
  882. var lastDryWeightDislysis = resp.data.lastDryWeightDislysis
  883. var system_prescribe = resp.data.system_prescribe
  884. this.$refs.nav.setLastRecord(
  885. lastPredialysisEvaluation,
  886. lastMonitorRecord,
  887. lastAssessmentAfterDislysis,
  888. lastDialysisPrescribe,
  889. lastDryWeightDislysis,
  890. schedual,
  891. system_prescribe
  892. )
  893. var headNurses = resp.data.headNurse
  894. var config = resp.data.config
  895. this.lastPredialysisEvaluation = lastPredialysisEvaluation
  896. this.lastMonitorRecord = lastMonitorRecord
  897. this.lastAssessmentAfterDislysis = lastAssessmentAfterDislysis
  898. this.lastDialysisPrescribe = lastDialysisPrescribe
  899. this.lastDryWeightDislysis = lastDryWeightDislysis
  900. this.headNurses = headNurses
  901. this.system_prescribe = system_prescribe
  902. this.niprocart_info = niprocart_info
  903. this.jms_info = jms_info
  904. this.fistula_needle_set_info = fistula_needle_set_info
  905. this.fistula_needle_set_16_info = fistula_needle_set_16_info
  906. this.hemoperfusion_info = hemoperfusion_info
  907. this.dialyser_sterilised_info = dialyser_sterilised_info
  908. this.filtryzer_info = filtryzer_info
  909. this.dialyzers_info = dialyzers_info
  910. this.injector_info = injector_info
  911. this.bloodlines_info = bloodlines_info
  912. this.tubingHemodialysis_info = tubingHemodialysis_info
  913. this.safe_package_info = safe_package_info
  914. this.aliquid_info = aliquid_info
  915. this.config = config
  916. this.patient = patient
  917. this.schedual = schedual == null ? { id: 0 } : schedual
  918. this.prescription = prescription == null ? { id: 0 } : prescription
  919. this.solution = solution == null ? { id: 0 } : solution
  920. this.receiver_treatment_access =
  921. receiver_treatment_access == null
  922. ? { id: 0 }
  923. : receiver_treatment_access
  924. this.predialysis_evaluation =
  925. predialysis_evaluation == null ? { id: 0 } : predialysis_evaluation
  926. this.doctor_advices = doctor_advices == null ? [] : doctor_advices
  927. this.double_check = double_check == null ? { id: 0 } : double_check
  928. this.assessment_after_dislysis =
  929. assessment_after_dislysis == null
  930. ? { id: 0 }
  931. : assessment_after_dislysis
  932. this.treatment_summary =
  933. treatment_summary == null ? { id: 0 } : treatment_summary
  934. this.monitor_records = monitor_records == null ? [] : monitor_records
  935. this.dialysis_order =
  936. dialysis_order == null ? { id: 0 } : dialysis_order
  937. // this.$refs.stat_order.setAdvices(this.doctor_advices)
  938. // this.$refs.monitoring.setRecords(this.monitor_records)
  939. this.admin_users = resp.data.doctors
  940. this.devices = resp.data.devices
  941. this.device_numbers = resp.data.device_numbers
  942. var device_map = {}
  943. for (let index = 0; index < this.devices.length; index++) {
  944. const device = this.devices[index]
  945. device_map[device.id] = device
  946. }
  947. this.device_map = device_map
  948. var admin_map = {}
  949. for (let index = 0; index < this.admin_users.length; index++) {
  950. const admin = this.admin_users[index]
  951. admin_map[admin.id] = admin
  952. }
  953. this.admin_user_map = admin_map
  954. var device_number_map = {}
  955. for (let index = 0; index < this.device_numbers.length; index++) {
  956. const device_number = this.device_numbers[index]
  957. device_number_map[device_number.id] = device_number
  958. }
  959. this.device_number_map = device_number_map
  960. } else {
  961. this.$message.error(resp.msg)
  962. }
  963. if (this.lastDialysisPrescribe != null) {
  964. delete this.lastDialysisPrescribe.target_ultrafiltration
  965. }
  966. if (this.solution != null) {
  967. delete this.solution.target_ultrafiltration
  968. }
  969. if(this.predialysis_evaluation.id > 0){
  970. this.newTime = parseTime(this.predialysis_evaluation.created_time, '{h}:{i}')
  971. }
  972. this.loading = false
  973. })
  974. },
  975. printOrder() {
  976. var xtdate = parseTime(this.date, '{y}-{m}-{d}')
  977. this.$router.push(
  978. '/dialysis/print?xtdate=' + xtdate + '&xtno=' + this.patient.dialysis_no
  979. )
  980. },
  981. // 日期
  982. handleScheduleDateChange: function(index) {
  983. this.treatStateVal = 0
  984. this.patientStateVal = 0
  985. this.zoneVal = 0
  986. this.scheduleStateVal = 0
  987. this.search_keyword = this.search_input = ''
  988. // this.$store.dispatch("SaveDialysisAreaSelectIndexs", {
  989. // zone: this.zone_selected,
  990. // schedule_type: this.schedule_type_selected,
  991. // schedule_date: this.selected_date,
  992. // })
  993. this.selected_date = index
  994. this.$store.dispatch('SetSelectedDate', { selected_date: index })
  995. this.requestDialysisSchedules()
  996. },
  997. // 初始化数据
  998. getInitData: function() {
  999. getDialysisRecordInitData().then(rs => {
  1000. var resp = rs.data
  1001. if (resp.state == 1) {
  1002. var zones = resp.data.zones
  1003. var schedules = resp.data.schedules
  1004. var zone_options = [{ id: 0, text: '全部分区' }]
  1005. for (let z_i = 0; z_i < zones.length; z_i++) {
  1006. const zone = zones[z_i]
  1007. zone_options.push({ id: zone.id, text: zone.name })
  1008. }
  1009. this.zone_options = zone_options
  1010. // this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
  1011. this.arr = this.processedDialysisSchedules(schedules, this.zone_options)
  1012. this.requestDialysisSchedules()
  1013. } else {
  1014. this.$message.error(resp.msg)
  1015. }
  1016. })
  1017. },
  1018. // 班次
  1019. handletimeType: function(index) {
  1020. this.scheduleStateVal = index
  1021. this.$store.dispatch('SetScheduleTypeSelected', { schedule_type_selected: index })
  1022. this.search_keyword = this.search_input = ''
  1023. this.getData()
  1024. },
  1025. // 分区
  1026. handleZoneChange: function(index) {
  1027. this.zoneVal = index
  1028. this.$store.dispatch('SetZoneSelected', { zone_selected: index })
  1029. this.search_keyword = this.search_input = ''
  1030. this.getData()
  1031. },
  1032. // 患者状态
  1033. handleStateChange: function(index) {
  1034. this.patientStateVal = index
  1035. this.$store.dispatch('SetPatientStateSelected', { patient_state_selected: index })
  1036. this.search_keyword = this.search_input = ''
  1037. this.getData()
  1038. },
  1039. handleTreatChange: function(index) {
  1040. this.treatStateVal = index
  1041. this.$store.dispatch('SetTreatStateSelected', { treat_state_selected: index })
  1042. this.search_keyword = this.search_input = ''
  1043. this.getData()
  1044. },
  1045. processedDialysisSchedules: function(schedules, zone_options) {
  1046. var zoneMap = {}
  1047. var scheduleMap = {}
  1048. for (let z_i = 0; z_i < zone_options.length; z_i++) {
  1049. const zone = zone_options[z_i]
  1050. if (zone.id == 0) {
  1051. continue
  1052. }
  1053. scheduleMap[zone.id] = []
  1054. }
  1055. for (let index = 0; index < schedules.length; index++) {
  1056. const schedule = schedules[index]
  1057. scheduleMap[schedule.device_number.zone.id].push(schedule)
  1058. }
  1059. var zone_schedules = []
  1060. for (let index = 0; index < zone_options.length; index++) {
  1061. const zone = zone_options[index]
  1062. if (zone.id == 0) {
  1063. continue
  1064. }
  1065. var schedules = scheduleMap[zone.id]
  1066. zone_schedules.push({ zone_id: zone.id, zone_name: zone.text, schedules: schedules })
  1067. }
  1068. return zone_schedules
  1069. },
  1070. searchAction: function() {
  1071. this.search_keyword = this.search_input
  1072. this.scheduleStateVal = 0
  1073. this.zoneVal = 0
  1074. this.treatStateVal = 0
  1075. this.patientStateVal = 0
  1076. if (this.search_input != '') {
  1077. const arr = []
  1078. this.filtedSchedules.map(item => {
  1079. arr.push(...item.schedules)
  1080. })
  1081. if (this.activeName == 'first') {
  1082. this.tableData = arr
  1083. } else if (this.activeName == 'second') {
  1084. this.tableData1 = arr
  1085. }
  1086. } else {
  1087. this.getData()
  1088. }
  1089. },
  1090. requestDialysisSchedules: function() {
  1091. var ymd = parseTime(this.selected_date, '{y}-{m}-{d}')
  1092. getDialysisSchedules(ymd).then(rs => {
  1093. var resp = rs.data
  1094. if (resp.state == 1) {
  1095. var schedules = resp.data.schedules
  1096. this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
  1097. const patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
  1098. if (this.activeName == 'first') {
  1099. for (let i = 0; i < patientArr.length; i++) {
  1100. for (let j = 0; j < patientArr[i].schedules.length; j++) {
  1101. if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order != null) {
  1102. // 删除元素后改变i的值
  1103. patientArr[i].schedules.splice(j--, 1)
  1104. }
  1105. }
  1106. }
  1107. } else if (this.activeName == 'second') {
  1108. for (let i = 0; i < patientArr.length; i++) {
  1109. for (let j = 0; j < patientArr[i].schedules.length; j++) {
  1110. if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
  1111. // 删除元素后改变i的值
  1112. patientArr[i].schedules.splice(j--, 1)
  1113. }
  1114. }
  1115. }
  1116. }
  1117. const newArr = []
  1118. patientArr.map(item => {
  1119. newArr.push(...item.schedules)
  1120. })
  1121. this.tableData = newArr
  1122. this.getData()
  1123. // console.log(66666666666,this.tableData)
  1124. } else {
  1125. this.$message.error(resp.msg)
  1126. }
  1127. })
  1128. },
  1129. changePatient(schedual) {
  1130. console.log(schedual)
  1131. this.patient_id = schedual.patient_id
  1132. this.date = schedual.schedule_date
  1133. // this.getScheduleDetail();
  1134. // this.getLongAdvice();
  1135. var patient_id = schedual.patient_id
  1136. var date = schedual.schedule_date
  1137. this.$router.push({
  1138. path: '/dialysis/details',
  1139. query: {
  1140. patient_id: patient_id,
  1141. date: date,
  1142. patient_name: schedual.patient.name
  1143. }
  1144. })
  1145. },
  1146. handleClick(type) {
  1147. console.log(99999999999,type)
  1148. sessionStorage.setItem('nameActive', type.name);
  1149. this.getData()
  1150. },
  1151. getData() {
  1152. let patientArr = []
  1153. patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
  1154. if (this.activeName == 'first') {
  1155. for (let i = 0; i < patientArr.length; i++) {
  1156. for (let j = 0; j < patientArr[i].schedules.length; j++) {
  1157. if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order != null) {
  1158. // 删除元素后改变i的值
  1159. console.log('候诊区', patientArr[i].schedules[j])
  1160. patientArr[i].schedules.splice(j--, 1)
  1161. }
  1162. }
  1163. }
  1164. let arr1 = []
  1165. if (this.patientStateVal == 0) {
  1166. arr1 = patientArr
  1167. } else if (this.patientStateVal == 1) {
  1168. let arr = []
  1169. arr = patientArr
  1170. for (let i = 0; i < arr.length; i++) {
  1171. for (let j = 0; j < arr[i].schedules.length; j++) {
  1172. if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis == null || (arr[i].schedules[j].assessment_before_dislysis.weight_before == '' && arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure == '' && arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure == ''))) {
  1173. // 删除元素后改变i的值
  1174. arr[i].schedules.splice(j--, 1)
  1175. }
  1176. }
  1177. }
  1178. console.log('执行1', arr)
  1179. arr1 = arr
  1180. } else if (this.patientStateVal == 2) {
  1181. let arr = []
  1182. arr = patientArr
  1183. for (let i = 0; i < arr.length; i++) {
  1184. for (let j = 0; j < arr[i].schedules.length; j++) {
  1185. if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis != null && (arr[i].schedules[j].assessment_before_dislysis.weight_before != 0 || arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure != 0 || arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure != 0))) {
  1186. // 删除元素后改变i的值
  1187. arr[i].schedules.splice(j--, 1)
  1188. }
  1189. }
  1190. }
  1191. console.log('执行2', arr)
  1192. arr1 = arr
  1193. }
  1194. let arr2 = []
  1195. if (this.treatStateVal == 0) {
  1196. arr2 = JSON.parse(JSON.stringify(arr1))
  1197. } else if (this.treatStateVal == 1) {
  1198. let arr = []
  1199. arr = JSON.parse(JSON.stringify(arr1))
  1200. for (let i = 0; i < arr.length; i++) {
  1201. for (let j = 0; j < arr[i].schedules.length; j++) {
  1202. if (arr[i].schedules.length > 0 && (arr[i].schedules[j].prescription != null || arr[i].schedules[j].prescription != null ? arr[i].schedules[j].prescription.creater != 0 : false)) {
  1203. // 删除元素后改变i的值
  1204. arr[i].schedules.splice(j--, 1)
  1205. }
  1206. }
  1207. }
  1208. arr2 = arr
  1209. }
  1210. let arr3 = []
  1211. if (this.scheduleStateVal == 0) {
  1212. arr3 = JSON.parse(JSON.stringify(arr2))
  1213. } else {
  1214. let arr = []
  1215. arr = JSON.parse(JSON.stringify(arr2))
  1216. for (let i = 0; i < arr.length; i++) {
  1217. for (let j = 0; j < arr[i].schedules.length; j++) {
  1218. if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
  1219. // 删除元素后改变i的值
  1220. arr[i].schedules.splice(j--, 1)
  1221. }
  1222. }
  1223. }
  1224. arr3 = arr
  1225. }
  1226. let arr4 = []
  1227. if (this.zoneVal == 0) {
  1228. arr4 = JSON.parse(JSON.stringify(arr3))
  1229. } else {
  1230. let arr = []
  1231. arr = JSON.parse(JSON.stringify(arr3))
  1232. for (let i = 0; i < arr.length; i++) {
  1233. if (this.zoneVal != arr[i].zone_id) {
  1234. // 删除元素后改变i的值
  1235. arr.splice(i--, 1)
  1236. }
  1237. }
  1238. arr4 = arr
  1239. }
  1240. const newArr = []
  1241. arr4.map(item => {
  1242. newArr.push(...item.schedules)
  1243. })
  1244. if(this.patientStateVal == 1){
  1245. newArr.map(item => {
  1246. item.created_time = item.assessment_before_dislysis.created_time
  1247. })
  1248. newArr.sort(this.compare('created_time'))
  1249. }
  1250. console.log('排序',newArr)
  1251. this.tableData = newArr
  1252. const name = this.$route.query.patient_name
  1253. this.tableData.map((item, index) => {
  1254. if (name == item.patient.name) {
  1255. // if (item.assessment_before_dislysis != null) {
  1256. // this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
  1257. // }
  1258. setTimeout(() => {
  1259. this.$refs.tab.setCurrentRow(this.tableData[index])
  1260. }, 10)
  1261. }
  1262. })
  1263. } else if (this.activeName == 'second') {
  1264. for (let i = 0; i < patientArr.length; i++) {
  1265. for (let j = 0; j < patientArr[i].schedules.length; j++) {
  1266. if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order == null) {
  1267. // 删除元素后改变i的值
  1268. console.log('透析区', patientArr[i].schedules[j])
  1269. patientArr[i].schedules.splice(j--, 1)
  1270. }
  1271. }
  1272. }
  1273. let arr1 = []
  1274. console.log('patientArr', patientArr)
  1275. // let patientArr =
  1276. if (this.patientStateVal == 0) {
  1277. arr1 = patientArr
  1278. } else if (this.patientStateVal == 1) {
  1279. let arr = []
  1280. arr = patientArr
  1281. for (let i = 0; i < arr.length; i++) {
  1282. for (let j = 0; j < arr[i].schedules.length; j++) {
  1283. if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis == null || (arr[i].schedules[j].assessment_before_dislysis.weight_before == '' && arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure == '' && arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure == ''))) {
  1284. // 删除元素后改变i的值
  1285. arr[i].schedules.splice(j--, 1)
  1286. }
  1287. }
  1288. }
  1289. console.log('执行1', arr)
  1290. arr1 = arr
  1291. } else if (this.patientStateVal == 2) {
  1292. let arr = []
  1293. arr = patientArr
  1294. for (let i = 0; i < arr.length; i++) {
  1295. for (let j = 0; j < arr[i].schedules.length; j++) {
  1296. if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis != null && (arr[i].schedules[j].assessment_before_dislysis.weight_before != 0 || arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure != 0 || arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure != 0))) {
  1297. // 删除元素后改变i的值
  1298. arr[i].schedules.splice(j--, 1)
  1299. }
  1300. }
  1301. }
  1302. console.log('执行2', arr)
  1303. arr1 = arr
  1304. } else if (this.patientStateVal == 3) {
  1305. let arr = []
  1306. arr = patientArr
  1307. for (let i = 0; i < arr.length; i++) {
  1308. for (let j = 0; j < arr[i].schedules.length; j++) {
  1309. if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 1)) {
  1310. // 删除元素后改变i的值
  1311. arr[i].schedules.splice(j--, 1)
  1312. }
  1313. }
  1314. }
  1315. console.log('执行1', arr)
  1316. arr1 = arr
  1317. } else if (this.patientStateVal == 4) {
  1318. let arr = []
  1319. arr = patientArr
  1320. for (let i = 0; i < arr.length; i++) {
  1321. for (let j = 0; j < arr[i].schedules.length; j++) {
  1322. if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 2)) {
  1323. // 删除元素后改变i的值
  1324. arr[i].schedules.splice(j--, 1)
  1325. }
  1326. }
  1327. }
  1328. console.log('执行2', arr)
  1329. arr1 = arr
  1330. }
  1331. let arr2 = []
  1332. if (this.treatStateVal == 0) {
  1333. arr2 = JSON.parse(JSON.stringify(arr1))
  1334. } else if (this.treatStateVal == 2) {
  1335. let arr = []
  1336. arr = JSON.parse(JSON.stringify(arr1))
  1337. for (let i = 0; i < arr.length; i++) {
  1338. for (let j = 0; j < arr[i].schedules.length; j++) {
  1339. if (arr[i].schedules.length > 0 && arr[i].schedules[j].treatment_summary != null && arr[i].schedules[j].treatment_summary.dialysis_summary != '') {
  1340. // 删除元素后改变i的值
  1341. arr[i].schedules.splice(j--, 1)
  1342. }
  1343. }
  1344. }
  1345. arr2 = arr
  1346. }
  1347. let arr3 = []
  1348. if (this.scheduleStateVal == 0) {
  1349. arr3 = JSON.parse(JSON.stringify(arr2))
  1350. } else {
  1351. let arr = []
  1352. arr = JSON.parse(JSON.stringify(arr2))
  1353. for (let i = 0; i < arr.length; i++) {
  1354. for (let j = 0; j < arr[i].schedules.length; j++) {
  1355. if (this.scheduleStateVal != arr[i].schedules[j].schedule_type) {
  1356. // 删除元素后改变i的值
  1357. arr[i].schedules.splice(j--, 1)
  1358. }
  1359. }
  1360. }
  1361. arr3 = arr
  1362. }
  1363. let arr4 = []
  1364. if (this.zoneVal == 0) {
  1365. arr4 = JSON.parse(JSON.stringify(arr3))
  1366. } else {
  1367. let arr = []
  1368. arr = JSON.parse(JSON.stringify(arr3))
  1369. for (let i = 0; i < arr.length; i++) {
  1370. if (this.zoneVal != arr[i].zone_id) {
  1371. // 删除元素后改变i的值
  1372. arr.splice(i--, 1)
  1373. }
  1374. }
  1375. arr4 = arr
  1376. }
  1377. const newArr = []
  1378. arr4.map(item => {
  1379. newArr.push(...item.schedules)
  1380. })
  1381. if(this.patientStateVal == 1){
  1382. newArr.map(item => {
  1383. item.created_time = item.assessment_before_dislysis.created_time
  1384. })
  1385. newArr.sort(this.compare('created_time'))
  1386. }
  1387. this.tableData1 = newArr
  1388. const name = this.$route.query.patient_name
  1389. this.tableData1.map((item, index) => {
  1390. if (name == item.patient.name) {
  1391. // if (item.assessment_before_dislysis != null) {
  1392. // this.newTime = parseTime(item.assessment_before_dislysis.created_time, '{h}:{i}')
  1393. // }
  1394. setTimeout(() => {
  1395. this.$refs.tab1.setCurrentRow(this.tableData1[index])
  1396. }, 10)
  1397. }
  1398. })
  1399. }
  1400. },
  1401. compare(property){
  1402. return function(a,b){
  1403. var value1 = a[property];
  1404. var value2 = b[property];
  1405. return value2 - value1;
  1406. }
  1407. },
  1408. getTime(date){
  1409. date = new Date(date * 1000)
  1410. var Y = date.getFullYear() + '-';
  1411. var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
  1412. var D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate());
  1413. var h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours());
  1414. var m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes());
  1415. var s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());
  1416. let strDate = h + ':' + m;
  1417. return strDate;
  1418. }
  1419. }
  1420. }
  1421. </script>
  1422. <style style="stylesheet/scss" lang="scss" scoped>
  1423. .details-bg {
  1424. background: #fff;
  1425. margin: 0 15px;
  1426. }
  1427. .printForm {
  1428. .title {
  1429. font-size: 30px;
  1430. font-weight: 500;
  1431. text-align: center;
  1432. line-height: 60px;
  1433. }
  1434. .info {
  1435. ul {
  1436. display: -webkit-box;
  1437. display: -moz-box;
  1438. display: -ms-flexbox;
  1439. display: -webkit-flex;
  1440. display: flex;
  1441. align-items: center;
  1442. -moz-box-sizing: border-box;
  1443. -webkit-box-sizing: border-box;
  1444. -o-box-sizing: border-box;
  1445. -ms-box-sizing: border-box;
  1446. box-sizing: border-box;
  1447. -webkit-justify-content: space-around;
  1448. -moz-justify-content: space-around;
  1449. -ms-justify-content: space-around;
  1450. -o-justify-content: space-around;
  1451. justify-content: space-around;
  1452. li {
  1453. display: flex;
  1454. box-sizing: border-box;
  1455. justify-content: space-around;
  1456. .name {
  1457. }
  1458. .InputBox {
  1459. padding: 0;
  1460. border: none;
  1461. border-bottom: 1px #e5e5e5 solid;
  1462. width: 60px;
  1463. outline: none;
  1464. }
  1465. }
  1466. }
  1467. }
  1468. .printTable {
  1469. tr {
  1470. padding: 2px;
  1471. th {
  1472. padding: 6px 4px;
  1473. }
  1474. td {
  1475. padding: 6px 4px;
  1476. }
  1477. }
  1478. }
  1479. }
  1480. .loadingBox{
  1481. display: flex;
  1482. .patientBox{
  1483. background: #fff;
  1484. }
  1485. .tip1{
  1486. background: #4fc7cb;
  1487. border-radius: 5px;
  1488. text-align: center;
  1489. font-size: 12px;
  1490. display: inline-block;
  1491. width: 60px;
  1492. color: #fff;
  1493. }
  1494. .tip2{
  1495. background: #ee8556;
  1496. border-radius: 5px;
  1497. text-align: center;
  1498. font-size: 12px;
  1499. display: inline-block;
  1500. width: 60px;
  1501. color: #fff;
  1502. }
  1503. .tip3{
  1504. background: #409eff;
  1505. border-radius: 5px;
  1506. text-align: center;
  1507. font-size: 12px;
  1508. display: inline-block;
  1509. width: 60px;
  1510. color: #fff;
  1511. }
  1512. .tip4{
  1513. background: #a8b3ba;
  1514. border-radius: 5px;
  1515. text-align: center;
  1516. font-size: 12px;
  1517. display: inline-block;
  1518. width: 60px;
  1519. color: #fff;
  1520. }
  1521. .tip5{
  1522. background: #7bce91;
  1523. border-radius: 5px;
  1524. text-align: center;
  1525. font-size: 12px;
  1526. display: inline-block;
  1527. width: 60px;
  1528. color: #fff;
  1529. }
  1530. }
  1531. </style>
  1532. <style lang="scss">
  1533. .loadingBox{
  1534. .el-loading-spinner{
  1535. top:10%;
  1536. }
  1537. .el-button--small, .el-button--small.is-round{
  1538. padding:9px 10px;
  1539. }
  1540. .el-date-editor{
  1541. .el-input__inner{
  1542. padding-right:0px;
  1543. }
  1544. }
  1545. .el-table td, .el-table th{
  1546. text-align: center;
  1547. }
  1548. .el-table .cell{
  1549. padding: 0;
  1550. }
  1551. }
  1552. </style>