index.vue 55KB

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