血透系统PC前端

dialysisSolution.vue 50KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367
  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 type="primary" size="small" icon="el-icon-plus" @click="openNew"
  11. :disabled="$store.getters.xt_user.subscibe.state==3?true:false">新增透析处方
  12. </el-button>
  13. </div>
  14. </div>
  15. <el-table ref="solutionTable" :data="tableData" border fit highlight-current-row
  16. @current-change="tableCurrentChange" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  17. style="width: 100%">
  18. <el-table-column
  19. type="index"
  20. align="center"
  21. label="序号"
  22. width="60">
  23. </el-table-column>
  24. <el-table-column
  25. prop="mode_name"
  26. align="center"
  27. label="透析模式"
  28. min-width="50">
  29. <template slot-scope="scope">
  30. {{modeOptions[scope.row.mode_id].name}}
  31. </template>
  32. </el-table-column>
  33. <el-table-column
  34. prop="dialysis_duration"
  35. align="center"
  36. label="透析时长"
  37. min-width="50">
  38. <template slot-scope="scope">
  39. {{scope.row.dialysis_duration_hour}} 小时 {{scope.row.dialysis_duration_minute}} 分钟
  40. </template>
  41. </el-table-column>
  42. <!-- <el-table-column
  43. prop="period"
  44. label="频率"
  45. align="center"
  46. min-width="50">
  47. <template slot-scope="scope" >
  48. <span v-if="scope.row.parent_id === 0" >{{scope.row.period}}{{scope.row.times}}</span>
  49. <span v-else >--</span>
  50. </template>
  51. </el-table-column> -->
  52. <!-- <el-table-column
  53. prop="name"
  54. label="处方名"
  55. align="center"
  56. min-width="50">
  57. <template slot-scope="scope" >
  58. <span >{{scope.row.name}}{{scope.row.sub_name}}</span>
  59. </template>
  60. </el-table-column> -->
  61. <!--<el-table-column-->
  62. <!--prop="doctor"-->
  63. <!--label="医生"-->
  64. <!--align="center"-->
  65. <!--min-width="110">-->
  66. <!--<template slot-scope="scope">-->
  67. <!--<span>{{getAdminUserName(scope.row.doctor)}}</span>-->
  68. <!--</template>-->
  69. <!--</el-table-column>-->
  70. <el-table-column
  71. prop="updated_time"
  72. align="center"
  73. label="更新日期"
  74. min-width="60">
  75. <template slot-scope="scope">
  76. <span>{{scope.row.updated_time | parseTime('{y}-{m}-{d}')}}</span>
  77. </template>
  78. </el-table-column>
  79. <!-- <el-table-column
  80. prop="state"
  81. label="状态"
  82. align="center"
  83. min-width="40">
  84. <template slot-scope="scope" >
  85. <span v-if="scope.row.initiate_mode==1">启用</span>
  86. <span v-else-if="scope.row.initiate_mode==2">停用</span>
  87. <span v-else>未知</span>
  88. </template>
  89. </el-table-column> -->
  90. <el-table-column label="操作" align="center" min-width="140">
  91. <template slot-scope="scope">
  92. <el-tooltip class="item" effect="dark" content="编辑" placement="top">
  93. <el-button
  94. size="small"
  95. type="primary"
  96. icon="el-icon-edit-outline"
  97. @click="openEdit(scope.$index, scope.row)"></el-button>
  98. </el-tooltip>
  99. <!-- <el-button
  100. size="mini"
  101. type="primary"
  102. @click="openChildEdit(scope.$index, scope.row)" v-else>编辑</el-button>
  103. <el-button
  104. size="mini"
  105. type="success"
  106. @click="openNewChild(scope.$index, scope.row)" v-if="scope.row.parent_id===0">新增</el-button>
  107. <el-button
  108. size="mini"
  109. type="danger"
  110. @click="handleDelete(scope.$index, scope.row)">删除</el-button>-->
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <el-pagination
  115. align="right"
  116. @size-change="handleSizeChange"
  117. @current-change="handleCurrentChange"
  118. :current-page="queryParams.page"
  119. :page-sizes="[10, 20, 50, 100]"
  120. :page-size="10"
  121. background
  122. style="margin-top:20px;"
  123. layout="total, sizes, prev, pager, next, jumper"
  124. :total="total">
  125. </el-pagination>
  126. </div>
  127. <el-dialog
  128. :title="isEdit?'编辑透析处方':'新增透析处方'"
  129. :visible.sync="dialogVisible"
  130. width="1010px">
  131. <el-form ref="addPlan" :model="addPlan" :rules="addPlanRules" label-width="160px">
  132. <el-row :gutter="20">
  133. <el-col :span="8" v-if="isShows('透析模式')">
  134. <el-form-item label="透析模式:" prop="mode">
  135. <el-select v-model="addPlan.mode" @change="addPlanModeChange" :disabled="isEdit?true:false">
  136. <el-option v-for="item in modeOptions" :label="item.name" :key="item.id" :value="item.id"></el-option>
  137. </el-select>
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="8" v-if="isShows('透析时长')">
  141. <el-form-item label="透析时长(h):" prop="dialysis_duration">
  142. <!-- <el-input v-model="addPlan.dialysis_duration"></el-input> -->
  143. <el-time-picker
  144. v-model="dialysisTimeShow"
  145. :picker-options="{
  146. selectableRange: '00:01:00 - 23:59:00'
  147. }"
  148. placeholder="透析时长"
  149. style="width:100%;"
  150. value-format="H:m"
  151. format="H:m"
  152. @change="selectnDialysisTime"
  153. >
  154. </el-time-picker>
  155. </el-form-item>
  156. </el-col>
  157. <!-- <el-col :span="8">
  158. <el-form-item label="透析器:" prop="dialyzer">
  159. <el-select v-model="addPlan.dialyzer" placeholder="" >
  160. <el-option v-for="item in deviceList" :label="item.name" :key="item.id" :value="item.id"></el-option>
  161. </el-select>
  162. </el-form-item>
  163. </el-col> -->
  164. <!-- <el-col :span="8">
  165. <el-form-item label="透析器:" prop="hemodialysis_machine">
  166. <el-select v-model="addPlan.hemodialysis_machine" placeholder="" >
  167. <el-option v-for="item in hemodialysis_machines" :label="item.name" :key="item.id" :value="item.id"></el-option>
  168. </el-select>
  169. </el-form-item>
  170. </el-col> -->
  171. <!-- <el-col :span="8">
  172. <el-form-item label="灌流器:" prop="perfusion_apparatus">
  173. <el-select v-model="addPlan.perfusion_apparatus" placeholder="" >
  174. <el-option v-for="item in perfusion_apparatus" :label="item.name" :key="item.id" :value="item.id"></el-option>
  175. </el-select>
  176. </el-form-item>
  177. </el-col> -->
  178. <el-col :span="8" v-if="isShows('血流量')">
  179. <el-form-item label="血流量(ml/min):" prop="blood_flow_volume">
  180. <el-input v-model="addPlan.blood_flow_volume"></el-input>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="8" v-if="isShows('目标超滤量')&&this.$store.getters.xt_user.template_info.template_id == 6">
  184. <el-form-item label="目标超滤量(ml) : ">
  185. <el-input v-model="addPlan.target_ultrafiltration" type="number"></el-input>
  186. </el-form-item>
  187. </el-col>
  188. <el-col :span="8" v-if="isShows('目标超滤量')&&this.$store.getters.xt_user.template_info.template_id != 6">
  189. <el-form-item label="目标超滤量(L) : ">
  190. <el-input v-model="addPlan.target_ultrafiltration" type="number"></el-input>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="8" v-if="isShows('透析液配方')">
  194. <el-form-item label="透析液配方:" >
  195. <el-select v-model="addPlan.dialysate_formulation">
  196. <el-option v-for="item in dialysate_formulation" :label="item.name" :key="item.id"
  197. :value="item.id"></el-option>
  198. </el-select>
  199. </el-form-item>
  200. </el-col>
  201. <!-- <el-col :span="12">
  202. <el-form-item label="脱水量(L):" prop="dewater">
  203. <el-input v-model="addPlan.dewater" ></el-input>
  204. </el-form-item>
  205. </el-col> -->
  206. <!-- <el-col :span="12">
  207. <el-form-item label="置换液(L):" prop="displace_liqui">
  208. <el-input v-model="addPlan.displace_liqui" ></el-input>
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="12">
  212. <el-form-item label="置换方式:" prop="replacement_way" >
  213. <el-select v-model="addPlan.replacement_way" >
  214. <el-option v-for="item in replacementWays" :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="抗凝剂:" prop="anticoagulant">
  220. <el-select v-model="addPlan.anticoagulant" @change="changeThisAnticoagulant">
  221. <el-option v-for="item in anticoagulantsConfit" :label="item.name" :key="item.id"
  222. :value="item.id"></el-option>
  223. </el-select>
  224. </el-form-item>
  225. </el-col>
  226. <el-col :span="8" v-if="anticoagulant.shouji != -1&&isShows('首剂')">
  227. <el-form-item :label="'首剂('+anticoagulant.shouji_unit+'): '" prop="anticoagulant_shouji">
  228. <el-input v-model="addPlan.anticoagulant_shouji"
  229. :disabled="anticoagulant.shouji==1?false:true" type="number"></el-input>
  230. </el-form-item>
  231. </el-col>
  232. <el-col :span="8" v-if="anticoagulant.weichi != -1&&isShows('维持')">
  233. <el-form-item :label="'维持('+anticoagulant.weichi_unit+'): '" prop="anticoagulant_weichi">
  234. <el-input v-model="addPlan.anticoagulant_weichi"
  235. :disabled="anticoagulant.weichi==1?false:true" type="number"></el-input>
  236. </el-form-item>
  237. </el-col>
  238. <el-col :span="8" v-if="anticoagulant.zongliang != -1&&isShows('总量')">
  239. <el-form-item :label="'总量('+anticoagulant.zongliang_unit+'): '" prop="anticoagulant_zongliang">
  240. <el-input v-model="addPlan.anticoagulant_zongliang"
  241. :disabled="anticoagulant.zongliang==1?false:true" type="number"></el-input>
  242. </el-form-item>
  243. </el-col>
  244. <el-col :span="8" v-if="anticoagulant.gaimingcheng != -1&&isShows('钙名称')">
  245. <el-form-item :label="'钙('+anticoagulant.gaimingcheng_unit+'): '" prop="anticoagulant_gaimingcheng">
  246. <el-input v-model="addPlan.anticoagulant_gaimingcheng"
  247. :disabled="anticoagulant.gaimingcheng==1?false:true" placeholder="钙名称"></el-input>
  248. </el-form-item>
  249. </el-col>
  250. <el-col :span="8" v-if="anticoagulant.gaijiliang != -1&&isShows('钙剂量')">
  251. <el-form-item prop="anticoagulant_gaijiliang">
  252. <el-input v-model="addPlan.anticoagulant_gaijiliang" :disabled="anticoagulant.gaijiliang==1?false:true"
  253. placeholder="钙剂量"></el-input>
  254. </el-form-item>
  255. </el-col>
  256. <el-col :span="8" v-if="isShows('置换量')">
  257. <el-form-item label="置换量(L) : " prop="replacement_total">
  258. <el-input v-model="addPlan.replacement_total" type="number"></el-input>
  259. </el-form-item>
  260. </el-col>
  261. <el-col :span="8" v-if="isShows('钾')">
  262. <el-form-item label="钾(mmol/L): " prop="kalium">
  263. <el-input v-model="addPlan.kalium"></el-input>
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="8" v-if="isShows('钠')">
  267. <el-form-item label="钠(mmol/L): " prop="sodium">
  268. <el-input v-model="addPlan.sodium"></el-input>
  269. </el-form-item>
  270. </el-col>
  271. <el-col :span="8" v-if="isShows('钙')">
  272. <el-form-item label="钙(mmol/L): " prop="calcium">
  273. <el-input v-model="addPlan.calcium"></el-input>
  274. </el-form-item>
  275. </el-col>
  276. <el-col :span="8" v-if="isShows('透析器/灌流器')">
  277. <el-form-item label="透析器/灌流器:">
  278. <el-input v-model="addPlan.dialyzer_perfusion_apparatus"></el-input>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="8" v-if="isShows('碳酸氢盐')">
  282. <el-form-item label="碳酸氢盐(mmol/L): " prop="bicarbonate">
  283. <el-input v-model="addPlan.bicarbonate"></el-input>
  284. </el-form-item>
  285. </el-col>
  286. <el-col :span="8" v-if="isShows('葡萄糖')">
  287. <el-form-item label="葡萄糖(mmol/L): " prop="glucose">
  288. <el-input v-model="addPlan.glucose"></el-input>
  289. </el-form-item>
  290. </el-col>
  291. <el-col :span="8" v-if="isShows('透析液流量')">
  292. <el-form-item label="透析液流量(ml/min): " prop="dialysate_flow">
  293. <el-input v-model="addPlan.dialysate_flow"></el-input>
  294. </el-form-item>
  295. </el-col>
  296. <el-col :span="8" v-if="isShows('透析液温度')">
  297. <el-form-item label="透析液温度(℃): " prop="dialysate_temperature">
  298. <el-input v-model="addPlan.dialysate_temperature"></el-input>
  299. </el-form-item>
  300. </el-col>
  301. <el-col :span="8" v-if="isShows('电导度')">
  302. <el-form-item label="电导度(mS/cm): " prop="conductivity">
  303. <el-input v-model="addPlan.conductivity"></el-input>
  304. </el-form-item>
  305. </el-col>
  306. <el-col :span="8" v-if="isShows('体液过多症状')">
  307. <el-form-item label="体液过多症状:">
  308. <el-select v-model="addPlan.body_fluid" @change="changeBodyFluid">
  309. <el-option v-for="item in body_fluid_option" :label="item.name" :key="item.id"
  310. :value="item.id"></el-option>
  311. </el-select>
  312. </el-form-item>
  313. </el-col>
  314. <el-col :span="8" v-if="isShows('体液过多其他症状')">
  315. <el-form-item label="体液过多其他症状">
  316. <el-input v-model="addPlan.body_fluid_other"></el-input>
  317. </el-form-item>
  318. </el-col>
  319. <el-col :span="8" v-if="isShows('透析前使用特殊药物')">
  320. <el-form-item label="透析前使用特殊药物">
  321. <el-select v-model="addPlan.special_medicine" placeholder="请选择" style="width:100%;"
  322. >
  323. <el-option :key="0" label="请选择" :value="0"></el-option>
  324. <el-option v-for="item in special_medicine_option" :label="item.name" :key="item.id"
  325. :value="item.id"></el-option>
  326. </el-select>
  327. </el-form-item>
  328. </el-col>
  329. <el-col :span="8" v-if="isShows('透析前使用其他特殊药物')">
  330. <el-form-item label="使用其他特殊药物">
  331. <el-input v-model="addPlan.special_medicine_other"></el-input>
  332. </el-form-item>
  333. </el-col>
  334. <el-col :span="8">
  335. <el-form-item label="置换液:" v-if="isShows('置换液')&&this.$store.getters.xt_user.template_info.template_id != 6">
  336. <el-select v-model="addPlan.displace_liqui_part" placeholder="请选择">
  337. <el-option :key="0" label="请选择" :value="0"></el-option>
  338. <el-option v-for="(option, index) in displace_liqui_part_option" :key="index"
  339. :label="option.name" :value="option.id"></el-option>
  340. </el-select>
  341. </el-form-item>
  342. <el-form-item label="置换方式:" v-if="isShows('置换液')&&this.$store.getters.xt_user.template_info.template_id == 6">
  343. <el-select v-model="addPlan.displace_liqui_part" placeholder="请选择">
  344. <el-option :key="0" label="请选择" :value="0"></el-option>
  345. <el-option v-for="(option, index) in displace_liqui_part_option" :key="index"
  346. :label="option.name" :value="option.id"></el-option>
  347. </el-select>
  348. </el-form-item>
  349. </el-col>
  350. <el-col :span="8" v-if="isShows('置换液总量')">
  351. <el-form-item label="置换液总量(L)">
  352. <el-input v-model="addPlan.displace_liqui_value"></el-input>
  353. </el-form-item>
  354. </el-col>
  355. <el-col :span="8" v-if="isShows('血管通路')">
  356. <el-form-item label="血管通路:">
  357. <el-select v-model="addPlan.blood_access" placeholder="请选择">
  358. <el-option :key="0" label="请选择" :value="0"></el-option>
  359. <el-option v-for="(option, index) in blood_access_option" :key="index"
  360. :label="option.name" :value="option.id"></el-option>
  361. </el-select>
  362. </el-form-item>
  363. </el-col>
  364. <!-- </el-row>
  365. <el-row :gutter="20" > -->
  366. <el-col :span="8" v-if="isShows('实际超滤量')">
  367. <el-form-item label="实际超滤量(L)">
  368. <el-input v-model="addPlan.ultrafiltration"></el-input>
  369. </el-form-item>
  370. </el-col>
  371. <el-col :span="8" v-if="isShows('目标KT/V')">
  372. <el-form-item label="目标KT/V">
  373. <el-input v-model="addPlan.target_ktv"></el-input>
  374. </el-form-item>
  375. </el-col>
  376. </el-row>
  377. <el-row :gutter="24">
  378. <el-col :span="24">
  379. <el-form-item label="备注: " prop="remark">
  380. <el-input
  381. type="textarea"
  382. :rows="2"
  383. placeholder="请输入内容"
  384. v-model="addPlan.remark">
  385. </el-input>
  386. </el-form-item>
  387. </el-col>
  388. </el-row>
  389. </el-form>
  390. <span slot="footer" class="dialog-footer">
  391. <el-button @click="dialogVisible = false">取 消</el-button>
  392. <el-button type="primary" @click="submitEditSolution('addPlan')" v-if="isEdit"
  393. :disabled="$store.getters.xt_user.subscibe.state==3?true:false">保 存</el-button>
  394. <el-button type="primary" @click="submitNewSolution('addPlan')" v-else
  395. :disabled="$store.getters.xt_user.subscibe.state==3?true:false">保 存</el-button>
  396. </span>
  397. </el-dialog>
  398. </div>
  399. </template>
  400. <script>
  401. import tableTitle from './components/tableTitle'
  402. import PatientSidebar from './components/PatientSidebar'
  403. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from '@/api/doctor'
  404. import {
  405. createChildPatientDialysisSolution,
  406. createPatientDialysisSolution,
  407. deleteDialysisSolution,
  408. editChildPatientDialysisSolution,
  409. editDialysisSolutionDetail,
  410. editPatientDialysisSolution,
  411. fetchPatientDialysisSolutions
  412. } from '@/api/patient'
  413. import { calculateAnticoagulantZL, uParseTime } from '@/utils/tools'
  414. import store from '@/store'
  415. import { GetDeviceInfo } from '@/api/dialysis'
  416. const periodWeek = [
  417. { value: '每周', label: '每周' },
  418. { value: '两周', label: '两周' },
  419. { value: '三周', label: '三周' },
  420. { value: '四周', label: '四周' }
  421. ]
  422. const periodDay = [
  423. { value: '2天', label: '2天' },
  424. { value: '3天', label: '3天' },
  425. { value: '4天', label: '4天' },
  426. { value: '5天', label: '5天' },
  427. { value: '10天', label: '10天' },
  428. { value: '15天', label: '15天' },
  429. { value: '30天', label: '30天' }
  430. ]
  431. const numOptionsWeek = [
  432. { value: '1次', label: '1次' },
  433. { value: '2次', label: '2次' },
  434. { value: '3次', label: '3次' },
  435. { value: '4次', label: '4次' },
  436. { value: '5次', label: '5次' },
  437. { value: '6次', label: '6次' },
  438. { value: '7次', label: '7次' }
  439. ]
  440. const numOptionsDay = [
  441. { value: '1次', label: '1次' }
  442. ]
  443. export default {
  444. name: 'Dialysis',
  445. data() {
  446. var checkFirstDialysis = (rule, value, callback) => {
  447. if (this.addPlan.type == 2 && !value) {
  448. return callback(new Error('请选择首次透析!'))
  449. }
  450. callback()
  451. }
  452. var checkSubName = (rule, value, callback) => {
  453. var pattern = /^\d*$/
  454. if (!pattern.test(value)) {
  455. return callback(new Error('只填写0-9的数字'))
  456. }
  457. callback()
  458. }
  459. return {
  460. deviceList: [],
  461. dialysisTimeShow: new Date(2018, 1, 1, 3, 0),
  462. isEdit: false,
  463. isChildEdit: false,
  464. totalrate: '无/两周一次',
  465. patientID: 0,
  466. dialogVisible: false,
  467. dialogFormVisible: false,
  468. formLabelWidth: '80px',
  469. formInputWidth: '80px',
  470. total: 0,
  471. tableData: null,
  472. form: {
  473. name: '',
  474. region: '',
  475. date1: '',
  476. date2: '',
  477. delivery: false,
  478. type: [],
  479. resource: '',
  480. desc: ''
  481. },
  482. addPlan: {
  483. id: 0,
  484. mode: '',
  485. mode_name: '',
  486. dialyzer: '',
  487. dialysis_duration: '',
  488. dialysis_duration_hour: '',
  489. dialysis_duration_minute: '',
  490. hemodialysis_machine: '',
  491. perfusion_apparatus: '',
  492. blood_flow_volume: '',
  493. dewater: '',
  494. displace_liqui: 0,
  495. replacement_way: '',
  496. anticoagulant: '',
  497. anticoagulant_shouji: '',
  498. anticoagulant_weichi: '',
  499. anticoagulant_zongliang: '',
  500. anticoagulant_gaimingcheng: '',
  501. anticoagulant_gaijiliang: '',
  502. kalium: '',
  503. replacement_total: '',
  504. sodium: '',
  505. calcium: '',
  506. bicarbonate: '',
  507. glucose: '',
  508. dry_weight: '',
  509. dialysate_flow: '',
  510. dialysate_temperature: '',
  511. conductivity: '',
  512. doctor: '',
  513. remark: '',
  514. target_ktv:'',
  515. target_ultrafiltration:'',
  516. dialyzer_perfusion_apparatus: '',
  517. body_fluid: '',
  518. body_fluid_other: '',
  519. special_medicine: '',
  520. special_medicine_other: '',
  521. displace_liqui_part: '',
  522. displace_liqui_value: '',
  523. ultrafiltration: '',
  524. blood_access: '',
  525. },
  526. childPlan: {
  527. mode: '',
  528. frequency: '',
  529. name: '',
  530. parent_id: 0,
  531. sub_name: '',
  532. initiate_mode: '',
  533. doctor: ''
  534. },
  535. modeOptions: null,
  536. anticoagulantsSet: {
  537. type: 1
  538. },
  539. replacementWays: null,
  540. anticoagulantsConfit: null,
  541. dialysate_formulation: [],
  542. body_fluid_option: [],
  543. special_medicine_option: [],
  544. displace_liqui_part_option: [],
  545. blood_access_option: [],
  546. timeOptions: [
  547. { value: 1, label: '按周' },
  548. { value: 2, label: '按日' }
  549. ],
  550. periodOptions: periodWeek,
  551. numOptions: numOptionsWeek,
  552. stateOptions: [
  553. { value: 1, label: '启用' },
  554. { value: 2, label: '停用' }
  555. ],
  556. doctorOptions: null,
  557. adminUserOptions: null,
  558. current_index: -1,
  559. addPlanRules: {
  560. mode: [{ required: true, message: '请选择透析模式', trigger: 'blur' }],
  561. type: [{ required: true, message: '请选择频率', trigger: 'blur' }],
  562. period: [{ required: true, message: '请选择周期', trigger: 'blur' }],
  563. times: [{ required: true, message: '请选择次数', trigger: 'blur' }],
  564. initiate_mode: [{ required: true, message: '请选择状态', trigger: 'blur' }],
  565. doctor: [{ required: true, message: '请选择医生', trigger: 'blur' }],
  566. first_dialysis: [{ validator: checkFirstDialysis, trigger: 'blur' }]
  567. },
  568. addChildPlanRules: {
  569. sub_name: [{ required: true, message: '请填写处方名', trigger: 'blur' }, {
  570. validator: checkSubName,
  571. trigger: 'blur'
  572. }],
  573. initiate_mode: [{ required: true, message: '请选择状态', trigger: 'blur' }],
  574. doctor: [{ required: true, message: '请选择医生', trigger: 'blur' }]
  575. },
  576. current_model: {
  577. id: 0,
  578. name: '',
  579. dialysis_duration: 2,
  580. replacement_total: 0,
  581. replacement_way: 2,
  582. hemodialysis_machine: 2,
  583. blood_filter: 2,
  584. perfusion_apparatus: 2,
  585. blood_flow_volume: 2,
  586. dialysate_flow: 2,
  587. kalium: 2,
  588. sodium: 2,
  589. calcium: 2,
  590. bicarbonate: 2
  591. },
  592. current_solution: {
  593. id: 0,
  594. name: '',
  595. sub_name: '',
  596. period: '',
  597. times: '',
  598. doctor: 0
  599. },
  600. anticoagulant: {
  601. id: 0,
  602. name: '',
  603. type: 1,
  604. shouji: 1,
  605. weichi: 1,
  606. zongliang: 1,
  607. gaimingcheng: -1,
  608. gaijiliang: -1,
  609. shouji_unit: 'mg',
  610. weichi_unit: 'mg/h',
  611. zongliang_unit: 'mg',
  612. gaimingcheng_unit: '',
  613. gaijiliang_unit: ''
  614. },
  615. blood_filters: null,
  616. perfusion_apparatus: null,
  617. hemodialysis_machines: null,
  618. solution_detail: {
  619. id: 0,
  620. affirm_state: 0,
  621. dialysis_duration: '',
  622. replacement_way: '',
  623. mode_id: '',
  624. blood_flow_volume: '',
  625. hemodialysis_machine: '',
  626. blood_filter: '',
  627. perfusion_apparatus: '',
  628. dialysate_flow: '',
  629. kalium: '',
  630. replacement_total: '',
  631. sodium: '',
  632. calcium: '',
  633. bicarbonate: '',
  634. anticoagulant: '',
  635. anticoagulant_shouji: '',
  636. anticoagulant_weichi: '',
  637. anticoagulant_zongliang: '',
  638. anticoagulant_gaimingcheng: '',
  639. anticoagulant_gaijiliang: ''
  640. },
  641. queryParams: {
  642. page: 1,
  643. limit: 10,
  644. id: 0
  645. }
  646. }
  647. },
  648. watch: {
  649. 'addPlan.anticoagulant_shouji': function() {
  650. if (this.addPlan.anticoagulant_shouji == '' && this.addPlan.anticoagulant_weichi == '') {
  651. this.addPlan.anticoagulant_zongliang = parseInt(0) + parseInt(0)
  652. } else if (this.addPlan.anticoagulant_shouji != '' && this.addPlan.anticoagulant_weichi != '') {
  653. this.addPlan.anticoagulant_zongliang = parseInt(this.addPlan.anticoagulant_shouji) + parseInt(this.addPlan.anticoagulant_weichi)
  654. } else if (this.addPlan.anticoagulant_shouji != '' && this.addPlan.anticoagulant_shouji == '') {
  655. this.addPlan.anticoagulant_zongliang = parseInt(this.addPlan.anticoagulant_shouji) + parseInt(0)
  656. } else if (this.addPlan.anticoagulant_shouji == '' && this.addPlan.anticoagulant_shouji != '') {
  657. this.addPlan.anticoagulant_zongliang = parseInt(0) + parseInt(this.addPlan.anticoagulant_shouji)
  658. }
  659. // if(this.addPlan.anticoagulant_zongliang === NaN){
  660. // console.log("222222")
  661. //
  662. // this.addPlan.anticoagulant_zongliang = ''
  663. // }
  664. if(isNaN(this.addPlan.anticoagulant_zongliang)){
  665. this.addPlan.anticoagulant_zongliang = ''
  666. }
  667. },
  668. 'addPlan.anticoagulant_weichi': function() {
  669. if (this.addPlan.anticoagulant_shouji == '' && this.addPlan.anticoagulant_weichi == '') {
  670. this.addPlan.anticoagulant_zongliang = parseInt(0) + parseInt(0)
  671. } else if (this.addPlan.anticoagulant_shouji != '' && this.addPlan.anticoagulant_weichi != '') {
  672. this.addPlan.anticoagulant_zongliang = parseInt(this.addPlan.anticoagulant_shouji) + parseInt(this.addPlan.anticoagulant_weichi)
  673. } else if (this.addPlan.anticoagulant_shouji != '' && this.addPlan.anticoagulant_shouji == '') {
  674. this.addPlan.anticoagulant_zongliang = parseInt(this.addPlan.anticoagulant_shouji) + parseInt(0)
  675. } else if (this.addPlan.anticoagulant_shouji == '' && this.addPlan.anticoagulant_shouji != '') {
  676. this.addPlan.anticoagulant_zongliang = parseInt(0) + parseInt(this.addPlan.anticoagulant_shouji)
  677. }
  678. if(isNaN(this.addPlan.anticoagulant_zongliang)){
  679. this.addPlan.anticoagulant_zongliang = ''
  680. }
  681. // console.log(this.addPlan.anticoagulant_zongliang)
  682. // if(this.addPlan.anticoagulant_zongliang === NaN){
  683. // }
  684. },
  685. },
  686. components: {
  687. tableTitle, PatientSidebar
  688. },
  689. methods: {
  690. changeBodyFluid: function() {
  691. },
  692. GetDeviceData: function() {
  693. let params = {}
  694. GetDeviceInfo(params).then(response => {
  695. this.deviceList = response.data.data.device
  696. })
  697. },
  698. selectnDialysisTime(val) {
  699. var valTime = val.split(':')
  700. this.addPlan.dialysis_duration = valTime[0] + '.' + valTime[1]
  701. this.addPlan.dialysis_duration_hour = valTime[0]
  702. this.addPlan.dialysis_duration_minute = valTime[1]
  703. },
  704. tableCurrentChange(current) {
  705. if (typeof (current) == 'undefined' || current == null) {
  706. this.current_solution = {
  707. id: 0,
  708. name: '',
  709. sub_name: '',
  710. period: '',
  711. times: '',
  712. doctor: 0
  713. }
  714. this.solution_detail = {
  715. id: 0,
  716. affirm_state: 0,
  717. dialysis_duration: '',
  718. replacement_way: '',
  719. mode_id: '',
  720. blood_flow_volume: '',
  721. hemodialysis_machine: '',
  722. blood_filter: '',
  723. perfusion_apparatus: '',
  724. dialysate_flow: '',
  725. kalium: '',
  726. replacement_total: '',
  727. sodium: '',
  728. calcium: '',
  729. bicarbonate: '',
  730. anticoagulant: '',
  731. anticoagulant_shouji: '',
  732. anticoagulant_weichi: '',
  733. anticoagulant_zongliang: '',
  734. anticoagulant_gaimingcheng: '',
  735. anticoagulant_gaijiliang: ''
  736. }
  737. return
  738. }
  739. this.current_solution = current
  740. this.setCurrentMode(current.mode_id)
  741. this.solution_detail = {
  742. id: this.current_solution.id,
  743. affirm_state: this.current_solution.affirm_state,
  744. dialysis_duration: this.current_solution.dialysis_duration != 0 ? this.current_solution.dialysis_duration : '',
  745. replacement_way: this.current_solution.replacement_way != 0 ? this.current_solution.replacement_way : '',
  746. replacement_total: this.current_solution.replacement_total != 0 ? this.current_solution.replacement_total : '',
  747. mode_id: this.current_solution.mode_id,
  748. blood_flow_volume: this.current_solution.blood_flow_volume != 0 ? this.current_solution.blood_flow_volume : '',
  749. hemodialysis_machine: this.current_solution.hemodialysis_machine != 0 ? this.current_solution.hemodialysis_machine : '',
  750. blood_filter: this.current_solution.blood_filter != 0 ? this.current_solution.blood_filter : '',
  751. perfusion_apparatus: this.current_solution.perfusion_apparatus != 0 ? this.current_solution.perfusion_apparatus : '',
  752. dialysate_flow: this.current_solution.dialysate_flow != 0 ? this.current_solution.dialysate_flow : '',
  753. kalium: this.current_solution.kalium != 0 ? this.current_solution.kalium : '',
  754. sodium: this.current_solution.sodium != 0 ? this.current_solution.sodium : '',
  755. calcium: this.current_solution.calcium != 0 ? this.current_solution.calcium : '',
  756. bicarbonate: this.current_solution.bicarbonate != 0 ? this.current_solution.bicarbonate : '',
  757. anticoagulant: this.current_solution.anticoagulant != 0 ? this.current_solution.anticoagulant : '',
  758. anticoagulant_shouji: this.current_solution.anticoagulant_shouji != 0 ? this.current_solution.anticoagulant_shouji : '',
  759. anticoagulant_weichi: this.current_solution.anticoagulant_weichi != 0 ? this.current_solution.anticoagulant_weichi : '',
  760. anticoagulant_zongliang: this.current_solution.anticoagulant_zongliang != 0 ? this.current_solution.anticoagulant_zongliang : ''
  761. }
  762. },
  763. handleDelete(index, row) {
  764. if (row.use_state == 1) {
  765. this.$message.error('方案已被使用,不能删除')
  766. return false
  767. }
  768. this.$confirm('确定删除' + row.name + row.sub_name + '方案吗?', '提示', {
  769. confirmButtonText: '确定',
  770. cancelButtonText: '取消',
  771. type: 'warning'
  772. }).then(() => {
  773. deleteDialysisSolution(row.id).then(response => {
  774. if (response.data.state == 0) {
  775. this.$message.error(response.data.msg)
  776. return false
  777. } else {
  778. this.$notify({
  779. title: '成功',
  780. message: '删除成功',
  781. type: 'success',
  782. duration: 2000
  783. })
  784. this.tableData.splice(index, 1)
  785. // if (row.parent_id>0) {
  786. // this.tableData.splice(index,1);
  787. // }else {
  788. // var resetTableData = this.tableData;
  789. // this.tableData = [];
  790. // var that = this;
  791. // resetTableData.forEach(function(item, itemindex){
  792. // if (item.id != row.id && item.parent_id != row.id) {
  793. // that.tableData.push(item);
  794. // }
  795. // });
  796. // }
  797. }
  798. })
  799. })
  800. },
  801. submitSolution(formName) {
  802. editDialysisSolutionDetail(this.patientID, this.solution_detail.id, this.solution_detail).then(response => {
  803. if (response.data.state == 0) {
  804. this.$message.error(response.data.msg)
  805. return false
  806. } else {
  807. this.$notify({
  808. title: '成功',
  809. message: '修改成功',
  810. type: 'success',
  811. duration: 2000
  812. })
  813. var thisSolution = response.data.data.solution
  814. var spliceIndex = -1
  815. for (let index = this.tableData.length - 1; ; index--) {
  816. if (this.tableData[index].id === thisSolution.id) {
  817. spliceIndex = index
  818. break
  819. }
  820. }
  821. if (spliceIndex > -1) {
  822. var newIndex = spliceIndex + 1
  823. if (newIndex === this.tableData.length) {
  824. this.tableData.pop()
  825. this.tableData.push(thisSolution)
  826. } else {
  827. var swapData = this.tableData.splice(newIndex)
  828. this.tableData.pop()
  829. this.tableData.push(thisSolution)
  830. this.tableData = this.tableData.concat(swapData)
  831. }
  832. }
  833. this.solution_detail.affirm_state = thisSolution.affirm_state
  834. this.$refs.solutionTable.setCurrentRow(this.tableData[spliceIndex])
  835. }
  836. })
  837. },
  838. submitEditChildSolution(formName) {
  839. this.$refs[formName].validate(valid => {
  840. if (valid) {
  841. var editData = {
  842. initiate_mode: this.childPlan.initiate_mode,
  843. doctor: this.childPlan.doctor
  844. }
  845. editChildPatientDialysisSolution(this.patientID, this.childPlan.id, editData).then(response => {
  846. if (response.data.state == 0) {
  847. this.$message.error(response.data.msg)
  848. return false
  849. } else {
  850. this.$notify({
  851. title: '成功',
  852. message: '修改成功',
  853. type: 'success',
  854. duration: 2000
  855. })
  856. this.$refs[formName].resetFields()
  857. this.dialogFormVisible = false
  858. this.tableData[this.current_index].doctor = response.data.data.solution.doctor
  859. this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time
  860. this.tableData[this.current_index].initiate_mode = response.data.data.solution.initiate_mode
  861. this.current_index = -1
  862. return false
  863. }
  864. })
  865. }
  866. })
  867. },
  868. submitNewChildSolution(formName) {
  869. this.$refs[formName].validate(valid => {
  870. if (valid) {
  871. var createData = {
  872. parent_id: this.childPlan.parent_id,
  873. sub_name: this.childPlan.sub_name,
  874. initiate_mode: this.childPlan.initiate_mode,
  875. doctor: this.childPlan.doctor
  876. }
  877. createChildPatientDialysisSolution(this.patientID, createData).then(response => {
  878. if (response.data.state == 0) {
  879. this.$message.error(response.data.msg)
  880. return false
  881. } else {
  882. this.$notify({
  883. title: '成功',
  884. message: '创建成功',
  885. type: 'success',
  886. duration: 2000
  887. })
  888. this.$refs[formName].resetFields()
  889. var spliceIndex = -1
  890. for (let index = this.tableData.length - 1; ; index--) {
  891. if (this.tableData[index].parent_id === createData.parent_id) {
  892. spliceIndex = index
  893. break
  894. } else if (this.tableData[index].id === createData.parent_id) {
  895. spliceIndex = index
  896. break
  897. }
  898. }
  899. if (spliceIndex > -1) {
  900. spliceIndex += 1
  901. if (spliceIndex === this.tableData.length) {
  902. this.tableData.push(response.data.data.solution)
  903. } else {
  904. var swapData = this.tableData.splice(spliceIndex)
  905. this.tableData.push(response.data.data.solution)
  906. this.tableData = this.tableData.concat(swapData)
  907. }
  908. }
  909. this.dialogFormVisible = false
  910. return false
  911. }
  912. })
  913. }
  914. })
  915. },
  916. submitEditSolution(formName) {
  917. this.$refs[formName].validate(valid => {
  918. if (valid) {
  919. editPatientDialysisSolution(this.patientID, this.addPlan.id, this.addPlan).then(response => {
  920. if (response.data.state == 0) {
  921. this.$message.error(response.data.msg)
  922. return false
  923. } else {
  924. this.$notify({
  925. title: '成功',
  926. message: '修改成功',
  927. type: 'success',
  928. duration: 2000
  929. })
  930. this.$refs[formName].resetFields()
  931. this.dialogVisible = false
  932. for (var dindex in response.data.data.solution) {
  933. if (dindex == 'id') {
  934. continue
  935. }
  936. this.tableData[this.current_index][dindex] = response.data.data.solution[dindex]
  937. }
  938. // this.tableData[this.current_index].dialysis_duration = response.data.data.solution.dialysis_duration;
  939. // this.tableData[this.current_index].doctor = response.data.data.solution.doctor;
  940. // this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time;
  941. this.current_index = -1
  942. return false
  943. }
  944. })
  945. }
  946. })
  947. },
  948. submitNewSolution(formName) {
  949. this.addPlan.anticoagulant_zongliang = this.addPlan.anticoagulant_zongliang.toString()
  950. this.$refs[formName].validate(valid => {
  951. if (valid) {
  952. createPatientDialysisSolution(this.patientID, this.addPlan).then(response => {
  953. if (response.data.state == 0) {
  954. this.$message.error(response.data.msg)
  955. return false
  956. } else {
  957. this.$notify({
  958. title: '成功',
  959. message: '创建成功',
  960. type: 'success',
  961. duration: 2000
  962. })
  963. this.$refs[formName].resetFields()
  964. this.dialogVisible = false
  965. this.tableData.unshift(response.data.data.solution)
  966. if (this.tableData.length > 10) {
  967. this.tableData.pop()
  968. }
  969. this.total += 1
  970. return false
  971. }
  972. })
  973. }
  974. })
  975. },
  976. handleEdit(index, row) {
  977. console.log(index, row)
  978. },
  979. handleSizeChange(val) {
  980. this.queryParams.limit = val
  981. this.fetchPatientDialysisSolutions()
  982. },
  983. handleCurrentChange(val) {
  984. this.queryParams.page = val
  985. this.fetchPatientDialysisSolutions()
  986. },
  987. openEdit(index, row) {
  988. console.log(row)
  989. this.current_index = index
  990. this.addPlan.id = row.id
  991. this.addPlan.mode = row.mode_id
  992. this.addPlan.mode_name = row.mode_name
  993. this.addPlan.dialyzer = row.dialyzer ? row.dialyzer : ''
  994. this.addPlan.dialysis_duration = '' + row.dialysis_duration
  995. this.addPlan.dialysis_duration_hour = '' + row.dialysis_duration_hour
  996. this.addPlan.dialysis_duration_minute = '' + row.dialysis_duration_minute
  997. this.addPlan.hemodialysis_machine = row.hemodialysis_machine + '';
  998. this.addPlan.perfusion_apparatus = row.perfusion_apparatus + '';
  999. this.addPlan.blood_flow_volume = row.blood_flow_volume.toString();
  1000. this.addPlan.anticoagulant = row.anticoagulant;
  1001. this.addPlan.replacement_total = row.replacement_total;
  1002. this.addPlan.target_ktv = row.target_ktv.toString();
  1003. this.addPlan.target_ultrafiltration = row.target_ultrafiltration.toString();
  1004. this.addPlan.anticoagulant_shouji = row.anticoagulant_shouji.toString();
  1005. this.addPlan.anticoagulant_weichi = row.anticoagulant_weichi.toString();
  1006. this.addPlan.anticoagulant_zongliang = row.anticoagulant_zongliang.toString();
  1007. this.addPlan.anticoagulant_gaimingcheng = row.anticoagulant_gaimingcheng.toString();
  1008. this.addPlan.anticoagulant_gaijiliang = row.anticoagulant_gaijiliang.toString();
  1009. this.addPlan.kalium = row.kalium.toString();
  1010. this.addPlan.sodium = row.sodium.toString();
  1011. this.addPlan.calcium = row.calcium.toString();
  1012. this.addPlan.bicarbonate = row.bicarbonate.toString();
  1013. this.addPlan.glucose = row.glucose.toString();
  1014. this.addPlan.dialysate_flow = row.dialysate_flow.toString();
  1015. this.addPlan.dialysate_temperature = row.dialysate_temperature.toString();
  1016. this.addPlan.conductivity = row.conductivity.toString();
  1017. this.addPlan.remark = row.remark;
  1018. this.addPlan.dialyzer_perfusion_apparatus = row.dialyzer_perfusion_apparatus.toString();
  1019. this.addPlan.body_fluid = row.body_fluid
  1020. this.addPlan.body_fluid_other = row.body_fluid_other.toString();
  1021. this.addPlan.special_medicine = row.special_medicine;
  1022. this.addPlan.special_medicine_other = row.special_medicine_other.toString();
  1023. this.addPlan.displace_liqui_part = row.displace_liqui_part;
  1024. this.addPlan.displace_liqui_value = row.displace_liqui_value.toString();
  1025. this.addPlan.ultrafiltration = row.ultrafiltration.toString();
  1026. this.addPlan.blood_access = row.blood_access;
  1027. this.dialogVisible = true
  1028. this.isEdit = true
  1029. this.addPlan.dialysate_formulation = row.dialysate_formulation
  1030. this.dialysisTimeShow = new Date(2018, 1, 1, this.addPlan.dialysis_duration_hour, this.addPlan.dialysis_duration_minute)
  1031. },
  1032. isShows(name) {
  1033. var filedList = store.getters.xt_user.fileds
  1034. for (let i = 0; i < filedList.length; i++) {
  1035. if (filedList[i].module == 1 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
  1036. return true
  1037. }
  1038. }
  1039. return false
  1040. },
  1041. openNew() {
  1042. this.current_index = -1
  1043. this.addPlan = {
  1044. mode: '',
  1045. mode_name: '',
  1046. id: 0,
  1047. type: 1,
  1048. period: '',
  1049. times: '',
  1050. initiate_mode: '',
  1051. doctor: '',
  1052. first_dialysis: '',
  1053. dialysis_duration: '3.30',
  1054. dialysis_duration_hour: '3',
  1055. dialysis_duration_minute: '30'
  1056. }
  1057. this.addPlanTypeChange()
  1058. this.dialogVisible = true
  1059. this.isEdit = false
  1060. },
  1061. openNewChild(index, row) {
  1062. this.childPlan = {
  1063. mode: row.mode_name,
  1064. frequency: row.period + row.times,
  1065. name: row.name,
  1066. parent_id: row.id,
  1067. sub_name: '',
  1068. initiate_mode: '',
  1069. doctor: ''
  1070. }
  1071. this.isChildEdit = false
  1072. this.dialogFormVisible = true
  1073. },
  1074. openChildEdit(index, row) {
  1075. this.childPlan = {
  1076. mode: row.mode_name,
  1077. frequency: row.period + row.times,
  1078. name: row.name,
  1079. parent_id: row.parent_id,
  1080. id: row.id,
  1081. sub_name: row.sub_name,
  1082. initiate_mode: row.initiate_mode,
  1083. doctor: row.doctor
  1084. }
  1085. this.current_index = index
  1086. this.isChildEdit = true
  1087. this.dialogFormVisible = true
  1088. },
  1089. fetchAllDoctorAndNurse() {
  1090. fetchAllDoctorAndNurse().then(response => {
  1091. if (response.data.state == 1) {
  1092. this.doctorOptions = response.data.data.doctors
  1093. }
  1094. })
  1095. },
  1096. fetchAllAdminUsers() {
  1097. fetchAllAdminUsers().then(response => {
  1098. if (response.data.state == 1) {
  1099. this.adminUserOptions = response.data.data.users
  1100. }
  1101. })
  1102. },
  1103. fetchPatientDialysisSolutions() {
  1104. fetchPatientDialysisSolutions(this.queryParams).then(response => {
  1105. if (response.data.state == 1) {
  1106. this.tableData = response.data.data.solutions
  1107. this.total = response.data.data.total
  1108. }
  1109. })
  1110. },
  1111. addPlanTypeChange() {
  1112. if (this.addPlan.type == 1) {
  1113. this.periodOptions = periodWeek
  1114. this.numOptions = numOptionsWeek
  1115. } else {
  1116. this.addPlan.type == 2
  1117. this.periodOptions = periodDay
  1118. this.numOptions = numOptionsDay
  1119. }
  1120. },
  1121. changeThisAnticoagulant() {
  1122. var thismode = parseInt(this.addPlan.anticoagulant)
  1123. if (isNaN(thismode) || thismode <= 0) {
  1124. return false
  1125. }
  1126. if (typeof (this.anticoagulantsConfit[thismode]) == 'undefined' || this.anticoagulantsConfit[thismode] == null) {
  1127. return false
  1128. }
  1129. this.anticoagulant = this.anticoagulantsConfit[thismode]
  1130. },
  1131. addPlanModeChange() {
  1132. var thismode = parseInt(this.addPlan.mode)
  1133. if (isNaN(thismode) || thismode <= 0) {
  1134. return false
  1135. }
  1136. if (typeof (this.modeOptions[thismode]) == 'undefined' || this.modeOptions[thismode] == null) {
  1137. return false
  1138. }
  1139. // this.current_model = this.modeOptions[thismode];
  1140. this.addPlan.mode_name = this.modeOptions[thismode].name
  1141. },
  1142. setCurrentMode(id) {
  1143. if (typeof (this.modeOptions[id]) == 'undefined' || this.modeOptions[id] == null) {
  1144. return false
  1145. }
  1146. this.current_model = this.modeOptions[id]
  1147. },
  1148. getDoctorName(doctorid) {
  1149. var name = ''
  1150. if (this.doctorOptions == null) {
  1151. return name
  1152. }
  1153. if (typeof (this.doctorOptions.length) == 'undefined') {
  1154. return name
  1155. }
  1156. var leng = this.doctorOptions.length
  1157. if (leng == 0) {
  1158. return name
  1159. }
  1160. for (let index = 0; index < leng; index++) {
  1161. if (this.doctorOptions[index].id == doctorid) {
  1162. name = this.doctorOptions[index].name
  1163. break
  1164. }
  1165. }
  1166. return name
  1167. },
  1168. getAdminUserName(id) {
  1169. var name = ''
  1170. if (this.adminUserOptions == null) {
  1171. return name
  1172. }
  1173. if (typeof (this.adminUserOptions.length) == 'undefined') {
  1174. return name
  1175. }
  1176. var leng = this.adminUserOptions.length
  1177. if (leng == 0) {
  1178. return name
  1179. }
  1180. for (let index = 0; index < leng; index++) {
  1181. if (this.adminUserOptions[index].id == id) {
  1182. name = this.adminUserOptions[index].name
  1183. break
  1184. }
  1185. }
  1186. return name
  1187. }
  1188. },
  1189. created() {
  1190. const id = this.$route.params && this.$route.params.id
  1191. this.patientID = parseInt(id)
  1192. if (isNaN(this.patientID) || this.patientID <= 0) {
  1193. this.$notify.error({
  1194. title: '错误',
  1195. message: '无效的id'
  1196. })
  1197. this.$router.back(-1)
  1198. }
  1199. this.GetDeviceData()
  1200. this.modeOptions = this.$store.getters.treatment_mode
  1201. this.anticoagulantsSet = this.$store.getters.anticoagulants_set
  1202. this.replacementWays = this.$store.getters.replacement_ways
  1203. this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit
  1204. this.blood_filters = this.$store.getters.blood_filters
  1205. this.perfusion_apparatus = this.$store.getters.perfusion_apparatus
  1206. this.hemodialysis_machines = this.$store.getters.hemodialysis_machines
  1207. this.dialysate_formulation = this.$store.getters.dialysate_formulation
  1208. this.body_fluid_option = this.$store.getters.body_fluid
  1209. this.special_medicine_option = this.$store.getters.special_medicine
  1210. this.displace_liqui_part_option = this.$store.getters.displace_liqui
  1211. this.blood_access_option = this.$store.getters.blood_access
  1212. this.queryParams.id = this.patientID
  1213. // this.fetchAllDoctorAndNurse();
  1214. this.fetchAllAdminUsers()
  1215. this.fetchPatientDialysisSolutions()
  1216. }
  1217. }
  1218. </script>
  1219. <style rel="stylesheet/scss" lang="scss" scoped>
  1220. .Total {
  1221. .sure {
  1222. float: right;
  1223. margin: 5px 10px 0 0;
  1224. }
  1225. .plan {
  1226. font-size: 15px;
  1227. color: #6caef7;
  1228. background: #ecf5ff;
  1229. height: 42px;
  1230. line-height: 42px;
  1231. border: 1px #ebeef5 solid;
  1232. width: 100%;
  1233. padding-left: 15px;
  1234. span {
  1235. margin: 0 20px 0 0;
  1236. }
  1237. }
  1238. }
  1239. .form-table {
  1240. border: 1px #ebeef5 solid;
  1241. padding-bottom: 20px;
  1242. .el-col-6 {
  1243. width: 380px;
  1244. }
  1245. .el-row {
  1246. margin: 0 !important;
  1247. .el-form-item {
  1248. margin-bottom: 12px;
  1249. .el-form-item__content {
  1250. .el-select {
  1251. width: 100%;
  1252. }
  1253. }
  1254. }
  1255. }
  1256. }
  1257. </style>