血透系统PC前端

prescription.vue 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917
  1. <template>
  2. <div class="app-container ">
  3. <div class="dataTitle">透析方案</div>
  4. <div class="app-container" style="margin-left: -20px;margin-top: -20px" v-loading="pageLoading"
  5. element-loading-text="拼命加载中">
  6. <el-row :gutter="20">
  7. <el-col :span="7">
  8. <el-table
  9. :header-cell-style="{
  10. backgroundColor: 'rgb(245, 247, 250)',
  11. color: '#606266'
  12. }"
  13. height="450"
  14. :row-style="{ color: '#303133' }"
  15. :data="treatment_mode"
  16. border
  17. style="width: 100%"
  18. highlight-current-row
  19. :row-class-name="tableRows"
  20. @row-click="onRowClicks"
  21. ref="singleTable"
  22. >
  23. <el-table-column
  24. label="透析模式"
  25. align="center">
  26. <template slot-scope="scope">
  27. {{ scope.row.name }}
  28. </template>
  29. </el-table-column>
  30. <el-table-column
  31. label="状态"
  32. width="80"
  33. align="center">
  34. <template slot-scope="scope">
  35. {{getModeStatus(scope.row.id)}}
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. </el-col>
  40. <el-col :span="17" v-loading="itemLoading">
  41. <div class="filter-container">
  42. <el-row :gutter="20">
  43. <el-col :span="16">
  44. <div>{{mode_name}}</div>
  45. </el-col>
  46. <el-col :span="8">
  47. <el-button style="float: right;visibility: hidden" size="small" class="filter-item" type="primary"
  48. icon="el-icon-edit-outline"
  49. @click="openEdit()">修改
  50. </el-button>
  51. </el-col>
  52. </el-row>
  53. </div>
  54. <div class="filter-container" style="float:right">
  55. <el-form ref="addPlan" :model="addPlan" label-width="160px" style="border: black">
  56. <el-row :gutter="20">
  57. <el-col :span="8">
  58. <el-form-item label="透析时长(h):" prop="dialysis_duration">
  59. <el-time-picker
  60. v-model="dialysisTimeShow"
  61. :picker-options="{
  62. selectableRange: '00:01:00 - 23:59:00'
  63. }"
  64. placeholder="透析时长"
  65. style="width:100%;"
  66. value-format="H:m"
  67. format="H:m"
  68. @change="selectnDialysisTime"
  69. >
  70. </el-time-picker>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="8">
  74. <el-form-item label="血流量(ml/min):" prop="blood_flow_volume">
  75. <el-input v-model="addPlan.blood_flow_volume" ></el-input>
  76. </el-form-item>
  77. </el-col>
  78. <!--<el-col :span="8" v-if="this.$store.getters.xt_user.template_info.template_id == 6">-->
  79. <!--<el-form-item label="目标超滤量(ml) : ">-->
  80. <!--<el-input v-model="addPlan.target_ultrafiltration" type="number" ></el-input>-->
  81. <!--</el-form-item>-->
  82. <!--</el-col>-->
  83. <!--<el-col :span="8" v-if="this.$store.getters.xt_user.template_info.template_id != 6">-->
  84. <!--<el-form-item label="目标超滤量(L) : ">-->
  85. <!--<el-input v-model="addPlan.target_ultrafiltration" type="number" ></el-input>-->
  86. <!--</el-form-item>-->
  87. <!--</el-col>-->
  88. <el-col :span="8">
  89. <el-form-item label="透析液配方:">
  90. <el-select v-model="addPlan.dialysate_formulation" >
  91. <el-option v-for="(item,index) in dialysate_formulation" :label="item.name" :key="index"
  92. :value="item.id"></el-option>
  93. </el-select>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="8">
  97. <el-form-item label="抗凝剂:" prop="anticoagulant">
  98. <el-select v-model="addPlan.anticoagulant" @change="changeThisAnticoagulant" >
  99. <el-option v-for="(item,index) in anticoagulantsConfit" :label="item.name" :key="index"
  100. :value="item.id"></el-option>
  101. </el-select>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :span="8" v-if="anticoagulant.shouji != -1">
  105. <el-form-item :label="'首剂('+anticoagulant.shouji_unit+'): '" prop="anticoagulant_shouji">
  106. <el-input v-model="addPlan.anticoagulant_shouji"
  107. :disabled="anticoagulant.shouji==1?false:true" type="number"></el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="8" v-if="anticoagulant.weichi != -1">
  111. <el-form-item :label="'维持('+anticoagulant.weichi_unit+'): '" prop="anticoagulant_weichi">
  112. <el-input v-model="addPlan.anticoagulant_weichi"
  113. :disabled="anticoagulant.weichi==1?false:true" type="number"></el-input>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="8" v-if="anticoagulant.zongliang != -1">
  117. <el-form-item :label="'总量('+anticoagulant.zongliang_unit+'): '" prop="anticoagulant_zongliang">
  118. <el-input v-model="addPlan.anticoagulant_zongliang"
  119. :disabled="anticoagulant.zongliang==1?false:true" type="number"></el-input>
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="8" v-if="anticoagulant.gaimingcheng != -1">
  123. <el-form-item label="钙名称:" prop="anticoagulant_gaimingcheng">
  124. <el-input v-model="addPlan.anticoagulant_gaimingcheng"
  125. :disabled="anticoagulant.gaimingcheng==1?false:true" placeholder="钙名称"></el-input>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="8" v-if="anticoagulant.gaijiliang != -1">
  129. <el-form-item :label="'钙剂量('+anticoagulant.gaimingcheng_unit+'): '" prop="anticoagulant_gaijiliang">
  130. <el-input v-model="addPlan.anticoagulant_gaijiliang" :disabled="anticoagulant.gaijiliang==1?false:true"
  131. placeholder="钙剂量"></el-input>
  132. </el-form-item>
  133. </el-col>
  134. <el-col :span="8">
  135. <el-form-item label="置换量(L) : " prop="replacement_total">
  136. <el-input v-model="addPlan.replacement_total" type="number"></el-input>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="8">
  140. <el-form-item label="钾(mmol/L): " prop="kalium">
  141. <el-input v-model="addPlan.kalium" ></el-input>
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="8">
  145. <el-form-item label="钠(mmol/L): " prop="sodium">
  146. <el-input v-model="addPlan.sodium" ></el-input>
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="8">
  150. <el-form-item label="钙(mmol/L): " prop="calcium">
  151. <el-input v-model="addPlan.calcium" ></el-input>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="8">
  155. <el-form-item label="透析器/灌流器:">
  156. <el-input v-model="addPlan.dialyzer_perfusion_apparatus" ></el-input>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :span="8">
  160. <el-form-item label="碳酸氢盐(mmol/L): " prop="bicarbonate">
  161. <el-input v-model="addPlan.bicarbonate" ></el-input>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="8">
  165. <el-form-item label="葡萄糖(mmol/L): " prop="glucose">
  166. <el-input v-model="addPlan.glucose" ></el-input>
  167. </el-form-item>
  168. </el-col>
  169. <el-col :span="8">
  170. <el-form-item label="透析液流量(ml/min): " prop="dialysate_flow">
  171. <el-input v-model="addPlan.dialysate_flow" ></el-input>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="8">
  175. <el-form-item label="透析液温度(℃): " prop="dialysate_temperature">
  176. <el-input v-model="addPlan.dialysate_temperature" ></el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="8">
  180. <el-form-item label="电导度(mS/cm): " prop="conductivity">
  181. <el-input v-model="addPlan.conductivity" ></el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="8">
  185. <el-form-item label="体液过多症状:">
  186. <el-select v-model="addPlan.body_fluid" >
  187. <el-option v-for="(item,index) in body_fluid_option" :label="item.name" :key="index"
  188. :value="item.id"></el-option>
  189. </el-select>
  190. </el-form-item>
  191. </el-col>
  192. <el-col :span="8">
  193. <el-form-item label="体液过多其他症状">
  194. <el-input v-model="addPlan.body_fluid_other" ></el-input>
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="8">
  198. <el-form-item label="透析前使用特殊药物">
  199. <el-select v-model="addPlan.special_medicine" placeholder="请选择" style="width:100%;"
  200. >
  201. <el-option :key="0" label="请选择" :value="0"></el-option>
  202. <el-option v-for="(item,index) in special_medicine_option" :label="item.name" :key="index"
  203. :value="item.id"></el-option>
  204. </el-select>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="8">
  208. <el-form-item label="使用其他特殊药物">
  209. <el-input v-model="addPlan.special_medicine_other" ></el-input>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="8">
  213. <el-form-item label="置换液:"
  214. v-if="current_select == 2 &&this.$store.getters.xt_user.template_info.template_id != 6">
  215. <el-select v-model="addPlan.displace_liqui_part" placeholder="请选择">
  216. <el-option :key="0" label="请选择" :value="0"></el-option>
  217. <el-option v-for="(option, index) in displace_liqui_part_option" :key="index"
  218. :label="option.name" :value="option.id"></el-option>
  219. </el-select>
  220. </el-form-item>
  221. <el-form-item label="置换方式:"
  222. v-if="current_select == 2 &&this.$store.getters.xt_user.template_info.template_id == 6">
  223. <el-select v-model="addPlan.displace_liqui_part" placeholder="请选择" >
  224. <el-option :key="0" label="请选择" :value="0"></el-option>
  225. <el-option v-for="(option, index) in displace_liqui_part_option" :key="index"
  226. :label="option.name" :value="option.id"></el-option>
  227. </el-select>
  228. </el-form-item>
  229. </el-col>
  230. <el-col :span="8" v-if="current_select == 2">
  231. <el-form-item label="置换液总量(L)">
  232. <el-input v-model="addPlan.displace_liqui_value" ></el-input>
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="8">
  236. <el-form-item label="血管通路:">
  237. <el-select v-model="addPlan.blood_access" placeholder="请选择">
  238. <el-option :key="0" label="请选择" :value="0"></el-option>
  239. <el-option v-for="(option, index) in blood_access_option" :key="index"
  240. :label="option.name" :value="option.id"></el-option>
  241. </el-select>
  242. </el-form-item>
  243. </el-col>
  244. <!-- </el-row>
  245. <el-row :gutter="20" > -->
  246. <el-col :span="8">
  247. <el-form-item label="实际超滤量(L)">
  248. <el-input v-model="addPlan.ultrafiltration" ></el-input>
  249. </el-form-item>
  250. </el-col>
  251. <el-col :span="8">
  252. <el-form-item label="目标KT/V">
  253. <el-input v-model="addPlan.target_ktv" ></el-input>
  254. </el-form-item>
  255. </el-col>
  256. </el-row>
  257. </el-form>
  258. <el-button style="float: right" size="small" class="filter-item" type="primary"
  259. icon="el-icon-edit-outline"
  260. @click="savePrescription()">保存
  261. </el-button>
  262. </div>
  263. </el-col>
  264. </el-row>
  265. </div>
  266. </div>
  267. </template>
  268. <script>
  269. import { calculateAnticoagulantZL, uParseTime } from '@/utils/tools'
  270. import {
  271. getAllSystemPrescription,
  272. getSystemPrescription,
  273. postSystemPrescription,
  274. updateSystemPrescription
  275. } from '@/api/config'
  276. export default {
  277. name: 'prescription',
  278. components: {},
  279. data() {
  280. return {
  281. dialysisTimeShow: new Date(2018, 1, 1, 3, 0),
  282. modeOptions: null,
  283. current_select: 0,
  284. mode_name: 'HD',
  285. pageLoading: false,
  286. itemLoading: false,
  287. treatment_mode: [// 治疗模式
  288. {
  289. id: 1,
  290. name: 'HD',
  291. dialysis_duration: 1,
  292. replacement_way: 2,
  293. hemodialysis_machine: 1,
  294. blood_filter: 2,
  295. perfusion_apparatus: 2,
  296. blood_flow_volume: 1,
  297. dialysate_flow: 1,
  298. kalium: 1,
  299. sodium: 1,
  300. calcium: 1,
  301. bicarbonate: 1
  302. },
  303. {
  304. id: 2,
  305. name: 'HDF',
  306. dialysis_duration: 1,
  307. replacement_way: 1,
  308. hemodialysis_machine: 2,
  309. blood_filter: 1,
  310. perfusion_apparatus: 2,
  311. blood_flow_volume: 1,
  312. dialysate_flow: 1,
  313. kalium: 1,
  314. sodium: 1,
  315. calcium: 1,
  316. bicarbonate: 1
  317. },
  318. {
  319. id: 3,
  320. name: 'HD+HP',
  321. dialysis_duration: 1,
  322. replacement_way: 2,
  323. hemodialysis_machine: 1,
  324. blood_filter: 2,
  325. perfusion_apparatus: 1,
  326. blood_flow_volume: 1,
  327. dialysate_flow: 1,
  328. kalium: 1,
  329. sodium: 1,
  330. calcium: 1,
  331. bicarbonate: 1
  332. },
  333. {
  334. id: 4,
  335. name: 'HP',
  336. dialysis_duration: 1,
  337. replacement_way: 2,
  338. hemodialysis_machine: 2,
  339. blood_filter: 2,
  340. perfusion_apparatus: 1,
  341. blood_flow_volume: 1,
  342. dialysate_flow: 2,
  343. kalium: 2,
  344. sodium: 2,
  345. calcium: 2,
  346. bicarbonate: 2
  347. },
  348. {
  349. id: 5,
  350. name: 'HF',
  351. dialysis_duration: 1,
  352. replacement_way: 1,
  353. hemodialysis_machine: 2,
  354. blood_filter: 1,
  355. perfusion_apparatus: 2,
  356. blood_flow_volume: 1,
  357. dialysate_flow: 2,
  358. kalium: 1,
  359. sodium: 1,
  360. calcium: 1,
  361. bicarbonate: 1
  362. },
  363. {
  364. id: 6,
  365. name: 'SCUF',
  366. dialysis_duration: 1,
  367. replacement_way: 2,
  368. hemodialysis_machine: 1,
  369. blood_filter: 2,
  370. perfusion_apparatus: 2,
  371. blood_flow_volume: 1,
  372. dialysate_flow: 2,
  373. kalium: 2,
  374. sodium: 2,
  375. calcium: 2,
  376. bicarbonate: 2
  377. },
  378. {
  379. id: 7,
  380. name: 'IUF',
  381. dialysis_duration: 1,
  382. replacement_way: 2,
  383. hemodialysis_machine: 1,
  384. blood_filter: 2,
  385. perfusion_apparatus: 2,
  386. blood_flow_volume: 2,
  387. dialysate_flow: 2,
  388. kalium: 2,
  389. sodium: 2,
  390. calcium: 2,
  391. bicarbonate: 2
  392. },
  393. {
  394. id: 8,
  395. name: 'HFHD',
  396. dialysis_duration: 1,
  397. replacement_way: 2,
  398. hemodialysis_machine: 1,
  399. blood_filter: 2,
  400. perfusion_apparatus: 2,
  401. blood_flow_volume: 1,
  402. dialysate_flow: 1,
  403. kalium: 1,
  404. sodium: 1,
  405. calcium: 1,
  406. bicarbonate: 1
  407. },
  408. {
  409. id: 9,
  410. name: 'HFHD+HP',
  411. dialysis_duration: 1,
  412. replacement_way: 2,
  413. hemodialysis_machine: 1,
  414. blood_filter: 2,
  415. perfusion_apparatus: 1,
  416. blood_flow_volume: 1,
  417. dialysate_flow: 1,
  418. kalium: 1,
  419. sodium: 1,
  420. calcium: 1,
  421. bicarbonate: 1
  422. },
  423. {
  424. id: 10,
  425. name: 'PHF',
  426. dialysis_duration: 1,
  427. replacement_way: 1,
  428. hemodialysis_machine: 2,
  429. blood_filter: 1,
  430. perfusion_apparatus: 2,
  431. blood_flow_volume: 1,
  432. dialysate_flow: 1,
  433. kalium: 1,
  434. sodium: 1,
  435. calcium: 1,
  436. bicarbonate: 1
  437. },
  438. {
  439. id: 11,
  440. name: 'HFR',
  441. dialysis_duration: 1,
  442. replacement_way: 2,
  443. hemodialysis_machine: 2,
  444. blood_filter: 1,
  445. perfusion_apparatus: 1,
  446. blood_flow_volume: 1,
  447. dialysate_flow: 1,
  448. kalium: 1,
  449. sodium: 1,
  450. calcium: 1,
  451. bicarbonate: 1
  452. },
  453. {
  454. id: 12,
  455. name: 'HDF+HP',
  456. dialysis_duration: 1,
  457. replacement_way: 1,
  458. hemodialysis_machine: 2,
  459. blood_filter: 1,
  460. perfusion_apparatus: 1,
  461. blood_flow_volume: 1,
  462. dialysate_flow: 1,
  463. kalium: 1,
  464. sodium: 1,
  465. calcium: 1,
  466. bicarbonate: 1
  467. },
  468. {
  469. id: 13,
  470. name: 'CRRT',
  471. dialysis_duration: 1,
  472. replacement_way: 1,
  473. hemodialysis_machine: 2,
  474. blood_filter: 1,
  475. perfusion_apparatus: 2,
  476. blood_flow_volume: 1,
  477. dialysate_flow: 2,
  478. kalium: 1,
  479. sodium: 1,
  480. calcium: 1,
  481. bicarbonate: 1
  482. },
  483. {
  484. id: 14,
  485. name: '腹水回输',
  486. dialysis_duration: 1,
  487. replacement_way: 2,
  488. hemodialysis_machine: 1,
  489. blood_filter: 2,
  490. perfusion_apparatus: 2,
  491. blood_flow_volume: 2,
  492. dialysate_flow: 2,
  493. kalium: 2,
  494. sodium: 2,
  495. calcium: 2,
  496. bicarbonate: 2
  497. },
  498. {
  499. id: 15,
  500. name: 'HD前置换',
  501. dialysis_duration: 1,
  502. replacement_way: 2,
  503. hemodialysis_machine: 1,
  504. blood_filter: 2,
  505. perfusion_apparatus: 2,
  506. blood_flow_volume: 1,
  507. dialysate_flow: 1,
  508. kalium: 1,
  509. sodium: 1,
  510. calcium: 1,
  511. bicarbonate: 1
  512. },
  513. {
  514. id: 16,
  515. name: 'HD后置换',
  516. dialysis_duration: 1,
  517. replacement_way: 2,
  518. hemodialysis_machine: 1,
  519. blood_filter: 2,
  520. perfusion_apparatus: 2,
  521. blood_flow_volume: 1,
  522. dialysate_flow: 1,
  523. kalium: 1,
  524. sodium: 1,
  525. calcium: 1,
  526. bicarbonate: 1
  527. },
  528. {
  529. id: 17,
  530. name: 'HDF前置换',
  531. dialysis_duration: 1,
  532. replacement_way: 1,
  533. hemodialysis_machine: 2,
  534. blood_filter: 1,
  535. perfusion_apparatus: 2,
  536. blood_flow_volume: 1,
  537. dialysate_flow: 1,
  538. kalium: 1,
  539. sodium: 1,
  540. calcium: 1,
  541. bicarbonate: 1
  542. },
  543. {
  544. id: 18,
  545. name: 'HDF后置换',
  546. dialysis_duration: 1,
  547. replacement_way: 1,
  548. hemodialysis_machine: 2,
  549. blood_filter: 1,
  550. perfusion_apparatus: 2,
  551. blood_flow_volume: 1,
  552. dialysate_flow: 1,
  553. kalium: 1,
  554. sodium: 1,
  555. calcium: 1,
  556. bicarbonate: 1
  557. }
  558. ],
  559. addPlan: {
  560. id: 0,
  561. mode:'',
  562. dialyzer: '',
  563. dialysis_duration: '',
  564. dialysis_duration_hour: '',
  565. dialysis_duration_minute: '',
  566. hemodialysis_machine: '',
  567. perfusion_apparatus: '',
  568. dialysate_formulation:'',
  569. blood_flow_volume: '',
  570. dewater: '',
  571. displace_liqui: 0,
  572. replacement_way: '',
  573. anticoagulant: '',
  574. anticoagulant_shouji: '',
  575. anticoagulant_weichi: '',
  576. anticoagulant_zongliang: '',
  577. anticoagulant_gaimingcheng: '',
  578. anticoagulant_gaijiliang: '',
  579. kalium: '',
  580. replacement_total: '',
  581. sodium: '',
  582. calcium: '',
  583. bicarbonate: '',
  584. glucose: '',
  585. dry_weight: '',
  586. dialysate_flow: '',
  587. dialysate_temperature: '',
  588. conductivity: '',
  589. doctor: '',
  590. remark: '',
  591. target_ktv: '',
  592. target_ultrafiltration: '',
  593. dialyzer_perfusion_apparatus: '',
  594. body_fluid: '',
  595. body_fluid_other: '',
  596. special_medicine: '',
  597. special_medicine_other: '',
  598. displace_liqui_part: '',
  599. displace_liqui_value: '',
  600. ultrafiltration: '',
  601. blood_access: ''
  602. },
  603. system_prescription: [],
  604. isEdit: false,
  605. anticoagulant: {
  606. id: 0,
  607. name: '',
  608. type: 1,
  609. shouji: 1,
  610. weichi: 1,
  611. zongliang: 1,
  612. gaimingcheng: -1,
  613. gaijiliang: -1,
  614. shouji_unit: 'mg',
  615. weichi_unit: 'mg/h',
  616. zongliang_unit: 'mg',
  617. gaimingcheng_unit: '',
  618. gaijiliang_unit: ''
  619. },
  620. anticoagulantsSet: {
  621. type: 1
  622. },
  623. replacementWays: null,
  624. anticoagulantsConfit: null,
  625. dialysate_formulation: [],
  626. body_fluid_option: [],
  627. special_medicine_option: [],
  628. displace_liqui_part_option: [],
  629. blood_access_option: []
  630. }
  631. },
  632. computed: {},
  633. methods: {
  634. openEdit() {
  635. },
  636. tableRows({ row, rowIndex }) {
  637. // 把每一行的索引放进row
  638. row.index = rowIndex
  639. },
  640. onRowClicks(row, event, column) {
  641. this.current_select = row.id
  642. this.mode_name = row.name
  643. this.isEdit = false
  644. this.addPlan.mode = row.id
  645. this.getSystemPrescription(row.id)
  646. },getSystemPrescription(id){
  647. var tempAddPlan = {
  648. id: 0,
  649. mode:'',
  650. dialyzer: '',
  651. dialysis_duration: '',
  652. dialysis_duration_hour: '',
  653. dialysis_duration_minute: '',
  654. hemodialysis_machine: '',
  655. dialysate_formulation:'',
  656. perfusion_apparatus: '',
  657. blood_flow_volume: '',
  658. dewater: '',
  659. displace_liqui: 0,
  660. replacement_way: '',
  661. anticoagulant: '',
  662. anticoagulant_shouji: '',
  663. anticoagulant_weichi: '',
  664. anticoagulant_zongliang: '',
  665. anticoagulant_gaimingcheng: '',
  666. anticoagulant_gaijiliang: '',
  667. kalium: '',
  668. replacement_total: '',
  669. sodium: '',
  670. calcium: '',
  671. bicarbonate: '',
  672. glucose: '',
  673. dry_weight: '',
  674. dialysate_flow: '',
  675. dialysate_temperature: '',
  676. conductivity: '',
  677. doctor: '',
  678. remark: '',
  679. target_ktv: '',
  680. target_ultrafiltration: '',
  681. dialyzer_perfusion_apparatus: '',
  682. body_fluid: '',
  683. body_fluid_other: '',
  684. special_medicine: '',
  685. special_medicine_other: '',
  686. displace_liqui_part: '',
  687. displace_liqui_value: '',
  688. ultrafiltration: '',
  689. blood_access: ''
  690. }
  691. for (const key in tempAddPlan) {
  692. this.addPlan[key] = tempAddPlan[key]
  693. }
  694. this.isEdit = false
  695. let params ={
  696. id:id
  697. }
  698. this.dialysisTimeShow = new Date(2018, 1, 1, this.addPlan.dialysis_duration_hour, this.addPlan.dialysis_duration_minute)
  699. getSystemPrescription(params).then(response => {
  700. if (response.data.state == 0) {
  701. this.$message.error(response.data.msg)
  702. return false
  703. } else {
  704. if(response.data.data.prescription.id > 0) {
  705. for (const key in response.data.data.prescription) {
  706. this.addPlan[key] = response.data.data.prescription[key]
  707. }
  708. this.dialysisTimeShow = new Date(2018, 1, 1, this.addPlan.dialysis_duration_hour, this.addPlan.dialysis_duration_minute)
  709. if (this.addPlan.id > 0) {
  710. this.isEdit = true
  711. }
  712. }
  713. this.addPlan.mode = id
  714. }
  715. })
  716. },
  717. getModeStatus: function(id) {
  718. for (let i = 0; i < this.system_prescription.length; i++) {
  719. if (this.system_prescription[i].mode_id == id) {
  720. return '已保存'
  721. }
  722. }
  723. return '未保存'
  724. }, getAllSystemPrescription() {
  725. getAllSystemPrescription().then(response => {
  726. if (response.data.state == 0) {
  727. this.$message.error(response.data.msg)
  728. return false
  729. } else {
  730. this.system_prescription = response.data.data.prescriptions
  731. for (let i = 0; i < this.system_prescription.length; i++) {
  732. if (this.system_prescription[i].mode == 1) {
  733. this.isEdit = true
  734. }
  735. }
  736. }
  737. })
  738. }, selectnDialysisTime(val) {
  739. console.log(val)
  740. console.log( this.addPlan.dialysis_duration)
  741. console.log( this.addPlan.dialysis_duration_hour)
  742. console.log( this.addPlan.dialysis_duration_minute)
  743. var valTime = val.split(':')
  744. this.addPlan.dialysis_duration = parseFloat(valTime[0]) + parseFloat((valTime[1] / 60).toFixed(2))
  745. this.addPlan.dialysis_duration_hour = valTime[0]
  746. this.addPlan.dialysis_duration_minute = valTime[1]
  747. }, changeThisAnticoagulant() {
  748. var thismode = parseInt(this.addPlan.anticoagulant)
  749. if (isNaN(thismode) || thismode <= 0) {
  750. return false
  751. }
  752. if (typeof (this.anticoagulantsConfit[thismode]) == 'undefined' || this.anticoagulantsConfit[thismode] == null) {
  753. return false
  754. }
  755. this.anticoagulant = this.anticoagulantsConfit[thismode]
  756. }, savePrescription:function() {
  757. this.addPlan.anticoagulant_zongliang = this.addPlan.anticoagulant_zongliang.toString()
  758. if (!this.isEdit){
  759. postSystemPrescription(this.addPlan).then(response => {
  760. if (response.data.state == 0) {
  761. this.$message.error(response.data.msg)
  762. return false
  763. } else {
  764. this.$notify({
  765. title: '成功',
  766. message: '创建成功',
  767. type: 'success',
  768. duration: 2000
  769. })
  770. this.isEdit = true
  771. this.system_prescription = []
  772. this.system_prescription = response.data.data.prescriptions
  773. this.addPlan.id = response.data.data.prescription.id
  774. return false
  775. }
  776. })
  777. }else{
  778. updateSystemPrescription(this.addPlan.id, this.addPlan).then(response => {
  779. if (response.data.state == 0) {
  780. this.$message.error(response.data.msg)
  781. return false
  782. } else {
  783. this.isEdit = true
  784. this.addPlan.id = response.data.data.prescription.id
  785. this.$notify({
  786. title: '成功',
  787. message: '编辑成功',
  788. type: 'success',
  789. duration: 2000
  790. })
  791. return false
  792. }
  793. })
  794. }
  795. }
  796. }, mounted() {
  797. this.$refs.singleTable.setCurrentRow(this.treatment_mode[0])
  798. this.mode_name = this.treatment_mode[0].name
  799. this.current_select = this.treatment_mode[0].id
  800. },
  801. created() {
  802. this.anticoagulantsSet = this.$store.getters.anticoagulants_set
  803. this.replacementWays = this.$store.getters.replacement_ways
  804. this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit
  805. this.blood_filters = this.$store.getters.blood_filters
  806. this.dialysate_formulation = this.$store.getters.dialysate_formulation
  807. this.body_fluid_option = this.$store.getters.body_fluid
  808. this.special_medicine_option = this.$store.getters.special_medicine
  809. this.displace_liqui_part_option = this.$store.getters.displace_liqui
  810. this.blood_access_option = this.$store.getters.blood_access
  811. this.addPlan.mode = 1
  812. this.getAllSystemPrescription()
  813. this.getSystemPrescription(this.addPlan.mode)
  814. }, watch: {
  815. 'addPlan.dialysis_duration': function() {
  816. console.log(this.addPlan.anticoagulant_shouji)
  817. console.log(this.addPlan.dialysis_duration)
  818. console.log(this.addPlan.anticoagulant_weichi)
  819. this.addPlan.anticoagulant_zongliang = calculateAnticoagulantZL(1,
  820. this.addPlan.anticoagulant_shouji,
  821. this.addPlan.dialysis_duration,
  822. this.addPlan.anticoagulant_weichi
  823. )
  824. },
  825. 'addPlan.anticoagulant_shouji': function() {
  826. console.log(this.addPlan.anticoagulant_shouji)
  827. console.log(this.addPlan.dialysis_duration)
  828. console.log(this.addPlan.anticoagulant_weichi)
  829. this.addPlan.anticoagulant_zongliang = calculateAnticoagulantZL(1,
  830. this.addPlan.anticoagulant_shouji,
  831. this.addPlan.dialysis_duration,
  832. this.addPlan.anticoagulant_weichi
  833. )
  834. },
  835. 'addPlan.anticoagulant_weichi': function() {
  836. console.log(this.addPlan.anticoagulant_shouji)
  837. console.log(this.addPlan.dialysis_duration)
  838. console.log(this.addPlan.anticoagulant_weichi)
  839. this.addPlan.anticoagulant_zongliang = calculateAnticoagulantZL(1,
  840. this.addPlan.anticoagulant_shouji,
  841. this.addPlan.dialysis_duration,
  842. this.addPlan.anticoagulant_weichi
  843. )
  844. }
  845. }
  846. }
  847. </script>
  848. <style rel="stylesheet/scss" lang="scss" scoped>
  849. </style>