血透系统pad前端

PrescriptionDialog.vue 87KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370
  1. <template>
  2. <div>
  3. <div v-if="isShowDialog" class="Dialog">
  4. <div class="DialogTit">
  5. <span @click="close()" class="iconfont">&#xe6e9;</span>
  6. <h1 class="name newName">透析处方</h1>
  7. <button class="newButton" @click="showmsgtip">{{patient.name}}</button>
  8. <span @click="commitInfo" class="success" v-if="isPermission()">保存</span>
  9. <span @click="commitInfo" class="success" v-if="!isPermission()"></span>
  10. </div>
  11. <div class="DialogContent newDialogContent" id="dialogTop">
  12. <div>
  13. <div @click="showSubMenu('mode')" class="item" ref="mode" v-if="isShow('透析模式')">
  14. <label class="name" for="txms">透析模式</label>
  15. <div class="content">
  16. <span class="text" id="txms">{{GetModeByModeId(dialysisPrescription.mode_id)}}</span>
  17. <span class="iconfont">&#xe6f9;</span>
  18. </div>
  19. </div>
  20. <div class="item" @click="openPicker" v-if="isShow('透析时长')">
  21. <label class="name" for="txsc">透析时长</label>
  22. <div class="content">
  23. <span class="text" style="width: 100px">{{timeValue}}</span>
  24. <span class="iconfont">&#xe6f9;</span>
  25. </div>
  26. </div>
  27. <div class="item" v-if="isShow('血流量')">
  28. <label class="name" for="xll">血流量(ml/min)</label>
  29. <div class="content">
  30. <input
  31. type="number"
  32. @click="newClick($event)"
  33. @focus="inputFocus"
  34. id="xll"
  35. v-model="dialysisPrescription.blood_flow_volume"
  36. />
  37. </div>
  38. </div>
  39. <div class="item" v-if="isShow('目标超滤量')">
  40. <label class="name" for="mbcll">目标超滤量(L)</label>
  41. <div class="content">
  42. <input
  43. type="number"
  44. @click="newClick($event)"
  45. @focus="inputFocus"
  46. id="mbcll"
  47. v-model="dialysisPrescription.target_ultrafiltration"
  48. />
  49. </div>
  50. </div>
  51. <div
  52. @click="showSubMenu('dialysate_formulation')"
  53. class="item"
  54. ref="dialysate_formulation"
  55. v-if="isShow('透析液配方')"
  56. >
  57. <label class="name" for="txypf">透析液配方</label>
  58. <div class="content">
  59. <span
  60. class="text"
  61. id="txypf"
  62. >{{GetDialysateFormulationById(dialysisPrescription.dialysate_formulation)}}</span>
  63. <span class="iconfont">&#xe6f9;</span>
  64. </div>
  65. </div>
  66. <div
  67. @click="showSubMenu('anticoagulant')"
  68. class="item"
  69. ref="anticoagulant"
  70. v-if="isShow('抗凝剂')"
  71. >
  72. <label class="name" for="knj">抗凝剂</label>
  73. <div class="content">
  74. <span
  75. class="text"
  76. id="knj"
  77. >{{GetAnticoagulantById(dialysisPrescription.anticoagulant)}}</span>
  78. <span class="iconfont">&#xe6f9;</span>
  79. </div>
  80. </div>
  81. <div class="item" v-if="dialysisPrescription.anticoagulant != 5&&isShow('首剂')">
  82. <label
  83. class="name"
  84. for="zl"
  85. v-if="dialysisPrescription.anticoagulant == 0 ||dialysisPrescription.anticoagulant == -2"
  86. >首剂(mg)</label>
  87. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2">首剂(iu)</label>
  88. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 3">首剂(iu)</label>
  89. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 4">首剂(mg)</label>
  90. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 1">首剂(mg)</label>
  91. <div class="content">
  92. <input
  93. v-if="dialysisPrescription.anticoagulant != 1"
  94. type="number"
  95. @click="newClick($event)"
  96. @focus="inputFocus"
  97. id="sj"
  98. v-model="dialysisPrescription.anticoagulant_shouji"
  99. :disabled="anticoagulant.shouji==1?false:true"
  100. />
  101. <input
  102. v-if="dialysisPrescription.anticoagulant == 1"
  103. type="number"
  104. @click="newClick($event)"
  105. @focus="inputFocus"
  106. id="sj"
  107. v-model="dialysisPrescription.no_anticoagulant_shouji"
  108. disabled="true"
  109. />
  110. </div>
  111. </div>
  112. <div class="item" v-if="anticoagulant.weichi != -1&&isShow('维持')">
  113. <label
  114. class="name"
  115. for="zl"
  116. v-if="dialysisPrescription.anticoagulant == 0 ||dialysisPrescription.anticoagulant == -2"
  117. >维持(mg/h)</label>
  118. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2">维持(iu/h)</label>
  119. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 3">维持(iu/h)</label>
  120. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 4">维持(mg/h)</label>
  121. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 5">维持(ml/h)</label>
  122. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 1">维持(mg/h)</label>
  123. <div class="content">
  124. <input
  125. v-if="dialysisPrescription.anticoagulant != 1"
  126. type="number"
  127. @click="newClick($event)"
  128. @focus="inputFocus"
  129. id="wz"
  130. class="inputBox"
  131. v-model="dialysisPrescription.anticoagulant_weichi"
  132. :disabled="anticoagulant.weichi==1?false:true"
  133. />
  134. <input
  135. v-if="dialysisPrescription.anticoagulant == 1"
  136. type="number"
  137. @click="newClick($event)"
  138. @focus="inputFocus"
  139. id="sj"
  140. v-model="dialysisPrescription.no_anticoagulant_weichi"
  141. disabled="true"
  142. />
  143. </div>
  144. </div>
  145. <div class="item" v-if="dialysisPrescription.anticoagulant != 5&& isShow('总量')">
  146. <label
  147. class="name"
  148. for="zl"
  149. v-if="dialysisPrescription.anticoagulant == 0 ||dialysisPrescription.anticoagulant == -2"
  150. >总量(mg)</label>
  151. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2">总量(iu)</label>
  152. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 3">总量(iu)</label>
  153. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 4">总量(mg)</label>
  154. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 1">总量(mg)</label>
  155. <div class="content">
  156. <input
  157. v-if="dialysisPrescription.anticoagulant != 1"
  158. type="number"
  159. @click="newClick($event)"
  160. @focus="inputFocus"
  161. id="zl"
  162. class="inputBox"
  163. v-model="dialysisPrescription.anticoagulant_zongliang"
  164. :disabled="anticoagulant.zongliang==1?false:true"
  165. />
  166. <input
  167. v-if="dialysisPrescription.anticoagulant == 1"
  168. type="number"
  169. @click="newClick($event)"
  170. @focus="inputFocus"
  171. id="sj"
  172. v-model="dialysisPrescription.no_anticoagulant_zongliang"
  173. disabled="true"
  174. />
  175. </div>
  176. </div>
  177. <div class="item" v-if="dialysisPrescription.anticoagulant == 5&& isShow('钙名称')">
  178. <label class="name" for="g">钙名称</label>
  179. <div class="content">
  180. <input
  181. type="text"
  182. id="g"
  183. class="inputBox"
  184. v-model="dialysisPrescription.anticoagulant_gaimingcheng"
  185. />
  186. </div>
  187. </div>
  188. <div class="item" v-if="dialysisPrescription.anticoagulant == 5&& isShow('钙剂量')">
  189. <label class="name" for="gjl">钙剂量(ml)</label>
  190. <div class="content">
  191. <input
  192. type="text"
  193. id="gjl"
  194. class="inputBox"
  195. v-model="dialysisPrescription.anticoagulant_gaijiliang"
  196. />
  197. </div>
  198. </div>
  199. <!-- <div class="item">
  200. <label class="name" for="gtz">干体重(kg)</label>
  201. <div class="content">
  202. <input type="tel" @focus="inputFocus" id="gtz" v-model="dialysisPrescription.dry_weight"/>
  203. </div>
  204. </div>-->
  205. <div class="line"></div>
  206. <div class="item" v-if="isShow('置换量')" v-show="zhiShow">
  207. <label class="name" for="zhy">置换量(L)</label>
  208. <div class="content">
  209. <input
  210. type="number"
  211. @click="newClick($event)"
  212. @focus="inputFocus"
  213. id="zhy"
  214. v-model="dialysisPrescription.replacement_total"
  215. />
  216. </div>
  217. </div>
  218. <!-- <div class="line"></div> -->
  219. <div class="item" v-if="isShow('钾')">
  220. <label class="name" for="j">钾(mmol/L)</label>
  221. <div class="content">
  222. <input type="number" @click="newClick($event)" @focus="inputFocus" id="j" v-model="dialysisPrescription.kalium" />
  223. </div>
  224. </div>
  225. <div class="item" v-if="isShow('钠')">
  226. <label class="name" for="n">钠(mmol/L):</label>
  227. <div class="content">
  228. <input type="number" @click="newClick($event)" @focus="inputFocus" id="n" v-model="dialysisPrescription.sodium" />
  229. </div>
  230. </div>
  231. <div class="item" v-if="isShow('钙')">
  232. <label class="name" for="gg">钙(mmol/L)</label>
  233. <div class="content">
  234. <input
  235. type="number"
  236. @click="newClick($event)"
  237. @focus="inputFocus"
  238. id="gg"
  239. v-model="dialysisPrescription.calcium"
  240. />
  241. </div>
  242. </div>
  243. <div class="item" v-if="isShow('碳酸氢盐')">
  244. <label class="name" for="tsqy">碳酸氢盐(mmol/L)</label>
  245. <div class="content">
  246. <input
  247. type="number"
  248. @click="newClick($event)"
  249. @focus="inputFocus"
  250. id="tsqy"
  251. v-model="dialysisPrescription.bicarbonate"
  252. />
  253. </div>
  254. </div>
  255. <div class="item" v-if="isShow('葡萄糖')">
  256. <label class="name" for="ptt">葡萄糖(mmol/L)</label>
  257. <div class="content">
  258. <input
  259. type="number"
  260. @click="newClick($event)"
  261. @focus="inputFocus"
  262. id="ptt"
  263. v-model="dialysisPrescription.glucose"
  264. />
  265. </div>
  266. </div>
  267. <div class="line"></div>
  268. <div class="item" v-if="isShow('透析液流量')">
  269. <label class="name" for="txyll">透析液流量(ml/min)</label>
  270. <div class="content">
  271. <input
  272. type="number"
  273. @click="newClick($event)"
  274. @focus="inputFocus"
  275. id="txyll"
  276. v-model="dialysisPrescription.dialysate_flow"
  277. />
  278. </div>
  279. </div>
  280. <div class="item" v-if="isShow('透析液温度')">
  281. <label class="name" for="txywd">透析液温度(℃)</label>
  282. <div class="content">
  283. <!--<span class="text">HD</span>-->
  284. <!--<span class="iconfont">&#xe6f9;</span>-->
  285. <input
  286. type="number"
  287. @click="newClick($event)"
  288. @focus="inputFocus"
  289. id="txywd"
  290. v-model="dialysisPrescription.dialysate_temperature"
  291. />
  292. </div>
  293. </div>
  294. <div class="item" v-if="isShow('电导度')">
  295. <label class="name" for="dtl">电导度(mS/m)</label>
  296. <div class="content">
  297. <input
  298. type="number"
  299. @click="newClick($event)"
  300. @focus="inputFocus"
  301. id="dtl"
  302. v-model="dialysisPrescription.conductivity"
  303. />
  304. </div>
  305. </div>
  306. <div class="item" v-if="isShow('透析器/灌流器')">
  307. <label class="name" for="dtl">透析器/灌流器</label>
  308. <div class="content">
  309. <input
  310. @focus="inputFocus"
  311. id="dt"
  312. v-model="dialysisPrescription.dialyzer_perfusion_apparatus"
  313. />
  314. </div>
  315. </div>
  316. <div class="line"></div>
  317. <div
  318. @click="showSubMenu('body_fluid')"
  319. class="item"
  320. ref="body_fluid"
  321. v-if="isShow('体液过多症状')"
  322. >
  323. <label class="name" for="knj">体液过多症状</label>
  324. <div class="content">
  325. <span class="text" id="knja">{{getBodyFluid(dialysisPrescription.body_fluid)}}</span>
  326. <span class="iconfont">&#xe6f9;</span>
  327. </div>
  328. </div>
  329. <div class="item" v-if="isShow('体液过多其他症状')">
  330. <label class="name" for="knj">体液过多其他症状</label>
  331. <div class="content">
  332. <input @focus="inputFocus" id="dt" v-model="dialysisPrescription.body_fluid_other" />
  333. </div>
  334. </div>
  335. <div
  336. @click="showSubMenu('special_medicine')"
  337. class="item"
  338. ref="special_medicine"
  339. v-if="isShow('透析前使用特殊药物')"
  340. >
  341. <label class="name" for="knj">透析前使用特殊药物</label>
  342. <div class="content">
  343. <span
  344. class="text"
  345. id="knjaa"
  346. >{{getSpecialMedicine(dialysisPrescription.special_medicine)}}</span>
  347. <span class="iconfont">&#xe6f9;</span>
  348. </div>
  349. </div>
  350. <div class="item" v-if="isShow('透析前使用其他特殊药物')">
  351. <label class="name" for="knj">透析前使用其他特殊药物</label>
  352. <div class="content">
  353. <input
  354. @focus="inputFocus"
  355. id="dt"
  356. v-model="dialysisPrescription.special_medicine_other"
  357. />
  358. </div>
  359. </div>
  360. <div
  361. @click="showSubMenu('displace_liqui_part')"
  362. class="item"
  363. ref="displace_liqui_part"
  364. v-if="isShow('置换液')"
  365. v-show="huShow"
  366. >
  367. <label class="name" for="knj" v-if="this.$store.getters.user.template_info.template_id != 6">置换液</label>
  368. <label class="name" for="knj" v-if="this.$store.getters.user.template_info.template_id == 6">置换方式</label>
  369. <div class="content">
  370. <span
  371. class="text"
  372. id="knjaa"
  373. >{{getDisplaceLiquiPart(dialysisPrescription.displace_liqui_part)}}</span>
  374. <span class="iconfont">&#xe6f9;</span>
  375. </div>
  376. </div>
  377. <div class="item" v-if="isShow('置换液总量')" v-show="totalShow">
  378. <label class="name" for="knj">置换液总量(L)</label>
  379. <div class="content">
  380. <input
  381. @focus="inputFocus"
  382. id="dt"
  383. v-model="dialysisPrescription.displace_liqui_value"
  384. />
  385. </div>
  386. </div>
  387. <div class="item" v-if="isShow('目标KT/V')">
  388. <label class="name" for="knj">目标KT/V</label>
  389. <div class="content">
  390. <input @focus="inputFocus" id="dt" v-model="dialysisPrescription.target_ktv" />
  391. </div>
  392. </div>
  393. <div
  394. @click="showSubMenu('blood_access')"
  395. class="item"
  396. ref="blood_access"
  397. v-if="isShow('血管通路')"
  398. >
  399. <label class="name" for="knj">血管通路</label>
  400. <div class="content">
  401. <span class="text" id="knjaa">{{getBloodAccess(dialysisPrescription.blood_access)}}</span>
  402. <span class="iconfont">&#xe6f9;</span>
  403. </div>
  404. </div>
  405. <div class="item" v-if="isShow('实际超滤量')">
  406. <label class="name" for="knj">实际超滤量(L)</label>
  407. <div class="content">
  408. <input @focus="inputFocus" id="dt" v-model="dialysisPrescription.ultrafiltration" />
  409. </div>
  410. </div>
  411. <div
  412. @click="dialysisGoodsClick()"
  413. class="item"
  414. ref="consumable_material"
  415. v-if="config.is_open == 1"
  416. >
  417. <label class="name" for="knj">透析耗材</label>
  418. <div class="content">
  419. <span class="text" id="knjaa"></span>
  420. <span class="iconfont">&#xe6f9;</span>
  421. </div>
  422. </div>
  423. <div class="item" style="display: none">
  424. <label class="name" for="dtl">医生签名</label>
  425. <div class="content">
  426. <div v-if="isShowDesc">医生尚未签名</div>
  427. <img
  428. v-if="isShowDoctorSign"
  429. style="width: 100px;height: 30px"
  430. :src="signUrl"
  431. alt
  432. srcset
  433. />
  434. </div>
  435. </div>
  436. <div class="line"></div>
  437. <div>
  438. <div class="item">
  439. <label class="name" for="bz">备注</label>
  440. <div class="content">
  441. <span class="text"></span>
  442. </div>
  443. </div>
  444. <textarea
  445. class="textarea"
  446. id="bz"
  447. placeholder="请输入内容"
  448. v-model="dialysisPrescription.remark"
  449. @focus="lastInputFocus"
  450. @blur="lastInputBlur"
  451. ></textarea>
  452. </div>
  453. </div>
  454. <!--<div class="footer">-->
  455. <!--处方医生:刘小军 医生-->
  456. <!--</div>-->
  457. <div class="PrescSubmit">
  458. <button style="display: none" class="tj" @click="sign()">医生签名</button>
  459. <button class="tjcq" @click="commitSolutionInfo" v-if="isPermission()">保存并设为长期处方</button>
  460. <button class="tj" style="display:none;" @click="commitInfo" v-if="isPermission()">保存</button>
  461. </div>
  462. </div>
  463. </div>
  464. <!--<two-menu title="二级菜单" v-show="isShowModeSubMenu"></two-menu>-->
  465. <check-box-sub-menu
  466. :visibility="visibility"
  467. v-on:menu-cancle="menuCancle"
  468. v-on:menu-comfirm="menuComfirm"
  469. v-on:menu-empty="menuEmpty"
  470. :propsForm="propForm"
  471. ></check-box-sub-menu>
  472. <!--<multiple-sub-menu :goodTypes="types" :visibility="is_show" v-on:menu-cancle="menuCancle" v-on:menu-comfirm="menuComfirm" :propsForm="propForm"></multiple-sub-menu>-->
  473. <multiple-sub-menu
  474. :goodTypes="types"
  475. :info="info"
  476. :visibility="is_show"
  477. v-on:menu-cancel-two="menuCancleTwo"
  478. v-on:menu-comfirm-two="menuComfirmTwo"
  479. :propsForm="propForm"
  480. :dialysisPrescription="dialysisPrescription"
  481. ></multiple-sub-menu>
  482. <mt-datetime-picker
  483. ref="picker"
  484. type="time"
  485. hourFormat="{value}小时"
  486. minuteFormat="{value}分钟"
  487. @confirm="handleTimeConfirm"
  488. v-model="time"
  489. ></mt-datetime-picker>
  490. <long-advice-sub-menu
  491. :visibility="advice_visibility"
  492. v-on:menu-cancle-three="menuCancleThree"
  493. v-on:menu-comfirm-three="menuComfirmThree"
  494. :propsForm="advicePropForm"
  495. ></long-advice-sub-menu>
  496. <msg-tip
  497. :visibility="msgtip_visibility"
  498. :predialysis="predialysis"
  499. :last_predialysis="last_predialysis"
  500. :record="record"
  501. :dry_weight="dry_weight"
  502. :last_record="last_record"
  503. :patient_prop="patient"
  504. :prescription_prop="prescription_prop"
  505. v-on:menu-msg-tip="menuMsgTip"
  506. ></msg-tip>
  507. </div>
  508. </template>
  509. <script>
  510. import CheckBoxSubMenu from './subMenu/checkBoxSubMenu'
  511. import MultipleSubMenu from './subMenu/multipleSubMenu'
  512. import {commitDialysisPrescription, CreateGroupAdvice, GetSolution, postSign, postSolution} from '@/api/dialysis'
  513. import { calculateAnticoagulantZL} from '@/utils/tools'
  514. import {Toast} from 'vant'
  515. import {getDataConfig} from '@/utils/data'
  516. import {parseTime} from '@/utils'
  517. import LongAdviceSubMenu from './subMenu/LongAdviceSubMenu'
  518. import MsgTip from './subMenu/MsgTip'
  519. export default {
  520. name: 'PrescriptionDialog',
  521. props: {
  522. admin_users_prop: {
  523. type: Array,
  524. default: function () {
  525. return new Array()
  526. }
  527. },
  528. system_prescription:{
  529. type: Object
  530. },
  531. predialysis: {
  532. type: Object
  533. },
  534. last_predialysis: {
  535. type: Object
  536. },
  537. record: {
  538. type: Object
  539. },
  540. last_record: {
  541. type: Object
  542. },
  543. patient_prop: {
  544. type: Object
  545. },
  546. solution_prop: {
  547. type: Object
  548. },
  549. config: {
  550. type: Object
  551. }, schedual: {
  552. type: Object
  553. }, dry_weight: {
  554. type: Object
  555. },
  556. operators: {
  557. type: Array,
  558. default: function () {
  559. return new Array()
  560. }
  561. },
  562. types: {
  563. type: Array,
  564. default: function () {
  565. return new Array()
  566. }
  567. },
  568. info: {
  569. type: Array,
  570. default: function () {
  571. return new Array()
  572. }
  573. }, last_prescription: {
  574. type: Object,
  575. },
  576. prescription_prop: {
  577. type: Object,
  578. }, is_open: {
  579. type: Number,
  580. }, targetAdvices: {
  581. type: Array,
  582. default: function () {
  583. return new Array()
  584. }
  585. }, waitUploadAdvices: {
  586. type: Array,
  587. default: function () {
  588. return new Array()
  589. }
  590. },
  591. machines_prop: {
  592. type: Array,
  593. default: function () {
  594. return new Array()
  595. }
  596. }
  597. },
  598. data () {
  599. return {
  600. is_pre: 0,
  601. template_id: 0,
  602. loading: false,
  603. signUrl: '',
  604. isShowDesc: true,
  605. advice_visibility: false,
  606. msgtip_visibility: false,
  607. time: '03:00',
  608. timeValue: '',
  609. tempTimeValue:'',
  610. isShowSign: false,
  611. anticoagulantsConfit: {},
  612. dialysateFormulationOptions: [],
  613. bodyFluidOptions: [],
  614. specialMedicineOptions: [],
  615. displaceLiquiPartOptions: [],
  616. bloodAccessOptions: [],
  617. advicePropForm: {
  618. list: [],
  619. result: [],
  620. operators: [],
  621. },
  622. is_show: false,
  623. perfusion_apparatus: {},
  624. replacementWays: [],
  625. dialyserList: [],
  626. modeOption: [],
  627. isShowDoctorBtn: true,
  628. isShowDoctorSign: false,
  629. visibility: false,
  630. isShowDialog: true,
  631. isShowModeSubMenu: false,
  632. dialysisPrescription: {
  633. mode_id: '',
  634. dialysis_duration: '',
  635. dialysis_duration_hour: '',
  636. dialysis_duration_minute: '',
  637. mode_name: '',
  638. dialyzer: '',
  639. perfusion_apparatus: '',
  640. blood_flow_volume: '',
  641. dewater_amount: '',
  642. displace_liqui: '',
  643. replacement_total: '',
  644. replacement_way: '',
  645. anticoagulant: '',
  646. anticoagulant_shouji: '',
  647. anticoagulant_weichi: '',
  648. anticoagulant_zongliang: '',
  649. anticoagulant_gaimingcheng: '',
  650. anticoagulant_gaijiliang: '',
  651. dialyzer_perfusion_apparatus: '',
  652. no_anticoagulant_shouji: '0',
  653. no_anticoagulant_weichi: '0',
  654. no_anticoagulant_zongliang: '0',
  655. kalium: '',
  656. sodium: '',
  657. calcium: '',
  658. bicarbonate: '',
  659. glucose: '',
  660. prescription_doctor: '',
  661. // dry_weight: "",
  662. dialysate_flow: '',
  663. dialysate_temperature: '',
  664. target_ultrafiltration: '',
  665. dialysate_formulation: '',
  666. conductivity: '',
  667. doctor: '',
  668. remark: '',
  669. body_fluid: '',
  670. special_medicine: '',
  671. special_medicine_other: '',
  672. displace_liqui_part: '',
  673. displace_liqui_value: '',
  674. blood_access: '',
  675. ultrafiltration: '',
  676. body_fluid_other: '',
  677. niprocart: '',
  678. jms: '',
  679. fistula_needle_set: '',
  680. fistula_needle_set_16: '',
  681. hemoperfusion: '',
  682. dialyser_sterilised: '',
  683. filtryzer: '',
  684. target_ktv: '',
  685. dialyzers: '',
  686. injector: '',
  687. bloodlines: '',
  688. tubing_hemodialysis: '',
  689. package: '',
  690. a_liquid: '',
  691. creater: '',
  692. modifier: '',
  693. },
  694. anticoagulant: {
  695. id: 0,
  696. name: '',
  697. type: 1,
  698. shouji: 1,
  699. weichi: 1,
  700. zongliang: 1,
  701. gaimingcheng: -1,
  702. gaijiliang: -1,
  703. shouji_unit: 'mg',
  704. weichi_unit: 'mg/h',
  705. zongliang_unit: 'mg',
  706. gaimingcheng_unit: '',
  707. gaijiliang_unit: ''
  708. },
  709. zhiShow: true,
  710. totalShow: true,
  711. huShow: true,
  712. doctorAdvices: [],
  713. propForm: {
  714. title: '',
  715. list: [],
  716. optionList: [],
  717. isMultiple: 2,
  718. result: [], //选中的值
  719. type: 1, //用来区分不同子菜单,方便对返回值进行赋值
  720. selectId: 0
  721. }
  722. }
  723. }, computed: {
  724. // 计算属性的 getter
  725. }, methods: {
  726. newClick(event){
  727. event.currentTarget.select();
  728. },
  729. showmsgtip () {
  730. this.msgtip_visibility = true
  731. this.isShowDialog = false
  732. },
  733. isPermission () {
  734. if (this.$store.getters.user.user.user_type == 3 && (this.$store.getters.user.template_info.template_id == 2 || this.$store.getters.user.template_info.template_id == 6)) {
  735. return false
  736. } else {
  737. return true
  738. }
  739. },
  740. isShow (name) {
  741. var filedList = this.$store.getters.user.fileds
  742. for (let i = 0; i < filedList.length; i++) {
  743. if (filedList[i].module == 1 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
  744. return true
  745. }
  746. }
  747. return false
  748. },
  749. openPicker: function () {
  750. this.$refs.picker.open()
  751. },
  752. handleTimeConfirm: function (val) {
  753. val = val.replace('小时')
  754. val = val.replace('分钟')
  755. let timeArray = val.split(':')
  756. if (parseInt(timeArray[0].substring(0, 1)) == 0) {
  757. this.dialysisPrescription.dialysis_duration_hour = timeArray[0].charAt(timeArray[0].length - 1)
  758. } else {
  759. this.dialysisPrescription.dialysis_duration_hour = timeArray[0]
  760. }
  761. if (parseInt(timeArray[1].substring(0, 1)) == 0) {
  762. this.dialysisPrescription.dialysis_duration_minute = timeArray[1].charAt(timeArray[1].length - 1)
  763. } else {
  764. this.dialysisPrescription.dialysis_duration_minute = timeArray[1]
  765. }
  766. this.timeValue = this.dialysisPrescription.dialysis_duration_hour + '小时' + this.dialysisPrescription.dialysis_duration_minute + '分钟'
  767. this.dialysisPrescription.dialysis_duration = parseFloat(this.dialysisPrescription.dialysis_duration_hour) + parseFloat((this.dialysisPrescription.dialysis_duration_minute / 60).toFixed(2))
  768. },
  769. inputFocus: function (event) {
  770. var input = event.target
  771. setTimeout(function () {
  772. input.scrollIntoView()
  773. }, 0)
  774. if (input.setSelectionRange) {
  775. setTimeout(function () {
  776. input.setSelectionRange(0, input.value.length)
  777. }, 0)
  778. } else if (input.createTextRange) {
  779. var rng = input.createTextRange()
  780. rng.move('character', input.value.length)
  781. rng.select()
  782. }
  783. },
  784. lastInputFocus: function (event) {
  785. var input = event.target
  786. event.currentTarget.select();
  787. setTimeout(function () {
  788. input.style.marginBottom = '2rem'
  789. input.parentNode.scrollIntoView()
  790. }, 0)
  791. },
  792. lastInputBlur: function (event) {
  793. var input = event.target
  794. setTimeout(function () {
  795. input.style.marginBottom = ''
  796. }, 0)
  797. },
  798. showSubMenu: function (val) {
  799. switch (val) {
  800. case 'mode':
  801. this.propForm.type = 1
  802. this.isShowDialog = false
  803. this.propForm.title = '透析模式'
  804. this.visibility = true
  805. this.propForm.list = []
  806. this.propForm.optionList = this.modeOption
  807. this.propForm.isMultiple = 1
  808. this.propForm.selectId = this.dialysisPrescription.mode_id
  809. this.propForm.click_ref = 'mode'
  810. break
  811. case 'dialyzer':
  812. this.propForm.type = 2
  813. this.isShowDialog = false
  814. this.propForm.title = '透析器'
  815. this.visibility = true
  816. this.propForm.list = []
  817. this.propForm.optionList = this.machines_prop
  818. this.propForm.isMultiple = 1
  819. this.propForm.selectId = this.dialysisPrescription.dialyzer
  820. this.propForm.click_ref = 'dialyzer'
  821. break
  822. case 'perfusion_apparatus':
  823. this.propForm.type = 3
  824. this.isShowDialog = false
  825. this.propForm.title = '灌流器'
  826. this.visibility = true
  827. this.propForm.list = []
  828. this.propForm.optionList = this.perfusion_apparatus
  829. this.propForm.isMultiple = 1
  830. this.propForm.selectId = this.dialysisPrescription.perfusion_apparatus
  831. this.propForm.click_ref = 'perfusion_apparatus'
  832. break
  833. case 'replacement_way':
  834. this.propForm.type = 4
  835. this.isShowDialog = false
  836. this.propForm.title = '置换方式'
  837. this.visibility = true
  838. this.propForm.list = []
  839. this.propForm.optionList = this.replacementWays
  840. this.propForm.isMultiple = 1
  841. this.propForm.selectId = this.dialysisPrescription.replacement_way
  842. this.propForm.click_ref = 'replacement_way'
  843. break
  844. case 'anticoagulant':
  845. this.propForm.type = 5
  846. this.isShowDialog = false
  847. this.propForm.title = '抗疑剂'
  848. this.visibility = true
  849. this.propForm.list = []
  850. this.propForm.optionList = this.anticoagulantsConfit
  851. this.propForm.isMultiple = 1
  852. this.propForm.selectId = this.dialysisPrescription.anticoagulant
  853. this.propForm.click_ref = 'anticoagulant'
  854. break
  855. case 'dialysate_formulation':
  856. this.propForm.type = 6
  857. this.isShowDialog = false
  858. this.propForm.title = '透析液配方'
  859. this.visibility = true
  860. this.propForm.list = []
  861. this.propForm.optionList = this.dialysateFormulationOptions
  862. this.propForm.isMultiple = 1
  863. this.propForm.selectId = this.dialysisPrescription.dialysate_formulation
  864. this.propForm.click_ref = 'dialysate_formulation'
  865. break
  866. case 'body_fluid':
  867. this.propForm.type = 7
  868. this.isShowDialog = false
  869. this.propForm.title = '体液过多症状'
  870. this.visibility = true
  871. this.propForm.list = []
  872. this.propForm.optionList = this.bodyFluidOptions
  873. this.propForm.isMultiple = 1
  874. this.propForm.selectId = this.dialysisPrescription.body_fluid
  875. this.propForm.click_ref = 'body_fluid'
  876. break
  877. case 'special_medicine':
  878. this.propForm.type = 8
  879. this.isShowDialog = false
  880. this.propForm.title = '透析前使用特殊药物'
  881. this.visibility = true
  882. this.propForm.list = []
  883. this.propForm.optionList = this.specialMedicineOptions
  884. this.propForm.isMultiple = 1
  885. this.propForm.selectId = this.dialysisPrescription.special_medicine
  886. this.propForm.click_ref = 'special_medicine'
  887. break
  888. case 'displace_liqui_part':
  889. this.propForm.type = 9
  890. this.isShowDialog = false
  891. this.propForm.title = '置换液'
  892. this.visibility = true
  893. this.propForm.list = []
  894. this.propForm.optionList = this.displaceLiquiPartOptions
  895. this.propForm.isMultiple = 1
  896. this.propForm.selectId = this.dialysisPrescription.displace_liqui_part
  897. this.propForm.click_ref = 'displace_liqui_part'
  898. break
  899. case 'blood_access':
  900. this.propForm.type = 10
  901. this.isShowDialog = false
  902. this.propForm.title = '血管通路'
  903. this.visibility = true
  904. this.propForm.list = []
  905. this.propForm.optionList = this.bloodAccessOptions
  906. this.propForm.isMultiple = 1
  907. this.propForm.selectId = this.dialysisPrescription.blood_access
  908. this.propForm.click_ref = 'blood_access'
  909. break
  910. case 'dialyzer_perfusion_apparatus':
  911. // this.propForm.type = 11
  912. // this.isShowDialog = false
  913. // this.propForm.title = '透析器/灌流器'
  914. // this.visibility = true
  915. // this.propForm.list = []
  916. // this.propForm.optionList = this.bloodAccessOptions
  917. // this.propForm.isMultiple = 1
  918. // this.propForm.selectId = this.dialysisPrescription.dialyzer_perfusion_apparatus
  919. // this.propForm.click_ref = 'dialyzer_perfusion_apparatus'
  920. // break
  921. this.propForm.result = []
  922. this.isHasOther = 2
  923. this.propForm.type = 11
  924. this.isShowDialog = false
  925. this.propForm.title = '透析器/灌流器'
  926. this.visibility = true
  927. this.propForm.list = []
  928. this.propForm.list = getDataConfig('hemodialysis', 'dialyzer_perfusion_apparatus')
  929. this.propForm.optionList = []
  930. this.propForm.isMultiple = 2
  931. // this.propForm.result = typeof(this.formValue.hemorrhage) == "string"? this.formValue.hemorrhage.split(","):[]
  932. if (this.dialysisPrescription.dialyzer_perfusion_apparatus != undefined || this.dialysisPrescription.dialyzer_perfusion_apparatus != null) {
  933. if (this.dialysisPrescription.dialyzer_perfusion_apparatus.length > 0) {
  934. this.propForm.result = this.dialysisPrescription.dialyzer_perfusion_apparatus.split(',')
  935. } else {
  936. this.propForm.result = []
  937. }
  938. } else {
  939. this.propForm.result = []
  940. }
  941. this.propForm.click_ref = 'dialyzer_perfusion_apparatus'
  942. break
  943. }
  944. },
  945. menuCancle: function () {
  946. this.visibility = false
  947. this.isShowDialog = true
  948. this.$nextTick(() => {
  949. if (this.$refs[this.propForm.click_ref] != undefined && this.$refs[this.propForm.click_ref] != null) {
  950. this.$refs[this.propForm.click_ref].scrollIntoView()
  951. }
  952. })
  953. },
  954. menuCancleThree: function () {
  955. this.advice_visibility = false
  956. this.isShowDialog = true
  957. },
  958. menuMsgTip: function () {
  959. this.msgtip_visibility = false
  960. this.isShowDialog = true
  961. },
  962. menuComfirmThree: function (targetAdvices) {
  963. if (targetAdvices.length > 0) {
  964. if (this.is_pre == 1) {
  965. Toast.loading({forbidClick: true, duration: 0})
  966. let ParamsQuery = this.dialysisPrescription
  967. ParamsQuery['patient'] = this.$route.query.patient_id
  968. ParamsQuery['record_date'] = this.record_date
  969. commitDialysisPrescription(ParamsQuery).then(response => {
  970. if (response.data.state == 0) {
  971. Toast.fail(response.data.msg)
  972. return false
  973. } else {
  974. var date = new Date();
  975. var year = date.getFullYear();
  976. var month = date.getMonth() + 1;
  977. var day = date.getDate();
  978. var hours = date.getHours();
  979. var minites = date.getMinutes();
  980. if (month < 10) {
  981. month = "0" + month;
  982. }
  983. if (day < 10) {
  984. day = "0" + day;
  985. }
  986. if (hours < 10) {
  987. hours = "0" + hours;
  988. }
  989. if (minites < 10) {
  990. minites = "0" + minites;
  991. }
  992. var nowDate = year + "-" + month + "-" + day +" " +hours+":"+ minites;
  993. Toast.success('提交成功')
  994. let params = {
  995. advices: targetAdvices,
  996. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  997. advice_doctor: targetAdvices[0].advice_doctor,
  998. advice_type: targetAdvices[0].advice_type,
  999. parent_id: this.$route.query.patient_id,
  1000. start_time: nowDate,
  1001. remark: '',
  1002. }
  1003. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
  1004. var resp = rs.data
  1005. if (resp.state == 1) {
  1006. this.$emit('prescription', response.data.data.prescription,resp.data.advices)
  1007. } else {
  1008. }
  1009. })
  1010. this.finish()
  1011. }
  1012. }).catch(error => {
  1013. Toast.fail("请求失败")
  1014. });
  1015. } else if (this.is_pre == 2) {
  1016. Toast.loading({forbidClick: true, duration: 0})
  1017. let ParamsQuery = this.dialysisPrescription
  1018. ParamsQuery['patient'] = this.$route.query.patient_id
  1019. ParamsQuery['record_date'] = this.record_date
  1020. postSolution(ParamsQuery).then(response => {
  1021. if (response.data.state == 0) {
  1022. Toast.fail(response.data.msg)
  1023. return false
  1024. } else {
  1025. Toast.success('提交成功')
  1026. var date = new Date();
  1027. var year = date.getFullYear();
  1028. var month = date.getMonth() + 1;
  1029. var day = date.getDate();
  1030. var hours = date.getHours();
  1031. var minites = date.getMinutes();
  1032. if (month < 10) {
  1033. month = "0" + month;
  1034. }
  1035. if (day < 10) {
  1036. day = "0" + day;
  1037. }
  1038. if (hours < 10) {
  1039. hours = "0" + hours;
  1040. }
  1041. if (minites < 10) {
  1042. minites = "0" + minites;
  1043. }
  1044. var nowDate = year + "-" + month + "-" + day +" " +hours+":"+ minites;
  1045. let params = {
  1046. advices: targetAdvices,
  1047. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  1048. advice_doctor: targetAdvices[0].advice_doctor,
  1049. advice_type: targetAdvices[0].advice_type,
  1050. parent_id: this.$route.query.patient_id,
  1051. start_time: nowDate,
  1052. remark: '',
  1053. }
  1054. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
  1055. var resp = rs.data
  1056. if (resp.state == 1) {
  1057. this.$emit('prescription', response.data.data.prescription,resp.data.advices)
  1058. this.$emit('longSolution', response.data.data.solution,resp.data.advices)
  1059. } else {
  1060. }
  1061. })
  1062. this.finish()
  1063. }
  1064. }).catch(error => {
  1065. Toast.fail("请求失败")
  1066. });
  1067. }
  1068. } else {
  1069. if (this.is_pre == 1) {
  1070. Toast.loading({forbidClick: true, duration: 0})
  1071. let ParamsQuery = this.dialysisPrescription
  1072. ParamsQuery['patient'] = this.$route.query.patient_id
  1073. ParamsQuery['record_date'] = this.record_date
  1074. commitDialysisPrescription(ParamsQuery).then(response => {
  1075. if (response.data.state == 0) {
  1076. Toast.fail(response.data.msg)
  1077. return false
  1078. } else {
  1079. Toast.success('提交成功')
  1080. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1081. this.finish()
  1082. }
  1083. })
  1084. } else if (this.is_pre == 2) {
  1085. Toast.loading({forbidClick: true, duration: 0})
  1086. let ParamsQuery = this.dialysisPrescription
  1087. ParamsQuery['patient'] = this.$route.query.patient_id
  1088. ParamsQuery['record_date'] = this.record_date
  1089. postSolution(ParamsQuery).then(response => {
  1090. if (response.data.state == 0) {
  1091. Toast.fail(response.data.msg)
  1092. return false
  1093. } else {
  1094. Toast.success('提交成功')
  1095. this.$emit('longSolution', response.data.data.solution, this.doctorAdvices)
  1096. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1097. this.finish()
  1098. }
  1099. }).catch(error => {
  1100. Toast.fail("请求失败")
  1101. });
  1102. }
  1103. }
  1104. },
  1105. menuComfirm: function (val) {
  1106. this.visibility = false
  1107. this.isShowDialog = true
  1108. this.$nextTick(() => {
  1109. if (this.$refs[this.propForm.click_ref] != undefined && this.$refs[this.propForm.click_ref] != null) {
  1110. this.$refs[this.propForm.click_ref].scrollIntoView()
  1111. }
  1112. })
  1113. switch (val.type) {
  1114. case 1:
  1115. Toast.loading({forbidClick: true, duration: 0, message: '切换模式中,请稍候',})
  1116. //从服务器获取对应模式的长期处方
  1117. let ParamsQuery = {}
  1118. ParamsQuery['patient_id'] = this.$route.query.patient_id
  1119. ParamsQuery['mode_id'] = val.selectId
  1120. GetSolution(ParamsQuery).then(response => {
  1121. if (response.data.state == 0) {
  1122. Toast.fail(response.data.msg)
  1123. return false
  1124. } else {
  1125. Toast.success('切换成功')
  1126. if (response.data.data.solution != null) {
  1127. for (const key in response.data.data.solution) { //长期处方不为空
  1128. if (key != 'target_ultrafiltration') {
  1129. this.dialysisPrescription[key] = response.data.data.solution[key]
  1130. }
  1131. }
  1132. } else {
  1133. if (response.data.data.prescription != null) { //临时处方不为空
  1134. for (const key in response.data.data.prescription) {
  1135. if (key != 'target_ultrafiltration') {
  1136. this.dialysisPrescription[key] = response.data.data.prescription[key]
  1137. }
  1138. }
  1139. } else if(response.data.data.system_prescription != null){
  1140. for (const key in response.data.data.system_prescription) {
  1141. if (key != 'target_ultrafiltration') {
  1142. this.dialysisPrescription[key] = response.data.data.system_prescription[key]
  1143. }
  1144. }
  1145. } else {
  1146. for (const key in this.dialysisPrescription) { //临时处方为空
  1147. if (key != 'target_ultrafiltration') {
  1148. this.dialysisPrescription[key] = ''
  1149. }
  1150. }
  1151. this.dialysisPrescription.mode_id = val.selectId
  1152. }
  1153. }
  1154. }
  1155. if (this.dialysisPrescription.dialysis_duration_hour === '' || this.dialysisPrescription.dialysis_duration_minute === '') {
  1156. this.timeValue = ''
  1157. this.time = '03:00'
  1158. } else {
  1159. this.timeValue = this.dialysisPrescription.dialysis_duration_hour + '小时' + this.dialysisPrescription.dialysis_duration_minute + '分钟'
  1160. this.time = (this.dialysisPrescription.dialysis_duration_hour > 10 ? this.dialysisPrescription.dialysis_duration_hour : '0' + this.dialysisPrescription.dialysis_duration_hour) + ':' + (this.dialysisPrescription.dialysis_duration_minute > 10 ? this.dialysisPrescription.dialysis_duration_minute : '0' + this.dialysisPrescription.dialysis_duration_minute)
  1161. }
  1162. }).catch(error => {
  1163. Toast.fail("请求失败")
  1164. });
  1165. break
  1166. case 2:
  1167. this.dialysisPrescription.dialyzer = val.selectId
  1168. break
  1169. case 3:
  1170. this.dialysisPrescription.perfusion_apparatus = val.selectId
  1171. break
  1172. case 4:
  1173. this.dialysisPrescription.replacement_way = val.selectId
  1174. break
  1175. case 5:
  1176. this.dialysisPrescription.anticoagulant = val.selectId
  1177. if (typeof this.anticoagulantsConfit[val.selectId] == 'undefined' || this.anticoagulantsConfit[val.selectId] == null) {
  1178. return
  1179. }
  1180. this.anticoagulant = this.anticoagulantsConfit[val.selectId]
  1181. break
  1182. case 6:
  1183. this.dialysisPrescription.dialysate_formulation = val.selectId
  1184. break
  1185. case 7:
  1186. this.dialysisPrescription.body_fluid = val.selectId
  1187. break
  1188. case 8:
  1189. this.dialysisPrescription.special_medicine = val.selectId
  1190. break
  1191. case 9:
  1192. this.dialysisPrescription.displace_liqui_part = val.selectId
  1193. break
  1194. case 10:
  1195. this.dialysisPrescription.blood_access = val.selectId
  1196. break
  1197. case 11:
  1198. this.dialysisPrescription.dialyzer_perfusion_apparatus = val.result.join(',')
  1199. break
  1200. }
  1201. },
  1202. GetModeByModeId: function (val) {
  1203. let treatment_mode_name = ''
  1204. let treatment_mode = this.modeOption
  1205. for (let keys in treatment_mode) {
  1206. if (treatment_mode[keys].id == val) {
  1207. treatment_mode_name = treatment_mode[keys].name
  1208. }
  1209. }
  1210. for (let keys in treatment_mode) {
  1211. if (treatment_mode[keys].id == val) {
  1212. treatment_mode_name = treatment_mode[keys].name
  1213. var treatment_mode_id = treatment_mode[keys].id
  1214. console.log("treatment_mode_id",treatment_mode_id)
  1215. if(treatment_mode_id === 1 || treatment_mode_id === 3 || treatment_mode_id === 4 || treatment_mode_id === 6 || treatment_mode_id === 7 || treatment_mode_id === 8 || treatment_mode_id === 9 || treatment_mode_id === 10 || treatment_mode_id === 11 || treatment_mode_id === 13 || treatment_mode_id === 14 || treatment_mode_id === 15 || treatment_mode_id === 16){
  1216. this.zhiShow = false
  1217. this.totalShow = false
  1218. this.huShow =false
  1219. }else{
  1220. this.zhiShow = true
  1221. this.totalShow = true
  1222. this.huShow = true
  1223. }
  1224. }
  1225. }
  1226. return treatment_mode_name
  1227. },
  1228. GetDialysateFormulationById: function (val) {
  1229. let name = ''
  1230. let dfl = this.dialysateFormulationOptions.length
  1231. for (let index = 0; index < dfl; index++) {
  1232. if (this.dialysateFormulationOptions[index].id == val) {
  1233. name = this.dialysateFormulationOptions[index].name
  1234. break
  1235. }
  1236. }
  1237. return name
  1238. },
  1239. GetDialyzerById: function (val) {
  1240. let dialyzer_name = ''
  1241. let machines = this.machines_prop
  1242. for (let i = 0; i < machines.length; i++) {
  1243. if (machines[i].id == val) {
  1244. dialyzer_name = machines[i].name
  1245. }
  1246. }
  1247. return dialyzer_name
  1248. },
  1249. GetPerfusionApparatusById: function (val) {
  1250. let perfusion_apparatus_name = ''
  1251. let perfusion_apparatus = this.perfusion_apparatus
  1252. for (let i = 0; i < perfusion_apparatus.length; i++) {
  1253. if (perfusion_apparatus[i].id == val) {
  1254. perfusion_apparatus_name = perfusion_apparatus[i].name
  1255. }
  1256. }
  1257. return perfusion_apparatus_name
  1258. },
  1259. GetReplacementWayById: function (val) {
  1260. let replacement_ways_name = ''
  1261. let replacement_ways = this.replacementWays
  1262. for (let i = 0; i < replacement_ways.length; i++) {
  1263. if (replacement_ways[i].id == val) {
  1264. replacement_ways_name = replacement_ways[i].name
  1265. }
  1266. }
  1267. return replacement_ways_name
  1268. },
  1269. GetAnticoagulantById: function (val) {
  1270. let anticoagulan_name = ''
  1271. let anticoagulant = this.anticoagulantsConfit
  1272. for (let keys in anticoagulant) {
  1273. if (anticoagulant[keys].id == val) {
  1274. anticoagulan_name = anticoagulant[keys].name
  1275. }
  1276. }
  1277. return anticoagulan_name
  1278. },
  1279. commitInfo: function () {
  1280. if(this.dialysisPrescription.anticoagulant == 1){
  1281. this.dialysisPrescription.anticoagulant_weichi = '0'
  1282. this.dialysisPrescription.anticoagulant_shouji = '0'
  1283. this.dialysisPrescription.anticoagulant_zongliang = '0'
  1284. }
  1285. if (this.$store.getters.user.template_info.template_id == 6) {
  1286. if (this.dialysisPrescription.mode_id == 2) {
  1287. if (this.dialysisPrescription.displace_liqui_part == 0 || this.dialysisPrescription.displace_liqui_part == -2 || this.dialysisPrescription.displace_liqui_value == 0 || this.dialysisPrescription.displace_liqui_value == '') {
  1288. Toast.fail('HDF模式下置换方式和置换液总量不能为空!')
  1289. return
  1290. }
  1291. }
  1292. }
  1293. this.is_pre = 1
  1294. if (this.prescription_prop.id == '') {
  1295. if (this.is_open == 0) {
  1296. Toast.loading({forbidClick: true, duration: 0})
  1297. let ParamsQuery = this.dialysisPrescription
  1298. ParamsQuery['patient'] = this.$route.query.patient_id
  1299. ParamsQuery['record_date'] = this.record_date
  1300. commitDialysisPrescription(ParamsQuery).then(response => {
  1301. if (response.data.state == 0) {
  1302. Toast.fail(response.data.msg)
  1303. return false
  1304. } else {
  1305. Toast.success('提交成功')
  1306. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1307. this.finish()
  1308. }
  1309. }).catch(error => {
  1310. Toast.fail("请求失败")
  1311. });
  1312. } else if (this.is_open == 1) {
  1313. if (this.targetAdvices.length > 0) {
  1314. //弹框推送提醒
  1315. this.advicePropForm.list = this.targetAdvices
  1316. this.advicePropForm.operators = this.admin_users_prop
  1317. this.advice_visibility = true
  1318. this.isShowDialog = false
  1319. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  1320. if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
  1321. this.advicePropForm.result.push(this.advicePropForm.list[i].id)
  1322. }
  1323. }
  1324. } else {
  1325. Toast.loading({forbidClick: true, duration: 0})
  1326. let ParamsQuery = this.dialysisPrescription
  1327. ParamsQuery['patient'] = this.$route.query.patient_id
  1328. ParamsQuery['record_date'] = this.record_date
  1329. commitDialysisPrescription(ParamsQuery).then(response => {
  1330. if (response.data.state == 0) {
  1331. Toast.fail(response.data.msg)
  1332. return false
  1333. } else {
  1334. Toast.success('提交成功')
  1335. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1336. this.finish()
  1337. }
  1338. }).catch(error => {
  1339. Toast.fail("请求失败")
  1340. });
  1341. }
  1342. } else if (this.is_open == 2) {
  1343. if (this.waitUploadAdvices.length > 0) {
  1344. Toast.loading({forbidClick: true, duration: 0})
  1345. let ParamsQuery = this.dialysisPrescription
  1346. ParamsQuery['patient'] = this.$route.query.patient_id
  1347. ParamsQuery['record_date'] = this.record_date
  1348. commitDialysisPrescription(ParamsQuery).then(response => {
  1349. if (response.data.state == 0) {
  1350. Toast.fail(response.data.msg)
  1351. return false
  1352. } else {
  1353. Toast.success('提交成功')
  1354. var date = new Date();
  1355. var year = date.getFullYear();
  1356. var month = date.getMonth() + 1;
  1357. var day = date.getDate();
  1358. var hours = date.getHours();
  1359. var minites = date.getMinutes();
  1360. if (month < 10) {
  1361. month = "0" + month;
  1362. }
  1363. if (day < 10) {
  1364. day = "0" + day;
  1365. }
  1366. if (hours < 10) {
  1367. hours = "0" + hours;
  1368. }
  1369. if (minites < 10) {
  1370. minites = "0" + minites;
  1371. }
  1372. var nowDate = year + "-" + month + "-" + day +" " +hours+":"+ minites;
  1373. let params = {
  1374. advices: this.waitUploadAdvices,
  1375. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  1376. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  1377. advice_type: this.waitUploadAdvices[0].advice_type,
  1378. parent_id: this.$route.query.patient_id,
  1379. start_time: nowDate,
  1380. remark: '',
  1381. }
  1382. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
  1383. var resp = rs.data
  1384. if (resp.state == 1) {
  1385. this.$emit('prescription', response.data.data.prescription, resp.data.advices)
  1386. } else {
  1387. }
  1388. })
  1389. this.finish()
  1390. }
  1391. }).catch(error => {
  1392. Toast.fail("请求失败")
  1393. });
  1394. } else {
  1395. Toast.loading({forbidClick: true, duration: 0})
  1396. let ParamsQuery = this.dialysisPrescription
  1397. ParamsQuery['patient'] = this.$route.query.patient_id
  1398. ParamsQuery['record_date'] = this.record_date
  1399. commitDialysisPrescription(ParamsQuery).then(response => {
  1400. if (response.data.state == 0) {
  1401. Toast.fail(response.data.msg)
  1402. return false
  1403. } else {
  1404. this.advice_visibility = false
  1405. Toast.success('提交成功')
  1406. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1407. this.finish()
  1408. }
  1409. }).catch(error => {
  1410. Toast.fail("请求失败")
  1411. });
  1412. }
  1413. }
  1414. } else {
  1415. if (this.prescription_prop.creater == 0) {
  1416. if (this.is_open == 0) {
  1417. Toast.loading({forbidClick: true, duration: 0})
  1418. let ParamsQuery = this.dialysisPrescription
  1419. ParamsQuery['patient'] = this.$route.query.patient_id
  1420. ParamsQuery['record_date'] = this.record_date
  1421. commitDialysisPrescription(ParamsQuery).then(response => {
  1422. if (response.data.state == 0) {
  1423. Toast.fail(response.data.msg)
  1424. return false
  1425. } else {
  1426. Toast.success('提交成功')
  1427. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1428. this.finish()
  1429. }
  1430. }).catch(error => {
  1431. Toast.fail("请求失败")
  1432. });
  1433. } else if (this.is_open == 1) {
  1434. if (this.targetAdvices.length > 0) {
  1435. //弹框推送提醒
  1436. this.advicePropForm.list = this.targetAdvices
  1437. this.advicePropForm.operators = this.admin_users_prop
  1438. this.advice_visibility = true
  1439. this.isShowDialog = false
  1440. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  1441. if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
  1442. this.advicePropForm.result.push(this.advicePropForm.list[i].id)
  1443. }
  1444. }
  1445. } else {
  1446. Toast.loading({forbidClick: true, duration: 0})
  1447. let ParamsQuery = this.dialysisPrescription
  1448. ParamsQuery['patient'] = this.$route.query.patient_id
  1449. ParamsQuery['record_date'] = this.record_date
  1450. commitDialysisPrescription(ParamsQuery).then(response => {
  1451. if (response.data.state == 0) {
  1452. Toast.fail(response.data.msg)
  1453. return false
  1454. } else {
  1455. Toast.success('提交成功')
  1456. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1457. this.finish()
  1458. }
  1459. }).catch(error => {
  1460. Toast.fail("请求失败")
  1461. });
  1462. }
  1463. } else if (this.is_open == 2) {
  1464. if (this.waitUploadAdvices.length > 0) {
  1465. Toast.loading({forbidClick: true, duration: 0})
  1466. let ParamsQuery = this.dialysisPrescription
  1467. ParamsQuery['patient'] = this.$route.query.patient_id
  1468. ParamsQuery['record_date'] = this.record_date
  1469. commitDialysisPrescription(ParamsQuery).then(response => {
  1470. if (response.data.state == 0) {
  1471. Toast.fail(response.data.msg)
  1472. return false
  1473. } else {
  1474. var date = new Date();
  1475. var year = date.getFullYear();
  1476. var month = date.getMonth() + 1;
  1477. var day = date.getDate();
  1478. var hours = date.getHours();
  1479. var minites = date.getMinutes();
  1480. if (month < 10) {
  1481. month = "0" + month;
  1482. }
  1483. if (day < 10) {
  1484. day = "0" + day;
  1485. }
  1486. if (hours < 10) {
  1487. hours = "0" + hours;
  1488. }
  1489. if (minites < 10) {
  1490. minites = "0" + minites;
  1491. }
  1492. var nowDate = year + "-" + month + "-" + day +" " +hours+":"+ minites;
  1493. let params = {
  1494. advices: this.waitUploadAdvices,
  1495. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  1496. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  1497. advice_type: this.waitUploadAdvices[0].advice_type,
  1498. parent_id: this.$route.query.patient_id,
  1499. start_time: nowDate,
  1500. remark: '',
  1501. }
  1502. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
  1503. var resp = rs.data
  1504. if (resp.state == 1) {
  1505. this.doctorAdvices = resp.data.advices
  1506. this.$emit('prescription', response.data.data.prescription, resp.data.advices)
  1507. } else {
  1508. }
  1509. })
  1510. Toast.success('提交成功')
  1511. this.finish()
  1512. }
  1513. }).catch(error => {
  1514. Toast.fail("请求失败")
  1515. });
  1516. } else {
  1517. Toast.loading({forbidClick: true, duration: 0})
  1518. let ParamsQuery = this.dialysisPrescription
  1519. ParamsQuery['patient'] = this.$route.query.patient_id
  1520. ParamsQuery['record_date'] = this.record_date
  1521. commitDialysisPrescription(ParamsQuery).then(response => {
  1522. if (response.data.state == 0) {
  1523. Toast.fail(response.data.msg)
  1524. return false
  1525. } else {
  1526. Toast.success('提交成功')
  1527. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1528. this.finish()
  1529. }
  1530. }).catch(error => {
  1531. Toast.fail("请求失败")
  1532. });
  1533. }
  1534. }
  1535. } else {
  1536. Toast.loading({forbidClick: true, duration: 0})
  1537. let ParamsQuery = this.dialysisPrescription
  1538. ParamsQuery['patient'] = this.$route.query.patient_id
  1539. ParamsQuery['record_date'] = this.record_date
  1540. commitDialysisPrescription(ParamsQuery).then(response => {
  1541. if (response.data.state == 0) {
  1542. Toast.fail(response.data.msg)
  1543. return false
  1544. } else {
  1545. Toast.success('提交成功')
  1546. this.$emit('prescription', response.data.data.prescription, this.doctorAdvices)
  1547. this.finish()
  1548. }
  1549. }).catch(error => {
  1550. Toast.fail("请求失败")
  1551. });
  1552. }
  1553. }
  1554. }, commitSolutionInfo: function () {
  1555. if (this.$store.getters.user.template_info.template_id == 6) {
  1556. if (this.dialysisPrescription.mode_id == 2) {
  1557. if (this.dialysisPrescription.displace_liqui_part == 0 || this.dialysisPrescription.displace_liqui_part == -2 || this.dialysisPrescription.displace_liqui_value == 0 || this.dialysisPrescription.displace_liqui_value == '') {
  1558. Toast.fail('HDF模式下置换方式和置换液总量不能为空!')
  1559. return
  1560. }
  1561. }
  1562. }
  1563. this.is_pre = 2
  1564. if (this.prescription_prop.id == '') {
  1565. if (this.is_open == 0) {
  1566. Toast.loading({forbidClick: true, duration: 0})
  1567. let ParamsQuery = this.dialysisPrescription
  1568. ParamsQuery['patient'] = this.$route.query.patient_id
  1569. ParamsQuery['record_date'] = this.record_date
  1570. postSolution(ParamsQuery).then(response => {
  1571. if (response.data.state == 0) {
  1572. Toast.fail(response.data.msg)
  1573. return false
  1574. } else {
  1575. Toast.success('提交成功')
  1576. this.$emit('advice')
  1577. this.$emit('longSolution', response.data.data.solution)
  1578. this.$emit('prescription', response.data.data.prescription)
  1579. this.finish()
  1580. }
  1581. })
  1582. } else if (this.is_open == 1) {
  1583. if (this.targetAdvices.length > 0) {
  1584. //弹框推送提醒
  1585. this.advicePropForm.list = this.targetAdvices
  1586. this.advicePropForm.operators = this.admin_users_prop
  1587. this.advice_visibility = true
  1588. this.isShowDialog = false
  1589. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  1590. if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
  1591. this.advicePropForm.result.push(this.advicePropForm.list[i].id)
  1592. }
  1593. }
  1594. } else {
  1595. Toast.loading({forbidClick: true, duration: 0})
  1596. let ParamsQuery = this.dialysisPrescription
  1597. ParamsQuery['patient'] = this.$route.query.patient_id
  1598. ParamsQuery['record_date'] = this.record_date
  1599. postSolution(ParamsQuery).then(response => {
  1600. if (response.data.state == 0) {
  1601. Toast.fail(response.data.msg)
  1602. return false
  1603. } else {
  1604. Toast.success('提交成功')
  1605. this.$emit('advice')
  1606. this.$emit('longSolution', response.data.data.solution)
  1607. this.$emit('prescription', response.data.data.prescription)
  1608. this.finish()
  1609. }
  1610. }).catch(error => {
  1611. Toast.fail("请求失败")
  1612. });
  1613. }
  1614. } else if (this.is_open == 2) {
  1615. if (this.waitUploadAdvices.length > 0) {
  1616. Toast.loading({forbidClick: true, duration: 0})
  1617. let ParamsQuery = this.dialysisPrescription
  1618. ParamsQuery['patient'] = this.$route.query.patient_id
  1619. ParamsQuery['record_date'] = this.record_date
  1620. postSolution(ParamsQuery).then(response => {
  1621. if (response.data.state == 0) {
  1622. Toast.fail(response.data.msg)
  1623. return false
  1624. } else {
  1625. Toast.success('提交成功')
  1626. var date = new Date();
  1627. var year = date.getFullYear();
  1628. var month = date.getMonth() + 1;
  1629. var day = date.getDate();
  1630. var hours = date.getHours();
  1631. var minites = date.getMinutes();
  1632. if (month < 10) {
  1633. month = "0" + month;
  1634. }
  1635. if (day < 10) {
  1636. day = "0" + day;
  1637. }
  1638. if (hours < 10) {
  1639. hours = "0" + hours;
  1640. }
  1641. if (minites < 10) {
  1642. minites = "0" + minites;
  1643. }
  1644. var nowDate = year + "-" + month + "-" + day +" " +hours+":"+ minites;
  1645. let params = {
  1646. advices: this.waitUploadAdvices,
  1647. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  1648. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  1649. advice_type: this.waitUploadAdvices[0].advice_type,
  1650. parent_id: this.$route.query.patient_id,
  1651. start_time: nowDate,
  1652. remark: '',
  1653. }
  1654. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
  1655. var resp = rs.data
  1656. if (resp.state == 1) {
  1657. this.doctorAdvices = resp.data.advices
  1658. this.$emit('longSolution', response.data.data.solution, resp.data.advices)
  1659. this.$emit('prescription', response.data.data.prescription, resp.data.advices)
  1660. } else {
  1661. }
  1662. })
  1663. this.finish()
  1664. }
  1665. }).catch(error => {
  1666. Toast.fail("请求失败")
  1667. });
  1668. } else {
  1669. Toast.loading({forbidClick: true, duration: 0})
  1670. let ParamsQuery = this.dialysisPrescription
  1671. ParamsQuery['patient'] = this.$route.query.patient_id
  1672. ParamsQuery['record_date'] = this.record_date
  1673. postSolution(ParamsQuery).then(response => {
  1674. if (response.data.state == 0) {
  1675. Toast.fail(response.data.msg)
  1676. return false
  1677. } else {
  1678. Toast.success('提交成功')
  1679. this.$emit('longSolution', response.data.data.solution)
  1680. this.$emit('prescription', response.data.data.prescription)
  1681. this.finish()
  1682. }
  1683. }).catch(error => {
  1684. Toast.fail("请求失败")
  1685. });
  1686. }
  1687. }
  1688. } else {
  1689. if (this.prescription_prop.creater == 0) {
  1690. if (this.is_open == 0) {
  1691. Toast.loading({forbidClick: true, duration: 0})
  1692. let ParamsQuery = this.dialysisPrescription
  1693. ParamsQuery['patient'] = this.$route.query.patient_id
  1694. ParamsQuery['record_date'] = this.record_date
  1695. postSolution(ParamsQuery).then(response => {
  1696. if (response.data.state == 0) {
  1697. Toast.fail(response.data.msg)
  1698. return false
  1699. } else {
  1700. Toast.success('提交成功')
  1701. this.$emit('longSolution', response.data.data.solution)
  1702. this.$emit('prescription', response.data.data.prescription)
  1703. this.finish()
  1704. }
  1705. }).catch(error => {
  1706. Toast.fail("请求失败")
  1707. });
  1708. } else if (this.is_open == 1) {
  1709. if (this.targetAdvices.length > 0) {
  1710. //弹框推送提醒
  1711. this.advicePropForm.list = this.targetAdvices
  1712. this.advicePropForm.operators = this.admin_users_prop
  1713. this.advice_visibility = true
  1714. this.isShowDialog = false
  1715. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  1716. if (this.advicePropForm.list[i].parent_id == 0 && this.advicePropForm.list[i].isCheck == 1) {
  1717. this.advicePropForm.result.push(this.advicePropForm.list[i].id)
  1718. }
  1719. }
  1720. } else {
  1721. Toast.loading({forbidClick: true, duration: 0})
  1722. let ParamsQuery = this.dialysisPrescription
  1723. ParamsQuery['patient'] = this.$route.query.patient_id
  1724. ParamsQuery['record_date'] = this.record_date
  1725. postSolution(ParamsQuery).then(response => {
  1726. if (response.data.state == 0) {
  1727. Toast.fail(response.data.msg)
  1728. return false
  1729. } else {
  1730. Toast.success('提交成功')
  1731. this.$emit('longSolution', response.data.data.solution)
  1732. this.$emit('prescription', response.data.data.prescription)
  1733. this.finish()
  1734. }
  1735. }).catch(error => {
  1736. Toast.fail("请求失败")
  1737. });
  1738. }
  1739. } else if (this.is_open == 2) {
  1740. if (this.waitUploadAdvices.length > 0) {
  1741. Toast.loading({forbidClick: true, duration: 0})
  1742. let ParamsQuery = this.dialysisPrescription
  1743. ParamsQuery['patient'] = this.$route.query.patient_id
  1744. ParamsQuery['record_date'] = this.record_date
  1745. postSolution(ParamsQuery).then(response => {
  1746. if (response.data.state == 0) {
  1747. Toast.fail(response.data.msg)
  1748. return false
  1749. } else {
  1750. this.advice_visibility = false
  1751. var date = new Date();
  1752. var year = date.getFullYear();
  1753. var month = date.getMonth() + 1;
  1754. var day = date.getDate();
  1755. var hours = date.getHours();
  1756. var minites = date.getMinutes();
  1757. if (month < 10) {
  1758. month = "0" + month;
  1759. }
  1760. if (day < 10) {
  1761. day = "0" + day;
  1762. }
  1763. if (hours < 10) {
  1764. hours = "0" + hours;
  1765. }
  1766. if (minites < 10) {
  1767. minites = "0" + minites;
  1768. }
  1769. var nowDate = year + "-" + month + "-" + day +" " +hours+":"+ minites;
  1770. let params = {
  1771. advices: this.waitUploadAdvices,
  1772. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  1773. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  1774. advice_type: this.waitUploadAdvices[0].advice_type,
  1775. parent_id: this.$route.query.patient_id,
  1776. start_time: nowDate,
  1777. remark: '',
  1778. }
  1779. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
  1780. var resp = rs.data
  1781. if (resp.state == 1) {
  1782. this.doctorAdvices = resp.data.advices
  1783. this.$emit('longSolution', response.data.data.solution,resp.data.advices)
  1784. this.$emit('prescription', response.data.data.prescription,resp.data.advices)
  1785. } else {
  1786. }
  1787. })
  1788. Toast.success('提交成功')
  1789. this.finish()
  1790. }
  1791. }).catch(error => {
  1792. Toast.fail("请求失败")
  1793. });
  1794. } else {
  1795. Toast.loading({forbidClick: true, duration: 0})
  1796. let ParamsQuery = this.dialysisPrescription
  1797. ParamsQuery['patient'] = this.$route.query.patient_id
  1798. ParamsQuery['record_date'] = this.record_date
  1799. postSolution(ParamsQuery).then(response => {
  1800. if (response.data.state == 0) {
  1801. Toast.fail(response.data.msg)
  1802. return false
  1803. } else {
  1804. Toast.success('提交成功')
  1805. this.$emit('advice')
  1806. this.$emit('longSolution', response.data.data.solution)
  1807. this.$emit('prescription', response.data.data.prescription)
  1808. this.finish()
  1809. }
  1810. }).catch(error => {
  1811. Toast.fail("请求失败")
  1812. });
  1813. }
  1814. }
  1815. } else {
  1816. Toast.loading({forbidClick: true, duration: 0})
  1817. let ParamsQuery = this.dialysisPrescription
  1818. ParamsQuery['patient'] = this.$route.query.patient_id
  1819. ParamsQuery['record_date'] = this.record_date
  1820. postSolution(ParamsQuery).then(response => {
  1821. if (response.data.state == 0) {
  1822. Toast.fail(response.data.msg)
  1823. return false
  1824. } else {
  1825. Toast.success('提交成功')
  1826. this.$emit('longSolution', response.data.data.solution)
  1827. this.$emit('prescription', response.data.data.prescription)
  1828. this.finish()
  1829. }
  1830. }).catch(error => {
  1831. Toast.fail("请求失败")
  1832. });
  1833. }
  1834. }
  1835. }, finish: function () {
  1836. this.$emit('finish')
  1837. }, close: function () {
  1838. this.$emit('close')
  1839. }, open: function () {
  1840. this.isShowDialog = true
  1841. this.visibility = false
  1842. this.$refs.picker.close()
  1843. var dialogTop = document.querySelector('#dialogTop')
  1844. if (dialogTop != null) {
  1845. this.$nextTick(() => {
  1846. dialogTop.scrollTop = 0
  1847. })
  1848. }
  1849. }, sign: function () {
  1850. let params = {
  1851. patient_id: this.$route.query.patient_id,
  1852. date: this.record_date,
  1853. }
  1854. postSign(params).then(response => {
  1855. if (response.data.state == 0) {
  1856. Toast.fail(response.data.msg)
  1857. return false
  1858. } else {
  1859. this.isShowDesc = false
  1860. this.isShowDoctorSign = true
  1861. this.dialysisPrescription.prescription_doctor = response.data.data.doctor_id
  1862. for (let i = 0; i < this.operators.length; i++) {
  1863. if (this.operators[i].creator == response.data.data.doctor_id) {
  1864. console.log(this.operators[i].url)
  1865. this.signUrl = this.operators[i].url
  1866. }
  1867. }
  1868. Toast.success('签名成功')
  1869. }
  1870. }).catch(error => {
  1871. Toast.fail("请求失败")
  1872. });
  1873. }, getBodyFluid: function (val) {
  1874. let body_fluid_name = ''
  1875. let body_fluid = this.bodyFluidOptions
  1876. for (let i = 0; i < body_fluid.length; i++) {
  1877. if (body_fluid[i].id == val) {
  1878. body_fluid_name = body_fluid[i].name
  1879. }
  1880. }
  1881. return body_fluid_name
  1882. }, getSpecialMedicine: function (val) {
  1883. let special_medicine_name = ''
  1884. let special_medicine = this.specialMedicineOptions
  1885. for (let i = 0; i < special_medicine.length; i++) {
  1886. if (special_medicine[i].id == val) {
  1887. special_medicine_name = special_medicine[i].name
  1888. }
  1889. }
  1890. return special_medicine_name
  1891. }, getDisplaceLiquiPart: function (val) {
  1892. let displace_liqui_part_name = ''
  1893. let displace_liqui_part = this.displaceLiquiPartOptions
  1894. for (let i = 0; i < displace_liqui_part.length; i++) {
  1895. if (displace_liqui_part[i].id == val) {
  1896. displace_liqui_part_name = displace_liqui_part[i].name
  1897. }
  1898. }
  1899. return displace_liqui_part_name
  1900. }, getBloodAccess: function (val) {
  1901. let blood_access_name = ''
  1902. let blood_access = this.bloodAccessOptions
  1903. for (let i = 0; i < blood_access.length; i++) {
  1904. if (blood_access[i].id == val) {
  1905. blood_access_name = blood_access[i].name
  1906. }
  1907. }
  1908. return blood_access_name
  1909. }, menuEmpty: function (val) {
  1910. this.visibility = false
  1911. this.isShowDialog = true
  1912. switch (val.type) {
  1913. case 1:
  1914. this.dialysisPrescription.mode_id = ''
  1915. break
  1916. case 2:
  1917. this.dialysisPrescription.dialyzer = ''
  1918. break
  1919. case 3:
  1920. this.dialysisPrescription.perfusion_apparatus = ''
  1921. break
  1922. case 4:
  1923. this.dialysisPrescription.replacement_way = ''
  1924. break
  1925. case 5:
  1926. this.anticoagulant = ''
  1927. break
  1928. case 6:
  1929. this.dialysisPrescription.dialysate_formulation = ''
  1930. break
  1931. case 7:
  1932. this.dialysisPrescription.body_fluid = ''
  1933. break
  1934. case 8:
  1935. this.dialysisPrescription.special_medicine = ''
  1936. break
  1937. case 9:
  1938. this.dialysisPrescription.displace_liqui_part = ''
  1939. break
  1940. case 10:
  1941. this.dialysisPrescription.blood_access = ''
  1942. break
  1943. }
  1944. }, getFloat: function (x) {
  1945. if (x != '.') {
  1946. var f = Math.round(x * 100) / 100
  1947. var s = f.toString()
  1948. var rs = s.indexOf('.')
  1949. if (rs <= 0) {
  1950. rs = s.length
  1951. s += '.'
  1952. }
  1953. while (s.length <= rs + 1) {
  1954. s += '0'
  1955. }
  1956. return s
  1957. } else {
  1958. return '0.0'
  1959. }
  1960. }, dialysisGoodsClick: function () {
  1961. this.isShowDialog = false
  1962. this.is_show = true
  1963. }, menuCancleTwo: function () {
  1964. this.isShowDialog = true
  1965. this.is_show = false
  1966. }, menuComfirmTwo: function (dialysisPrescription) {
  1967. this.isShowDialog = true
  1968. this.is_show = false
  1969. this.dialysisPrescription.niprocart = dialysisPrescription.niprocart
  1970. this.dialysisPrescription.jms = dialysisPrescription.jms
  1971. this.dialysisPrescription.fistula_needle_set = dialysisPrescription.fistula_needle_set
  1972. this.dialysisPrescription.fistula_needle_set_16 = dialysisPrescription.fistula_needle_set_16
  1973. this.dialysisPrescription.hemoperfusion = dialysisPrescription.hemoperfusion
  1974. this.dialysisPrescription.dialyser_sterilised = dialysisPrescription.dialyser_sterilised
  1975. this.dialysisPrescription.filtryzer = dialysisPrescription.filtryzer
  1976. this.dialysisPrescription.dialyzers = dialysisPrescription.dialyzers
  1977. this.dialysisPrescription.injector = dialysisPrescription.injector
  1978. this.dialysisPrescription.bloodlines = dialysisPrescription.bloodlines
  1979. this.dialysisPrescription.tubing_hemodialysis = dialysisPrescription.tubing_hemodialysis
  1980. this.dialysisPrescription.package = dialysisPrescription.package
  1981. this.dialysisPrescription.a_liquid = dialysisPrescription.a_liquid
  1982. }
  1983. },
  1984. created () {
  1985. this.template_id = this.$store.getters.user.template_info.template_id
  1986. this.modeOption = this.$store.getters.treatment_mode
  1987. delete this.modeOption['0']
  1988. var perfusion_apparatus = getDataConfig('hemodialysis', 'perfusion_apparatus')
  1989. this.perfusion_apparatus = perfusion_apparatus
  1990. this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit
  1991. this.bodyFluidOptions = this.$store.getters.body_fluid
  1992. this.specialMedicineOptions = this.$store.getters.special_medicine
  1993. this.displaceLiquiPartOptions = this.$store.getters.displace_liqui
  1994. this.bloodAccessOptions = this.$store.getters.blood_access
  1995. this.dialysateFormulationOptions = getDataConfig('hemodialysis', 'dialysate_formulation')
  1996. this.replacementWays = getDataConfig('hemodialysis', 'replacement_ways')
  1997. this.patient = this.patient_prop
  1998. console.log(this.dialysisPrescription)
  1999. if (this.prescription_prop != null && typeof (this.prescription_prop.id) != 'undefined' && this.prescription_prop.id > 0) {
  2000. for (const key in this.prescription_prop) {
  2001. this.dialysisPrescription[key] = this.prescription_prop[key]
  2002. }
  2003. } else if (this.solution_prop != null && typeof this.solution_prop.id != 'undefined' && this.solution_prop.id) {
  2004. for (const key in this.solution_prop) {
  2005. if(key != "target_ultrafiltration") {
  2006. this.dialysisPrescription[key] = this.solution_prop[key]
  2007. }
  2008. }
  2009. } else if (this.last_prescription != null && typeof this.last_prescription.id != 'undefined' && this.last_prescription.id) {
  2010. for (const key in this.last_prescription) {
  2011. if(key != "target_ultrafiltration") {
  2012. this.dialysisPrescription[key] = this.last_prescription[key]
  2013. }
  2014. }
  2015. } else if(this.system_prescription != null && typeof this.system_prescription.id != 'undefined' && this.system_prescription.id){
  2016. for (const key in this.system_prescription) {
  2017. if (key != "target_ultrafiltration") {
  2018. this.dialysisPrescription[key] = this.system_prescription[key]
  2019. }
  2020. }
  2021. }else{
  2022. this.dialysisPrescription.mode_id = this.schedual.mode_id
  2023. }
  2024. if (this.dialysisPrescription.dialysis_duration_hour.length == 0 || this.dialysisPrescription.dialysis_duration_minute.length == 0) {
  2025. this.timeValue = ''
  2026. this.time = '03:00'
  2027. } else {
  2028. this.timeValue = this.dialysisPrescription.dialysis_duration_hour + '小时' + this.dialysisPrescription.dialysis_duration_minute + '分钟'
  2029. this.time = (this.dialysisPrescription.dialysis_duration_hour > 10 ? this.dialysisPrescription.dialysis_duration_hour : '0' + this.dialysisPrescription.dialysis_duration_hour) + ':' + (this.dialysisPrescription.dialysis_duration_minute > 10 ? this.dialysisPrescription.dialysis_duration_minute : '0' + this.dialysisPrescription.dialysis_duration_minute)
  2030. }
  2031. this.dialyserList = this.machines_prop
  2032. // this.doctor = this.$store.getters.user.user.user_type;
  2033. var date = this.$route.query && this.$route.query.date
  2034. date *= 1000
  2035. var newDate = new Date(date)
  2036. var y = newDate.getFullYear()
  2037. var m = newDate.getMonth() + 1
  2038. var d = newDate.getDate()
  2039. if (isNaN(y) || isNaN(m) || isNaN(d)) {
  2040. newDate = new Date()
  2041. y = newDate.getFullYear()
  2042. m = newDate.getMonth() + 1
  2043. d = newDate.getDate()
  2044. }
  2045. this.record_date =
  2046. y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d)
  2047. // this.patient.id = this.patient_prop.id
  2048. this.dialysisPrescription.kalium = this.getFloat(this.dialysisPrescription.kalium)
  2049. this.dialysisPrescription.sodium = this.getFloat(this.dialysisPrescription.sodium)
  2050. this.dialysisPrescription.calcium = this.getFloat(this.dialysisPrescription.calcium)
  2051. this.dialysisPrescription.ultrafiltration = this.getFloat(this.dialysisPrescription.ultrafiltration)
  2052. this.dialysisPrescription.target_ultrafiltration = this.getFloat(this.dialysisPrescription.target_ultrafiltration)
  2053. if(this.dialysisPrescription.anticoagulant_shouji == ''){
  2054. this.dialysisPrescription.anticoagulant_shouji = '0'
  2055. }
  2056. if(this.dialysisPrescription.anticoagulant_weichi == ''){
  2057. this.dialysisPrescription.anticoagulant_weichi = '0'
  2058. }
  2059. if(this.dialysisPrescription.anticoagulant_zongliang == ''){
  2060. this.dialysisPrescription.anticoagulant_weichi = '0'
  2061. }
  2062. },
  2063. components: {
  2064. LongAdviceSubMenu,
  2065. MultipleSubMenu,
  2066. MsgTip,
  2067. // MultipleSubMenu,
  2068. CheckBoxSubMenu
  2069. },
  2070. watch: {
  2071. "dialysisPrescription.dialysis_duration":function(){
  2072. console.log(this.dialysisPrescription.dialysis_duration)
  2073. this.dialysisPrescription.anticoagulant_zongliang=calculateAnticoagulantZL(1,
  2074. this.dialysisPrescription.anticoagulant_shouji,
  2075. this.dialysisPrescription.dialysis_duration,
  2076. this.dialysisPrescription.anticoagulant_weichi
  2077. );
  2078. if(isNaN(this.dialysisPrescription.anticoagulant_zongliang)){
  2079. this.dialysisPrescription.anticoagulant_zongliang = ''
  2080. }
  2081. },
  2082. "dialysisPrescription.anticoagulant_shouji":function(){
  2083. this.dialysisPrescription.anticoagulant_zongliang=calculateAnticoagulantZL(1,
  2084. this.dialysisPrescription.anticoagulant_shouji,
  2085. this.dialysisPrescription.dialysis_duration,
  2086. this.dialysisPrescription.anticoagulant_weichi
  2087. );
  2088. if(isNaN(this.dialysisPrescription.anticoagulant_zongliang)){
  2089. this.dialysisPrescription.anticoagulant_zongliang = ''
  2090. }
  2091. },
  2092. "dialysisPrescription.anticoagulant_weichi":function(){
  2093. this.dialysisPrescription.anticoagulant_zongliang=calculateAnticoagulantZL(1,
  2094. this.dialysisPrescription.anticoagulant_shouji,
  2095. this.dialysisPrescription.dialysis_duration,
  2096. this.dialysisPrescription.anticoagulant_weichi
  2097. );
  2098. if(isNaN(this.dialysisPrescription.anticoagulant_zongliang)){
  2099. this.dialysisPrescription.anticoagulant_zongliang = ''
  2100. }
  2101. },
  2102. isShowDialog (val) {
  2103. if (val) {
  2104. this.advice_visibility = false
  2105. }
  2106. }
  2107. }
  2108. }
  2109. </script>
  2110. <style style="stylesheet/scss" lang="scss" scoped>
  2111. .DialogContent {
  2112. // padding-bottom:2rem !important;
  2113. .textarea {
  2114. width: 100%;
  2115. height: 2.4rem;
  2116. line-height: 0.6rem;
  2117. color: $pgh-color;
  2118. font-size: 0.45rem;
  2119. padding-left: 0.36rem;
  2120. border: none;
  2121. border-bottom: 1px #e5e5e5 solid;
  2122. }
  2123. }
  2124. .newButton {
  2125. background: #258ffc;
  2126. padding: 0 0.2rem;
  2127. height: 0.85rem;
  2128. line-height: 0.85rem;
  2129. border-radius: 5px;
  2130. color: #fff;
  2131. margin-right: -3.5rem;
  2132. }
  2133. .newName {
  2134. margin-right: -3rem;
  2135. }
  2136. .newDialogContent {
  2137. display: flex;
  2138. flex-direction: column;
  2139. height: 100%;
  2140. overflow: hidden;
  2141. > :first-child {
  2142. flex: 1;
  2143. overflow: auto;
  2144. }
  2145. }
  2146. </style>