血透系统PC前端

dialysisSolution.vue 53KB

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