dialysisSolution.vue 63KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909
  1. <template>
  2. <div class="patient-container">
  3. <patient-sidebar :id="patientID" defaultActive="2-1"></patient-sidebar>
  4. <div class="patient-app-container app-container">
  5. <div class="Total">
  6. <!-- <div class="plan" >透析计划</div> -->
  7. <!-- <table-title title="长期透析处方"></table-title> -->
  8. <div class="sum">
  9. <!-- <span>透析总频率:<el-input :value="totalrate" disabled style="width:180px"></el-input></span> -->
  10. <el-button
  11. type="primary"
  12. size="small"
  13. icon="el-icon-plus"
  14. @click="openNew"
  15. :disabled="
  16. $store.getters.xt_user.subscibe.state == 3 ? true : false
  17. "
  18. >新增透析处方
  19. </el-button>
  20. </div>
  21. </div>
  22. <el-table
  23. ref="solutionTable"
  24. :data="tableData"
  25. border
  26. fit
  27. highlight-current-row
  28. @current-change="tableCurrentChange"
  29. :header-cell-style="{
  30. backgroundColor: 'rgb(245, 247, 250)',
  31. color: '#606266'
  32. }"
  33. :row-style="{ color: '#303133' }"
  34. style="width: 100%"
  35. >
  36. <el-table-column type="index" align="center" label="序号" width="60">
  37. </el-table-column>
  38. <el-table-column
  39. prop="mode_name"
  40. align="center"
  41. label="透析模式"
  42. min-width="50"
  43. >
  44. <template slot-scope="scope">
  45. {{ modeOptions[scope.row.mode_id]?modeOptions[scope.row.mode_id].name:'' }}
  46. </template>
  47. </el-table-column>
  48. <el-table-column
  49. prop="dialysis_duration"
  50. align="center"
  51. label="透析时长"
  52. min-width="50"
  53. >
  54. <template slot-scope="scope">
  55. {{ scope.row.dialysis_duration_hour }} 小时
  56. {{ scope.row.dialysis_duration_minute }} 分钟
  57. </template>
  58. </el-table-column>
  59. <!-- <el-table-column
  60. prop="period"
  61. label="频率"
  62. align="center"
  63. min-width="50">
  64. <template slot-scope="scope" >
  65. <span v-if="scope.row.parent_id === 0" >{{scope.row.period}}{{scope.row.times}}</span>
  66. <span v-else >--</span>
  67. </template>
  68. </el-table-column> -->
  69. <!-- <el-table-column
  70. prop="name"
  71. label="处方名"
  72. align="center"
  73. min-width="50">
  74. <template slot-scope="scope" >
  75. <span >{{scope.row.name}}{{scope.row.sub_name}}</span>
  76. </template>
  77. </el-table-column> -->
  78. <el-table-column
  79. prop="doctor"
  80. label="医生"
  81. align="center"
  82. min-width="110"
  83. >
  84. <template slot-scope="scope">
  85. <span>{{ getAdminUserName(scope.row.registrars_id) }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column
  89. prop="updated_time"
  90. align="center"
  91. label="更新日期"
  92. min-width="60"
  93. >
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.updated_time | parseTime("{y}-{m}-{d}") }}</span>
  96. </template>
  97. </el-table-column>
  98. <!-- <el-table-column
  99. prop="state"
  100. label="状态"
  101. align="center"
  102. min-width="40">
  103. <template slot-scope="scope" >
  104. <span v-if="scope.row.initiate_mode==1">启用</span>
  105. <span v-else-if="scope.row.initiate_mode==2">停用</span>
  106. <span v-else>未知</span>
  107. </template>
  108. </el-table-column> -->
  109. <el-table-column label="操作" align="center" min-width="140">
  110. <template slot-scope="scope">
  111. <el-tooltip
  112. class="item"
  113. effect="dark"
  114. content="编辑"
  115. placement="top"
  116. >
  117. <el-button
  118. size="small"
  119. type="primary"
  120. icon="el-icon-edit-outline"
  121. @click="openEdit(scope.$index, scope.row)"
  122. ></el-button>
  123. </el-tooltip>
  124. <!-- <el-button
  125. size="mini"
  126. type="primary"
  127. @click="openChildEdit(scope.$index, scope.row)" v-else>编辑</el-button>
  128. <el-button
  129. size="mini"
  130. type="success"
  131. @click="openNewChild(scope.$index, scope.row)" v-if="scope.row.parent_id===0">新增</el-button>
  132. <el-button
  133. size="mini"
  134. type="danger"
  135. @click="handleDelete(scope.$index, scope.row)">删除</el-button>-->
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. <el-pagination
  140. align="right"
  141. @size-change="handleSizeChange"
  142. @current-change="handleCurrentChange"
  143. :current-page="queryParams.page"
  144. :page-sizes="[10, 20, 50, 100]"
  145. :page-size="10"
  146. background
  147. style="margin-top:20px;"
  148. layout="total, sizes, prev, pager, next, jumper"
  149. :total="total"
  150. >
  151. </el-pagination>
  152. </div>
  153. <el-dialog
  154. :title="isEdit ? '编辑透析处方' : '新增透析处方'"
  155. :visible.sync="dialogVisible"
  156. width="1010px"
  157. >
  158. <el-form
  159. ref="addPlan"
  160. :model="addPlan"
  161. :rules="addPlanRules"
  162. label-width="160px"
  163. >
  164. <el-row :gutter="20">
  165. <el-col :span="8" v-if="isShows('透析模式')">
  166. <el-form-item label="透析模式:" prop="mode">
  167. <el-select
  168. v-model="addPlan.mode"
  169. @change="addPlanModeChange"
  170. :disabled="isEdit ? true : false"
  171. >
  172. <el-option
  173. v-for="item in modeOptions"
  174. :label="item.name"
  175. :key="item.id"
  176. :value="item.id"
  177. ></el-option>
  178. </el-select>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="8" v-if="isShows('透析时长')">
  182. <el-form-item label="透析时长(h):" prop="dialysis_duration">
  183. <el-time-picker
  184. v-model="dialysisTimeShow"
  185. :picker-options="{
  186. selectableRange: '00:01:00 - 23:59:00'
  187. }"
  188. placeholder="透析时长"
  189. style="width:100%;"
  190. value-format="H:m"
  191. format="H:m"
  192. @change="selectnDialysisTime"
  193. >
  194. </el-time-picker>
  195. </el-form-item>
  196. </el-col>
  197. <!-- <el-col :span="8">
  198. <el-form-item label="透析器:" prop="dialyzer">
  199. <el-select v-model="addPlan.dialyzer" placeholder="" >
  200. <el-option v-for="item in deviceList" :label="item.name" :key="item.id" :value="item.id"></el-option>
  201. </el-select>
  202. </el-form-item>
  203. </el-col> -->
  204. <!-- <el-col :span="8">
  205. <el-form-item label="透析器:" prop="hemodialysis_machine">
  206. <el-select v-model="addPlan.hemodialysis_machine" placeholder="" >
  207. <el-option v-for="item in hemodialysis_machines" :label="item.name" :key="item.id" :value="item.id"></el-option>
  208. </el-select>
  209. </el-form-item>
  210. </el-col> -->
  211. <!-- <el-col :span="8">
  212. <el-form-item label="灌流器:" prop="perfusion_apparatus">
  213. <el-select v-model="addPlan.perfusion_apparatus" placeholder="" >
  214. <el-option v-for="item in perfusion_apparatus" :label="item.name" :key="item.id" :value="item.id"></el-option>
  215. </el-select>
  216. </el-form-item>
  217. </el-col> -->
  218. <el-col :span="8" v-if="isShows('血流量')">
  219. <el-form-item label="血流量(ml/min):" prop="blood_flow_volume">
  220. <el-input v-model="addPlan.blood_flow_volume"></el-input>
  221. </el-form-item>
  222. </el-col>
  223. <!--<el-col :span="8" v-if="isShows('目标超滤量')&&this.$store.getters.xt_user.template_info.template_id == 6">-->
  224. <!--<el-form-item label="目标超滤量(ml) : ">-->
  225. <!--<el-input v-model="addPlan.target_ultrafiltration" type="number"></el-input>-->
  226. <!--</el-form-item>-->
  227. <!--</el-col>-->
  228. <!--<el-col :span="8" v-if="isShows('目标超滤量')&&this.$store.getters.xt_user.template_info.template_id != 6">-->
  229. <!--<el-form-item label="目标超滤量(L) : ">-->
  230. <!--<el-input v-model="addPlan.target_ultrafiltration" type="number"></el-input>-->
  231. <!--</el-form-item>-->
  232. <!--</el-col>-->
  233. <el-col :span="8" v-if="isShows('透析液配方')">
  234. <el-form-item label="透析液配方:">
  235. <el-select v-model="addPlan.dialysate_formulation">
  236. <el-option
  237. v-for="item in dialysate_formulation"
  238. :label="item.name"
  239. :key="item.id"
  240. :value="item.id"
  241. ></el-option>
  242. </el-select>
  243. </el-form-item>
  244. </el-col>
  245. <!-- <el-col :span="12">
  246. <el-form-item label="脱水量(L):" prop="dewater">
  247. <el-input v-model="addPlan.dewater" ></el-input>
  248. </el-form-item>
  249. </el-col> -->
  250. <!-- <el-col :span="12">
  251. <el-form-item label="置换液(L):" prop="displace_liqui">
  252. <el-input v-model="addPlan.displace_liqui" ></el-input>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="12">
  256. <el-form-item label="置换方式:" prop="replacement_way" >
  257. <el-select v-model="addPlan.replacement_way" >
  258. <el-option v-for="item in replacementWays" :label="item.name" :key="item.id" :value="item.id"></el-option>
  259. </el-select>
  260. </el-form-item>
  261. </el-col> -->
  262. <el-col :span="8" v-if="isShows('抗凝剂')">
  263. <el-form-item label="抗凝剂:" prop="anticoagulant">
  264. <el-select
  265. v-model="addPlan.anticoagulant"
  266. @change="changeThisAnticoagulant"
  267. >
  268. <el-option
  269. v-for="item in anticoagulantsConfit"
  270. :label="item.name"
  271. :key="item.id"
  272. :value="item.id"
  273. ></el-option>
  274. </el-select>
  275. </el-form-item>
  276. </el-col>
  277. <el-col
  278. :span="8"
  279. v-if="anticoagulant.shouji != -1 && isShows('首剂')"
  280. >
  281. <el-form-item
  282. :label="'首剂(' + anticoagulant.shouji_unit + '): '"
  283. prop="anticoagulant_shouji"
  284. >
  285. <el-input
  286. v-model="addPlan.anticoagulant_shouji"
  287. :disabled="anticoagulant.shouji == 1 ? false : true"
  288. type="number"
  289. ></el-input>
  290. </el-form-item>
  291. </el-col>
  292. <el-col
  293. :span="8"
  294. v-if="anticoagulant.weichi != -1 && isShows('维持')"
  295. >
  296. <el-form-item
  297. :label="'维持(' + anticoagulant.weichi_unit + '): '"
  298. prop="anticoagulant_weichi"
  299. >
  300. <el-input
  301. v-model="addPlan.anticoagulant_weichi"
  302. :disabled="anticoagulant.weichi == 1 ? false : true"
  303. type="number"
  304. ></el-input>
  305. </el-form-item>
  306. </el-col>
  307. <el-col
  308. :span="8"
  309. v-if="anticoagulant.zongliang != -1 && isShows('总量')"
  310. >
  311. <el-form-item
  312. :label="'总量(' + anticoagulant.zongliang_unit + '): '"
  313. prop="anticoagulant_zongliang"
  314. >
  315. <el-input
  316. v-model="addPlan.anticoagulant_zongliang"
  317. :disabled="anticoagulant.zongliang == 1 ? false : true"
  318. type="number"
  319. ></el-input>
  320. </el-form-item>
  321. </el-col>
  322. <el-col
  323. :span="8"
  324. v-if="anticoagulant.gaimingcheng != -1 && isShows('钙名称')"
  325. >
  326. <el-form-item label="钙名称:" prop="anticoagulant_gaimingcheng">
  327. <el-input
  328. v-model="addPlan.anticoagulant_gaimingcheng"
  329. :disabled="anticoagulant.gaimingcheng == 1 ? false : true"
  330. placeholder="钙名称"
  331. ></el-input>
  332. </el-form-item>
  333. </el-col>
  334. <el-col
  335. :span="8"
  336. v-if="anticoagulant.gaijiliang != -1 && isShows('钙剂量')"
  337. >
  338. <el-form-item
  339. :label="'钙剂量(' + anticoagulant.gaimingcheng_unit + '): '"
  340. prop="anticoagulant_gaijiliang"
  341. >
  342. <el-input
  343. v-model="addPlan.anticoagulant_gaijiliang"
  344. :disabled="anticoagulant.gaijiliang == 1 ? false : true"
  345. placeholder="钙剂量"
  346. ></el-input>
  347. </el-form-item>
  348. </el-col>
  349. <el-col :span="8" v-if="isShows('置换量')" v-show="zhiShow">
  350. <el-form-item label="置换量(L) : " prop="replacement_total">
  351. <el-input
  352. v-model="addPlan.replacement_total"
  353. type="number"
  354. ></el-input>
  355. </el-form-item>
  356. </el-col>
  357. <el-col :span="8" v-if="isShows('钾')">
  358. <el-form-item label="钾(mmol/L): " prop="kalium">
  359. <el-input v-model="addPlan.kalium"></el-input>
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="8" v-if="isShows('钠')">
  363. <el-form-item label="钠(mmol/L): " prop="sodium">
  364. <el-input v-model="addPlan.sodium"></el-input>
  365. </el-form-item>
  366. </el-col>
  367. <el-col :span="8" v-if="isShows('钙')">
  368. <el-form-item label="钙(mmol/L): " prop="calcium">
  369. <el-input v-model="addPlan.calcium"></el-input>
  370. </el-form-item>
  371. </el-col>
  372. <el-col :span="8" v-if="isShows('透析器/灌流器')">
  373. <el-form-item label="透析器/灌流器:">
  374. <el-input
  375. v-model="addPlan.dialyzer_perfusion_apparatus" @focus="showInnerDialog('5')"></el-input>
  376. </el-form-item>
  377. </el-col>
  378. <el-col :span="8" v-if="isShows('透析器')">
  379. <el-form-item label="透析器:">
  380. <el-input v-model="dialysis_dialyszers" @focus="showInnerDialog('6')"></el-input>
  381. </el-form-item>
  382. </el-col>
  383. <el-col :span="8" v-if="isShows('灌流器')">
  384. <el-form-item label="灌流器:">
  385. <el-input v-model="dialysis_irrigation" @focus="showInnerDialog('7')"></el-input>
  386. </el-form-item>
  387. </el-col>
  388. <el-col :span="8" v-if="isShows('碳酸氢盐')">
  389. <el-form-item label="碳酸氢盐(mmol/L): " prop="bicarbonate">
  390. <el-input v-model="addPlan.bicarbonate"></el-input>
  391. </el-form-item>
  392. </el-col>
  393. <el-col :span="8" v-if="isShows('葡萄糖')">
  394. <el-form-item label="葡萄糖(mmol/L): " prop="glucose">
  395. <el-input v-model="addPlan.glucose"></el-input>
  396. </el-form-item>
  397. </el-col>
  398. <el-col :span="8" v-if="isShows('透析液流量')">
  399. <el-form-item label="透析液流量(ml/min): " prop="dialysate_flow">
  400. <el-input v-model="addPlan.dialysate_flow"></el-input>
  401. </el-form-item>
  402. </el-col>
  403. <el-col :span="8" v-if="isShows('透析液温度')">
  404. <el-form-item
  405. label="透析液温度(℃): "
  406. prop="dialysate_temperature"
  407. >
  408. <el-input v-model="addPlan.dialysate_temperature"></el-input>
  409. </el-form-item>
  410. </el-col>
  411. <el-col :span="8" v-if="isShows('电导度')">
  412. <el-form-item label="电导度(mS/cm): " prop="conductivity">
  413. <el-input v-model="addPlan.conductivity"></el-input>
  414. </el-form-item>
  415. </el-col>
  416. <el-col :span="8" v-if="isShows('体液过多症状')">
  417. <el-form-item label="体液过多症状:">
  418. <el-select v-model="addPlan.body_fluid" @change="changeBodyFluid">
  419. <el-option
  420. v-for="item in body_fluid_option"
  421. :label="item.name"
  422. :key="item.id"
  423. :value="item.id"
  424. ></el-option>
  425. </el-select>
  426. </el-form-item>
  427. </el-col>
  428. <el-col :span="8" v-if="isShows('体液过多其他症状')">
  429. <el-form-item label="体液过多其他症状">
  430. <el-input v-model="addPlan.body_fluid_other"></el-input>
  431. </el-form-item>
  432. </el-col>
  433. <el-col :span="8" v-if="isShows('透析前使用特殊药物')">
  434. <el-form-item label="透析前使用特殊药物">
  435. <el-select
  436. v-model="addPlan.special_medicine"
  437. placeholder="请选择"
  438. style="width:100%;"
  439. >
  440. <el-option :key="0" label="请选择" :value="0"></el-option>
  441. <el-option
  442. v-for="item in special_medicine_option"
  443. :label="item.name"
  444. :key="item.id"
  445. :value="item.id"
  446. ></el-option>
  447. </el-select>
  448. </el-form-item>
  449. </el-col>
  450. <el-col :span="8" v-if="isShows('透析前使用其他特殊药物')">
  451. <el-form-item label="使用其他特殊药物">
  452. <el-input v-model="addPlan.special_medicine_other"></el-input>
  453. </el-form-item>
  454. </el-col>
  455. <el-col :span="8">
  456. <el-form-item
  457. label="置换液:"
  458. v-if="
  459. isShows('置换液') &&
  460. this.$store.getters.xt_user.template_info.template_id != 6
  461. "
  462. v-show="huShow"
  463. >
  464. <el-select
  465. v-model="addPlan.displace_liqui_part"
  466. placeholder="请选择"
  467. >
  468. <el-option :key="0" label="请选择" :value="0"></el-option>
  469. <el-option
  470. v-for="(option, index) in displace_liqui_part_option"
  471. :key="index"
  472. :label="option.name"
  473. :value="option.id"
  474. ></el-option>
  475. </el-select>
  476. </el-form-item>
  477. <el-form-item
  478. label="置换方式:"
  479. v-if="
  480. isShows('置换液') &&
  481. this.$store.getters.xt_user.template_info.template_id == 6
  482. "
  483. >
  484. <el-select
  485. v-model="addPlan.displace_liqui_part"
  486. placeholder="请选择"
  487. >
  488. <el-option :key="0" label="请选择" :value="0"></el-option>
  489. <el-option
  490. v-for="(option, index) in displace_liqui_part_option"
  491. :key="index"
  492. :label="option.name"
  493. :value="option.id"
  494. ></el-option>
  495. </el-select>
  496. </el-form-item>
  497. </el-col>
  498. <el-col :span="8" v-if="isShows('置换液总量')" v-show="totalShow">
  499. <el-form-item label="置换液总量(L)">
  500. <el-input v-model="addPlan.displace_liqui_value"></el-input>
  501. </el-form-item>
  502. </el-col>
  503. <el-col :span="8" v-if="isShows('血管通路')">
  504. <el-form-item label="血管通路:">
  505. <el-select v-model="addPlan.blood_access" placeholder="请选择">
  506. <el-option :key="0" label="请选择" :value="0"></el-option>
  507. <el-option
  508. v-for="(option, index) in blood_access_option"
  509. :key="index"
  510. :label="option.name"
  511. :value="option.id"
  512. ></el-option>
  513. </el-select>
  514. </el-form-item>
  515. </el-col>
  516. <!-- </el-row>
  517. <el-row :gutter="20" > -->
  518. <el-col :span="8" v-if="isShows('实际超滤量')">
  519. <el-form-item label="实际超滤量(L)">
  520. <el-input v-model="addPlan.ultrafiltration"></el-input>
  521. </el-form-item>
  522. </el-col>
  523. <el-col :span="8" v-if="isShows('目标KT/V')">
  524. <el-form-item label="目标KT/V">
  525. <el-input v-model="addPlan.target_ktv"></el-input>
  526. </el-form-item>
  527. </el-col>
  528. </el-row>
  529. <el-row :gutter="24">
  530. <el-col :span="24">
  531. <el-form-item label="备注: " prop="remark">
  532. <el-input
  533. type="textarea"
  534. :rows="2"
  535. placeholder="请输入内容"
  536. v-model="addPlan.remark"
  537. >
  538. </el-input>
  539. </el-form-item>
  540. </el-col>
  541. </el-row>
  542. </el-form>
  543. <span slot="footer" class="dialog-footer">
  544. <el-button @click="dialogVisible = false">取 消</el-button>
  545. <el-button
  546. type="primary"
  547. @click="submitEditSolution('addPlan')"
  548. v-if="isEdit"
  549. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  550. >保 存</el-button
  551. >
  552. <el-button
  553. type="primary"
  554. @click="submitNewSolution('addPlan')"
  555. v-else
  556. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  557. >保 存</el-button
  558. >
  559. </span>
  560. </el-dialog>
  561. <multi-select-box
  562. :propsForm="InnerDialogProps"
  563. v-on:dialog-comfirm="innerDialogComfirm"
  564. v-on:dialog-cancle="innerDialogCancle">
  565. </multi-select-box>
  566. </div>
  567. </template>
  568. <script>
  569. import tableTitle from './components/tableTitle'
  570. import PatientSidebar from './components/PatientSidebar'
  571. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
  572. import {
  573. createChildPatientDialysisSolution,
  574. createPatientDialysisSolution,
  575. deleteDialysisSolution,
  576. editChildPatientDialysisSolution,
  577. editDialysisSolutionDetail,
  578. editPatientDialysisSolution,
  579. fetchPatientDialysisSolutions
  580. } from '@/api/patient'
  581. import { getSystemPrescription } from '@/api/config'
  582. import { getDataConfig } from '@/utils/data'
  583. import { calculateAnticoagulantZL, uParseTime } from '@/utils/tools'
  584. import store from '@/store'
  585. import { GetDeviceInfo } from '@/api/dialysis'
  586. import MultiSelectBox from '../dialysis/details/dialog/MultiSelectBox/index'
  587. const periodWeek = [
  588. { value: '每周', label: '每周' },
  589. { value: '两周', label: '两周' },
  590. { value: '三周', label: '三周' },
  591. { value: '四周', label: '四周' }
  592. ]
  593. const periodDay = [
  594. { value: '2天', label: '2天' },
  595. { value: '3天', label: '3天' },
  596. { value: '4天', label: '4天' },
  597. { value: '5天', label: '5天' },
  598. { value: '10天', label: '10天' },
  599. { value: '15天', label: '15天' },
  600. { value: '30天', label: '30天' }
  601. ]
  602. const numOptionsWeek = [
  603. { value: '1次', label: '1次' },
  604. { value: '2次', label: '2次' },
  605. { value: '3次', label: '3次' },
  606. { value: '4次', label: '4次' },
  607. { value: '5次', label: '5次' },
  608. { value: '6次', label: '6次' },
  609. { value: '7次', label: '7次' }
  610. ]
  611. const numOptionsDay = [{ value: '1次', label: '1次' }]
  612. export default {
  613. name: 'Dialysis',
  614. data() {
  615. var checkFirstDialysis = (rule, value, callback) => {
  616. if (this.addPlan.type == 2 && !value) {
  617. return callback(new Error('请选择首次透析!'))
  618. }
  619. callback()
  620. }
  621. var checkSubName = (rule, value, callback) => {
  622. var pattern = /^\d*$/
  623. if (!pattern.test(value)) {
  624. return callback(new Error('只填写0-9的数字'))
  625. }
  626. callback()
  627. }
  628. return {
  629. zhiShow:false,
  630. huShow:false,
  631. totalShow:false,
  632. InnerDialogProps: {
  633. values: [],
  634. visibility: false,
  635. isShowTextArea: true,
  636. customContent: '',
  637. titles: '',
  638. type: '' // 不同弹框类型,用来匹配数据
  639. },
  640. deviceList: [],
  641. dialysisTimeShow: new Date(2018, 1, 1, 3, 0),
  642. isEdit: false,
  643. isChildEdit: false,
  644. totalrate: '无/两周一次',
  645. patientID: 0,
  646. dialogVisible: false,
  647. dialogFormVisible: false,
  648. formLabelWidth: '80px',
  649. formInputWidth: '80px',
  650. total: 0,
  651. tableData: null,
  652. form: {
  653. name: '',
  654. region: '',
  655. date1: '',
  656. date2: '',
  657. delivery: false,
  658. type: [],
  659. resource: '',
  660. desc: ''
  661. },
  662. addPlan: {
  663. id: 0,
  664. mode: '',
  665. mode_name: '',
  666. registrars_id: 0,
  667. dialyzer: '',
  668. dialysis_duration: '',
  669. dialysis_duration_hour: '',
  670. dialysis_duration_minute: '',
  671. hemodialysis_machine: '',
  672. perfusion_apparatus: '',
  673. blood_flow_volume: '',
  674. dewater: '',
  675. displace_liqui: 0,
  676. replacement_way: '',
  677. anticoagulant: '',
  678. anticoagulant_shouji: '',
  679. anticoagulant_weichi: '',
  680. anticoagulant_zongliang: '',
  681. anticoagulant_gaimingcheng: '',
  682. anticoagulant_gaijiliang: '',
  683. kalium: '',
  684. replacement_total: '',
  685. sodium: '',
  686. calcium: '',
  687. bicarbonate: '',
  688. glucose: '',
  689. dry_weight: '',
  690. dialysate_flow: '',
  691. dialysate_temperature: '',
  692. conductivity: '',
  693. doctor: '',
  694. dialysate_formulation: '',
  695. remark: '',
  696. target_ktv: '',
  697. target_ultrafiltration: '',
  698. dialyzer_perfusion_apparatus: '',
  699. body_fluid: '',
  700. body_fluid_other: '',
  701. special_medicine: '',
  702. special_medicine_other: '',
  703. displace_liqui_part: '',
  704. displace_liqui_value: '',
  705. ultrafiltration: '',
  706. blood_access: '',
  707. dialysis_dialyszers:'',
  708. dialysis_irrigation:'',
  709. },
  710. childPlan: {
  711. mode: '',
  712. frequency: '',
  713. name: '',
  714. parent_id: 0,
  715. sub_name: '',
  716. initiate_mode: '',
  717. doctor: ''
  718. },
  719. modeOptions: null,
  720. anticoagulantsSet: {
  721. type: 1
  722. },
  723. replacementWays: null,
  724. anticoagulantsConfit: null,
  725. dialysate_formulation: [],
  726. body_fluid_option: [],
  727. special_medicine_option: [],
  728. displace_liqui_part_option: [],
  729. blood_access_option: [],
  730. timeOptions: [{ value: 1, label: '按周' }, { value: 2, label: '按日' }],
  731. periodOptions: periodWeek,
  732. numOptions: numOptionsWeek,
  733. stateOptions: [{ value: 1, label: '启用' }, { value: 2, label: '停用' }],
  734. doctorOptions: null,
  735. adminUserOptions: null,
  736. current_index: -1,
  737. addPlanRules: {
  738. mode: [{ required: true, message: '请选择透析模式', trigger: 'blur' }],
  739. type: [{ required: true, message: '请选择频率', trigger: 'blur' }],
  740. period: [{ required: true, message: '请选择周期', trigger: 'blur' }],
  741. times: [{ required: true, message: '请选择次数', trigger: 'blur' }],
  742. initiate_mode: [
  743. { required: true, message: '请选择状态', trigger: 'blur' }
  744. ],
  745. doctor: [{ required: true, message: '请选择医生', trigger: 'blur' }],
  746. first_dialysis: [{ validator: checkFirstDialysis, trigger: 'blur' }]
  747. },
  748. addChildPlanRules: {
  749. sub_name: [
  750. { required: true, message: '请填写处方名', trigger: 'blur' },
  751. {
  752. validator: checkSubName,
  753. trigger: 'blur'
  754. }
  755. ],
  756. initiate_mode: [
  757. { required: true, message: '请选择状态', trigger: 'blur' }
  758. ],
  759. doctor: [{ required: true, message: '请选择医生', trigger: 'blur' }]
  760. },
  761. current_model: {
  762. id: 0,
  763. name: '',
  764. dialysis_duration: 2,
  765. replacement_total: 0,
  766. replacement_way: 2,
  767. hemodialysis_machine: 2,
  768. blood_filter: 2,
  769. perfusion_apparatus: 2,
  770. blood_flow_volume: 2,
  771. dialysate_flow: 2,
  772. kalium: 2,
  773. sodium: 2,
  774. calcium: 2,
  775. bicarbonate: 2
  776. },
  777. current_solution: {
  778. id: 0,
  779. name: '',
  780. sub_name: '',
  781. period: '',
  782. times: '',
  783. doctor: 0
  784. },
  785. anticoagulant: {
  786. id: 0,
  787. name: '',
  788. type: 1,
  789. shouji: 1,
  790. weichi: 1,
  791. zongliang: 1,
  792. gaimingcheng: -1,
  793. gaijiliang: -1,
  794. shouji_unit: 'mg',
  795. weichi_unit: 'mg/h',
  796. zongliang_unit: 'mg',
  797. gaimingcheng_unit: '',
  798. gaijiliang_unit: ''
  799. },
  800. blood_filters: null,
  801. perfusion_apparatus: null,
  802. hemodialysis_machines: null,
  803. dialyzerPerfusionApparatus: [],
  804. solution_detail: {
  805. id: 0,
  806. affirm_state: 0,
  807. dialysis_duration: '',
  808. replacement_way: '',
  809. mode_id: '',
  810. blood_flow_volume: '',
  811. hemodialysis_machine: '',
  812. blood_filter: '',
  813. perfusion_apparatus: '',
  814. dialysate_flow: '',
  815. kalium: '',
  816. replacement_total: '',
  817. sodium: '',
  818. calcium: '',
  819. bicarbonate: '',
  820. anticoagulant: '',
  821. anticoagulant_shouji: '',
  822. anticoagulant_weichi: '',
  823. anticoagulant_zongliang: '',
  824. anticoagulant_gaimingcheng: '',
  825. anticoagulant_gaijiliang: ''
  826. },
  827. queryParams: {
  828. page: 1,
  829. limit: 10,
  830. id: 0
  831. },
  832. stockType:[],
  833. irrigations:[],
  834. dialyzers:[],
  835. dialysis_dialyszers:'',
  836. dialysis_irrigation:"",
  837. }
  838. },
  839. watch: {
  840. 'addPlan.dialysis_duration': function() {
  841. this.addPlan.anticoagulant_zongliang = calculateAnticoagulantZL(
  842. 1,
  843. this.addPlan.anticoagulant_shouji,
  844. this.addPlan.dialysis_duration,
  845. this.addPlan.anticoagulant_weichi
  846. )
  847. },
  848. 'addPlan.anticoagulant_shouji': function() {
  849. this.addPlan.anticoagulant_zongliang = calculateAnticoagulantZL(
  850. 1,
  851. this.addPlan.anticoagulant_shouji,
  852. this.addPlan.dialysis_duration,
  853. this.addPlan.anticoagulant_weichi
  854. )
  855. },
  856. 'addPlan.anticoagulant_weichi': function() {
  857. this.addPlan.anticoagulant_zongliang = calculateAnticoagulantZL(
  858. 1,
  859. this.addPlan.anticoagulant_shouji,
  860. this.addPlan.dialysis_duration,
  861. this.addPlan.anticoagulant_weichi
  862. )
  863. }
  864. },
  865. components: {
  866. MultiSelectBox,
  867. tableTitle,
  868. PatientSidebar
  869. },
  870. methods: {
  871. showInnerDialog: function(val) {
  872. this.InnerDialogProps.visibility = true
  873. switch (val) {
  874. case '5': // 透析器/灌流器
  875. this.InnerDialogProps.values = this.dialyzerPerfusionApparatus
  876. this.InnerDialogProps.titles = '透析器/灌流器'
  877. this.InnerDialogProps.type = 'dialyzer_perfusion_apparatus'
  878. this.InnerDialogProps.selected = this.addPlan.dialyzer_perfusion_apparatus
  879. this.InnerDialogProps.isShowTextArea = false
  880. break
  881. case '6':
  882. for(let i=0;i<this.dialyzers.length;i++){
  883. this.dialyzers[i].name = this.dialyzers[i].specification_name
  884. }
  885. this.InnerDialogProps.values = this.dialyzers
  886. this.InnerDialogProps.titles = '透析器'
  887. this.InnerDialogProps.type = 'dialyzers'
  888. this.InnerDialogProps.selected = this.dialysis_dialyszers
  889. this.InnerDialogProps.isShowTextArea = false
  890. break
  891. case '7':
  892. for(let i=0;i<this.irrigations.length;i++){
  893. this.irrigations[i].name = this.irrigations[i].specification_name
  894. }
  895. this.InnerDialogProps.values = this.irrigations
  896. this.InnerDialogProps.titles = '灌流器'
  897. this.InnerDialogProps.type = 'irrigations'
  898. this.InnerDialogProps.selected = this.dialysis_irrigation
  899. this.InnerDialogProps.isShowTextArea = false
  900. break
  901. }
  902. },
  903. innerDialogComfirm: function(val) {
  904. this.InnerDialogProps.visibility = false
  905. switch (val.type) {
  906. case 'dialyzer_perfusion_apparatus':
  907. this.addPlan.dialyzer_perfusion_apparatus = val.value.join(',')
  908. break
  909. case 'dialyzers':
  910. this.dialysis_dialyszers = val.value.join(',')
  911. console.log("3333333",this.addPlan.dialysis_dialyszers)
  912. break
  913. case 'irrigations':
  914. this.dialysis_irrigation = val.value.join(',')
  915. break
  916. }
  917. },
  918. innerDialogCancle: function() {
  919. this.InnerDialogProps.visibility = false
  920. },
  921. changeBodyFluid: function() {},
  922. GetDeviceData: function() {
  923. const params = {}
  924. GetDeviceInfo(params).then(response => {
  925. this.deviceList = response.data.data.device
  926. })
  927. },
  928. selectnDialysisTime(val) {
  929. var valTime = val.split(':')
  930. this.addPlan.dialysis_duration =
  931. parseFloat(valTime[0]) + parseFloat((valTime[1] / 60).toFixed(2))
  932. this.addPlan.dialysis_duration_hour = valTime[0]
  933. this.addPlan.dialysis_duration_minute = valTime[1]
  934. },
  935. tableCurrentChange(current) {
  936. if (typeof current === 'undefined' || current == null) {
  937. this.current_solution = {
  938. id: 0,
  939. name: '',
  940. sub_name: '',
  941. period: '',
  942. times: '',
  943. doctor: 0
  944. }
  945. this.solution_detail = {
  946. id: 0,
  947. affirm_state: 0,
  948. dialysis_duration: '',
  949. replacement_way: '',
  950. mode_id: '',
  951. blood_flow_volume: '',
  952. hemodialysis_machine: '',
  953. blood_filter: '',
  954. perfusion_apparatus: '',
  955. dialysate_flow: '',
  956. kalium: '',
  957. replacement_total: '',
  958. sodium: '',
  959. calcium: '',
  960. bicarbonate: '',
  961. anticoagulant: '',
  962. anticoagulant_shouji: '',
  963. anticoagulant_weichi: '',
  964. anticoagulant_zongliang: '',
  965. anticoagulant_gaimingcheng: '',
  966. anticoagulant_gaijiliang: ''
  967. }
  968. return
  969. }
  970. this.current_solution = current
  971. this.setCurrentMode(current.mode_id)
  972. this.solution_detail = {
  973. id: this.current_solution.id,
  974. affirm_state: this.current_solution.affirm_state,
  975. dialysis_duration:
  976. this.current_solution.dialysis_duration != 0
  977. ? this.current_solution.dialysis_duration
  978. : '',
  979. replacement_way:
  980. this.current_solution.replacement_way != 0
  981. ? this.current_solution.replacement_way
  982. : '',
  983. replacement_total:
  984. this.current_solution.replacement_total != 0
  985. ? this.current_solution.replacement_total
  986. : '',
  987. mode_id: this.current_solution.mode_id,
  988. blood_flow_volume:
  989. this.current_solution.blood_flow_volume != 0
  990. ? this.current_solution.blood_flow_volume
  991. : '',
  992. hemodialysis_machine:
  993. this.current_solution.hemodialysis_machine != 0
  994. ? this.current_solution.hemodialysis_machine
  995. : '',
  996. blood_filter:
  997. this.current_solution.blood_filter != 0
  998. ? this.current_solution.blood_filter
  999. : '',
  1000. perfusion_apparatus:
  1001. this.current_solution.perfusion_apparatus != 0
  1002. ? this.current_solution.perfusion_apparatus
  1003. : '',
  1004. dialysate_flow:
  1005. this.current_solution.dialysate_flow != 0
  1006. ? this.current_solution.dialysate_flow
  1007. : '',
  1008. kalium:
  1009. this.current_solution.kalium != 0 ? this.current_solution.kalium : '',
  1010. sodium:
  1011. this.current_solution.sodium != 0 ? this.current_solution.sodium : '',
  1012. calcium:
  1013. this.current_solution.calcium != 0
  1014. ? this.current_solution.calcium
  1015. : '',
  1016. bicarbonate:
  1017. this.current_solution.bicarbonate != 0
  1018. ? this.current_solution.bicarbonate
  1019. : '',
  1020. anticoagulant:
  1021. this.current_solution.anticoagulant != 0
  1022. ? this.current_solution.anticoagulant
  1023. : '',
  1024. anticoagulant_shouji:
  1025. this.current_solution.anticoagulant_shouji != 0
  1026. ? this.current_solution.anticoagulant_shouji
  1027. : '',
  1028. anticoagulant_weichi:
  1029. this.current_solution.anticoagulant_weichi != 0
  1030. ? this.current_solution.anticoagulant_weichi
  1031. : '',
  1032. anticoagulant_zongliang:
  1033. this.current_solution.anticoagulant_zongliang != 0
  1034. ? this.current_solution.anticoagulant_zongliang
  1035. : ''
  1036. }
  1037. },
  1038. handleDelete(index, row) {
  1039. if (row.use_state == 1) {
  1040. this.$message.error('方案已被使用,不能删除')
  1041. return false
  1042. }
  1043. this.$confirm('确定删除' + row.name + row.sub_name + '方案吗?', '提示', {
  1044. confirmButtonText: '确定',
  1045. cancelButtonText: '取消',
  1046. type: 'warning'
  1047. }).then(() => {
  1048. deleteDialysisSolution(row.id).then(response => {
  1049. if (response.data.state == 0) {
  1050. this.$message.error(response.data.msg)
  1051. return false
  1052. } else {
  1053. this.$notify({
  1054. title: '成功',
  1055. message: '删除成功',
  1056. type: 'success',
  1057. duration: 2000
  1058. })
  1059. this.tableData.splice(index, 1)
  1060. // if (row.parent_id>0) {
  1061. // this.tableData.splice(index,1);
  1062. // }else {
  1063. // var resetTableData = this.tableData;
  1064. // this.tableData = [];
  1065. // var that = this;
  1066. // resetTableData.forEach(function(item, itemindex){
  1067. // if (item.id != row.id && item.parent_id != row.id) {
  1068. // that.tableData.push(item);
  1069. // }
  1070. // });
  1071. // }
  1072. }
  1073. })
  1074. })
  1075. },
  1076. submitSolution(formName) {
  1077. editDialysisSolutionDetail(
  1078. this.patientID,
  1079. this.solution_detail.id,
  1080. this.solution_detail
  1081. ).then(response => {
  1082. if (response.data.state == 0) {
  1083. this.$message.error(response.data.msg)
  1084. return false
  1085. } else {
  1086. this.$notify({
  1087. title: '成功',
  1088. message: '修改成功',
  1089. type: 'success',
  1090. duration: 2000
  1091. })
  1092. var thisSolution = response.data.data.solution
  1093. var spliceIndex = -1
  1094. for (let index = this.tableData.length - 1; ; index--) {
  1095. if (this.tableData[index].id === thisSolution.id) {
  1096. spliceIndex = index
  1097. break
  1098. }
  1099. }
  1100. if (spliceIndex > -1) {
  1101. var newIndex = spliceIndex + 1
  1102. if (newIndex === this.tableData.length) {
  1103. this.tableData.pop()
  1104. this.tableData.push(thisSolution)
  1105. } else {
  1106. var swapData = this.tableData.splice(newIndex)
  1107. this.tableData.pop()
  1108. this.tableData.push(thisSolution)
  1109. this.tableData = this.tableData.concat(swapData)
  1110. }
  1111. }
  1112. this.solution_detail.affirm_state = thisSolution.affirm_state
  1113. this.$refs.solutionTable.setCurrentRow(this.tableData[spliceIndex])
  1114. }
  1115. })
  1116. },
  1117. submitEditChildSolution(formName) {
  1118. this.$refs[formName].validate(valid => {
  1119. if (valid) {
  1120. var editData = {
  1121. initiate_mode: this.childPlan.initiate_mode,
  1122. doctor: this.childPlan.doctor
  1123. }
  1124. editChildPatientDialysisSolution(
  1125. this.patientID,
  1126. this.childPlan.id,
  1127. editData
  1128. ).then(response => {
  1129. if (response.data.state == 0) {
  1130. this.$message.error(response.data.msg)
  1131. return false
  1132. } else {
  1133. this.$notify({
  1134. title: '成功',
  1135. message: '修改成功',
  1136. type: 'success',
  1137. duration: 2000
  1138. })
  1139. this.$refs[formName].resetFields()
  1140. this.dialogFormVisible = false
  1141. this.tableData[this.current_index].doctor =
  1142. response.data.data.solution.doctor
  1143. this.tableData[this.current_index].updated_time =
  1144. response.data.data.solution.updated_time
  1145. this.tableData[this.current_index].initiate_mode =
  1146. response.data.data.solution.initiate_mode
  1147. this.current_index = -1
  1148. return false
  1149. }
  1150. })
  1151. }
  1152. })
  1153. },
  1154. submitNewChildSolution(formName) {
  1155. this.$refs[formName].validate(valid => {
  1156. if (valid) {
  1157. var createData = {
  1158. parent_id: this.childPlan.parent_id,
  1159. sub_name: this.childPlan.sub_name,
  1160. initiate_mode: this.childPlan.initiate_mode,
  1161. doctor: this.childPlan.doctor
  1162. }
  1163. createChildPatientDialysisSolution(this.patientID, createData).then(
  1164. response => {
  1165. if (response.data.state == 0) {
  1166. this.$message.error(response.data.msg)
  1167. return false
  1168. } else {
  1169. this.$notify({
  1170. title: '成功',
  1171. message: '创建成功',
  1172. type: 'success',
  1173. duration: 2000
  1174. })
  1175. this.$refs[formName].resetFields()
  1176. var spliceIndex = -1
  1177. for (let index = this.tableData.length - 1; ; index--) {
  1178. if (
  1179. this.tableData[index].parent_id === createData.parent_id
  1180. ) {
  1181. spliceIndex = index
  1182. break
  1183. } else if (
  1184. this.tableData[index].id === createData.parent_id
  1185. ) {
  1186. spliceIndex = index
  1187. break
  1188. }
  1189. }
  1190. if (spliceIndex > -1) {
  1191. spliceIndex += 1
  1192. if (spliceIndex === this.tableData.length) {
  1193. this.tableData.push(response.data.data.solution)
  1194. } else {
  1195. var swapData = this.tableData.splice(spliceIndex)
  1196. this.tableData.push(response.data.data.solution)
  1197. this.tableData = this.tableData.concat(swapData)
  1198. }
  1199. }
  1200. this.dialogFormVisible = false
  1201. return false
  1202. }
  1203. }
  1204. )
  1205. }
  1206. })
  1207. },
  1208. submitEditSolution(formName) {
  1209. this.$refs[formName].validate(valid => {
  1210. if (valid) {
  1211. let mode = '2'
  1212. if (
  1213. this.addPlan.registrars_id != this.$store.getters.xt_user.user.id
  1214. ) {
  1215. mode = '3'
  1216. }
  1217. this.addPlan.dialysis_dialyszers = this.dialysis_dialyszers
  1218. this.addPlan.dialysis_irrigation = this.dialysis_irrigation
  1219. console.log("333333",this.addPlan)
  1220. editPatientDialysisSolution(
  1221. this.patientID,
  1222. this.addPlan.id,
  1223. this.addPlan,
  1224. mode
  1225. ).then(response => {
  1226. if (response.data.state == 0) {
  1227. this.$message.error(response.data.msg)
  1228. return false
  1229. } else {
  1230. this.$notify({
  1231. title: '成功',
  1232. message: '修改成功',
  1233. type: 'success',
  1234. duration: 2000
  1235. })
  1236. this.$refs[formName].resetFields()
  1237. this.dialogVisible = false
  1238. for (var dindex in response.data.data.solution) {
  1239. if (dindex == 'id') {
  1240. continue
  1241. }
  1242. this.tableData[this.current_index][dindex] =
  1243. response.data.data.solution[dindex]
  1244. }
  1245. // this.tableData[this.current_index].dialysis_duration = response.data.data.solution.dialysis_duration;
  1246. // this.tableData[this.current_index].doctor = response.data.data.solution.doctor;
  1247. // this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time;
  1248. this.current_index = -1
  1249. return false
  1250. }
  1251. })
  1252. }
  1253. })
  1254. },
  1255. submitNewSolution(formName) {
  1256. this.addPlan.anticoagulant_zongliang = this.addPlan.anticoagulant_zongliang.toString()
  1257. this.$refs[formName].validate(valid => {
  1258. if (valid) {
  1259. const mode = '1'
  1260. this.addPlan.dialysis_dialyszers = this.dialysis_dialyszers
  1261. this.addPlan.dialysis_irrigation = this.dialysis_irrigation
  1262. console.log("add",this.addPlan)
  1263. createPatientDialysisSolution(
  1264. this.patientID,
  1265. this.addPlan,
  1266. mode
  1267. ).then(response => {
  1268. if (response.data.state == 0) {
  1269. this.$message.error(response.data.msg)
  1270. return false
  1271. } else {
  1272. this.$notify({
  1273. title: '成功',
  1274. message: '创建成功',
  1275. type: 'success',
  1276. duration: 2000
  1277. })
  1278. this.$refs[formName].resetFields()
  1279. this.dialogVisible = false
  1280. this.tableData.unshift(response.data.data.solution)
  1281. if (this.tableData.length > 10) {
  1282. this.tableData.pop()
  1283. }
  1284. this.total += 1
  1285. return false
  1286. }
  1287. })
  1288. }
  1289. })
  1290. },
  1291. handleEdit(index, row) {
  1292. // console.log(index, row)
  1293. },
  1294. handleSizeChange(val) {
  1295. this.queryParams.limit = val
  1296. this.fetchPatientDialysisSolutions()
  1297. },
  1298. handleCurrentChange(val) {
  1299. this.queryParams.page = val
  1300. this.fetchPatientDialysisSolutions()
  1301. },
  1302. openEdit(index, row) {
  1303. this.current_index = index
  1304. this.addPlan.id = row.id
  1305. this.addPlan.mode = row.mode_id
  1306. this.addPlan.mode_name = row.mode_name
  1307. this.addPlan.dialyzer = row.dialyzer ? row.dialyzer : ''
  1308. this.addPlan.dialysis_duration = '' + row.dialysis_duration
  1309. this.addPlan.dialysis_duration_hour = '' + row.dialysis_duration_hour
  1310. this.addPlan.dialysis_duration_minute = '' + row.dialysis_duration_minute
  1311. this.addPlan.hemodialysis_machine = row.hemodialysis_machine + ''
  1312. this.addPlan.perfusion_apparatus = row.perfusion_apparatus + ''
  1313. this.addPlan.blood_flow_volume = row.blood_flow_volume.toString()
  1314. if (row.anticoagulant == 3) {
  1315. this.addPlan.anticoagulant = '低分子肝素'
  1316. }
  1317. if (row.anticoagulant != 3) {
  1318. if(row.anticoagulant == 0){
  1319. this.addPlan.anticoagulant = ""
  1320. }else{
  1321. this.addPlan.anticoagulant = row.anticoagulant
  1322. }
  1323. }
  1324. this.addPlan.replacement_total = row.replacement_total
  1325. this.addPlan.target_ktv = row.target_ktv.toString()
  1326. this.addPlan.target_ultrafiltration = row.target_ultrafiltration.toString()
  1327. this.addPlan.dialysis_duration = parseFloat(row.dialysis_duration_hour) + parseFloat((row.dialysis_duration_minute / 60).toFixed(2))
  1328. this.addPlan.dialysis_duration_hour = row.dialysis_duration_hour
  1329. this.addPlan.dialysis_duration_minute = row.dialysis_duration_minute
  1330. this.addPlan.anticoagulant_shouji = row.anticoagulant_shouji.toString()
  1331. this.addPlan.anticoagulant_weichi = row.anticoagulant_weichi.toString()
  1332. this.addPlan.anticoagulant_zongliang = row.anticoagulant_zongliang.toString()
  1333. this.addPlan.anticoagulant_gaimingcheng = row.anticoagulant_gaimingcheng.toString()
  1334. this.addPlan.anticoagulant_gaijiliang = row.anticoagulant_gaijiliang.toString()
  1335. this.addPlan.kalium = row.kalium.toString()
  1336. this.addPlan.sodium = row.sodium.toString()
  1337. this.addPlan.calcium = row.calcium.toString()
  1338. this.addPlan.bicarbonate = row.bicarbonate.toString()
  1339. this.addPlan.glucose = row.glucose.toString()
  1340. this.addPlan.dialysate_flow = row.dialysate_flow.toString()
  1341. this.addPlan.dialysate_temperature = row.dialysate_temperature.toString()
  1342. this.addPlan.conductivity = row.conductivity.toString()
  1343. this.addPlan.remark = row.remark
  1344. this.addPlan.dialyzer_perfusion_apparatus = row.dialyzer_perfusion_apparatus.toString()
  1345. this.addPlan.dialysis_irrigation = row.dialysis_irrigation
  1346. this.addPlan.dialysis_dialyszers = row.dialysis_dialyszers
  1347. this.dialysis_irrigation = row.dialysis_irrigation
  1348. this.dialysis_dialyszers = row.dialysis_dialyszers
  1349. if(row.body_fluid == 0){
  1350. this.addPlan.body_fluid = ""
  1351. }else{
  1352. this.addPlan.body_fluid = row.body_fluid
  1353. }
  1354. this.addPlan.body_fluid_other = row.body_fluid_other.toString()
  1355. this.addPlan.special_medicine = row.special_medicine
  1356. this.addPlan.special_medicine_other = row.special_medicine_other.toString()
  1357. this.addPlan.displace_liqui_part = row.displace_liqui_part
  1358. this.addPlan.displace_liqui_value = row.displace_liqui_value.toString()
  1359. this.addPlan.ultrafiltration = row.ultrafiltration.toString()
  1360. this.addPlan.blood_access = row.blood_access
  1361. this.addPlan.registrars_id = row.registrars_id
  1362. this.addPlan.dialysis_irrigation = row.dialysis_irrigation
  1363. this.addPlan.dialysis_dialyszers = row.dialysis_dialyszers
  1364. this.dialysis_irrigation = row.dialysis_irrigation
  1365. this.dialysis_dialyszers = row.dialysis_dialyszers
  1366. this.dialogVisible = true
  1367. this.isEdit = true
  1368. if(row.dialysate_formulation==0){
  1369. this.addPlan.dialysate_formulation= ""
  1370. }
  1371. this.addPlan.dialysate_formulation = row.dialysate_formulation
  1372. this.dialysisTimeShow = new Date(
  1373. 2018,
  1374. 1,
  1375. 1,
  1376. this.addPlan.dialysis_duration_hour,
  1377. this.addPlan.dialysis_duration_minute
  1378. )
  1379. },
  1380. isShows(name) {
  1381. var filedList = store.getters.xt_user.fileds
  1382. for (let i = 0; i < filedList.length; i++) {
  1383. if (
  1384. filedList[i].module == 1 &&
  1385. filedList[i].filed_name_cn == name &&
  1386. filedList[i].is_show == 1
  1387. ) {
  1388. return true
  1389. }
  1390. }
  1391. return false
  1392. },
  1393. openNew() {
  1394. this.current_index = -1
  1395. this.addPlan = {
  1396. mode: '',
  1397. mode_name: '',
  1398. id: 0,
  1399. type: 1,
  1400. period: '',
  1401. times: '',
  1402. initiate_mode: '',
  1403. doctor: '',
  1404. first_dialysis: '',
  1405. dialyzer: '',
  1406. dialysate_formulation: '',
  1407. hemodialysis_machine: '',
  1408. perfusion_apparatus: '',
  1409. blood_flow_volume: '',
  1410. dewater: '',
  1411. displace_liqui: 0,
  1412. replacement_way: '',
  1413. anticoagulant: '',
  1414. anticoagulant_shouji: '',
  1415. anticoagulant_weichi: '',
  1416. anticoagulant_zongliang: '',
  1417. anticoagulant_gaimingcheng: '',
  1418. anticoagulant_gaijiliang: '',
  1419. kalium: '',
  1420. replacement_total: '',
  1421. sodium: '',
  1422. calcium: '',
  1423. bicarbonate: '',
  1424. glucose: '',
  1425. dry_weight: '',
  1426. dialysate_flow: '',
  1427. dialysate_temperature: '',
  1428. conductivity: '',
  1429. remark: '',
  1430. target_ktv: '',
  1431. target_ultrafiltration: '',
  1432. dialyzer_perfusion_apparatus: '',
  1433. body_fluid: '',
  1434. body_fluid_other: '',
  1435. special_medicine: '',
  1436. special_medicine_other: '',
  1437. displace_liqui_part: '',
  1438. displace_liqui_value: '',
  1439. ultrafiltration: '',
  1440. blood_access: '',
  1441. dialysis_duration: '3.30',
  1442. dialysis_duration_hour: '3',
  1443. dialysis_duration_minute: '30'
  1444. }
  1445. this.addPlanTypeChange()
  1446. this.dialogVisible = true
  1447. this.isEdit = false
  1448. },
  1449. openNewChild(index, row) {
  1450. this.childPlan = {
  1451. mode: row.mode_name,
  1452. frequency: row.period + row.times,
  1453. name: row.name,
  1454. parent_id: row.id,
  1455. sub_name: '',
  1456. initiate_mode: '',
  1457. doctor: ''
  1458. }
  1459. this.isChildEdit = false
  1460. this.dialogFormVisible = true
  1461. },
  1462. openChildEdit(index, row) {
  1463. this.childPlan = {
  1464. mode: row.mode_name,
  1465. frequency: row.period + row.times,
  1466. name: row.name,
  1467. parent_id: row.parent_id,
  1468. id: row.id,
  1469. sub_name: row.sub_name,
  1470. initiate_mode: row.initiate_mode,
  1471. doctor: row.doctor
  1472. }
  1473. this.current_index = index
  1474. this.isChildEdit = true
  1475. this.dialogFormVisible = true
  1476. },
  1477. fetchAllDoctorAndNurse() {
  1478. fetchAllDoctorAndNurse().then(response => {
  1479. if (response.data.state == 1) {
  1480. this.doctorOptions = response.data.data.doctors
  1481. }
  1482. })
  1483. },
  1484. fetchAllAdminUsers() {
  1485. fetchAllAdminUsers().then(response => {
  1486. if (response.data.state == 1) {
  1487. this.adminUserOptions = response.data.data.users
  1488. }
  1489. })
  1490. },
  1491. fetchPatientDialysisSolutions() {
  1492. fetchPatientDialysisSolutions(this.queryParams).then(response => {
  1493. if (response.data.state == 1) {
  1494. this.tableData = response.data.data.solutions
  1495. this.total = response.data.data.total
  1496. this.stockType = response.data.data.stockType
  1497. console.log("2333555555555",this.stockType)
  1498. if(this.stockType.length >0 ){
  1499. var arr = []
  1500. var arrTwo = []
  1501. for(let i=0;i<this.stockType.length;i++){
  1502. if(this.stockType[i].stock_attribute == 2){
  1503. arr.push(this.stockType[i])
  1504. }
  1505. if(this.stockType[i].stock_attribute == 3){
  1506. arrTwo.push(this.stockType[i])
  1507. }
  1508. }
  1509. var dialyzator = []
  1510. var irrigation = []
  1511. for(let i=0;i<arr.length;i++){
  1512. for(let j=0;j<arr[i].GoodInfo.length;j++){
  1513. dialyzator.push(arr[i].GoodInfo[j])
  1514. }
  1515. }
  1516. console.log("透析器",dialyzator)
  1517. this.dialyzers = dialyzator
  1518. for(let i=0;i<arrTwo.length;i++){
  1519. for(let j=0;j<arrTwo[i].GoodInfo.length;j++){
  1520. irrigation.push(arrTwo[i].GoodInfo[j])
  1521. }
  1522. }
  1523. console.log("灌流器",irrigation)
  1524. this.irrigations = irrigation
  1525. }
  1526. }
  1527. })
  1528. },
  1529. addPlanTypeChange() {
  1530. if (this.addPlan.type == 1) {
  1531. this.periodOptions = periodWeek
  1532. this.numOptions = numOptionsWeek
  1533. } else {
  1534. this.addPlan.type == 2
  1535. this.periodOptions = periodDay
  1536. this.numOptions = numOptionsDay
  1537. }
  1538. },
  1539. changeThisAnticoagulant() {
  1540. var thismode = parseInt(this.addPlan.anticoagulant)
  1541. if (isNaN(thismode) || thismode <= 0) {
  1542. return false
  1543. }
  1544. if (
  1545. typeof this.anticoagulantsConfit[thismode] === 'undefined' ||
  1546. this.anticoagulantsConfit[thismode] == null
  1547. ) {
  1548. return false
  1549. }
  1550. this.anticoagulant = this.anticoagulantsConfit[thismode]
  1551. },
  1552. addPlanModeChange() {
  1553. var thismode = parseInt(this.addPlan.mode)
  1554. if(thismode == 2 || thismode == 5 || thismode ==12){
  1555. this.zhiShow = true
  1556. this.huShow= true
  1557. this.totalShow = true
  1558. }else{
  1559. this.zhiShow= false
  1560. this.huShow = false
  1561. this.totalShow = false
  1562. }
  1563. if (isNaN(thismode) || thismode <= 0) {
  1564. return false
  1565. }
  1566. if (
  1567. typeof this.modeOptions[thismode] === 'undefined' ||
  1568. this.modeOptions[thismode] == null
  1569. ) {
  1570. return false
  1571. }
  1572. // this.current_model = this.modeOptions[thismode];
  1573. this.addPlan.mode_name = this.modeOptions[thismode].name
  1574. const params = {
  1575. id: thismode
  1576. }
  1577. getSystemPrescription(params).then(response => {
  1578. if (response.data.state == 1) {
  1579. var prescription = response.data.data.prescription
  1580. if(prescription.anticoagulant == 0){
  1581. prescription.anticoagulant = ""
  1582. }
  1583. if(prescription.body_fluid == 0){
  1584. prescription.body_fluid = ""
  1585. }
  1586. if (response.data.data.prescription.id > 0) {
  1587. for (const key in response.data.data.prescription) {
  1588. // 因为el-input特性整数类型或者浮点数类型需要转换成字符串,所以加上toString()
  1589. this.$set(
  1590. this.addPlan,
  1591. key,
  1592. response.data.data.prescription[key].toString()
  1593. )
  1594. }
  1595. // 因为el-select特性,整数类型不能转字符串,所以额外处理这些数据
  1596. this.$set(
  1597. this.addPlan,
  1598. 'dialysate_formulation',
  1599. response.data.data.prescription['dialysate_formulation']
  1600. )
  1601. this.$set(
  1602. this.addPlan,
  1603. 'anticoagulant',
  1604. response.data.data.prescription['anticoagulant']
  1605. )
  1606. this.$set(
  1607. this.addPlan,
  1608. 'body_fluid',
  1609. response.data.data.prescription['body_fluid']
  1610. )
  1611. this.$set(
  1612. this.addPlan,
  1613. 'special_medicine',
  1614. response.data.data.prescription['special_medicine']
  1615. )
  1616. this.$set(
  1617. this.addPlan,
  1618. 'displace_liqui_part',
  1619. response.data.data.prescription['displace_liqui_part']
  1620. )
  1621. this.$set(
  1622. this.addPlan,
  1623. 'blood_access',
  1624. response.data.data.prescription['blood_access']
  1625. )
  1626. this.dialysisTimeShow = new Date(
  1627. 2018,
  1628. 1,
  1629. 1,
  1630. this.addPlan.dialysis_duration_hour,
  1631. this.addPlan.dialysis_duration_minute
  1632. )
  1633. } else {
  1634. var tempAddPlan = {
  1635. id: 0,
  1636. dialyzer: '',
  1637. dialysis_duration: '',
  1638. dialysis_duration_hour: '',
  1639. dialysis_duration_minute: '',
  1640. hemodialysis_machine: '',
  1641. dialysate_formulation: '',
  1642. perfusion_apparatus: '',
  1643. blood_flow_volume: '',
  1644. dewater: '',
  1645. displace_liqui: 0,
  1646. replacement_way: '',
  1647. anticoagulant: '',
  1648. anticoagulant_shouji: '',
  1649. anticoagulant_weichi: '',
  1650. anticoagulant_zongliang: '',
  1651. anticoagulant_gaimingcheng: '',
  1652. anticoagulant_gaijiliang: '',
  1653. kalium: '',
  1654. replacement_total: '',
  1655. sodium: '',
  1656. calcium: '',
  1657. bicarbonate: '',
  1658. glucose: '',
  1659. dry_weight: '',
  1660. dialysate_flow: '',
  1661. dialysate_temperature: '',
  1662. conductivity: '',
  1663. doctor: '',
  1664. remark: '',
  1665. target_ktv: '',
  1666. target_ultrafiltration: '',
  1667. dialyzer_perfusion_apparatus: '',
  1668. body_fluid: '',
  1669. body_fluid_other: '',
  1670. special_medicine: '',
  1671. special_medicine_other: '',
  1672. displace_liqui_part: '',
  1673. displace_liqui_value: '',
  1674. ultrafiltration: '',
  1675. blood_access: ''
  1676. }
  1677. for (const key in tempAddPlan) {
  1678. this.addPlan[key] = tempAddPlan[key]
  1679. }
  1680. }
  1681. }
  1682. })
  1683. },
  1684. setCurrentMode(id) {
  1685. if (
  1686. typeof this.modeOptions[id] === 'undefined' ||
  1687. this.modeOptions[id] == null
  1688. ) {
  1689. return false
  1690. }
  1691. this.current_model = this.modeOptions[id]
  1692. },
  1693. getDoctorName(doctorid) {
  1694. var name = ''
  1695. if (this.doctorOptions == null) {
  1696. return name
  1697. }
  1698. if (typeof this.doctorOptions.length === 'undefined') {
  1699. return name
  1700. }
  1701. var leng = this.doctorOptions.length
  1702. if (leng == 0) {
  1703. return name
  1704. }
  1705. for (let index = 0; index < leng; index++) {
  1706. if (this.doctorOptions[index].id == doctorid) {
  1707. name = this.doctorOptions[index].name
  1708. break
  1709. }
  1710. }
  1711. return name
  1712. },
  1713. getAdminUserName(id) {
  1714. var name = ''
  1715. if (this.adminUserOptions == null) {
  1716. return name
  1717. }
  1718. if (typeof this.adminUserOptions.length === 'undefined') {
  1719. return name
  1720. }
  1721. var leng = this.adminUserOptions.length
  1722. if (leng == 0) {
  1723. return name
  1724. }
  1725. for (let index = 0; index < leng; index++) {
  1726. if (this.adminUserOptions[index].id == id) {
  1727. name = this.adminUserOptions[index].name
  1728. break
  1729. }
  1730. }
  1731. return name
  1732. }
  1733. },
  1734. created() {
  1735. const id = this.$route.params && this.$route.params.id
  1736. this.patientID = parseInt(id)
  1737. if (isNaN(this.patientID) || this.patientID <= 0) {
  1738. this.$notify.error({
  1739. title: '错误',
  1740. message: '无效的id'
  1741. })
  1742. this.$router.back(-1)
  1743. }
  1744. this.GetDeviceData()
  1745. this.fetchAllAdminUsers()
  1746. this.fetchPatientDialysisSolutions()
  1747. this.modeOptions = this.$store.getters.treatment_mode
  1748. this.anticoagulantsSet = this.$store.getters.anticoagulants_set
  1749. this.replacementWays = this.$store.getters.replacement_ways
  1750. this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit
  1751. this.blood_filters = this.$store.getters.blood_filters
  1752. this.perfusion_apparatus = this.$store.getters.perfusion_apparatus
  1753. this.hemodialysis_machines = this.$store.getters.hemodialysis_machines
  1754. this.dialysate_formulation = getDataConfig(
  1755. 'hemodialysis',
  1756. 'dialysate_formulation'
  1757. )
  1758. this.body_fluid_option = this.$store.getters.body_fluid
  1759. this.special_medicine_option = this.$store.getters.special_medicine
  1760. this.displace_liqui_part_option = this.$store.getters.displace_liqui
  1761. this.blood_access_option = this.$store.getters.blood_access
  1762. this.blood_access_option = getDataConfig('hemodialysis', 'vascular_access_desc')
  1763. this.dialyzerPerfusionApparatus = getDataConfig(
  1764. 'hemodialysis',
  1765. 'dialyzer_perfusion_apparatus'
  1766. )
  1767. this.queryParams.id = this.patientID
  1768. // this.fetchAllDoctorAndNurse();
  1769. }
  1770. }
  1771. </script>
  1772. <style rel="stylesheet/scss" lang="scss" scoped>
  1773. .Total {
  1774. .sure {
  1775. float: right;
  1776. margin: 5px 10px 0 0;
  1777. }
  1778. .plan {
  1779. font-size: 15px;
  1780. color: #6caef7;
  1781. background: #ecf5ff;
  1782. height: 42px;
  1783. line-height: 42px;
  1784. border: 1px #ebeef5 solid;
  1785. width: 100%;
  1786. padding-left: 15px;
  1787. span {
  1788. margin: 0 20px 0 0;
  1789. }
  1790. }
  1791. }
  1792. .form-table {
  1793. border: 1px #ebeef5 solid;
  1794. padding-bottom: 20px;
  1795. .el-col-6 {
  1796. width: 380px;
  1797. }
  1798. .el-row {
  1799. margin: 0 !important;
  1800. .el-form-item {
  1801. margin-bottom: 12px;
  1802. .el-form-item__content {
  1803. .el-select {
  1804. width: 100%;
  1805. }
  1806. }
  1807. }
  1808. }
  1809. }
  1810. </style>
  1811. <style>
  1812. .el-table td,
  1813. .el-table th.is-leaf,
  1814. .el-table--border,
  1815. .el-table--group {
  1816. border-color: #d0d3da;
  1817. }
  1818. .el-table--border::after,
  1819. .el-table--group::after,
  1820. .el-table::before {
  1821. background-color: #d0d3da;
  1822. }
  1823. </style>