PrescriptionDialog.vue 107KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057
  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. <span @click="commitInfo" class="success" v-if="hasPermission">保存</span>
  11. <span @click="commitInfo" class="success" v-if="!hasPermission"></span>
  12. </div>
  13. <div class="warnTxt" v-if="showTxt != ''">
  14. {{ showTxt }}
  15. </div>
  16. <div class="DialogContent newDialogContent" id="dialogTop">
  17. <div>
  18. <div @click="showSubMenu('mode')" class="item" ref="mode" v-if="isShow('透析模式')">
  19. <label class="name" for="txms">透析模式</label>
  20. <div class="content">
  21. <span class="text" id="txms">{{GetModeByModeId(dialysisPrescription.mode_id)}}</span>
  22. <span class="iconfont">&#xe6f9;</span>
  23. </div>
  24. </div>
  25. <div class="item" @click="openPicker" v-if="isShow('透析时长')">
  26. <label class="name" for="txsc">透析时长</label>
  27. <div class="content">
  28. <span class="text" style="width: 100px">{{timeValue}}</span>
  29. <span class="iconfont">&#xe6f9;</span>
  30. </div>
  31. </div>
  32. <div class="item" v-if="isShow('血流量')">
  33. <label class="name" for="xll">血流量(ml/min)</label>
  34. <div class="content">
  35. <input
  36. type="number"
  37. @click="newClick($event)"
  38. @focus="inputFocus"
  39. id="xll"
  40. v-model="dialysisPrescription.blood_flow_volume"
  41. />
  42. </div>
  43. </div>
  44. <div class="item" v-if="isShow('目标超滤量')">
  45. <label class="name" v-if="this.$store.getters.user.template_info.template_id != 17" for="mbcll">目标超滤量(L)</label>
  46. <label class="name" v-if="this.$store.getters.user.template_info.template_id == 17" for="mbcll">目标超滤量(ml)</label>
  47. <div class="content">
  48. <input
  49. type="number"
  50. @click="newClick($event)"
  51. @focus="inputFocus"
  52. id="mbcll"
  53. v-model="dialysisPrescription.target_ultrafiltration"
  54. />
  55. </div>
  56. </div>
  57. <div
  58. @click="showSubMenu('dialysate_formulation')"
  59. class="item"
  60. ref="dialysate_formulation"
  61. v-if="isShow('透析液配方')"
  62. >
  63. <label class="name" for="txypf">透析液配方</label>
  64. <div class="content">
  65. <span
  66. class="text"
  67. id="txypf"
  68. >{{GetDialysateFormulationById(dialysisPrescription.dialysate_formulation)}}</span>
  69. <span class="iconfont">&#xe6f9;</span>
  70. </div>
  71. </div>
  72. <div @click="showSubMenu('anticoagulant')" class="item" ref="anticoagulant" v-if="isShow('抗凝剂')" >
  73. <label class="name" for="knj">抗凝剂</label>
  74. <div class="content">
  75. <span class="text" id="knj" >{{GetAnticoagulantById(dialysisPrescription.anticoagulant)}}</span>
  76. <span class="iconfont">&#xe6f9;</span>
  77. </div>
  78. </div>
  79. <div class="item" v-if="dialysisPrescription.anticoagulant != 5&&isShow('首剂')">
  80. <label
  81. class="name"
  82. for="zl"
  83. v-if="dialysisPrescription.anticoagulant == 0 ||dialysisPrescription.anticoagulant == -2"
  84. >首剂(mg)</label>
  85. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2 && this.$store.getters.user.template_info.template_id != 13">首剂(iu)</label>
  86. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2 && this.$store.getters.user.template_info.template_id == 13">首剂(mg)</label>
  87. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 3">首剂(iu)</label>
  88. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 4">首剂(mg)</label>
  89. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 1">首剂(mg)</label>
  90. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 6">首剂(iu)</label>
  91. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 7">首剂(iu)</label>
  92. <div class="content">
  93. <input
  94. v-if="dialysisPrescription.anticoagulant != 1"
  95. type="number"
  96. @click="newClick($event)"
  97. @focus="inputFocus"
  98. id="sj"
  99. v-model="dialysisPrescription.anticoagulant_shouji"
  100. :disabled="anticoagulant.shouji==1?false:true"
  101. />
  102. <input
  103. v-if="dialysisPrescription.anticoagulant == 1"
  104. type="number"
  105. @click="newClick($event)"
  106. @focus="inputFocus"
  107. id="sj"
  108. v-model="dialysisPrescription.no_anticoagulant_shouji"
  109. disabled="true"
  110. />
  111. </div>
  112. </div>
  113. <div class="item" v-if="anticoagulant.weichi != -1&&isShow('维持')">
  114. <label
  115. class="name"
  116. for="zl"
  117. v-if="dialysisPrescription.anticoagulant == 0 ||dialysisPrescription.anticoagulant == -2"
  118. >维持(mg/h)</label>
  119. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2 && this.$store.getters.user.template_info.template_id != 13">维持(iu/h)</label>
  120. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2 && this.$store.getters.user.template_info.template_id == 13">维持(mg/h)</label>
  121. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 3">维持(iu/h)</label>
  122. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 4">维持(mg/h)</label>
  123. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 5">维持(ml/h)</label>
  124. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 1">维持(mg/h)</label>
  125. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 6">维持(iu/h)</label>
  126. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 7">维持(iu/h)</label>
  127. <div class="content">
  128. <input
  129. v-if="dialysisPrescription.anticoagulant != 1"
  130. type="number"
  131. @click="newClick($event)"
  132. @focus="inputFocus"
  133. id="wz"
  134. class="inputBox"
  135. v-model="dialysisPrescription.anticoagulant_weichi"
  136. :disabled="anticoagulant.weichi==1?false:true"
  137. />
  138. <input
  139. v-if="dialysisPrescription.anticoagulant == 1"
  140. type="number"
  141. @click="newClick($event)"
  142. @focus="inputFocus"
  143. id="sj"
  144. v-model="dialysisPrescription.no_anticoagulant_weichi"
  145. disabled="true"
  146. />
  147. </div>
  148. </div>
  149. <div class="item" v-if="dialysisPrescription.anticoagulant != 5&& isShow('总量')">
  150. <label
  151. class="name"
  152. for="zl"
  153. v-if="dialysisPrescription.anticoagulant == 0 ||dialysisPrescription.anticoagulant == -2"
  154. >总量(mg)</label>
  155. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2 && this.$store.getters.user.template_info.template_id != 13">总量(iu)</label>
  156. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 2 && this.$store.getters.user.template_info.template_id == 13">总量(mg)</label>
  157. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 3">总量(iu)</label>
  158. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 4">总量(mg)</label>
  159. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 1">总量(mg)</label>
  160. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 6">总量(iu)</label>
  161. <label class="name" for="zl" v-if="dialysisPrescription.anticoagulant == 7">总量(iu)</label>
  162. <div class="content">
  163. <input
  164. v-if="dialysisPrescription.anticoagulant != 1"
  165. type="number"
  166. @click="newClick($event)"
  167. @focus="inputFocus"
  168. id="zl"
  169. class="inputBox"
  170. v-model="dialysisPrescription.anticoagulant_zongliang"
  171. :disabled="anticoagulant.zongliang==1?false:true"
  172. />
  173. <input
  174. v-if="dialysisPrescription.anticoagulant == 1"
  175. type="number"
  176. @click="newClick($event)"
  177. @focus="inputFocus"
  178. id="sj"
  179. v-model="dialysisPrescription.no_anticoagulant_zongliang"
  180. disabled="true"
  181. />
  182. </div>
  183. </div>
  184. <div class="item" v-if="dialysisPrescription.anticoagulant == 5&& isShow('钙名称')">
  185. <label class="name" for="g">钙名称</label>
  186. <div class="content">
  187. <input
  188. type="text"
  189. id="g"
  190. class="inputBox"
  191. v-model="dialysisPrescription.anticoagulant_gaimingcheng"
  192. />
  193. </div>
  194. </div>
  195. <div class="item" v-if="dialysisPrescription.anticoagulant == 5&& isShow('钙剂量')">
  196. <label class="name" for="gjl">钙剂量(ml)</label>
  197. <div class="content">
  198. <input
  199. type="text"
  200. id="gjl"
  201. class="inputBox"
  202. v-model="dialysisPrescription.anticoagulant_gaijiliang"
  203. />
  204. </div>
  205. </div>
  206. <!-- <div class="item">
  207. <label class="name" for="gtz">干体重(kg)</label>
  208. <div class="content">
  209. <input type="tel" @focus="inputFocus" id="gtz" v-model="dialysisPrescription.dry_weight"/>
  210. </div>
  211. </div>-->
  212. <div class="line"></div>
  213. <div class="item" v-if="isShow('置换量')" v-show="zhiShow">
  214. <label class="name" for="zhy">置换量(L)</label>
  215. <div class="content">
  216. <input
  217. type="number"
  218. @click="newClick($event)"
  219. @focus="inputFocus"
  220. id="zhy"
  221. v-model="dialysisPrescription.replacement_total"
  222. />
  223. </div>
  224. </div>
  225. <!-- <div class="line"></div> -->
  226. <div class="item" v-if="isShow('钾')">
  227. <label class="name" for="j">钾(mmol/L)</label>
  228. <div class="content">
  229. <input type="number" @click="newClick($event)" @focus="inputFocus" id="j"
  230. v-model="dialysisPrescription.kalium"/>
  231. </div>
  232. </div>
  233. <div class="item" v-if="isShow('钠')">
  234. <label class="name" for="n">钠(mmol/L):</label>
  235. <div class="content">
  236. <input type="number" @click="newClick($event)" @focus="inputFocus" id="n"
  237. v-model="dialysisPrescription.sodium"/>
  238. </div>
  239. </div>
  240. <div class="item" v-if="isShow('钙')">
  241. <label class="name" for="gg">钙(mmol/L)</label>
  242. <div class="content">
  243. <input
  244. type="number"
  245. @click="newClick($event)"
  246. @focus="inputFocus"
  247. id="gg"
  248. v-model="dialysisPrescription.calcium"
  249. />
  250. </div>
  251. </div>
  252. <div class="item" v-if="isShow('碳酸氢盐')">
  253. <label class="name" for="tsqy">碳酸氢盐(mmol/L)</label>
  254. <div class="content">
  255. <input
  256. type="number"
  257. @click="newClick($event)"
  258. @focus="inputFocus"
  259. id="tsqy"
  260. v-model="dialysisPrescription.bicarbonate"
  261. />
  262. </div>
  263. </div>
  264. <div class="item" v-if="isShow('葡萄糖')">
  265. <label class="name" for="ptt">葡萄糖(mmol/L)</label>
  266. <div class="content">
  267. <input
  268. type="number"
  269. @click="newClick($event)"
  270. @focus="inputFocus"
  271. id="ptt"
  272. v-model="dialysisPrescription.glucose"
  273. />
  274. </div>
  275. </div>
  276. <div class="line"></div>
  277. <div class="item" v-if="isShow('透析液流量')">
  278. <label class="name" for="txyll">透析液流量(ml/min)</label>
  279. <div class="content">
  280. <input
  281. type="number"
  282. @click="newClick($event)"
  283. @focus="inputFocus"
  284. id="txyll"
  285. v-model="dialysisPrescription.dialysate_flow"
  286. />
  287. </div>
  288. </div>
  289. <div class="item" v-if="isShow('透析液温度')">
  290. <label class="name" for="txywd">透析液温度(℃)</label>
  291. <div class="content">
  292. <!--<span class="text">HD</span>-->
  293. <!--<span class="iconfont">&#xe6f9;</span>-->
  294. <input
  295. type="number"
  296. @click="newClick($event)"
  297. @focus="inputFocus"
  298. id="txywd"
  299. v-model="dialysisPrescription.dialysate_temperature"
  300. />
  301. </div>
  302. </div>
  303. <div class="item" v-if="isShow('电导率')">
  304. <label class="name" for="dtl">电导率(mS/cm)</label>
  305. <div class="content">
  306. <input
  307. type="number"
  308. @click="newClick($event)"
  309. @focus="inputFocus"
  310. id="dtl"
  311. v-model="dialysisPrescription.conductivity"
  312. />
  313. </div>
  314. </div>
  315. <!-- <div class="item" v-if="isShow('透析器/灌流器')">-->
  316. <!-- <label class="name" for="dtl">透析器/灌流器</label>-->
  317. <!-- <div class="content">-->
  318. <!-- <input-->
  319. <!-- @focus="inputFocus"-->
  320. <!-- id="dt"-->
  321. <!-- v-model="dialysisPrescription.dialyzer_perfusion_apparatus"-->
  322. <!-- />-->
  323. <!-- </div>-->
  324. <!-- </div>-->
  325. <div @click="showSubMenu('dialyzer_perfusion_apparatus')" class="item" ref="mode" v-if="isShow('透析器/灌流器')">
  326. <label class="name" for="txms">透析器/灌流器</label>
  327. <div class="content">
  328. <span class="text" id="txms">{{getDialyzerPerfusionApparatus(dialysisPrescription.dialyzer_perfusion_apparatus)}}</span>
  329. <span class="iconfont">&#xe6f9;</span>
  330. </div>
  331. </div>
  332. <div class="line"></div>
  333. <div
  334. @click="showSubMenu('body_fluid')"
  335. class="item"
  336. ref="body_fluid"
  337. v-if="isShow('体液过多症状')"
  338. >
  339. <label class="name" for="knj">体液过多症状</label>
  340. <div class="content">
  341. <span class="text" id="knja">{{getBodyFluid(dialysisPrescription.body_fluid)}}</span>
  342. <span class="iconfont">&#xe6f9;</span>
  343. </div>
  344. </div>
  345. <div class="item" v-if="isShow('体液过多其他症状')">
  346. <label class="name" for="knj">体液过多其他症状</label>
  347. <div class="content">
  348. <input @focus="inputFocus" id="dt" v-model="dialysisPrescription.body_fluid_other"/>
  349. </div>
  350. </div>
  351. <div
  352. @click="showSubMenu('special_medicine')"
  353. class="item"
  354. ref="special_medicine"
  355. v-if="isShow('透析前使用特殊药物')"
  356. >
  357. <label class="name" for="knj">透析前使用特殊药物</label>
  358. <div class="content">
  359. <span
  360. class="text"
  361. id="knjaa"
  362. >{{getSpecialMedicine(dialysisPrescription.special_medicine)}}</span>
  363. <span class="iconfont">&#xe6f9;</span>
  364. </div>
  365. </div>
  366. <div class="item" v-if="isShow('透析前使用其他特殊药物')">
  367. <label class="name" for="knj">透析前使用其他特殊药物</label>
  368. <div class="content">
  369. <input
  370. @focus="inputFocus"
  371. id="dt"
  372. v-model="dialysisPrescription.special_medicine_other"
  373. />
  374. </div>
  375. </div>
  376. <div
  377. @click="showSubMenu('displace_liqui_part')"
  378. class="item"
  379. ref="displace_liqui_part"
  380. v-if="isShow('置换液')"
  381. v-show="huShow"
  382. >
  383. <label class="name" for="knj" v-if="this.$store.getters.user.template_info.template_id != 6">置换液</label>
  384. <label class="name" for="knj" v-if="this.$store.getters.user.template_info.template_id == 6">置换方式</label>
  385. <div class="content">
  386. <span
  387. class="text"
  388. id="knjaa"
  389. >{{getDisplaceLiquiPart(dialysisPrescription.displace_liqui_part)}}</span>
  390. <span class="iconfont">&#xe6f9;</span>
  391. </div>
  392. </div>
  393. <div class="item" v-if="isShow('置换液总量')" v-show="totalShow">
  394. <label class="name" for="knj">置换液总量(L)</label>
  395. <div class="content">
  396. <input
  397. @focus="inputFocus"
  398. id="dt"
  399. v-model="dialysisPrescription.displace_liqui_value"
  400. />
  401. </div>
  402. </div>
  403. <div class="item" v-if="isShow('目标KT/V')">
  404. <label class="name" for="knj">目标KT/V</label>
  405. <div class="content">
  406. <input @focus="inputFocus" id="dt" v-model="dialysisPrescription.target_ktv"/>
  407. </div>
  408. </div>
  409. <!-- <div-->
  410. <!-- @click="showSubMenu('blood_access')"-->
  411. <!-- class="item"-->
  412. <!-- ref="blood_access"-->
  413. <!-- v-if="isShow('血管通路')"-->
  414. <!-- >-->
  415. <!-- <label class="name" for="knj">血管通路</label>-->
  416. <!-- <div class="content">-->
  417. <!-- <span class="text" id="knjaa">{{getBloodAccess(dialysisPrescription.blood_access)}}</span>-->
  418. <!-- <span class="iconfont">&#xe6f9;</span>-->
  419. <!-- </div>-->
  420. <!-- </div>-->
  421. <div
  422. @click="showSubMenu('vascular_access_desc')"
  423. class="item"
  424. ref="vascular_access_desc"
  425. v-if="isShow('血管通路')"
  426. >
  427. <h2 class="name">血管通路</h2>
  428. <div class="content">
  429. <span class="text">{{getBloodAccessTwo(dialysisPrescription.blood_access)}}</span>
  430. <span class="iconfont">&#xe6f9;</span>
  431. </div>
  432. </div>
  433. <!-- <div class="item" v-if="isShow('实际超滤量')">-->
  434. <!-- <label class="name" for="knj">实际超滤量(L)</label>-->
  435. <!-- <div class="content">-->
  436. <!-- <input @focus="inputFocus" id="dt" v-model="dialysisPrescription.ultrafiltration" />-->
  437. <!-- </div>-->
  438. <!-- </div>-->
  439. <div
  440. @click="dialysisGoodsClick()"
  441. class="item"
  442. ref="consumable_material"
  443. v-if="config.is_open == 1"
  444. >
  445. <label class="name" for="knj">透析耗材</label>
  446. <div class="content">
  447. <span class="text" id="knjaa"></span>
  448. <span class="iconfont">&#xe6f9;</span>
  449. </div>
  450. </div>
  451. <div class="item" style="display: none">
  452. <label class="name" for="dtl">医生签名</label>
  453. <div class="content">
  454. <div v-if="isShowDesc">医生尚未签名</div>
  455. <img
  456. v-if="isShowDoctorSign"
  457. style="width: 100px;height: 30px"
  458. :src="signUrl"
  459. alt
  460. srcset
  461. />
  462. </div>
  463. </div>
  464. <div class="line"></div>
  465. <div>
  466. <div class="item">
  467. <label class="name" for="bz">备注</label>
  468. <div class="content">
  469. <span class="text"></span>
  470. </div>
  471. </div>
  472. <textarea
  473. class="textarea"
  474. id="bz"
  475. placeholder="请输入内容"
  476. v-model="dialysisPrescription.remark"
  477. @focus="lastInputFocus"
  478. @blur="lastInputBlur"
  479. ></textarea>
  480. </div>
  481. </div>
  482. <!--<div class="footer">-->
  483. <!--处方医生:刘小军 医生-->
  484. <!--</div>-->
  485. <div class="PrescSubmit">
  486. <button style="display: none" class="tj" @click="sign()">医生签名</button>
  487. <button class="tjcq" @click="commitSolutionInfo" v-if="isPermission()">保存并设为长期处方</button>
  488. <button class="tj" style="display:none;" @click="commitInfo" v-if="isPermission()">保存</button>
  489. </div>
  490. </div>
  491. </div>
  492. <!--<two-menu title="二级菜单" v-show="isShowModeSubMenu"></two-menu>-->
  493. <check-box-sub-menu
  494. :visibility="visibility"
  495. v-on:menu-cancle="menuCancle"
  496. v-on:menu-comfirm="menuComfirm"
  497. v-on:menu-empty="menuEmpty"
  498. :propsForm="propForm"
  499. ></check-box-sub-menu>
  500. <!--<multiple-sub-menu :goodTypes="types" :visibility="is_show" v-on:menu-cancle="menuCancle" v-on:menu-comfirm="menuComfirm" :propsForm="propForm"></multiple-sub-menu>-->
  501. <multiple-sub-menu
  502. :goodTypes="types"
  503. :info="info"
  504. :visibility="is_show"
  505. v-on:menu-cancel-two="menuCancleTwo"
  506. v-on:menu-comfirm-two="menuComfirmTwo"
  507. :propsForm="propForm"
  508. :dialysisPrescription="dialysisPrescription"
  509. ></multiple-sub-menu>
  510. <mt-datetime-picker
  511. ref="picker"
  512. type="time"
  513. hourFormat="{value}小时"
  514. minuteFormat="{value}分钟"
  515. @confirm="handleTimeConfirm"
  516. v-model="time"
  517. ></mt-datetime-picker>
  518. <long-advice-sub-menu
  519. :visibility="advice_visibility"
  520. v-on:menu-cancle-three="menuCancleThree"
  521. v-on:menu-comfirm-three="menuComfirmThree"
  522. :propsForm="advicePropForm"
  523. ></long-advice-sub-menu>
  524. <msg-tip
  525. :visibility="msgtip_visibility"
  526. :predialysis="predialysis"
  527. :last_predialysis="last_predialysis"
  528. :record="record"
  529. :dry_weight="dry_weight"
  530. :last_record="last_record"
  531. :patient_prop="patient"
  532. :prescription_prop="prescription_prop"
  533. v-on:menu-msg-tip="menuMsgTip"
  534. ></msg-tip>
  535. </div>
  536. </template>
  537. <script>
  538. import CheckBoxSubMenu from './subMenu/checkBoxSubMenu'
  539. import MultipleSubMenu from './subMenu/multipleSubMenu'
  540. import {
  541. commitDialysisPrescription,
  542. CreateGroupAdvice,
  543. GetSolution,
  544. postSign,
  545. postSolution
  546. } from '@/api/dialysis'
  547. import { calculateAnticoagulantZL } from '@/utils/tools'
  548. import { Toast } from 'vant'
  549. import { getDataConfig } from '@/utils/data'
  550. import { parseTime } from '@/utils'
  551. import LongAdviceSubMenu from './subMenu/LongAdviceSubMenu'
  552. import MsgTip from './subMenu/MsgTip'
  553. import request from '@/utils/request'
  554. export default {
  555. name: 'PrescriptionDialog',
  556. props: {
  557. admin_users_prop: {
  558. type: Array,
  559. default: function () {
  560. return new Array()
  561. }
  562. },
  563. system_prescription: {
  564. type: Object
  565. },
  566. predialysis: {
  567. type: Object
  568. },
  569. last_predialysis: {
  570. type: Object
  571. },
  572. record: {
  573. type: Object
  574. },
  575. last_record: {
  576. type: Object
  577. },
  578. patient_prop: {
  579. type: Object
  580. },
  581. solution_prop: {
  582. type: Object
  583. },
  584. config: {
  585. type: Object
  586. },
  587. schedual: {
  588. type: Object
  589. },
  590. dry_weight: {
  591. type: Object
  592. },
  593. operators: {
  594. type: Array,
  595. default: function () {
  596. return new Array()
  597. }
  598. },
  599. types: {
  600. type: Array,
  601. default: function () {
  602. return new Array()
  603. }
  604. },
  605. info: {
  606. type: Array,
  607. default: function () {
  608. return new Array()
  609. }
  610. },
  611. last_prescription: {
  612. type: Object
  613. },
  614. prescription_prop: {
  615. type: Object
  616. },
  617. is_open: {
  618. type: Number
  619. },
  620. targetAdvices: {
  621. type: Array,
  622. default: function () {
  623. return new Array()
  624. }
  625. },
  626. waitUploadAdvices: {
  627. type: Array,
  628. default: function () {
  629. return new Array()
  630. }
  631. },
  632. machines_prop: {
  633. type: Array,
  634. default: function () {
  635. return new Array()
  636. }
  637. }
  638. },
  639. data () {
  640. return {
  641. showTxt: '',
  642. hasPermission: true,
  643. is_pre: 0,
  644. template_id: 0,
  645. loading: false,
  646. signUrl: '',
  647. isShowDesc: true,
  648. advice_visibility: false,
  649. msgtip_visibility: false,
  650. time: '03:00',
  651. timeValue: '',
  652. tempTimeValue: '',
  653. isShowSign: false,
  654. anticoagulantsConfit: {},
  655. anticoagulantsConfitTwo: {},
  656. dialysateFormulationOptions: [],
  657. bodyFluidOptions: [],
  658. specialMedicineOptions: [],
  659. displaceLiquiPartOptions: [],
  660. bloodAccessOptions: [],
  661. advicePropForm: {
  662. list: [],
  663. result: [],
  664. operators: []
  665. },
  666. is_show: false,
  667. perfusion_apparatus: {},
  668. replacementWays: [],
  669. dialyserList: [],
  670. modeOption: [],
  671. isShowDoctorBtn: true,
  672. isShowDoctorSign: false,
  673. visibility: false,
  674. isShowDialog: true,
  675. isShowModeSubMenu: false,
  676. dialysisPrescription: {
  677. mode_id: '',
  678. dialysis_duration: '',
  679. dialysis_duration_hour: '',
  680. dialysis_duration_minute: '',
  681. mode_name: '',
  682. dialyzer: '',
  683. perfusion_apparatus: '',
  684. blood_flow_volume: '',
  685. dewater_amount: '',
  686. displace_liqui: '',
  687. replacement_total: '',
  688. replacement_way: '',
  689. anticoagulant: '',
  690. anticoagulant_shouji: '',
  691. anticoagulant_weichi: '',
  692. anticoagulant_zongliang: '',
  693. anticoagulant_gaimingcheng: '',
  694. anticoagulant_gaijiliang: '',
  695. dialyzer_perfusion_apparatus: '',
  696. no_anticoagulant_shouji: '0',
  697. no_anticoagulant_weichi: '0',
  698. no_anticoagulant_zongliang: '0',
  699. kalium: '',
  700. sodium: '',
  701. calcium: '',
  702. bicarbonate: '',
  703. glucose: '',
  704. prescription_doctor: '',
  705. // dry_weight: "",
  706. dialysate_flow: '',
  707. dialysate_temperature: '',
  708. target_ultrafiltration: '',
  709. dialysate_formulation: '',
  710. conductivity: '',
  711. doctor: '',
  712. remark: '',
  713. body_fluid: '',
  714. special_medicine: '',
  715. special_medicine_other: '',
  716. displace_liqui_part: '',
  717. displace_liqui_value: '',
  718. blood_access: '',
  719. ultrafiltration: '',
  720. body_fluid_other: '',
  721. niprocart: '',
  722. jms: '',
  723. fistula_needle_set: '',
  724. fistula_needle_set_16: '',
  725. hemoperfusion: '',
  726. dialyser_sterilised: '',
  727. filtryzer: '',
  728. target_ktv: '',
  729. dialyzers: '',
  730. injector: '',
  731. bloodlines: '',
  732. tubing_hemodialysis: '',
  733. package: '',
  734. a_liquid: '',
  735. creater: '',
  736. modifier: ''
  737. },
  738. anticoagulant: {
  739. id: 0,
  740. name: '',
  741. type: 1,
  742. shouji: 1,
  743. weichi: 1,
  744. zongliang: 1,
  745. gaimingcheng: -1,
  746. gaijiliang: -1,
  747. shouji_unit: 'mg',
  748. weichi_unit: 'mg/h',
  749. zongliang_unit: 'mg',
  750. gaimingcheng_unit: '',
  751. gaijiliang_unit: ''
  752. },
  753. zhiShow: true,
  754. totalShow: true,
  755. huShow: true,
  756. doctorAdvices: [],
  757. propForm: {
  758. title: '',
  759. list: [],
  760. optionList: [],
  761. isMultiple: 2,
  762. result: [], // 选中的值
  763. type: 1, // 用来区分不同子菜单,方便对返回值进行赋值
  764. selectId: 0
  765. },
  766. data: [],
  767. dialyzerPerfusionApparatus: []
  768. }
  769. },
  770. computed: {
  771. // 计算属性的 getter
  772. },
  773. methods: {
  774. newClick (event) {
  775. event.currentTarget.select()
  776. },
  777. showmsgtip () {
  778. this.msgtip_visibility = true
  779. this.isShowDialog = false
  780. },
  781. isPermission () {
  782. if (
  783. this.$store.getters.user.user.user_type == 3 &&
  784. (this.$store.getters.user.template_info.template_id == 2 ||
  785. this.$store.getters.user.template_info.template_id == 6)
  786. ) {
  787. return false
  788. } else {
  789. return true
  790. }
  791. },
  792. isShow (name) {
  793. var filedList = this.$store.getters.user.fileds
  794. for (let i = 0; i < filedList.length; i++) {
  795. if (
  796. filedList[i].module == 1 &&
  797. filedList[i].filed_name_cn == name &&
  798. filedList[i].is_show == 1
  799. ) {
  800. return true
  801. }
  802. }
  803. return false
  804. },
  805. openPicker: function () {
  806. this.$refs.picker.open()
  807. },
  808. handleTimeConfirm: function (val) {
  809. val = val.replace('小时')
  810. val = val.replace('分钟')
  811. let timeArray = val.split(':')
  812. if (parseInt(timeArray[0].substring(0, 1)) == 0) {
  813. this.dialysisPrescription.dialysis_duration_hour = timeArray[0].charAt(
  814. timeArray[0].length - 1
  815. )
  816. } else {
  817. this.dialysisPrescription.dialysis_duration_hour = timeArray[0]
  818. }
  819. if (parseInt(timeArray[1].substring(0, 1)) == 0) {
  820. this.dialysisPrescription.dialysis_duration_minute = timeArray[1].charAt(
  821. timeArray[1].length - 1
  822. )
  823. } else {
  824. this.dialysisPrescription.dialysis_duration_minute = timeArray[1]
  825. }
  826. this.timeValue =
  827. this.dialysisPrescription.dialysis_duration_hour +
  828. '小时' +
  829. this.dialysisPrescription.dialysis_duration_minute +
  830. '分钟'
  831. this.dialysisPrescription.dialysis_duration =
  832. parseFloat(this.dialysisPrescription.dialysis_duration_hour) +
  833. parseFloat(
  834. (this.dialysisPrescription.dialysis_duration_minute / 60).toFixed(2)
  835. )
  836. },
  837. inputFocus: function (event) {
  838. var input = event.target
  839. setTimeout(function () {
  840. input.scrollIntoView()
  841. }, 0)
  842. if (input.setSelectionRange) {
  843. setTimeout(function () {
  844. input.setSelectionRange(0, input.value.length)
  845. }, 0)
  846. } else if (input.createTextRange) {
  847. var rng = input.createTextRange()
  848. rng.move('character', input.value.length)
  849. rng.select()
  850. }
  851. },
  852. lastInputFocus: function (event) {
  853. var input = event.target
  854. event.currentTarget.select()
  855. setTimeout(function () {
  856. input.style.marginBottom = '2rem'
  857. input.parentNode.scrollIntoView()
  858. }, 0)
  859. },
  860. lastInputBlur: function (event) {
  861. var input = event.target
  862. setTimeout(function () {
  863. input.style.marginBottom = ''
  864. }, 0)
  865. },
  866. showSubMenu: function (val) {
  867. switch (val) {
  868. case 'mode':
  869. this.propForm.type = 1
  870. this.isShowDialog = false
  871. this.propForm.title = '透析模式'
  872. this.visibility = true
  873. this.propForm.list = []
  874. this.propForm.optionList = this.modeOption
  875. this.propForm.isMultiple = 1
  876. this.propForm.selectId = this.dialysisPrescription.mode_id
  877. this.propForm.click_ref = 'mode'
  878. break
  879. case 'dialyzer':
  880. this.propForm.type = 2
  881. this.isShowDialog = false
  882. this.propForm.title = '透析器'
  883. this.visibility = true
  884. this.propForm.list = []
  885. this.propForm.optionList = this.machines_prop
  886. this.propForm.isMultiple = 1
  887. this.propForm.selectId = this.dialysisPrescription.dialyzer
  888. this.propForm.click_ref = 'dialyzer'
  889. break
  890. case 'perfusion_apparatus':
  891. this.propForm.type = 3
  892. this.isShowDialog = false
  893. this.propForm.title = '灌流器'
  894. this.visibility = true
  895. this.propForm.list = []
  896. this.propForm.optionList = this.perfusion_apparatus
  897. this.propForm.isMultiple = 1
  898. this.propForm.selectId = this.dialysisPrescription.perfusion_apparatus
  899. this.propForm.click_ref = 'perfusion_apparatus'
  900. break
  901. case 'replacement_way':
  902. this.propForm.type = 4
  903. this.isShowDialog = false
  904. this.propForm.title = '置换方式'
  905. this.visibility = true
  906. this.propForm.list = []
  907. this.propForm.optionList = this.replacementWays
  908. this.propForm.isMultiple = 1
  909. this.propForm.selectId = this.dialysisPrescription.replacement_way
  910. this.propForm.click_ref = 'replacement_way'
  911. break
  912. case 'anticoagulant':
  913. this.propForm.type = 5
  914. this.isShowDialog = false
  915. this.propForm.title = '抗疑剂'
  916. this.visibility = true
  917. this.propForm.list = []
  918. this.propForm.optionList = this.anticoagulantsConfit
  919. this.propForm.isMultiple = 1
  920. console.log('this-----', this.dialysisPrescription.anticoagulant)
  921. this.propForm.selectId = this.dialysisPrescription.anticoagulant
  922. this.propForm.click_ref = 'anticoagulant'
  923. break
  924. case 'dialysate_formulation':
  925. this.propForm.type = 6
  926. this.isShowDialog = false
  927. this.propForm.title = '透析液配方'
  928. this.visibility = true
  929. this.propForm.list = []
  930. this.propForm.optionList = this.dialysateFormulationOptions
  931. this.propForm.isMultiple = 1
  932. this.propForm.selectId = this.dialysisPrescription.dialysate_formulation
  933. this.propForm.click_ref = 'dialysate_formulation'
  934. break
  935. case 'body_fluid':
  936. this.propForm.type = 7
  937. this.isShowDialog = false
  938. this.propForm.title = '体液过多症状'
  939. this.visibility = true
  940. this.propForm.list = []
  941. this.propForm.optionList = this.bodyFluidOptions
  942. this.propForm.isMultiple = 1
  943. this.propForm.selectId = this.dialysisPrescription.body_fluid
  944. this.propForm.click_ref = 'body_fluid'
  945. break
  946. case 'special_medicine':
  947. this.propForm.type = 8
  948. this.isShowDialog = false
  949. this.propForm.title = '透析前使用特殊药物'
  950. this.visibility = true
  951. this.propForm.list = []
  952. this.propForm.optionList = this.specialMedicineOptions
  953. this.propForm.isMultiple = 1
  954. this.propForm.selectId = this.dialysisPrescription.special_medicine
  955. this.propForm.click_ref = 'special_medicine'
  956. break
  957. case 'displace_liqui_part':
  958. this.propForm.type = 9
  959. this.isShowDialog = false
  960. this.propForm.title = '置换液'
  961. this.visibility = true
  962. this.propForm.list = []
  963. this.propForm.optionList = this.displaceLiquiPartOptions
  964. this.propForm.isMultiple = 1
  965. this.propForm.selectId = this.dialysisPrescription.displace_liqui_part
  966. this.propForm.click_ref = 'displace_liqui_part'
  967. break
  968. case 'blood_access':
  969. this.propForm.type = 10
  970. this.isShowDialog = false
  971. this.propForm.title = '血管通路'
  972. this.visibility = true
  973. this.propForm.list = []
  974. this.propForm.optionList = this.bloodAccessOptions
  975. this.propForm.isMultiple = 1
  976. this.propForm.selectId = this.dialysisPrescription.blood_access
  977. this.propForm.click_ref = 'blood_access'
  978. break
  979. case 'vascular_access_desc':
  980. this.propForm.type = 10
  981. this.isShowDialog = false
  982. this.propForm.title = '血管通路'
  983. this.visibility = true
  984. this.propForm.list = []
  985. this.propForm.optionList = this.data
  986. this.propForm.isMultiple = 1
  987. this.propForm.selectId = this.dialysisPrescription.blood_access
  988. this.propForm.click_ref = 'vascular_access_desc'
  989. break
  990. case 'dialyzer_perfusion_apparatus':
  991. this.propForm.type = 11
  992. this.isShowDialog = false
  993. this.propForm.title = '透析器/灌流器'
  994. this.visibility = true
  995. this.propForm.list = []
  996. this.propForm.optionList = this.dialyzerPerfusionApparatus
  997. this.propForm.isMultiple = 1
  998. this.propForm.selectId = this.dialysisPrescription.dialyzer_perfusion_apparatus
  999. this.propForm.click_ref = 'dialyzer_perfusion_apparatus'
  1000. break
  1001. }
  1002. },
  1003. QueryPartById: function (val) {
  1004. let vascular_access_part_name = ''
  1005. let vascular_access = getDataConfig(
  1006. 'hemodialysis',
  1007. 'vascular_access_desc'
  1008. )
  1009. for (let i = 0; i < vascular_access.length; i++) {
  1010. if (vascular_access[i].id == val) {
  1011. vascular_access_part_name = vascular_access[i].name
  1012. }
  1013. }
  1014. return vascular_access_part_name
  1015. },
  1016. menuCancle: function () {
  1017. this.visibility = false
  1018. this.isShowDialog = true
  1019. this.$nextTick(() => {
  1020. if (
  1021. this.$refs[this.propForm.click_ref] != undefined &&
  1022. this.$refs[this.propForm.click_ref] != null
  1023. ) {
  1024. this.$refs[this.propForm.click_ref].scrollIntoView()
  1025. }
  1026. })
  1027. },
  1028. menuCancleThree: function () {
  1029. this.advice_visibility = false
  1030. this.isShowDialog = true
  1031. },
  1032. menuMsgTip: function () {
  1033. this.msgtip_visibility = false
  1034. this.isShowDialog = true
  1035. },
  1036. menuComfirmThree: function (targetAdvices) {
  1037. if (targetAdvices.length > 0) {
  1038. if (this.is_pre == 1) {
  1039. Toast.loading({ forbidClick: true, duration: 0 })
  1040. var arr = this.dialysisPrescription
  1041. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1042. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1043. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1044. }
  1045. }
  1046. let ParamsQuery = arr
  1047. ParamsQuery['patient'] = this.$route.query.patient_id
  1048. ParamsQuery['record_date'] = this.record_date
  1049. if (this.prescription_prop.id == '') {
  1050. ParamsQuery['mode'] = '1'
  1051. } else {
  1052. if (this.prescription_prop.creater == 0) {
  1053. ParamsQuery['mode'] = '1'
  1054. } else {
  1055. ParamsQuery['mode'] = '2'
  1056. if (
  1057. this.prescription_prop.creater !=
  1058. this.$store.getters.user.admin.id
  1059. ) {
  1060. ParamsQuery['mode'] = '3'
  1061. }
  1062. }
  1063. }
  1064. commitDialysisPrescription(ParamsQuery)
  1065. .then(response => {
  1066. if (response.data.state == 0) {
  1067. Toast.fail(response.data.msg)
  1068. return false
  1069. } else {
  1070. var date = new Date()
  1071. var year = date.getFullYear()
  1072. var month = date.getMonth() + 1
  1073. var day = date.getDate()
  1074. var hours = date.getHours()
  1075. var minites = date.getMinutes()
  1076. if (month < 10) {
  1077. month = '0' + month
  1078. }
  1079. if (day < 10) {
  1080. day = '0' + day
  1081. }
  1082. if (hours < 10) {
  1083. hours = '0' + hours
  1084. }
  1085. if (minites < 10) {
  1086. minites = '0' + minites
  1087. }
  1088. var nowDate =
  1089. year + '-' + month + '-' + day + ' ' + hours + ':' + minites
  1090. Toast.success('提交成功')
  1091. let params = {
  1092. advices: targetAdvices,
  1093. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  1094. advice_doctor: targetAdvices[0].advice_doctor,
  1095. advice_type: targetAdvices[0].advice_type,
  1096. parent_id: this.$route.query.patient_id,
  1097. start_time: nowDate,
  1098. remark: ''
  1099. }
  1100. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(
  1101. rs => {
  1102. var resp = rs.data
  1103. if (resp.state == 1) {
  1104. this.$emit(
  1105. 'prescription',
  1106. response.data.data.prescription,
  1107. resp.data.advices
  1108. )
  1109. } else {
  1110. }
  1111. }
  1112. )
  1113. this.finish()
  1114. }
  1115. })
  1116. .catch(error => {
  1117. Toast.fail('请求失败')
  1118. })
  1119. } else if (this.is_pre == 2) {
  1120. Toast.loading({ forbidClick: true, duration: 0 })
  1121. var arr = this.dialysisPrescription
  1122. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1123. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1124. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1125. }
  1126. }
  1127. let ParamsQuery = arr
  1128. ParamsQuery['patient'] = this.$route.query.patient_id
  1129. ParamsQuery['record_date'] = this.record_date
  1130. ParamsQuery['mode'] = '1'
  1131. postSolution(ParamsQuery)
  1132. .then(response => {
  1133. if (response.data.state == 0) {
  1134. Toast.fail(response.data.msg)
  1135. return false
  1136. } else {
  1137. Toast.success('提交成功')
  1138. var date = new Date()
  1139. var year = date.getFullYear()
  1140. var month = date.getMonth() + 1
  1141. var day = date.getDate()
  1142. var hours = date.getHours()
  1143. var minites = date.getMinutes()
  1144. if (month < 10) {
  1145. month = '0' + month
  1146. }
  1147. if (day < 10) {
  1148. day = '0' + day
  1149. }
  1150. if (hours < 10) {
  1151. hours = '0' + hours
  1152. }
  1153. if (minites < 10) {
  1154. minites = '0' + minites
  1155. }
  1156. var nowDate =
  1157. year + '-' + month + '-' + day + ' ' + hours + ':' + minites
  1158. let params = {
  1159. advices: targetAdvices,
  1160. advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
  1161. advice_doctor: targetAdvices[0].advice_doctor,
  1162. advice_type: targetAdvices[0].advice_type,
  1163. parent_id: this.$route.query.patient_id,
  1164. start_time: nowDate,
  1165. remark: ''
  1166. }
  1167. CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(
  1168. rs => {
  1169. var resp = rs.data
  1170. if (resp.state == 1) {
  1171. this.$emit(
  1172. 'prescription',
  1173. response.data.data.prescription,
  1174. resp.data.advices
  1175. )
  1176. this.$emit(
  1177. 'longSolution',
  1178. response.data.data.solution,
  1179. resp.data.advices
  1180. )
  1181. } else {
  1182. }
  1183. }
  1184. )
  1185. this.finish()
  1186. }
  1187. })
  1188. .catch(error => {
  1189. Toast.fail('请求失败')
  1190. })
  1191. }
  1192. } else {
  1193. if (this.is_pre == 1) {
  1194. Toast.loading({ forbidClick: true, duration: 0 })
  1195. var arr = this.dialysisPrescription
  1196. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1197. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1198. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1199. }
  1200. }
  1201. let ParamsQuery = arr
  1202. ParamsQuery['patient'] = this.$route.query.patient_id
  1203. ParamsQuery['record_date'] = this.record_date
  1204. if (this.prescription_prop.id == '') {
  1205. ParamsQuery['mode'] = '1'
  1206. } else {
  1207. if (this.prescription_prop.creater == 0) {
  1208. ParamsQuery['mode'] = '1'
  1209. } else {
  1210. ParamsQuery['mode'] = '2'
  1211. if (
  1212. this.prescription_prop.creater !=
  1213. this.$store.getters.user.admin.id
  1214. ) {
  1215. ParamsQuery['mode'] = '3'
  1216. }
  1217. }
  1218. }
  1219. commitDialysisPrescription(ParamsQuery).then(response => {
  1220. if (response.data.state == 0) {
  1221. Toast.fail(response.data.msg)
  1222. return false
  1223. } else {
  1224. Toast.success('提交成功')
  1225. this.$emit(
  1226. 'prescription',
  1227. response.data.data.prescription,
  1228. this.doctorAdvices
  1229. )
  1230. this.finish()
  1231. }
  1232. })
  1233. } else if (this.is_pre == 2) {
  1234. Toast.loading({ forbidClick: true, duration: 0 })
  1235. var arr = this.dialysisPrescription
  1236. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1237. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1238. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1239. }
  1240. }
  1241. let ParamsQuery = arr
  1242. console.log('推送3---', ParamsQuery)
  1243. ParamsQuery['patient'] = this.$route.query.patient_id
  1244. ParamsQuery['record_date'] = this.record_date
  1245. ParamsQuery['mode'] = '1'
  1246. postSolution(ParamsQuery)
  1247. .then(response => {
  1248. if (response.data.state == 0) {
  1249. Toast.fail(response.data.msg)
  1250. return false
  1251. } else {
  1252. Toast.success('提交成功')
  1253. this.$emit(
  1254. 'longSolution',
  1255. response.data.data.solution,
  1256. this.doctorAdvices
  1257. )
  1258. this.$emit(
  1259. 'prescription',
  1260. response.data.data.prescription,
  1261. this.doctorAdvices
  1262. )
  1263. this.finish()
  1264. }
  1265. })
  1266. .catch(error => {
  1267. Toast.fail('请求失败')
  1268. })
  1269. }
  1270. }
  1271. },
  1272. menuComfirm: function (val) {
  1273. this.visibility = false
  1274. this.isShowDialog = true
  1275. this.$nextTick(() => {
  1276. if (
  1277. this.$refs[this.propForm.click_ref] != undefined &&
  1278. this.$refs[this.propForm.click_ref] != null
  1279. ) {
  1280. this.$refs[this.propForm.click_ref].scrollIntoView()
  1281. }
  1282. })
  1283. switch (val.type) {
  1284. case 1:
  1285. Toast.loading({
  1286. forbidClick: true,
  1287. duration: 0,
  1288. message: '切换模式中,请稍候'
  1289. })
  1290. // 从服务器获取对应模式的长期处方
  1291. let ParamsQuery = {}
  1292. ParamsQuery['patient_id'] = this.$route.query.patient_id
  1293. ParamsQuery['mode_id'] = val.selectId
  1294. GetSolution(ParamsQuery)
  1295. .then(response => {
  1296. if (response.data.state == 0) {
  1297. Toast.fail(response.data.msg)
  1298. return false
  1299. } else {
  1300. Toast.success('切换成功')
  1301. if (response.data.data.solution != null) {
  1302. for (const key in response.data.data.solution) {
  1303. // 长期处方不为空
  1304. if (key != 'target_ultrafiltration') {
  1305. this.dialysisPrescription[key] =
  1306. response.data.data.solution[key]
  1307. }
  1308. }
  1309. } else {
  1310. if (response.data.data.prescription != null) {
  1311. // 临时处方不为空
  1312. for (const key in response.data.data.prescription) {
  1313. if (key != 'target_ultrafiltration') {
  1314. this.dialysisPrescription[key] =
  1315. response.data.data.prescription[key]
  1316. }
  1317. }
  1318. } else if (response.data.data.system_prescription != null) {
  1319. for (const key in response.data.data.system_prescription) {
  1320. if (key != 'target_ultrafiltration') {
  1321. this.dialysisPrescription[key] =
  1322. response.data.data.system_prescription[key]
  1323. }
  1324. }
  1325. } else {
  1326. for (const key in this.dialysisPrescription) {
  1327. // 临时处方为空
  1328. if (key != 'target_ultrafiltration') {
  1329. this.dialysisPrescription[key] = ''
  1330. }
  1331. }
  1332. this.dialysisPrescription.mode_id = val.selectId
  1333. }
  1334. }
  1335. }
  1336. if (
  1337. this.dialysisPrescription.dialysis_duration_hour === '' ||
  1338. this.dialysisPrescription.dialysis_duration_minute === ''
  1339. ) {
  1340. this.timeValue = ''
  1341. this.time = '03:00'
  1342. } else {
  1343. this.timeValue =
  1344. this.dialysisPrescription.dialysis_duration_hour +
  1345. '小时' +
  1346. this.dialysisPrescription.dialysis_duration_minute +
  1347. '分钟'
  1348. this.time =
  1349. (this.dialysisPrescription.dialysis_duration_hour > 10
  1350. ? this.dialysisPrescription.dialysis_duration_hour
  1351. : '0' + this.dialysisPrescription.dialysis_duration_hour) +
  1352. ':' +
  1353. (this.dialysisPrescription.dialysis_duration_minute > 10
  1354. ? this.dialysisPrescription.dialysis_duration_minute
  1355. : '0' + this.dialysisPrescription.dialysis_duration_minute)
  1356. }
  1357. })
  1358. .catch(error => {
  1359. Toast.fail('请求失败')
  1360. })
  1361. break
  1362. case 2:
  1363. this.dialysisPrescription.dialyzer = val.selectId
  1364. break
  1365. case 3:
  1366. this.dialysisPrescription.perfusion_apparatus = val.selectId
  1367. break
  1368. case 4:
  1369. this.dialysisPrescription.replacement_way = val.selectId
  1370. break
  1371. case 5:
  1372. this.dialysisPrescription.anticoagulant = val.selectId
  1373. if (
  1374. typeof this.anticoagulantsConfit[val.selectId] === 'undefined' ||
  1375. this.anticoagulantsConfit[val.selectId] == null
  1376. ) {
  1377. return
  1378. }
  1379. this.anticoagulant = this.anticoagulantsConfit[val.selectId]
  1380. break
  1381. case 6:
  1382. this.dialysisPrescription.dialysate_formulation = val.selectId
  1383. break
  1384. case 7:
  1385. this.dialysisPrescription.body_fluid = val.selectId
  1386. break
  1387. case 8:
  1388. this.dialysisPrescription.special_medicine = val.selectId
  1389. break
  1390. case 9:
  1391. this.dialysisPrescription.displace_liqui_part = val.selectId
  1392. break
  1393. case 10:
  1394. this.dialysisPrescription.blood_access = val.selectId
  1395. break
  1396. case 11:
  1397. this.dialysisPrescription.dialyzer_perfusion_apparatus = val.selectId
  1398. break
  1399. }
  1400. },
  1401. GetModeByModeId: function (val) {
  1402. let treatment_mode_name = ''
  1403. let treatment_mode = this.modeOption
  1404. for (let keys in treatment_mode) {
  1405. if (treatment_mode[keys].id == val) {
  1406. treatment_mode_name = treatment_mode[keys].name
  1407. }
  1408. }
  1409. for (let keys in treatment_mode) {
  1410. if (treatment_mode[keys].id == val) {
  1411. treatment_mode_name = treatment_mode[keys].name
  1412. var treatment_mode_id = treatment_mode[keys].id
  1413. if (
  1414. treatment_mode_id === 1 ||
  1415. treatment_mode_id === 3 ||
  1416. treatment_mode_id === 4 ||
  1417. treatment_mode_id === 6 ||
  1418. treatment_mode_id === 7 ||
  1419. treatment_mode_id === 8 ||
  1420. treatment_mode_id === 9 ||
  1421. treatment_mode_id === 10 ||
  1422. treatment_mode_id === 11 ||
  1423. treatment_mode_id === 13 ||
  1424. treatment_mode_id === 14 ||
  1425. treatment_mode_id === 15 ||
  1426. treatment_mode_id === 16 ||
  1427. treatment_mode_id === 19
  1428. ) {
  1429. this.zhiShow = false
  1430. this.totalShow = false
  1431. this.huShow = false
  1432. } else {
  1433. this.zhiShow = true
  1434. this.totalShow = true
  1435. this.huShow = true
  1436. }
  1437. }
  1438. }
  1439. return treatment_mode_name
  1440. },
  1441. GetDialysateFormulationById: function (val) {
  1442. let name = ''
  1443. let dfl = this.dialysateFormulationOptions.length
  1444. for (let index = 0; index < dfl; index++) {
  1445. if (this.dialysateFormulationOptions[index].id == val) {
  1446. name = this.dialysateFormulationOptions[index].name
  1447. break
  1448. }
  1449. }
  1450. return name
  1451. },
  1452. GetDialyzerById: function (val) {
  1453. let dialyzer_name = ''
  1454. let machines = this.machines_prop
  1455. for (let i = 0; i < machines.length; i++) {
  1456. if (machines[i].id == val) {
  1457. dialyzer_name = machines[i].name
  1458. }
  1459. }
  1460. return dialyzer_name
  1461. },
  1462. GetPerfusionApparatusById: function (val) {
  1463. let perfusion_apparatus_name = ''
  1464. let perfusion_apparatus = this.perfusion_apparatus
  1465. for (let i = 0; i < perfusion_apparatus.length; i++) {
  1466. if (perfusion_apparatus[i].id == val) {
  1467. perfusion_apparatus_name = perfusion_apparatus[i].name
  1468. }
  1469. }
  1470. return perfusion_apparatus_name
  1471. },
  1472. GetReplacementWayById: function (val) {
  1473. let replacement_ways_name = ''
  1474. let replacement_ways = this.replacementWays
  1475. for (let i = 0; i < replacement_ways.length; i++) {
  1476. if (replacement_ways[i].id == val) {
  1477. replacement_ways_name = replacement_ways[i].name
  1478. }
  1479. }
  1480. return replacement_ways_name
  1481. },
  1482. GetAnticoagulantById: function (val) {
  1483. console.log('aaaaaa', val)
  1484. let anticoagulan_name = ''
  1485. let anticoagulant = this.anticoagulantsConfitTwo
  1486. for (let keys in anticoagulant) {
  1487. if (anticoagulant[keys].id == val) {
  1488. anticoagulan_name = anticoagulant[keys].name
  1489. }
  1490. }
  1491. return anticoagulan_name
  1492. },
  1493. commitInfo: function () {
  1494. if (this.dialysisPrescription.anticoagulant == 1) {
  1495. this.dialysisPrescription.anticoagulant_weichi = '0'
  1496. this.dialysisPrescription.anticoagulant_shouji = '0'
  1497. this.dialysisPrescription.anticoagulant_zongliang = '0'
  1498. }
  1499. if (this.$store.getters.user.template_info.template_id == 6) {
  1500. if (this.dialysisPrescription.mode_id == 2) {
  1501. if (
  1502. this.dialysisPrescription.displace_liqui_part == 0 ||
  1503. this.dialysisPrescription.displace_liqui_part == -2 ||
  1504. this.dialysisPrescription.displace_liqui_value == 0 ||
  1505. this.dialysisPrescription.displace_liqui_value == ''
  1506. ) {
  1507. Toast.fail('HDF模式下置换方式和置换液总量不能为空!')
  1508. return
  1509. }
  1510. }
  1511. }
  1512. this.is_pre = 1
  1513. if (this.prescription_prop.id == '') {
  1514. if (this.is_open == 0) {
  1515. Toast.loading({ forbidClick: true, duration: 0 })
  1516. var arr = this.dialysisPrescription
  1517. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1518. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1519. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1520. }
  1521. }
  1522. let ParamsQuery = arr
  1523. console.log('ParamsQueryOne', ParamsQuery)
  1524. ParamsQuery['patient'] = this.$route.query.patient_id
  1525. ParamsQuery['record_date'] = this.record_date
  1526. ParamsQuery['mode'] = '1'
  1527. commitDialysisPrescription(ParamsQuery)
  1528. .then(response => {
  1529. if (response.data.state == 0) {
  1530. Toast.fail(response.data.msg)
  1531. return false
  1532. } else {
  1533. Toast.success('提交成功')
  1534. this.$emit(
  1535. 'prescription',
  1536. response.data.data.prescription,
  1537. this.doctorAdvices
  1538. )
  1539. this.finish()
  1540. }
  1541. })
  1542. .catch(error => {
  1543. Toast.fail('请求失败')
  1544. })
  1545. } else if (this.is_open == 1) {
  1546. if (this.targetAdvices.length > 0) {
  1547. // 弹框推送提醒
  1548. this.advicePropForm.list = this.targetAdvices
  1549. this.advicePropForm.operators = this.admin_users_prop
  1550. this.advice_visibility = true
  1551. this.isShowDialog = false
  1552. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  1553. if (
  1554. this.advicePropForm.list[i].parent_id == 0 &&
  1555. this.advicePropForm.list[i].isCheck == 1
  1556. ) {
  1557. this.advicePropForm.result.push(this.advicePropForm.list[i].id)
  1558. }
  1559. }
  1560. } else {
  1561. Toast.loading({ forbidClick: true, duration: 0 })
  1562. var arr = this.dialysisPrescription
  1563. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1564. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1565. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1566. }
  1567. }
  1568. let ParamsQuery = arr
  1569. console.log('ParamsQueryTwo', ParamsQuery)
  1570. ParamsQuery['patient'] = this.$route.query.patient_id
  1571. ParamsQuery['record_date'] = this.record_date
  1572. ParamsQuery['mode'] = '1'
  1573. commitDialysisPrescription(ParamsQuery)
  1574. .then(response => {
  1575. if (response.data.state == 0) {
  1576. Toast.fail(response.data.msg)
  1577. return false
  1578. } else {
  1579. Toast.success('提交成功')
  1580. this.$emit(
  1581. 'prescription',
  1582. response.data.data.prescription,
  1583. this.doctorAdvices
  1584. )
  1585. this.finish()
  1586. }
  1587. })
  1588. .catch(error => {
  1589. Toast.fail('请求失败')
  1590. })
  1591. }
  1592. } else if (this.is_open == 2) {
  1593. if (this.waitUploadAdvices.length > 0) {
  1594. Toast.loading({ forbidClick: true, duration: 0 })
  1595. var arr = this.dialysisPrescription
  1596. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1597. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1598. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1599. }
  1600. }
  1601. let ParamsQuery = arr
  1602. console.log('ParamsQueryThree', ParamsQuery)
  1603. ParamsQuery['patient'] = this.$route.query.patient_id
  1604. ParamsQuery['record_date'] = this.record_date
  1605. ParamsQuery['mode'] = '1'
  1606. commitDialysisPrescription(ParamsQuery)
  1607. .then(response => {
  1608. if (response.data.state == 0) {
  1609. Toast.fail(response.data.msg)
  1610. return false
  1611. } else {
  1612. Toast.success('提交成功')
  1613. var date = new Date()
  1614. var year = date.getFullYear()
  1615. var month = date.getMonth() + 1
  1616. var day = date.getDate()
  1617. var hours = date.getHours()
  1618. var minites = date.getMinutes()
  1619. if (month < 10) {
  1620. month = '0' + month
  1621. }
  1622. if (day < 10) {
  1623. day = '0' + day
  1624. }
  1625. if (hours < 10) {
  1626. hours = '0' + hours
  1627. }
  1628. if (minites < 10) {
  1629. minites = '0' + minites
  1630. }
  1631. var nowDate =
  1632. year +
  1633. '-' +
  1634. month +
  1635. '-' +
  1636. day +
  1637. ' ' +
  1638. hours +
  1639. ':' +
  1640. minites
  1641. let params = {
  1642. advices: this.waitUploadAdvices,
  1643. advice_date: parseTime(
  1644. this.$route.query.date,
  1645. '{y}-{m}-{d}'
  1646. ),
  1647. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  1648. advice_type: this.waitUploadAdvices[0].advice_type,
  1649. parent_id: this.$route.query.patient_id,
  1650. start_time: nowDate,
  1651. remark: ''
  1652. }
  1653. CreateGroupAdvice(
  1654. this.$route.query.patient_id,
  1655. 0,
  1656. params
  1657. ).then(rs => {
  1658. var resp = rs.data
  1659. if (resp.state == 1) {
  1660. this.$emit(
  1661. 'prescription',
  1662. response.data.data.prescription,
  1663. resp.data.advices
  1664. )
  1665. } else {
  1666. }
  1667. })
  1668. this.finish()
  1669. }
  1670. })
  1671. .catch(error => {
  1672. Toast.fail('请求失败')
  1673. })
  1674. } else {
  1675. Toast.loading({ forbidClick: true, duration: 0 })
  1676. var arr = this.dialysisPrescription
  1677. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1678. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1679. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1680. }
  1681. }
  1682. let ParamsQuery = arr
  1683. console.log('ParamsQueryFour', ParamsQuery)
  1684. ParamsQuery['patient'] = this.$route.query.patient_id
  1685. ParamsQuery['record_date'] = this.record_date
  1686. commitDialysisPrescription(ParamsQuery)
  1687. .then(response => {
  1688. if (response.data.state == 0) {
  1689. Toast.fail(response.data.msg)
  1690. return false
  1691. } else {
  1692. this.advice_visibility = false
  1693. Toast.success('提交成功')
  1694. this.$emit(
  1695. 'prescription',
  1696. response.data.data.prescription,
  1697. this.doctorAdvices
  1698. )
  1699. this.finish()
  1700. }
  1701. })
  1702. .catch(error => {
  1703. Toast.fail('请求失败')
  1704. })
  1705. }
  1706. }
  1707. } else {
  1708. if (this.prescription_prop.creater == 0) {
  1709. if (this.is_open == 0) {
  1710. Toast.loading({ forbidClick: true, duration: 0 })
  1711. var arr = this.dialysisPrescription
  1712. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1713. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1714. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1715. }
  1716. }
  1717. let ParamsQuery = arr
  1718. console.log('ParamsQueryFive', ParamsQuery)
  1719. ParamsQuery['patient'] = this.$route.query.patient_id
  1720. ParamsQuery['record_date'] = this.record_date
  1721. ParamsQuery['mode'] = '1'
  1722. commitDialysisPrescription(ParamsQuery)
  1723. .then(response => {
  1724. if (response.data.state == 0) {
  1725. Toast.fail(response.data.msg)
  1726. return false
  1727. } else {
  1728. Toast.success('提交成功')
  1729. this.$emit(
  1730. 'prescription',
  1731. response.data.data.prescription,
  1732. this.doctorAdvices
  1733. )
  1734. this.finish()
  1735. }
  1736. })
  1737. .catch(error => {
  1738. Toast.fail('请求失败')
  1739. })
  1740. } else if (this.is_open == 1) {
  1741. if (this.targetAdvices.length > 0) {
  1742. // 弹框推送提醒
  1743. this.advicePropForm.list = this.targetAdvices
  1744. this.advicePropForm.operators = this.admin_users_prop
  1745. this.advice_visibility = true
  1746. this.isShowDialog = false
  1747. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  1748. if (
  1749. this.advicePropForm.list[i].parent_id == 0 &&
  1750. this.advicePropForm.list[i].isCheck == 1
  1751. ) {
  1752. this.advicePropForm.result.push(
  1753. this.advicePropForm.list[i].id
  1754. )
  1755. }
  1756. }
  1757. } else {
  1758. Toast.loading({ forbidClick: true, duration: 0 })
  1759. var arr = this.dialysisPrescription
  1760. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1761. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1762. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1763. }
  1764. }
  1765. let ParamsQuery = arr
  1766. console.log('ParamsQuerySIx', ParamsQuery)
  1767. ParamsQuery['patient'] = this.$route.query.patient_id
  1768. ParamsQuery['record_date'] = this.record_date
  1769. ParamsQuery['mode'] = '1'
  1770. commitDialysisPrescription(ParamsQuery)
  1771. .then(response => {
  1772. if (response.data.state == 0) {
  1773. Toast.fail(response.data.msg)
  1774. return false
  1775. } else {
  1776. Toast.success('提交成功')
  1777. this.$emit(
  1778. 'prescription',
  1779. response.data.data.prescription,
  1780. this.doctorAdvices
  1781. )
  1782. this.finish()
  1783. }
  1784. })
  1785. .catch(error => {
  1786. Toast.fail('请求失败')
  1787. })
  1788. }
  1789. } else if (this.is_open == 2) {
  1790. if (this.waitUploadAdvices.length > 0) {
  1791. Toast.loading({ forbidClick: true, duration: 0 })
  1792. var arr = this.dialysisPrescription
  1793. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1794. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1795. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1796. }
  1797. }
  1798. let ParamsQuery = arr
  1799. console.log('ParamsQuerySeven', ParamsQuery)
  1800. ParamsQuery['patient'] = this.$route.query.patient_id
  1801. ParamsQuery['record_date'] = this.record_date
  1802. ParamsQuery['mode'] = '1'
  1803. commitDialysisPrescription(ParamsQuery)
  1804. .then(response => {
  1805. if (response.data.state == 0) {
  1806. Toast.fail(response.data.msg)
  1807. return false
  1808. } else {
  1809. var date = new Date()
  1810. var year = date.getFullYear()
  1811. var month = date.getMonth() + 1
  1812. var day = date.getDate()
  1813. var hours = date.getHours()
  1814. var minites = date.getMinutes()
  1815. if (month < 10) {
  1816. month = '0' + month
  1817. }
  1818. if (day < 10) {
  1819. day = '0' + day
  1820. }
  1821. if (hours < 10) {
  1822. hours = '0' + hours
  1823. }
  1824. if (minites < 10) {
  1825. minites = '0' + minites
  1826. }
  1827. var nowDate =
  1828. year +
  1829. '-' +
  1830. month +
  1831. '-' +
  1832. day +
  1833. ' ' +
  1834. hours +
  1835. ':' +
  1836. minites
  1837. let params = {
  1838. advices: this.waitUploadAdvices,
  1839. advice_date: parseTime(
  1840. this.$route.query.date,
  1841. '{y}-{m}-{d}'
  1842. ),
  1843. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  1844. advice_type: this.waitUploadAdvices[0].advice_type,
  1845. parent_id: this.$route.query.patient_id,
  1846. start_time: nowDate,
  1847. remark: ''
  1848. }
  1849. CreateGroupAdvice(
  1850. this.$route.query.patient_id,
  1851. 0,
  1852. params
  1853. ).then(rs => {
  1854. var resp = rs.data
  1855. if (resp.state == 1) {
  1856. this.doctorAdvices = resp.data.advices
  1857. this.$emit(
  1858. 'prescription',
  1859. response.data.data.prescription,
  1860. resp.data.advices
  1861. )
  1862. } else {
  1863. }
  1864. })
  1865. Toast.success('提交成功')
  1866. this.finish()
  1867. }
  1868. })
  1869. .catch(error => {
  1870. Toast.fail('请求失败')
  1871. })
  1872. } else {
  1873. Toast.loading({ forbidClick: true, duration: 0 })
  1874. var arr = this.dialysisPrescription
  1875. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1876. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1877. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1878. }
  1879. }
  1880. let ParamsQuery = arr
  1881. console.log('ParamsQueryeight', ParamsQuery)
  1882. ParamsQuery['patient'] = this.$route.query.patient_id
  1883. ParamsQuery['record_date'] = this.record_date
  1884. ParamsQuery['mode'] = '1'
  1885. commitDialysisPrescription(ParamsQuery)
  1886. .then(response => {
  1887. if (response.data.state == 0) {
  1888. Toast.fail(response.data.msg)
  1889. return false
  1890. } else {
  1891. Toast.success('提交成功')
  1892. this.$emit(
  1893. 'prescription',
  1894. response.data.data.prescription,
  1895. this.doctorAdvices
  1896. )
  1897. this.finish()
  1898. }
  1899. })
  1900. .catch(error => {
  1901. Toast.fail('请求失败')
  1902. })
  1903. }
  1904. }
  1905. } else {
  1906. Toast.loading({ forbidClick: true, duration: 0 })
  1907. var arr = this.dialysisPrescription
  1908. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1909. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1910. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1911. }
  1912. }
  1913. let ParamsQuery = arr
  1914. console.log('paramsquerynight', ParamsQuery)
  1915. ParamsQuery['patient'] = this.$route.query.patient_id
  1916. ParamsQuery['record_date'] = this.record_date
  1917. ParamsQuery['mode'] = '2'
  1918. if (
  1919. this.prescription_prop.creater != this.$store.getters.user.admin.id
  1920. ) {
  1921. ParamsQuery['mode'] = '3'
  1922. }
  1923. commitDialysisPrescription(ParamsQuery)
  1924. .then(response => {
  1925. if (response.data.state == 0) {
  1926. Toast.fail(response.data.msg)
  1927. return false
  1928. } else {
  1929. Toast.success('提交成功')
  1930. this.$emit(
  1931. 'prescription',
  1932. response.data.data.prescription,
  1933. this.doctorAdvices
  1934. )
  1935. this.finish()
  1936. }
  1937. })
  1938. .catch(error => {
  1939. Toast.fail('请求失败')
  1940. })
  1941. }
  1942. }
  1943. },
  1944. commitSolutionInfo: function () {
  1945. if (this.$store.getters.user.template_info.template_id == 6) {
  1946. if (this.dialysisPrescription.mode_id == 2) {
  1947. if (
  1948. this.dialysisPrescription.displace_liqui_part == 0 ||
  1949. this.dialysisPrescription.displace_liqui_part == -2 ||
  1950. this.dialysisPrescription.displace_liqui_value == 0 ||
  1951. this.dialysisPrescription.displace_liqui_value == ''
  1952. ) {
  1953. Toast.fail('HDF模式下置换方式和置换液总量不能为空!')
  1954. return
  1955. }
  1956. }
  1957. }
  1958. this.is_pre = 2
  1959. if (this.prescription_prop.id == '') {
  1960. if (this.is_open == 0) {
  1961. Toast.loading({ forbidClick: true, duration: 0 })
  1962. var arr = this.dialysisPrescription
  1963. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  1964. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  1965. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  1966. }
  1967. }
  1968. let ParamsQuery = arr
  1969. console.log('ParamsQueryOne', ParamsQuery)
  1970. ParamsQuery['patient'] = this.$route.query.patient_id
  1971. ParamsQuery['record_date'] = this.record_date
  1972. ParamsQuery['mode'] = '1'
  1973. postSolution(ParamsQuery).then(response => {
  1974. if (response.data.state == 0) {
  1975. Toast.fail(response.data.msg)
  1976. return false
  1977. } else {
  1978. Toast.success('提交成功')
  1979. this.$emit('advice')
  1980. this.$emit('longSolution', response.data.data.solution)
  1981. this.$emit('prescription', response.data.data.prescription)
  1982. this.finish()
  1983. }
  1984. })
  1985. } else if (this.is_open == 1) {
  1986. if (this.targetAdvices.length > 0) {
  1987. // 弹框推送提醒
  1988. this.advicePropForm.list = this.targetAdvices
  1989. this.advicePropForm.operators = this.admin_users_prop
  1990. this.advice_visibility = true
  1991. this.isShowDialog = false
  1992. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  1993. if (
  1994. this.advicePropForm.list[i].parent_id == 0 &&
  1995. this.advicePropForm.list[i].isCheck == 1
  1996. ) {
  1997. this.advicePropForm.result.push(this.advicePropForm.list[i].id)
  1998. }
  1999. }
  2000. } else {
  2001. Toast.loading({ forbidClick: true, duration: 0 })
  2002. var arr = this.dialysisPrescription
  2003. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2004. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2005. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2006. }
  2007. }
  2008. let ParamsQuery = arr
  2009. console.log('ParamsQueryOne', ParamsQuery)
  2010. ParamsQuery['patient'] = this.$route.query.patient_id
  2011. ParamsQuery['record_date'] = this.record_date
  2012. ParamsQuery['mode'] = '1'
  2013. postSolution(ParamsQuery)
  2014. .then(response => {
  2015. if (response.data.state == 0) {
  2016. Toast.fail(response.data.msg)
  2017. return false
  2018. } else {
  2019. Toast.success('提交成功')
  2020. this.$emit('advice')
  2021. this.$emit('longSolution', response.data.data.solution)
  2022. this.$emit('prescription', response.data.data.prescription)
  2023. this.finish()
  2024. }
  2025. })
  2026. .catch(error => {
  2027. Toast.fail('请求失败')
  2028. })
  2029. }
  2030. } else if (this.is_open == 2) {
  2031. if (this.waitUploadAdvices.length > 0) {
  2032. Toast.loading({ forbidClick: true, duration: 0 })
  2033. var arr = this.dialysisPrescription
  2034. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2035. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2036. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2037. }
  2038. }
  2039. let ParamsQuery = arr
  2040. console.log('ParamsQueryOne', ParamsQuery)
  2041. ParamsQuery['patient'] = this.$route.query.patient_id
  2042. ParamsQuery['record_date'] = this.record_date
  2043. ParamsQuery['mode'] = '1'
  2044. postSolution(ParamsQuery)
  2045. .then(response => {
  2046. if (response.data.state == 0) {
  2047. Toast.fail(response.data.msg)
  2048. return false
  2049. } else {
  2050. Toast.success('提交成功')
  2051. var date = new Date()
  2052. var year = date.getFullYear()
  2053. var month = date.getMonth() + 1
  2054. var day = date.getDate()
  2055. var hours = date.getHours()
  2056. var minites = date.getMinutes()
  2057. if (month < 10) {
  2058. month = '0' + month
  2059. }
  2060. if (day < 10) {
  2061. day = '0' + day
  2062. }
  2063. if (hours < 10) {
  2064. hours = '0' + hours
  2065. }
  2066. if (minites < 10) {
  2067. minites = '0' + minites
  2068. }
  2069. var nowDate =
  2070. year +
  2071. '-' +
  2072. month +
  2073. '-' +
  2074. day +
  2075. ' ' +
  2076. hours +
  2077. ':' +
  2078. minites
  2079. let params = {
  2080. advices: this.waitUploadAdvices,
  2081. advice_date: parseTime(
  2082. this.$route.query.date,
  2083. '{y}-{m}-{d}'
  2084. ),
  2085. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  2086. advice_type: this.waitUploadAdvices[0].advice_type,
  2087. parent_id: this.$route.query.patient_id,
  2088. start_time: nowDate,
  2089. remark: ''
  2090. }
  2091. CreateGroupAdvice(
  2092. this.$route.query.patient_id,
  2093. 0,
  2094. params
  2095. ).then(rs => {
  2096. var resp = rs.data
  2097. if (resp.state == 1) {
  2098. this.doctorAdvices = resp.data.advices
  2099. this.$emit(
  2100. 'longSolution',
  2101. response.data.data.solution,
  2102. resp.data.advices
  2103. )
  2104. this.$emit(
  2105. 'prescription',
  2106. response.data.data.prescription,
  2107. resp.data.advices
  2108. )
  2109. } else {
  2110. }
  2111. })
  2112. this.finish()
  2113. }
  2114. })
  2115. .catch(error => {
  2116. Toast.fail('请求失败')
  2117. })
  2118. } else {
  2119. Toast.loading({ forbidClick: true, duration: 0 })
  2120. var arr = this.dialysisPrescription
  2121. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2122. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2123. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2124. }
  2125. }
  2126. let ParamsQuery = arr
  2127. console.log('ParamsQueryOne', ParamsQuery)
  2128. ParamsQuery['patient'] = this.$route.query.patient_id
  2129. ParamsQuery['record_date'] = this.record_date
  2130. ParamsQuery['mode'] = '1'
  2131. postSolution(ParamsQuery)
  2132. .then(response => {
  2133. if (response.data.state == 0) {
  2134. Toast.fail(response.data.msg)
  2135. return false
  2136. } else {
  2137. Toast.success('提交成功')
  2138. this.$emit('longSolution', response.data.data.solution)
  2139. this.$emit('prescription', response.data.data.prescription)
  2140. this.finish()
  2141. }
  2142. })
  2143. .catch(error => {
  2144. Toast.fail('请求失败')
  2145. })
  2146. }
  2147. }
  2148. } else {
  2149. if (this.prescription_prop.creater == 0) {
  2150. if (this.is_open == 0) {
  2151. Toast.loading({ forbidClick: true, duration: 0 })
  2152. var arr = this.dialysisPrescription
  2153. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2154. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2155. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2156. }
  2157. }
  2158. let ParamsQuery = arr
  2159. console.log('ParamsQueryOne', ParamsQuery)
  2160. ParamsQuery['patient'] = this.$route.query.patient_id
  2161. ParamsQuery['record_date'] = this.record_date
  2162. ParamsQuery['mode'] = '1'
  2163. postSolution(ParamsQuery)
  2164. .then(response => {
  2165. if (response.data.state == 0) {
  2166. Toast.fail(response.data.msg)
  2167. return false
  2168. } else {
  2169. Toast.success('提交成功')
  2170. this.$emit('longSolution', response.data.data.solution)
  2171. this.$emit('prescription', response.data.data.prescription)
  2172. this.finish()
  2173. }
  2174. })
  2175. .catch(error => {
  2176. Toast.fail('请求失败')
  2177. })
  2178. } else if (this.is_open == 1) {
  2179. if (this.targetAdvices.length > 0) {
  2180. // 弹框推送提醒
  2181. this.advicePropForm.list = this.targetAdvices
  2182. this.advicePropForm.operators = this.admin_users_prop
  2183. this.advice_visibility = true
  2184. this.isShowDialog = false
  2185. for (let i = 0; i < this.advicePropForm.list.length; i++) {
  2186. if (
  2187. this.advicePropForm.list[i].parent_id == 0 &&
  2188. this.advicePropForm.list[i].isCheck == 1
  2189. ) {
  2190. this.advicePropForm.result.push(
  2191. this.advicePropForm.list[i].id
  2192. )
  2193. }
  2194. }
  2195. } else {
  2196. Toast.loading({ forbidClick: true, duration: 0 })
  2197. var arr = this.dialysisPrescription
  2198. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2199. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2200. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2201. }
  2202. }
  2203. let ParamsQuery = arr
  2204. console.log('ParamsQueryOne', ParamsQuery)
  2205. ParamsQuery['patient'] = this.$route.query.patient_id
  2206. ParamsQuery['record_date'] = this.record_date
  2207. ParamsQuery['mode'] = '1'
  2208. postSolution(ParamsQuery)
  2209. .then(response => {
  2210. if (response.data.state == 0) {
  2211. Toast.fail(response.data.msg)
  2212. return false
  2213. } else {
  2214. Toast.success('提交成功')
  2215. this.$emit('longSolution', response.data.data.solution)
  2216. this.$emit('prescription', response.data.data.prescription)
  2217. this.finish()
  2218. }
  2219. })
  2220. .catch(error => {
  2221. Toast.fail('请求失败')
  2222. })
  2223. }
  2224. } else if (this.is_open == 2) {
  2225. if (this.waitUploadAdvices.length > 0) {
  2226. Toast.loading({ forbidClick: true, duration: 0 })
  2227. var arr = this.dialysisPrescription
  2228. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2229. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2230. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2231. }
  2232. }
  2233. let ParamsQuery = arr
  2234. console.log('ParamsQueryOne', ParamsQuery)
  2235. ParamsQuery['patient'] = this.$route.query.patient_id
  2236. ParamsQuery['record_date'] = this.record_date
  2237. ParamsQuery['mode'] = '2'
  2238. postSolution(ParamsQuery)
  2239. .then(response => {
  2240. if (response.data.state == 0) {
  2241. Toast.fail(response.data.msg)
  2242. return false
  2243. } else {
  2244. this.advice_visibility = false
  2245. var date = new Date()
  2246. var year = date.getFullYear()
  2247. var month = date.getMonth() + 1
  2248. var day = date.getDate()
  2249. var hours = date.getHours()
  2250. var minites = date.getMinutes()
  2251. if (month < 10) {
  2252. month = '0' + month
  2253. }
  2254. if (day < 10) {
  2255. day = '0' + day
  2256. }
  2257. if (hours < 10) {
  2258. hours = '0' + hours
  2259. }
  2260. if (minites < 10) {
  2261. minites = '0' + minites
  2262. }
  2263. var nowDate =
  2264. year +
  2265. '-' +
  2266. month +
  2267. '-' +
  2268. day +
  2269. ' ' +
  2270. hours +
  2271. ':' +
  2272. minites
  2273. let params = {
  2274. advices: this.waitUploadAdvices,
  2275. advice_date: parseTime(
  2276. this.$route.query.date,
  2277. '{y}-{m}-{d}'
  2278. ),
  2279. advice_doctor: this.waitUploadAdvices[0].advice_doctor,
  2280. advice_type: this.waitUploadAdvices[0].advice_type,
  2281. parent_id: this.$route.query.patient_id,
  2282. start_time: nowDate,
  2283. remark: ''
  2284. }
  2285. CreateGroupAdvice(
  2286. this.$route.query.patient_id,
  2287. 0,
  2288. params
  2289. ).then(rs => {
  2290. var resp = rs.data
  2291. if (resp.state == 1) {
  2292. this.doctorAdvices = resp.data.advices
  2293. this.$emit(
  2294. 'longSolution',
  2295. response.data.data.solution,
  2296. resp.data.advices
  2297. )
  2298. this.$emit(
  2299. 'prescription',
  2300. response.data.data.prescription,
  2301. resp.data.advices
  2302. )
  2303. } else {
  2304. }
  2305. })
  2306. Toast.success('提交成功')
  2307. this.finish()
  2308. }
  2309. })
  2310. .catch(error => {
  2311. Toast.fail('请求失败')
  2312. })
  2313. } else {
  2314. Toast.loading({ forbidClick: true, duration: 0 })
  2315. var arr = this.dialysisPrescription
  2316. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2317. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2318. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2319. }
  2320. }
  2321. let ParamsQuery = arr
  2322. console.log('ParamsQueryOne', ParamsQuery)
  2323. ParamsQuery['patient'] = this.$route.query.patient_id
  2324. ParamsQuery['record_date'] = this.record_date
  2325. ParamsQuery['mode'] = '1'
  2326. postSolution(ParamsQuery)
  2327. .then(response => {
  2328. if (response.data.state == 0) {
  2329. Toast.fail(response.data.msg)
  2330. return false
  2331. } else {
  2332. Toast.success('提交成功')
  2333. this.$emit('advice')
  2334. this.$emit('longSolution', response.data.data.solution)
  2335. this.$emit('prescription', response.data.data.prescription)
  2336. this.finish()
  2337. }
  2338. })
  2339. .catch(error => {
  2340. Toast.fail('请求失败')
  2341. })
  2342. }
  2343. }
  2344. } else {
  2345. Toast.loading({ forbidClick: true, duration: 0 })
  2346. var arr = this.dialysisPrescription
  2347. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2348. if (arr.dialyzer_perfusion_apparatus == this.dialyzerPerfusionApparatus[i].id) {
  2349. arr.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[i].name
  2350. }
  2351. }
  2352. let ParamsQuery = arr
  2353. console.log('ParamsQueryOne', ParamsQuery)
  2354. ParamsQuery['patient'] = this.$route.query.patient_id
  2355. ParamsQuery['record_date'] = this.record_date
  2356. ParamsQuery['mode'] = '1'
  2357. postSolution(ParamsQuery)
  2358. .then(response => {
  2359. if (response.data.state == 0) {
  2360. Toast.fail(response.data.msg)
  2361. return false
  2362. } else {
  2363. Toast.success('提交成功')
  2364. this.$emit('longSolution', response.data.data.solution)
  2365. this.$emit('prescription', response.data.data.prescription)
  2366. this.finish()
  2367. }
  2368. })
  2369. .catch(error => {
  2370. Toast.fail('请求失败')
  2371. })
  2372. }
  2373. }
  2374. },
  2375. finish: function () {
  2376. this.$emit('finish')
  2377. },
  2378. close: function () {
  2379. this.$emit('close')
  2380. },
  2381. open: function () {
  2382. this.isShowDialog = true
  2383. this.visibility = false
  2384. this.$refs.picker.close()
  2385. var dialogTop = document.querySelector('#dialogTop')
  2386. if (dialogTop != null) {
  2387. this.$nextTick(() => {
  2388. dialogTop.scrollTop = 0
  2389. })
  2390. }
  2391. },
  2392. sign: function () {
  2393. let params = {
  2394. patient_id: this.$route.query.patient_id,
  2395. date: this.record_date
  2396. }
  2397. postSign(params)
  2398. .then(response => {
  2399. if (response.data.state == 0) {
  2400. Toast.fail(response.data.msg)
  2401. return false
  2402. } else {
  2403. this.isShowDesc = false
  2404. this.isShowDoctorSign = true
  2405. this.dialysisPrescription.prescription_doctor =
  2406. response.data.data.doctor_id
  2407. for (let i = 0; i < this.operators.length; i++) {
  2408. if (this.operators[i].creator == response.data.data.doctor_id) {
  2409. // console.log(this.operators[i].url);
  2410. this.signUrl = this.operators[i].url
  2411. }
  2412. }
  2413. Toast.success('签名成功')
  2414. }
  2415. })
  2416. .catch(error => {
  2417. Toast.fail('请求失败')
  2418. })
  2419. },
  2420. getBodyFluid: function (val) {
  2421. let body_fluid_name = ''
  2422. let body_fluid = this.bodyFluidOptions
  2423. for (let i = 0; i < body_fluid.length; i++) {
  2424. if (body_fluid[i].id == val) {
  2425. body_fluid_name = body_fluid[i].name
  2426. }
  2427. }
  2428. return body_fluid_name
  2429. },
  2430. getSpecialMedicine: function (val) {
  2431. let special_medicine_name = ''
  2432. let special_medicine = this.specialMedicineOptions
  2433. for (let i = 0; i < special_medicine.length; i++) {
  2434. if (special_medicine[i].id == val) {
  2435. special_medicine_name = special_medicine[i].name
  2436. }
  2437. }
  2438. return special_medicine_name
  2439. },
  2440. getDisplaceLiquiPart: function (val) {
  2441. let displace_liqui_part_name = ''
  2442. let displace_liqui_part = this.displaceLiquiPartOptions
  2443. for (let i = 0; i < displace_liqui_part.length; i++) {
  2444. if (displace_liqui_part[i].id == val) {
  2445. displace_liqui_part_name = displace_liqui_part[i].name
  2446. }
  2447. }
  2448. return displace_liqui_part_name
  2449. },
  2450. getBloodAccess: function (val) {
  2451. let blood_access_name = ''
  2452. let blood_access = this.bloodAccessOptions
  2453. for (let i = 0; i < blood_access.length; i++) {
  2454. if (blood_access[i].id == val) {
  2455. blood_access_name = blood_access[i].name
  2456. }
  2457. }
  2458. return blood_access_name
  2459. },
  2460. getBloodAccessTwo: function (val) {
  2461. let blood_access_name = ''
  2462. for (let i = 0; i < this.data.length; i++) {
  2463. if (val == this.data[i].id) {
  2464. blood_access_name = this.data[i].name
  2465. }
  2466. }
  2467. return blood_access_name
  2468. },
  2469. getDialyzerPerfusionApparatus: function (val) {
  2470. console.log('val', val)
  2471. let dialyzer_perfusion_apparatus = ''
  2472. let arr = this.dialyzerPerfusionApparatus
  2473. for (let i = 0; i < arr.length; i++) {
  2474. if (arr[i].id == val) {
  2475. dialyzer_perfusion_apparatus = arr[i].name
  2476. }
  2477. }
  2478. return dialyzer_perfusion_apparatus
  2479. },
  2480. menuEmpty: function (val) {
  2481. this.visibility = false
  2482. this.isShowDialog = true
  2483. switch (val.type) {
  2484. case 1:
  2485. this.dialysisPrescription.mode_id = ''
  2486. break
  2487. case 2:
  2488. this.dialysisPrescription.dialyzer = ''
  2489. break
  2490. case 3:
  2491. this.dialysisPrescription.perfusion_apparatus = ''
  2492. break
  2493. case 4:
  2494. this.dialysisPrescription.replacement_way = ''
  2495. break
  2496. case 5:
  2497. this.anticoagulant = ''
  2498. break
  2499. case 6:
  2500. this.dialysisPrescription.dialysate_formulation = ''
  2501. break
  2502. case 7:
  2503. this.dialysisPrescription.body_fluid = ''
  2504. break
  2505. case 8:
  2506. this.dialysisPrescription.special_medicine = ''
  2507. break
  2508. case 9:
  2509. this.dialysisPrescription.displace_liqui_part = ''
  2510. break
  2511. case 10:
  2512. this.dialysisPrescription.blood_access = ''
  2513. break
  2514. }
  2515. },
  2516. getFloat: function (x) {
  2517. if (x != '.') {
  2518. var f = Math.round(x * 100) / 100
  2519. var s = f.toString()
  2520. var rs = s.indexOf('.')
  2521. if (rs <= 0) {
  2522. rs = s.length
  2523. s += '.'
  2524. }
  2525. while (s.length <= rs + 1) {
  2526. s += '0'
  2527. }
  2528. return s
  2529. } else {
  2530. return '0.0'
  2531. }
  2532. },
  2533. dialysisGoodsClick: function () {
  2534. this.isShowDialog = false
  2535. this.is_show = true
  2536. },
  2537. menuCancleTwo: function () {
  2538. this.isShowDialog = true
  2539. this.is_show = false
  2540. },
  2541. menuComfirmTwo: function (dialysisPrescription) {
  2542. this.isShowDialog = true
  2543. this.is_show = false
  2544. this.dialysisPrescription.niprocart = dialysisPrescription.niprocart
  2545. this.dialysisPrescription.jms = dialysisPrescription.jms
  2546. this.dialysisPrescription.fistula_needle_set =
  2547. dialysisPrescription.fistula_needle_set
  2548. this.dialysisPrescription.fistula_needle_set_16 =
  2549. dialysisPrescription.fistula_needle_set_16
  2550. this.dialysisPrescription.hemoperfusion =
  2551. dialysisPrescription.hemoperfusion
  2552. this.dialysisPrescription.dialyser_sterilised =
  2553. dialysisPrescription.dialyser_sterilised
  2554. this.dialysisPrescription.filtryzer = dialysisPrescription.filtryzer
  2555. this.dialysisPrescription.dialyzers = dialysisPrescription.dialyzers
  2556. this.dialysisPrescription.injector = dialysisPrescription.injector
  2557. this.dialysisPrescription.bloodlines = dialysisPrescription.bloodlines
  2558. this.dialysisPrescription.tubing_hemodialysis =
  2559. dialysisPrescription.tubing_hemodialysis
  2560. this.dialysisPrescription.package = dialysisPrescription.package
  2561. this.dialysisPrescription.a_liquid = dialysisPrescription.a_liquid
  2562. },
  2563. getPermission () {
  2564. request
  2565. .get('/m/api/permission/get', {
  2566. params: {
  2567. create_url: '/m/api/dialysis/dialysisPrescription?mode=1',
  2568. modify_url: '/m/api/dialysis/dialysisPrescription?mode=2',
  2569. modify_other_url: '/m/api/dialysis/dialysisPrescription?mode=3',
  2570. module: 1
  2571. }
  2572. })
  2573. .then(res => {
  2574. if (res.data.state == 0) {
  2575. this.hasPermission = false
  2576. } else if (res.data.state == 1) {
  2577. if (
  2578. this.prescription_prop.id != '' &&
  2579. this.prescription_prop.creater != 0
  2580. ) {
  2581. // 有数据
  2582. if (
  2583. this.prescription_prop.creater ==
  2584. this.$store.getters.user.admin.id
  2585. ) {
  2586. // 创建人是自己
  2587. if (res.data.data.is_has_modify == false) {
  2588. this.hasPermission = false
  2589. this.showTxt = '你没有修改透析处方权限'
  2590. }
  2591. } else {
  2592. // 创建人不是自己
  2593. if (res.data.data.is_has_modify_other == false) {
  2594. this.hasPermission = false
  2595. this.showTxt = '你没有修改他人透析处方权限'
  2596. }
  2597. }
  2598. } else if (
  2599. this.prescription_prop.id == '' ||
  2600. this.prescription_prop.creater == 0
  2601. ) {
  2602. if (res.data.data.is_has_create == false) {
  2603. this.hasPermission = false
  2604. this.showTxt = '你没有新增透析处方权限'
  2605. }
  2606. }
  2607. }
  2608. })
  2609. }
  2610. },
  2611. created () {
  2612. this.getPermission()
  2613. this.template_id = this.$store.getters.user.template_info.template_id
  2614. this.modeOption = this.$store.getters.treatment_mode
  2615. delete this.modeOption['0']
  2616. var perfusion_apparatus = getDataConfig(
  2617. 'hemodialysis',
  2618. 'perfusion_apparatus'
  2619. )
  2620. this.data = getDataConfig('hemodialysis', 'vascular_access_desc')
  2621. this.perfusion_apparatus = perfusion_apparatus
  2622. this.anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
  2623. var anticoagulantsConfitOne = this.$store.getters.anticoagulants_confit
  2624. // for (let i = 0; i < anticoagulantsConfitOne.length; i++) {
  2625. // console.log('anticoagulantsConfitOne', anticoagulantsConfitOne[i].name)
  2626. // }
  2627. // var anticoagulantsConfit = getDataConfig('hemodialysis', 'anticoagulant')
  2628. // let arr = []
  2629. // anticoagulantsConfit.map((item, index) => {
  2630. // let objChild = { ...item }
  2631. // arr.push(objChild)
  2632. // })
  2633. // var arrthree = {}
  2634. // arrthree = { ...arr }
  2635. // console.log('arrthree', arrthree)
  2636. let arrFour = []
  2637. Object.keys(anticoagulantsConfitOne).map((item, index) => {
  2638. if (index != 2) {
  2639. arrFour.push(anticoagulantsConfitOne[item])
  2640. }
  2641. })
  2642. this.anticoagulantsConfit = arrFour
  2643. this.bodyFluidOptions = this.$store.getters.body_fluid
  2644. var special_medicine = [
  2645. {id: 1, name: '无'},
  2646. {id: 2, name: '降压药'},
  2647. {id: 3, name: '抗凝'},
  2648. {id: 4, name: '其他'},
  2649. {id: 5, name: '降糖药'}
  2650. ]
  2651. this.specialMedicineOptions = special_medicine
  2652. // this.specialMedicineOptions = this.$store.getters.special_medicine
  2653. this.displaceLiquiPartOptions = this.$store.getters.displace_liqui
  2654. this.bloodAccessOptions = this.$store.getters.blood_access
  2655. this.dialysateFormulationOptions = getDataConfig(
  2656. 'hemodialysis',
  2657. 'dialysate_formulation'
  2658. )
  2659. this.replacementWays = getDataConfig('hemodialysis', 'replacement_ways')
  2660. this.patient = this.patient_prop
  2661. if (
  2662. this.prescription_prop != null &&
  2663. typeof this.prescription_prop.id !== 'undefined' &&
  2664. this.prescription_prop.id > 0
  2665. ) {
  2666. for (const key in this.prescription_prop) {
  2667. this.dialysisPrescription[key] = this.prescription_prop[key]
  2668. }
  2669. } else if (
  2670. this.solution_prop != null &&
  2671. typeof this.solution_prop.id !== 'undefined' &&
  2672. this.solution_prop.id
  2673. ) {
  2674. for (const key in this.solution_prop) {
  2675. if (key != 'target_ultrafiltration') {
  2676. this.dialysisPrescription[key] = this.solution_prop[key]
  2677. }
  2678. }
  2679. } else if (
  2680. this.last_prescription != null &&
  2681. typeof this.last_prescription.id !== 'undefined' &&
  2682. this.last_prescription.id
  2683. ) {
  2684. for (const key in this.last_prescription) {
  2685. if (key != 'target_ultrafiltration') {
  2686. this.dialysisPrescription[key] = this.last_prescription[key]
  2687. }
  2688. }
  2689. } else if (
  2690. this.system_prescription != null &&
  2691. typeof this.system_prescription.id !== 'undefined' &&
  2692. this.system_prescription.id
  2693. ) {
  2694. for (const key in this.system_prescription) {
  2695. if (key != 'target_ultrafiltration') {
  2696. this.dialysisPrescription[key] = this.system_prescription[key]
  2697. }
  2698. }
  2699. } else {
  2700. this.dialysisPrescription.mode_id = this.schedual.mode_id
  2701. }
  2702. if (
  2703. this.dialysisPrescription.dialysis_duration_hour.length == 0 ||
  2704. this.dialysisPrescription.dialysis_duration_minute.length == 0
  2705. ) {
  2706. this.timeValue = ''
  2707. this.time = '03:00'
  2708. this.dialysisPrescription.dialysis_duration = 3
  2709. } else {
  2710. this.timeValue =
  2711. this.dialysisPrescription.dialysis_duration_hour +
  2712. '小时' +
  2713. this.dialysisPrescription.dialysis_duration_minute +
  2714. '分钟'
  2715. this.time =
  2716. (this.dialysisPrescription.dialysis_duration_hour > 10
  2717. ? this.dialysisPrescription.dialysis_duration_hour
  2718. : '0' + this.dialysisPrescription.dialysis_duration_hour) +
  2719. ':' +
  2720. (this.dialysisPrescription.dialysis_duration_minute > 10
  2721. ? this.dialysisPrescription.dialysis_duration_minute
  2722. : '0' + this.dialysisPrescription.dialysis_duration_minute)
  2723. this.dialysisPrescription.dialysis_duration =
  2724. parseFloat(this.dialysisPrescription.dialysis_duration_hour) +
  2725. parseFloat(
  2726. (this.dialysisPrescription.dialysis_duration_minute / 60).toFixed(2)
  2727. )
  2728. }
  2729. this.dialyserList = this.machines_prop
  2730. // this.doctor = this.$store.getters.user.user.user_type;
  2731. var date = this.$route.query && this.$route.query.date
  2732. date *= 1000
  2733. var newDate = new Date(date)
  2734. var y = newDate.getFullYear()
  2735. var m = newDate.getMonth() + 1
  2736. var d = newDate.getDate()
  2737. if (isNaN(y) || isNaN(m) || isNaN(d)) {
  2738. newDate = new Date()
  2739. y = newDate.getFullYear()
  2740. m = newDate.getMonth() + 1
  2741. d = newDate.getDate()
  2742. }
  2743. this.record_date =
  2744. y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d)
  2745. // this.patient.id = this.patient_prop.id
  2746. this.dialysisPrescription.kalium = this.getFloat(
  2747. this.dialysisPrescription.kalium
  2748. )
  2749. this.dialysisPrescription.sodium = this.getFloat(
  2750. this.dialysisPrescription.sodium
  2751. )
  2752. this.dialysisPrescription.calcium = this.getFloat(
  2753. this.dialysisPrescription.calcium
  2754. )
  2755. this.dialysisPrescription.ultrafiltration = this.getFloat(
  2756. this.dialysisPrescription.ultrafiltration
  2757. )
  2758. this.dialysisPrescription.target_ultrafiltration = this.getFloat(
  2759. this.dialysisPrescription.target_ultrafiltration
  2760. )
  2761. if (this.dialysisPrescription.anticoagulant_shouji == '') {
  2762. this.dialysisPrescription.anticoagulant_shouji = '0'
  2763. }
  2764. if (this.dialysisPrescription.anticoagulant_weichi == '') {
  2765. this.dialysisPrescription.anticoagulant_weichi = '0'
  2766. }
  2767. if (this.dialysisPrescription.anticoagulant_zongliang == '') {
  2768. this.dialysisPrescription.anticoagulant_weichi = '0'
  2769. }
  2770. this.dialyzerPerfusionApparatus = getDataConfig(
  2771. 'hemodialysis',
  2772. 'dialyzer_perfusion_apparatus'
  2773. )
  2774. for (let i = 0; i < this.dialyzerPerfusionApparatus.length; i++) {
  2775. if (
  2776. this.dialysisPrescription.dialyzer_perfusion_apparatus ==
  2777. this.dialyzerPerfusionApparatus[i].name
  2778. ) {
  2779. this.dialysisPrescription.dialyzer_perfusion_apparatus = this.dialyzerPerfusionApparatus[
  2780. i
  2781. ].id
  2782. }
  2783. }
  2784. console.log('数据来源', this.dialysisPrescription)
  2785. },
  2786. components: {
  2787. LongAdviceSubMenu,
  2788. MultipleSubMenu,
  2789. MsgTip,
  2790. // MultipleSubMenu,
  2791. CheckBoxSubMenu
  2792. },
  2793. watch: {
  2794. 'dialysisPrescription.dialysis_duration': function () {
  2795. console.log(this.dialysisPrescription.dialysis_duration)
  2796. this.dialysisPrescription.anticoagulant_zongliang = calculateAnticoagulantZL(
  2797. 1,
  2798. this.dialysisPrescription.anticoagulant_shouji,
  2799. this.dialysisPrescription.dialysis_duration,
  2800. this.dialysisPrescription.anticoagulant_weichi
  2801. )
  2802. if (isNaN(this.dialysisPrescription.anticoagulant_zongliang)) {
  2803. this.dialysisPrescription.anticoagulant_zongliang = ''
  2804. }
  2805. },
  2806. 'dialysisPrescription.anticoagulant_shouji': function () {
  2807. this.dialysisPrescription.anticoagulant_zongliang = calculateAnticoagulantZL(
  2808. 1,
  2809. this.dialysisPrescription.anticoagulant_shouji,
  2810. this.dialysisPrescription.dialysis_duration,
  2811. this.dialysisPrescription.anticoagulant_weichi
  2812. )
  2813. if (isNaN(this.dialysisPrescription.anticoagulant_zongliang)) {
  2814. this.dialysisPrescription.anticoagulant_zongliang = ''
  2815. }
  2816. },
  2817. 'dialysisPrescription.anticoagulant_weichi': function () {
  2818. this.dialysisPrescription.anticoagulant_zongliang = calculateAnticoagulantZL(
  2819. 1,
  2820. this.dialysisPrescription.anticoagulant_shouji,
  2821. this.dialysisPrescription.dialysis_duration,
  2822. this.dialysisPrescription.anticoagulant_weichi
  2823. )
  2824. if (isNaN(this.dialysisPrescription.anticoagulant_zongliang)) {
  2825. this.dialysisPrescription.anticoagulant_zongliang = ''
  2826. }
  2827. },
  2828. isShowDialog (val) {
  2829. if (val) {
  2830. this.advice_visibility = false
  2831. }
  2832. }
  2833. }
  2834. }
  2835. </script>
  2836. <style style="stylesheet/scss" lang="scss" scoped>
  2837. .DialogContent {
  2838. .textarea {
  2839. width: 100%;
  2840. height: 2.4rem;
  2841. line-height: 0.6rem;
  2842. color: $pgh-color;
  2843. font-size: 0.45rem;
  2844. padding-left: 0.36rem;
  2845. border: none;
  2846. border-bottom: 1px #e5e5e5 solid;
  2847. }
  2848. .newButton {
  2849. background: #258ffc;
  2850. padding: 0 0.2rem;
  2851. height: 0.85rem;
  2852. line-height: 0.85rem;
  2853. border-radius: 5px;
  2854. color: #fff;
  2855. margin-right: -3.5rem;
  2856. }
  2857. .newName {
  2858. margin-right: -3rem;
  2859. }
  2860. .newDialogContent {
  2861. display: flex;
  2862. flex-direction: column;
  2863. height: 100%;
  2864. overflow: hidden;
  2865. > :first-child {
  2866. flex: 1;
  2867. overflow: auto;
  2868. }
  2869. }
  2870. }
  2871. .warnTxt {
  2872. font-size: 0.5rem;
  2873. height: 1rem;
  2874. line-height: 1rem;
  2875. text-align: center;
  2876. background: #faa331;
  2877. color: #fff;
  2878. }
  2879. </style>
  2880. <style lang="scss">
  2881. .DialogTit {
  2882. .newButton {
  2883. background: #258ffc;
  2884. padding: 0 0.2rem;
  2885. height: 0.85rem;
  2886. line-height: 0.85rem;
  2887. border-radius: 5px;
  2888. color: #fff;
  2889. margin-right: -2.5rem;
  2890. }
  2891. .PrescSubmit {
  2892. position: fixed;
  2893. bottom: 0;
  2894. }
  2895. }
  2896. </style>