Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

doctorAdvice.vue 161KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728
  1. <template>
  2. <div class="patient-container">
  3. <!--<el-dialog title="透析处方长期医嘱医生确认推送提醒" :visible.sync="dialogConfigVisible">-->
  4. <!--<el-form>-->
  5. <!--<el-form-item label="是否开启推送:">-->
  6. <!--<el-radio-group v-model="is_open_remind" @change="changeRemind">-->
  7. <!--<el-radio :label="1">开启</el-radio>-->
  8. <!--<el-radio :label="2">不开启</el-radio>-->
  9. <!--</el-radio-group>-->
  10. <!--</el-form-item>-->
  11. <!--</el-form>-->
  12. <!--</el-dialog>-->
  13. <patient-sidebar
  14. :id="patientID"
  15. defaultActive="1-4"
  16. v-on:tran-patient="onTranPatient"
  17. ></patient-sidebar>
  18. <div class="patient-app-container advice-container app-container">
  19. <div class="cellButton" style="float:right;">
  20. <!--<el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" size="small"-->
  21. <!--@click="dialogConfigVisible = true"-->
  22. <!--type="primary" icon="el-icon-circle-plus-outline">长期医嘱提醒配置-->
  23. <!--</el-button>-->
  24. <el-button
  25. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  26. size="small"
  27. @click="openNew"
  28. type="primary"
  29. icon="el-icon-circle-plus-outline"
  30. >新增
  31. </el-button>
  32. <el-button
  33. size="small"
  34. @click="printThisInfo()"
  35. :type="
  36. adviceType == 1 || adviceType == 3 || adviceType == 2
  37. ? 'primary'
  38. : 'warning'
  39. "
  40. icon="el-icon-printer"
  41. >打印
  42. </el-button>
  43. </div>
  44. <div class="cell clearfix">
  45. <el-input
  46. style="width: 400px;"
  47. v-model="listQuery.keywords"
  48. class="filter-item"
  49. size="small"
  50. />
  51. <el-button
  52. size="small"
  53. type="primary"
  54. icon="el-icon-search"
  55. @click="changeKey"
  56. >搜索
  57. </el-button>
  58. </div>
  59. <div class="cell clearfix">
  60. <label class="title"><span class="name">医嘱类型</span> : </label>
  61. <div class="time ">
  62. <ul class="">
  63. <li
  64. :class="item.value == adviceType ? 'active' : ''"
  65. @click="selectAdviceType(item.value)"
  66. v-for="item in adviceTypeArr"
  67. :key="item.value"
  68. >
  69. {{ item.label }}
  70. </li>
  71. </ul>
  72. </div>
  73. </div>
  74. <div class="cell clearfix">
  75. <label class="title"><span class="name">显示范围</span> : </label>
  76. <div class="time ">
  77. <ul class="">
  78. <li
  79. :class="item.value == stopType ? 'active' : ''"
  80. @click="selectStopType(item.value)"
  81. v-for="item in stopTypeArr"
  82. :key="item.value"
  83. >
  84. {{ item.label }}
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. <div class="cell clearfix">
  90. <label class="title"><span class="name">日期查询</span> : </label>
  91. <el-date-picker
  92. size="small"
  93. v-model="listQuery.start_time"
  94. prefix-icon="el-icon-date"
  95. @change="changeTime"
  96. :editable="false"
  97. style="width: 196px;"
  98. type="date"
  99. placeholder="选择日期时间"
  100. align="right"
  101. :picker-options="pickerOptions"
  102. format="yyyy-MM-dd"
  103. value-format="yyyy-MM-dd"
  104. ></el-date-picker>
  105. <span class="cellLine"> - </span>
  106. <el-date-picker
  107. size="small"
  108. v-model="listQuery.end_time"
  109. prefix-icon="el-icon-date"
  110. @change="changeTime"
  111. :editable="false"
  112. style="width: 196px;"
  113. type="date"
  114. placeholder="选择日期时间"
  115. align="right"
  116. :picker-options="pickerOptions"
  117. format="yyyy-MM-dd"
  118. value-format="yyyy-MM-dd"
  119. ></el-date-picker>
  120. </div>
  121. <el-table
  122. id="oictable"
  123. @cell-click="clickuseradvicecell"
  124. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  125. row-class-name="user-advice-table-row"
  126. :span-method="mergeSpan"
  127. ref="multipleTable"
  128. :data="adviceTableData"
  129. border
  130. fit
  131. highlight-current-row
  132. @select="selectAdvice"
  133. @selection-change="changeAdvice"
  134. style="width: 100%;margin-top: 10px;"
  135. :cell-class-name="adviceNameShow"
  136. >
  137. <el-table-column
  138. align="center"
  139. label="全选"
  140. width="60px"
  141. type="selection"
  142. fixed
  143. ></el-table-column>
  144. <!--<el-table-column type="index" :index="indexMethod" label="序号" width="60px" align="center"></el-table-column>-->
  145. <el-table-column
  146. label="期效"
  147. width="60px"
  148. property="advice_type"
  149. align="center"
  150. fixed
  151. >
  152. <template slot-scope="scope">
  153. <span v-if="scope.row.advice_type == 1">长嘱</span>
  154. <span
  155. v-else-if="
  156. scope.row.advice_type == 3 || scope.row.advice_type == 2
  157. "
  158. >临嘱</span
  159. >
  160. <span v-else></span>
  161. </template>
  162. </el-table-column>
  163. <el-table-column
  164. label="开始时间"
  165. width="180"
  166. property="start_time"
  167. align="center"
  168. >
  169. <template slot-scope="scope">
  170. <span>{{
  171. scope.row.start_time | parseTime("{y}-{m}-{d} {h}:{i}")
  172. }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column
  176. label="医嘱内容"
  177. property="advice_name"
  178. width="180"
  179. align="center"
  180. style="word-break: keep-all;white-space:nowrap;"
  181. >
  182. <template slot-scope="scope">
  183. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  184. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  185. {{ scope.row.advice_name
  186. }}<i class="el-icon-arrow-down el-icon--right"></i>
  187. </span>
  188. <el-dropdown-menu slot="dropdown">
  189. <!--<el-dropdown-item :disabled="$store.getters.xt_user.subscibe.state==3?true:false"-->
  190. <!--@click.native="openEdit(scope.$index, scope.row)">修改医嘱-->
  191. <!--</el-dropdown-item>-->
  192. <el-dropdown-item
  193. v-if="scope.row.advice_type == 1"
  194. :disabled="
  195. $store.getters.xt_user.subscibe.state == 3 ? true : false
  196. "
  197. @click.native="openStop(scope.$index, scope.row)"
  198. >停止医嘱
  199. </el-dropdown-item>
  200. <el-dropdown-item
  201. v-if="scope.row.advice_type == 3"
  202. :disabled="
  203. $store.getters.xt_user.subscibe.state == 3 ? true : false
  204. "
  205. @click.native="openExec(scope.$index, scope.row)"
  206. >执行医嘱
  207. </el-dropdown-item>
  208. <el-dropdown-item
  209. v-if="scope.row.advice_type == 3"
  210. :disabled="
  211. $store.getters.xt_user.subscibe.state == 3 ? true : false
  212. "
  213. @click.native="openCheck(scope.$index, scope.row)"
  214. >核对医嘱
  215. </el-dropdown-item>
  216. <el-dropdown-item
  217. :disabled="
  218. $store.getters.xt_user.subscibe.state == 3 ? true : false
  219. "
  220. @click.native="openDelete(scope.$index, scope.row)"
  221. >删除医嘱
  222. </el-dropdown-item>
  223. <el-dropdown-item
  224. :disabled="
  225. $store.getters.xt_user.subscibe.state == 3 ? true : false
  226. "
  227. @click.native="openNewChild(scope.$index, scope.row)"
  228. >新增子药
  229. </el-dropdown-item>
  230. </el-dropdown-menu>
  231. </el-dropdown>
  232. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  233. <span class="el-dropdown-link">
  234. &emsp;&emsp;{{ scope.row.advice_name
  235. }}<i class="el-icon-arrow-down el-icon--right"></i>
  236. </span>
  237. <el-dropdown-menu slot="dropdown">
  238. <el-dropdown-item
  239. :disabled="
  240. $store.getters.xt_user.subscibe.state == 3 ? true : false
  241. "
  242. @click.native="openEdit(scope.$index, scope.row)"
  243. >修改医嘱
  244. </el-dropdown-item>
  245. <el-dropdown-item
  246. :disabled="
  247. $store.getters.xt_user.subscibe.state == 3 ? true : false
  248. "
  249. @click.native="openDelete(scope.$index, scope.row)"
  250. >删除医嘱
  251. </el-dropdown-item>
  252. </el-dropdown-menu>
  253. </el-dropdown>
  254. </template>
  255. </el-table-column>
  256. <!-- <el-table-column label="药品规格*数量" width="180" property="drug_spec" align="center">
  257. <template slot-scope="scope" >
  258. <span v-if="scope.row.drug_spec!=0">
  259. {{scope.row.drug_spec}}{{scope.row.drug_spec_unit}}
  260. </span>
  261. <span v-if="scope.row.prescribing_number!=0">*{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
  262. </template>
  263. </el-table-column> -->
  264. <el-table-column
  265. label="药品规格"
  266. width="180"
  267. property="advice_desc"
  268. align="center"
  269. >
  270. <template slot-scope="scope">
  271. <span v-if="scope.row.advice_desc"
  272. >{{ scope.row.advice_desc }}{{ scope.row.drug_spec_unit }}</span
  273. >
  274. </template>
  275. </el-table-column>
  276. <el-table-column
  277. label="开药数量"
  278. width="180"
  279. property="prescribing_number"
  280. align="center"
  281. >
  282. <template slot-scope="scope">
  283. <span v-if="scope.row.prescribing_number != 0"
  284. >{{ scope.row.prescribing_number
  285. }}{{ scope.row.prescribing_number_unit }}</span
  286. >
  287. </template>
  288. </el-table-column>
  289. <el-table-column
  290. label="单次用量"
  291. width="180"
  292. property="single_dose"
  293. align="center"
  294. >
  295. <template slot-scope="scope">
  296. <span v-if="scope.row.single_dose != 0"
  297. >{{ scope.row.single_dose }}{{ scope.row.single_dose_unit }}</span
  298. >
  299. </template>
  300. </el-table-column>
  301. <el-table-column
  302. label="频率"
  303. width="180"
  304. property="execution_frequency"
  305. align="center"
  306. >
  307. <template slot-scope="scope">
  308. <span v-if="scope.row.parent_id == 0">{{
  309. scope.row.execution_frequency
  310. }}</span>
  311. </template>
  312. </el-table-column>
  313. <el-table-column
  314. label="用法"
  315. width="180"
  316. property="delivery_way"
  317. align="center"
  318. >
  319. <template slot-scope="scope">
  320. <span v-if="scope.row.parent_id == 0">{{
  321. scope.row.delivery_way
  322. }}</span>
  323. </template>
  324. </el-table-column>
  325. <el-table-column
  326. label="执行时间"
  327. width="180"
  328. property="execution_time"
  329. align="center"
  330. >
  331. <template slot-scope="scope">
  332. <span v-if="scope.row.execution_state == 1">
  333. {{
  334. scope.row.execution_time | parseTime("{y}-{m}-{d} {h}:{i}")
  335. }}</span
  336. >
  337. </template>
  338. </el-table-column>
  339. <el-table-column
  340. label="终止时间"
  341. width="180"
  342. property="stop_time"
  343. align="center"
  344. >
  345. <template slot-scope="scope">
  346. <span v-if="scope.row.stop_state == 1">
  347. {{ scope.row.stop_time | parseTime("{y}-{m}-{d} {h}:{i}") }}</span
  348. >
  349. </template>
  350. </el-table-column>
  351. <el-table-column
  352. label="执行护士"
  353. width="180"
  354. property="execution_staff"
  355. v-show="adviceType == 3"
  356. align="center"
  357. >
  358. <template slot-scope="scope">
  359. <span v-if="scope.row.parent_id == 0">{{
  360. getXuserName(scope.row.execution_staff)
  361. }}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column
  365. label="开嘱医生"
  366. width="180"
  367. property="advice_doctor"
  368. align="center"
  369. >
  370. <template slot-scope="scope">
  371. {{ getXuserName(scope.row.advice_doctor) }}
  372. </template>
  373. </el-table-column>
  374. <el-table-column
  375. label="开嘱时间"
  376. width="180"
  377. property="created_time"
  378. align="center"
  379. >
  380. <template slot-scope="scope">
  381. {{ scope.row.created_time | parseTime("{y}-{m}-{d} {h}:{i}") }}
  382. </template>
  383. </el-table-column>
  384. <el-table-column
  385. label="校对护士"
  386. width="180"
  387. property="checker"
  388. align="center"
  389. >
  390. <template slot-scope="scope">
  391. <span v-if="scope.row.parent_id == 0">{{
  392. getXuserName(scope.row.checker)
  393. }}</span>
  394. </template>
  395. </el-table-column>
  396. <el-table-column
  397. label="校对时间"
  398. width="180"
  399. property="check_time"
  400. align="center"
  401. >
  402. <template slot-scope="scope">
  403. <span v-if="scope.row.check_state == 1">{{
  404. scope.row.created_time | parseTime("{y}-{m}-{d} {h}:{i}")
  405. }}</span>
  406. </template>
  407. </el-table-column>
  408. <!-- <template v-if="adviceType==3">
  409. <el-table-column key="advice_doctor_3" label="开嘱医生" min-width="80" property="advice_doctor" align="center">
  410. <template slot-scope="scope">
  411. {{getXuserName(scope.row.advice_doctor)}}
  412. </template>
  413. </el-table-column>
  414. <el-table-column key="execution_time_3" label="执行时间" min-width="80" property="execution_time" v-show="adviceType==3" align="center">
  415. <template slot-scope="scope">
  416. <span v-if="scope.row.execution_state==1&&scope.row.parent_id==0"> {{scope.row.execution_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
  417. </template>
  418. </el-table-column>
  419. <el-table-column key="execution_staff_3" label="执行人员" min-width="80" property="execution_staff" v-show="adviceType==3" align="center">
  420. <template slot-scope="scope">
  421. <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.execution_staff)}}</span>
  422. </template>
  423. </el-table-column>
  424. <el-table-column key="checker_3" label="核对人员" min-width="80" property="checker" v-show="adviceType==3" align="center">
  425. <template slot-scope="scope">
  426. <span v-if="scope.row.parent_id==0">{{getXuserName(scope.row.checker)}}</span>
  427. </template>
  428. </el-table-column>
  429. <el-table-column key="remark_3" label="备注" min-width="80" property="remark" align="center"> </el-table-column>
  430. </template>
  431. <template v-if="adviceType==1">
  432. <el-table-column key="advice_doctor_1" label="开嘱医生" min-width="80" property="advice_doctor" align="center">
  433. <template slot-scope="scope">
  434. {{getXuserName(scope.row.advice_doctor)}}
  435. </template>
  436. </el-table-column>
  437. <el-table-column key="advice_affirm_1" label="开嘱确认" min-width="80" property="advice_affirm" v-show="adviceType==0" align="center"> </el-table-column>
  438. <el-table-column key="stop_time_1" label="停止时间" min-width="80" property="stop_time" v-show="adviceType==1" align="center">
  439. <template slot-scope="scope">
  440. <span v-if="scope.row.stop_state==1&&scope.row.parent_id==0"> {{scope.row.stop_time | parseTime("{y}-{m}-{d} {h}:{i}")}}</span>
  441. </template>
  442. </el-table-column>
  443. <el-table-column key="stop_doctor_1" label="停嘱医生" min-width="80" property="stop_doctor" v-show="adviceType==1" align="center">
  444. <template slot-scope="scope">
  445. <span v-if="scope.row.stop_state==1&&scope.row.parent_id==0"> {{getXuserName(scope.row.stop_doctor)}}</span>
  446. </template>
  447. </el-table-column>
  448. </template> -->
  449. <el-table-column label="操作" width="180" align="center" fixed="right">
  450. <template slot-scope="scope">
  451. <!-- <el-button-group> -->
  452. <el-tooltip
  453. class="item"
  454. effect="dark"
  455. content="编辑"
  456. placement="top"
  457. >
  458. <el-button
  459. icon="el-icon-edit-outline"
  460. type="primary"
  461. size="small"
  462. :disabled="
  463. $store.getters.xt_user.subscibe.state == 3 ? true : false
  464. "
  465. @click="
  466. scope.row.groupno > 0
  467. ? openEditGroupAdvice(scope.row.groupno)
  468. : openEdit(scope.$index, scope.row)
  469. "
  470. v-if="isShowStartTime(scope.$index, scope.row)"
  471. ></el-button>
  472. </el-tooltip>
  473. <el-tooltip
  474. class="item"
  475. effect="dark"
  476. content="删除"
  477. placement="top"
  478. >
  479. <el-button
  480. icon="el-icon-delete"
  481. type="danger"
  482. size="small"
  483. :disabled="
  484. $store.getters.xt_user.subscibe.state == 3 ? true : false
  485. "
  486. @click="
  487. scope.row.groupno > 0
  488. ? DeleteGroupAdvice(scope.row.groupno, scope.row)
  489. : openDelete(scope.$index, scope.row)
  490. "
  491. v-if="isShowStartTime(scope.$index, scope.row)"
  492. ></el-button>
  493. </el-tooltip>
  494. <!-- </el-button-group> -->
  495. </template>
  496. </el-table-column>
  497. </el-table>
  498. <el-pagination
  499. @size-change="handleSizeChange"
  500. @current-change="handleCurrentChange"
  501. :page-sizes="[10, 20, 50, 100]"
  502. :page-size="10"
  503. background
  504. style="margin-top:20px;float: right"
  505. layout="total, sizes, prev, pager, next, jumper"
  506. :total="total"
  507. ></el-pagination>
  508. <el-dialog
  509. title="新增医嘱"
  510. :visible.sync="groupFormVisible"
  511. width="700px"
  512. >
  513. <el-form ref="groupForm" :rules="groupRules" :model="groupForm">
  514. <el-row>
  515. <el-col :span="12">
  516. <el-form-item label="医嘱类型 :" required prop="advice_type">
  517. <el-select
  518. v-model="groupForm.advice_type"
  519. placeholder="请选择"
  520. @change="changeOptions"
  521. >
  522. <el-option
  523. :label="item.label"
  524. :key="item.value"
  525. :value="item.value"
  526. v-for="item in adviceTypeOptions"
  527. ></el-option>
  528. </el-select>
  529. </el-form-item>
  530. </el-col>
  531. <el-col :span="12">
  532. <el-form-item label="开始时间 :" required prop="start_time">
  533. <el-date-picker
  534. style="width:200px"
  535. type="datetime"
  536. format="yyyy-MM-dd HH:mm"
  537. value-format="yyyy-MM-dd HH:mm"
  538. placeholder="选择时间"
  539. v-model="groupForm.start_time"
  540. ></el-date-picker>
  541. </el-form-item>
  542. </el-col>
  543. </el-row>
  544. <el-row>
  545. <el-form-item label="备注 :">
  546. <el-input type="textarea" v-model="groupForm.remark"></el-input>
  547. </el-form-item>
  548. </el-row>
  549. <el-row>
  550. <el-col :span="12">
  551. <el-form-item label="开嘱医生 :">
  552. <span>{{ adminusername }} </span>
  553. </el-form-item>
  554. </el-col>
  555. <el-col :span="12">
  556. <el-form-item label="开嘱时间 :">
  557. <span>{{ groupForm.advice_date }} </span>
  558. </el-form-item>
  559. </el-col>
  560. </el-row>
  561. <el-row>
  562. <el-col :span="2">
  563. &nbsp;
  564. </el-col>
  565. <el-col :span="5">
  566. <el-button
  567. :disabled="
  568. $store.getters.xt_user.subscibe.state == 3 ? true : false
  569. "
  570. round
  571. @click="openAdviceTemplate()"
  572. >选择医嘱模板
  573. </el-button>
  574. </el-col>
  575. <el-col :span="5">
  576. <el-button
  577. :disabled="
  578. $store.getters.xt_user.subscibe.state == 3 ? true : false
  579. "
  580. round
  581. @click="openGroupAdvice(0)"
  582. >新增医嘱内容
  583. </el-button>
  584. </el-col>
  585. <el-col :span="5">
  586. <el-button
  587. :disabled="
  588. $store.getters.xt_user.subscibe.state == 3 ? true : false
  589. "
  590. round
  591. @click="openGroupAdvice(1)"
  592. >修改医嘱内容
  593. </el-button>
  594. </el-col>
  595. <el-col :span="5">
  596. <el-button
  597. :disabled="
  598. $store.getters.xt_user.subscibe.state == 3 ? true : false
  599. "
  600. round
  601. @click="openDeleteGroupAdvice()"
  602. >删除医嘱内容
  603. </el-button>
  604. </el-col>
  605. </el-row>
  606. <el-row>
  607. <el-col :span="24">
  608. <el-table
  609. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  610. id="user-advice-name-table"
  611. :data="groupForm.adviceNames"
  612. border
  613. fit
  614. highlight-current-row
  615. :row-class-name="groupClassName"
  616. @current-change="selectGroupAdvice"
  617. style="width: 100%;margin-top: 10px;margin-bottom: 10px;"
  618. :row-key="getRowKey"
  619. ref="advicenametable"
  620. :expand-row-keys="expandRowKeys"
  621. type="expand"
  622. default-expand-all
  623. >
  624. <el-table-column
  625. label="医嘱内容"
  626. property="advice_name"
  627. style="word-break: keep-all;white-space:nowrap;"
  628. >
  629. </el-table-column>
  630. <!-- <el-table-column label="药品规格*数量" min-width="80" property="drug_spec" align="center">
  631. <template slot-scope="scope" >
  632. <span v-if="scope.row.drug_spec!=0">{{scope.row.drug_spec}}{{scope.row.drug_spec_unit}}</span>
  633. <span v-if="scope.row.prescribing_number!=0">*{{scope.row.prescribing_number}}{{scope.row.prescribing_number_unit}}</span>
  634. </template>
  635. </el-table-column> -->
  636. <el-table-column
  637. label="药品规格"
  638. min-width="80"
  639. property="advice_desc"
  640. align="center"
  641. >
  642. <template slot-scope="scope">
  643. <span v-if="scope.row.advice_desc"
  644. >{{ scope.row.advice_desc
  645. }}{{ scope.row.drug_spec_unit }}</span
  646. >
  647. </template>
  648. </el-table-column>
  649. <el-table-column
  650. label="开药数量"
  651. min-width="80"
  652. property="prescribing_number"
  653. align="center"
  654. >
  655. <template slot-scope="scope">
  656. <span v-if="scope.row.prescribing_number != 0"
  657. >{{ scope.row.prescribing_number
  658. }}{{ scope.row.prescribing_number_unit }}</span
  659. >
  660. </template>
  661. </el-table-column>
  662. <el-table-column
  663. label="单次用量"
  664. min-width="80"
  665. property="single_dose"
  666. align="center"
  667. >
  668. <template slot-scope="scope">
  669. <span v-if="scope.row.single_dose != 0"
  670. >{{ scope.row.single_dose
  671. }}{{ scope.row.single_dose_unit }}</span
  672. >
  673. </template>
  674. </el-table-column>
  675. <el-table-column
  676. label="给药途径"
  677. min-width="80"
  678. property="delivery_way"
  679. align="center"
  680. >
  681. <template slot-scope="scope">
  682. <span v-if="scope.row.parent_row == 0">{{
  683. scope.row.delivery_way
  684. }}</span>
  685. </template>
  686. </el-table-column>
  687. <el-table-column
  688. label="执行频率"
  689. min-width="80"
  690. property="execution_frequency"
  691. align="center"
  692. >
  693. <template slot-scope="scope">
  694. <span v-if="scope.row.parent_row == 0">{{
  695. scope.row.execution_frequency
  696. }}</span>
  697. </template>
  698. </el-table-column>
  699. <el-table-column
  700. label="提醒频率"
  701. min-width="80"
  702. property="execution_frequency"
  703. align="center"
  704. >
  705. <template slot-scope="scope">
  706. <span v-if="scope.row.frequency_type == 1">每次必推</span>
  707. <span v-if="scope.row.frequency_type == 2"
  708. >{{ scope.row.day_count }}天/1次</span
  709. >
  710. <span v-if="scope.row.frequency_type == 3"
  711. >每周{{ scope.row.week_days }}</span
  712. >
  713. </template>
  714. </el-table-column>
  715. </el-table>
  716. </el-col>
  717. </el-row>
  718. </el-form>
  719. <div slot="footer" class="dialog-footer">
  720. <el-button
  721. :disabled="
  722. $store.getters.xt_user.subscibe.state == 3 ||
  723. groupForm.adviceNames.length == 0
  724. ? true
  725. : false
  726. "
  727. type="primary"
  728. @click="submitgroupAdvice('groupForm')"
  729. :loading="addLoading"
  730. >保 存
  731. </el-button>
  732. </div>
  733. </el-dialog>
  734. <el-dialog
  735. title="选择医嘱模板"
  736. :close-on-click-modal="false"
  737. :visible.sync="templateFormVisible"
  738. width="72%"
  739. >
  740. <el-row :gutter="20">
  741. <el-col :span="8">
  742. <el-table
  743. :data="adviceTemplates"
  744. ref="templatetable"
  745. border
  746. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  747. highlight-current-row
  748. @current-change="templateTableChange"
  749. style="width: 100%"
  750. >
  751. <el-table-column prop="name" label="模板名称"></el-table-column>
  752. </el-table>
  753. </el-col>
  754. <el-col :span="16">
  755. <el-table
  756. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  757. id="user-advice-select-template-table"
  758. :data="selectedTemp.list"
  759. border
  760. :span-method="spanselecttable"
  761. @select="selectTemplateAdvice"
  762. @selection-change="changeTemplateAdvice"
  763. @select-all="selectAllTemplateAdvice"
  764. row-key="row_key"
  765. ref="selecttemplatetable"
  766. style="width: 100%"
  767. >
  768. <el-table-column type="selection" width="55"></el-table-column>
  769. <el-table-column
  770. label="医嘱内容"
  771. property="advice_name"
  772. style="word-break: keep-all;white-space:nowrap;"
  773. ></el-table-column>
  774. <el-table-column label="药品规格" property="advice_desc">
  775. <template slot-scope="scope">
  776. <span v-if="scope.row.advice_desc"
  777. >{{ scope.row.advice_desc
  778. }}{{ scope.row.drug_spec_unit }}</span
  779. >
  780. </template>
  781. </el-table-column>
  782. <el-table-column
  783. label="开药数量"
  784. min-width="80"
  785. property="prescribing_number"
  786. align="center"
  787. >
  788. <template slot-scope="scope">
  789. <span v-if="scope.row.prescribing_number != 0"
  790. >{{ scope.row.prescribing_number
  791. }}{{ scope.row.prescribing_number_unit }}</span
  792. >
  793. </template>
  794. </el-table-column>
  795. <el-table-column
  796. label="单次用量"
  797. min-width="80"
  798. property="single_dose"
  799. align="center"
  800. >
  801. <template slot-scope="scope">
  802. <span v-if="scope.row.single_dose != 0"
  803. >{{ scope.row.single_dose
  804. }}{{ scope.row.single_dose_unit }}</span
  805. >
  806. </template>
  807. </el-table-column>
  808. <el-table-column
  809. label="给药途径"
  810. min-width="80"
  811. property="delivery_way"
  812. align="center"
  813. >
  814. <template slot-scope="scope">
  815. <span v-if="scope.row.parent_row == 0">{{
  816. scope.row.delivery_way
  817. }}</span>
  818. </template>
  819. </el-table-column>
  820. <el-table-column
  821. label="执行频率"
  822. min-width="80"
  823. property="execution_frequency"
  824. align="center"
  825. >
  826. <template slot-scope="scope">
  827. <span v-if="scope.row.parent_row == 0">{{
  828. scope.row.execution_frequency
  829. }}</span>
  830. </template>
  831. </el-table-column>
  832. <el-table-column
  833. v-if="groupForm.advice_type == 1"
  834. label="提醒频率"
  835. min-width="80"
  836. property="execution_frequency"
  837. align="center"
  838. >
  839. <template slot-scope="scope">
  840. <span v-if="scope.row.frequency_type == 1">每次必推</span>
  841. <span v-if="scope.row.frequency_type == 2"
  842. >{{ scope.row.day_count }}天/1次</span
  843. >
  844. <span v-if="scope.row.frequency_type == 3"
  845. >每周{{ scope.row.week_days }}</span
  846. >
  847. </template>
  848. </el-table-column>
  849. </el-table>
  850. </el-col>
  851. </el-row>
  852. <div slot="footer" class="dialog-footer">
  853. <el-button @click="cancleDialog()">取 消</el-button>
  854. <el-button
  855. :disabled="
  856. $store.getters.xt_user.subscibe.state == 3 ? true : false
  857. "
  858. type="primary"
  859. @click="newAddTempForm()"
  860. >保 存
  861. </el-button>
  862. </div>
  863. </el-dialog>
  864. <el-dialog
  865. title="选择医嘱模板"
  866. :visible.sync="oldTemplateFormVisible"
  867. width="700px"
  868. >
  869. <el-form
  870. ref="templateForm"
  871. :rules="templateRules"
  872. :model="templateForm"
  873. >
  874. <el-row>
  875. <el-col :span="24">
  876. <el-form-item prop="id">
  877. <el-select
  878. v-model="templateForm.id"
  879. filterable
  880. clearable
  881. placeholder="请选择(输入可搜索)"
  882. style="width:100%"
  883. >
  884. <el-option
  885. v-for="item in adviceTemplates"
  886. :key="item.id"
  887. :label="item.name"
  888. :value="item.id"
  889. >
  890. </el-option>
  891. </el-select>
  892. </el-form-item>
  893. </el-col>
  894. </el-row>
  895. </el-form>
  896. <div slot="footer" class="dialog-footer">
  897. <el-button @click="templateFormVisible = false">取 消</el-button>
  898. <el-button
  899. :disabled="
  900. $store.getters.xt_user.subscibe.state == 3 ? true : false
  901. "
  902. type="primary"
  903. @click="addTempForm('templateForm')"
  904. >保 存
  905. </el-button>
  906. </div>
  907. </el-dialog>
  908. <el-dialog
  909. :title="nameFormTitle"
  910. :visible.sync="nameFormVisible"
  911. width="800px"
  912. >
  913. <el-form
  914. ref="nameForm"
  915. :rules="nameRules"
  916. :model="nameForm"
  917. label-width="90px"
  918. >
  919. <el-row>
  920. <el-col :span="10">
  921. <el-form-item label="医嘱内容 :" required prop="advice_name">
  922. <!-- <el-input v-model="nameForm.advice_name"></el-input> -->
  923. <el-select
  924. v-model="nameForm.advice_name"
  925. filterable
  926. clearable
  927. allow-create
  928. :disabled="isChild"
  929. placeholder="请选择(输入可搜索)"
  930. style="width:200px"
  931. @change="changeDrugName"
  932. >
  933. <el-option
  934. v-for="item in medicals"
  935. :key="item.id"
  936. :label="item.drug_name"
  937. :value="item.id"
  938. ></el-option>
  939. </el-select>
  940. <!-- <div style="color:red;font-size:12px;">
  941. 库存不足50
  942. </div> -->
  943. </el-form-item>
  944. </el-col>
  945. <el-col :span="14">
  946. <el-form-item label="药品规格 :" prop="advice_desc">
  947. <el-col :span="12">
  948. <!-- <el-input v-model="nameForm.advice_desc"></el-input> -->
  949. <el-select
  950. v-model="nameForm.advice_desc"
  951. filterable
  952. clearable
  953. allow-create
  954. :disabled="isChild"
  955. placeholder="请选择(输入可搜索)"
  956. style="width:190px"
  957. >
  958. <el-option
  959. v-for="item in drugSpec"
  960. :key="item.id"
  961. :label="item.drug_spec"
  962. :value="item.drug_spec"
  963. ></el-option>
  964. </el-select>
  965. </el-col>
  966. <el-col class="line" :span="2">&nbsp;</el-col>
  967. <el-col :span="6">
  968. <el-select
  969. v-model="nameForm.drug_spec_unit"
  970. filterable
  971. clearable
  972. allow-create
  973. placeholder="选择"
  974. >
  975. <el-option
  976. v-for="item in unitsOption"
  977. :key="item.id"
  978. :label="item.name"
  979. :value="item.name"
  980. >
  981. </el-option>
  982. </el-select>
  983. </el-col>
  984. </el-form-item>
  985. </el-col>
  986. </el-row>
  987. <el-row>
  988. <el-col :span="12">
  989. <el-form-item label="单次用量 :" prop="single_dose">
  990. <el-col :span="8">
  991. <el-input v-model="nameForm.single_dose"></el-input>
  992. </el-col>
  993. <el-col class="line" :span="2">&nbsp;</el-col>
  994. <el-col :span="14">
  995. <el-select
  996. v-model="nameForm.single_dose_unit"
  997. filterable
  998. clearable
  999. allow-create
  1000. placeholder="选择"
  1001. >
  1002. <el-option
  1003. v-for="item in unitsOption"
  1004. :key="item.id"
  1005. :label="item.name"
  1006. :value="item.name"
  1007. >
  1008. </el-option>
  1009. </el-select>
  1010. </el-col>
  1011. </el-form-item>
  1012. </el-col>
  1013. <el-col :span="12">
  1014. <el-form-item label="开药数量 :" prop="prescribing_number">
  1015. <el-col :span="8">
  1016. <el-input v-model="nameForm.prescribing_number"></el-input>
  1017. </el-col>
  1018. <el-col class="line" :span="2">&nbsp;</el-col>
  1019. <el-col :span="14">
  1020. <el-select
  1021. v-model="nameForm.prescribing_number_unit"
  1022. filterable
  1023. clearable
  1024. allow-create
  1025. placeholder="选择"
  1026. >
  1027. <el-option
  1028. v-for="item in unitsOption"
  1029. :key="item.id"
  1030. :label="item.name"
  1031. :value="item.name"
  1032. >
  1033. </el-option>
  1034. </el-select>
  1035. </el-col>
  1036. </el-form-item>
  1037. </el-col>
  1038. </el-row>
  1039. <el-row>
  1040. <el-col :span="12">
  1041. <el-form-item label="给药途径 :" prop="delivery_way">
  1042. <el-select
  1043. v-model="nameForm.delivery_way"
  1044. filterable
  1045. clearable
  1046. allow-create
  1047. :disabled="isChild"
  1048. placeholder="请选择(输入可搜索)"
  1049. style="width:100%"
  1050. >
  1051. <el-option
  1052. v-for="item in deliveryWayOptions"
  1053. :key="item.id"
  1054. :label="item.name"
  1055. :value="item.name"
  1056. >
  1057. </el-option>
  1058. </el-select>
  1059. </el-form-item>
  1060. </el-col>
  1061. <el-col :span="12">
  1062. <el-form-item label="执行频率 :" prop="execution_frequency">
  1063. <el-select
  1064. v-model="nameForm.execution_frequency"
  1065. filterable
  1066. clearable
  1067. allow-create
  1068. :disabled="isChild"
  1069. placeholder="请选择(输入可搜索)"
  1070. style="width:100%"
  1071. >
  1072. <el-option
  1073. v-for="item in executionFrequencyOptions"
  1074. :key="item.id"
  1075. :label="item.name"
  1076. :value="item.name"
  1077. >
  1078. </el-option>
  1079. </el-select>
  1080. </el-form-item>
  1081. </el-col>
  1082. <el-col :span="24" v-if="groupForm.advice_type == 1 && !isChild">
  1083. <el-form-item label="周期提醒 :">
  1084. <el-radio-group v-model="nameForm.frequency_type">
  1085. <el-radio :label="1">每次必推</el-radio>
  1086. <el-radio :label="2">天数频率</el-radio>
  1087. <el-radio :label="3">星期频率</el-radio>
  1088. </el-radio-group>
  1089. </el-form-item>
  1090. </el-col>
  1091. <el-col :span="12" v-if="nameForm.frequency_type == 2">
  1092. <el-form-item prop="day_count">
  1093. <el-input
  1094. style="width: 50px"
  1095. v-model="nameForm.day_count"
  1096. ></el-input
  1097. >&nbsp; 天/一次
  1098. </el-form-item>
  1099. </el-col>
  1100. <el-col :span="24" v-if="nameForm.frequency_type == 3">
  1101. <el-form-item prop="weekday">
  1102. <el-checkbox-group v-model="weeks">
  1103. <el-checkbox label="周一" name="type"></el-checkbox>
  1104. <el-checkbox label="周二" name="type"></el-checkbox>
  1105. <el-checkbox label="周三" name="type"></el-checkbox>
  1106. <el-checkbox label="周四" name="type"></el-checkbox>
  1107. <el-checkbox label="周五" name="type"></el-checkbox>
  1108. <el-checkbox label="周六" name="type"></el-checkbox>
  1109. <el-checkbox label="周日" name="type"></el-checkbox>
  1110. </el-checkbox-group>
  1111. </el-form-item>
  1112. </el-col>
  1113. </el-row>
  1114. </el-form>
  1115. <div slot="footer" class="dialog-footer">
  1116. <el-button @click="nameFormVisible = false">取消</el-button>
  1117. <el-button
  1118. :disabled="
  1119. $store.getters.xt_user.subscibe.state == 3 ? true : false
  1120. "
  1121. type="primary"
  1122. @click="submitNameForm('nameForm')"
  1123. >保 存
  1124. </el-button>
  1125. </div>
  1126. </el-dialog>
  1127. <edit-group-advice
  1128. :adviceTemplates="adviceTemplates"
  1129. :groupFormVisible="groupEditFormVisible"
  1130. :groupForm="groupForm"
  1131. :adviceTypeOptions="adviceTypeOptions"
  1132. :executionFrequencyOptions="executionFrequencyOptions"
  1133. :adminusername="adminusername"
  1134. :unitsOption="unitsOption"
  1135. :deliveryWayOptions="deliveryWayOptions"
  1136. :rowKey="rowKey"
  1137. :adviceTemplateMaps="adviceTemplateMaps"
  1138. :patientID="patientID"
  1139. :adviceType="adviceType"
  1140. :adviceTableData="adviceTableData"
  1141. ref="editGroupForm"
  1142. ></edit-group-advice>
  1143. <el-dialog
  1144. :title="dialogTitle"
  1145. :visible.sync="dialogFormVisible"
  1146. width="700px"
  1147. >
  1148. <el-form
  1149. ref="adviceForm"
  1150. :rules="adviceRules"
  1151. :model="adviceForm"
  1152. label-width="90px"
  1153. >
  1154. <el-row>
  1155. <el-col :span="12">
  1156. <el-form-item label="医嘱类型 :" required prop="advice_type">
  1157. <el-select
  1158. v-model="adviceForm.advice_type"
  1159. :disabled="isEdit || adviceForm.parent_id > 0 ? true : false"
  1160. placeholder="请选择"
  1161. >
  1162. <el-option
  1163. :label="item.label"
  1164. :key="item.value"
  1165. :value="item.value"
  1166. v-for="item in adviceTypeOptions"
  1167. ></el-option>
  1168. </el-select>
  1169. </el-form-item>
  1170. </el-col>
  1171. <el-col :span="12">
  1172. <el-form-item label="开嘱时间 :" required prop="advice_date">
  1173. <el-date-picker
  1174. type="date"
  1175. readonly
  1176. format="yyyy-MM-dd"
  1177. value-format="yyyy-MM-dd"
  1178. placeholder="选择日期"
  1179. v-model="adviceForm.advice_date"
  1180. style="width: 100%;"
  1181. ></el-date-picker>
  1182. </el-form-item>
  1183. </el-col>
  1184. <el-col :span="12">
  1185. <el-form-item
  1186. label="开始时间 :"
  1187. required
  1188. prop="start_time"
  1189. style="width:280px;"
  1190. >
  1191. <el-date-picker
  1192. type="datetime"
  1193. format="yyyy-MM-dd HH:mm:ss"
  1194. value-format="yyyy-MM-dd HH:mm:ss"
  1195. placeholder="选择时间"
  1196. v-model="adviceForm.start_time"
  1197. :disabled="adviceForm.parent_id == 0 ? false : true"
  1198. ></el-date-picker>
  1199. </el-form-item>
  1200. </el-col>
  1201. <el-col :span="12">
  1202. <el-form-item label="医嘱内容 :" required prop="advice_name">
  1203. <el-input v-model="adviceForm.advice_name"></el-input>
  1204. <!--<el-select v-model="adviceForm.advice_name" @change="changeAdviceName" filterable clearable allow-create placeholder="请选择(输入可搜索)" style="width:50%" >-->
  1205. <!--<el-option-->
  1206. <!--v-for="item in adviceTemplates"-->
  1207. <!--:key="item.id"-->
  1208. <!--:label="item.advice_name"-->
  1209. <!--:value="item.id"-->
  1210. <!--&gt;-->
  1211. <!--<span >{{ item.advice_name }}</span>-->
  1212. <!--<span >{{ item.advice_spec }}</span>-->
  1213. <!--</el-option>-->
  1214. <!--</el-select>-->
  1215. </el-form-item>
  1216. </el-col>
  1217. <el-col :span="12">
  1218. <el-form-item label="药品规格 :" prop="advice_desc">
  1219. <el-col :span="9">
  1220. <el-input v-model="adviceForm.advice_desc"></el-input>
  1221. </el-col>
  1222. <el-col class="line" :span="1">&nbsp;</el-col>
  1223. <el-col :span="14">
  1224. <el-select
  1225. v-model="adviceForm.drug_spec_unit"
  1226. filterable
  1227. clearable
  1228. allow-create
  1229. placeholder="选择"
  1230. >
  1231. <el-option
  1232. v-for="item in unitsOption"
  1233. :key="item.id"
  1234. :label="item.name"
  1235. :value="item.name"
  1236. >
  1237. </el-option>
  1238. </el-select>
  1239. </el-col>
  1240. </el-form-item>
  1241. </el-col>
  1242. <el-col :span="12">
  1243. <el-form-item label="单次用量 :" prop="single_dose">
  1244. <el-col :span="9">
  1245. <el-input v-model="adviceForm.single_dose"></el-input>
  1246. </el-col>
  1247. <el-col class="line" :span="1">&nbsp;</el-col>
  1248. <el-col :span="14">
  1249. <!-- <el-input v-model="adviceForm.single_dose_unit" ></el-input> -->
  1250. <el-select
  1251. v-model="adviceForm.single_dose_unit"
  1252. filterable
  1253. clearable
  1254. allow-create
  1255. placeholder="选择"
  1256. >
  1257. <el-option
  1258. v-for="item in unitsOption"
  1259. :key="item.id"
  1260. :label="item.name"
  1261. :value="item.name"
  1262. >
  1263. </el-option>
  1264. </el-select>
  1265. </el-col>
  1266. </el-form-item>
  1267. </el-col>
  1268. <el-col :span="12">
  1269. <el-form-item label="开药数量 :" prop="prescribing_number">
  1270. <el-col :span="9">
  1271. <el-input v-model="adviceForm.prescribing_number"></el-input>
  1272. </el-col>
  1273. <el-col class="line" :span="1">&nbsp;</el-col>
  1274. <el-col :span="14">
  1275. <el-select
  1276. v-model="adviceForm.prescribing_number_unit"
  1277. filterable
  1278. clearable
  1279. allow-create
  1280. placeholder="选择"
  1281. >
  1282. <el-option
  1283. v-for="item in unitsOption"
  1284. :key="item.id"
  1285. :label="item.name"
  1286. :value="item.name"
  1287. >
  1288. </el-option>
  1289. </el-select>
  1290. <!-- <el-input v-model="adviceForm.prescribing_number_unit" ></el-input> -->
  1291. </el-col>
  1292. </el-form-item>
  1293. </el-col>
  1294. <el-col :span="12">
  1295. <el-form-item label="给药途径 :" prop="delivery_way">
  1296. <el-select
  1297. v-model="adviceForm.delivery_way"
  1298. :disabled="adviceForm.parent_id == 0 ? false : true"
  1299. filterable
  1300. clearable
  1301. allow-create
  1302. placeholder="请选择(输入可搜索)"
  1303. style="width:100%"
  1304. >
  1305. <el-option
  1306. v-for="item in deliveryWayOptions"
  1307. :key="item.id"
  1308. :label="item.name"
  1309. :value="item.name"
  1310. >
  1311. </el-option>
  1312. </el-select>
  1313. </el-form-item>
  1314. </el-col>
  1315. <el-col :span="12">
  1316. <el-form-item
  1317. label="执行频率 :"
  1318. prop="execution_frequency"
  1319. style="width:100%;"
  1320. >
  1321. <el-select
  1322. v-model="adviceForm.execution_frequency"
  1323. :disabled="adviceForm.parent_id == 0 ? false : true"
  1324. filterable
  1325. clearable
  1326. allow-create
  1327. placeholder="请选择(输入可搜索)"
  1328. style="width:100%"
  1329. >
  1330. <el-option
  1331. v-for="item in executionFrequencyOptions"
  1332. :key="item.id"
  1333. :label="item.name"
  1334. :value="item.name"
  1335. >
  1336. </el-option>
  1337. </el-select>
  1338. </el-form-item>
  1339. </el-col>
  1340. </el-row>
  1341. <el-form-item label="备注 :">
  1342. <el-input type="textarea" v-model="adviceForm.remark"></el-input>
  1343. </el-form-item>
  1344. <el-form-item label="开嘱医生 :">
  1345. <span>{{ adminusername }} </span>
  1346. </el-form-item>
  1347. </el-form>
  1348. <div slot="footer" class="dialog-footer">
  1349. <template v-if="isEdit">
  1350. <el-button @click="dialogFormVisible = false">取消</el-button>
  1351. <el-button
  1352. :disabled="
  1353. $store.getters.xt_user.subscibe.state == 3 ? true : false
  1354. "
  1355. type="primary"
  1356. @click="submitEditAdvice('adviceForm')"
  1357. >保 存
  1358. </el-button>
  1359. </template>
  1360. <template v-else>
  1361. <el-button
  1362. @click="dialogFormVisible = false"
  1363. v-if="adviceForm.parent_id > 0"
  1364. >取 消
  1365. </el-button>
  1366. <el-button
  1367. :disabled="
  1368. $store.getters.xt_user.subscibe.state == 3 ? true : false
  1369. "
  1370. type="primary"
  1371. @click="submitNewAdvice('adviceForm', 're')"
  1372. v-if="adviceForm.parent_id == 0"
  1373. >继 续
  1374. </el-button>
  1375. <el-button
  1376. :disabled="
  1377. $store.getters.xt_user.subscibe.state == 3 ? true : false
  1378. "
  1379. type="primary"
  1380. @click="submitNewAdvice('adviceForm', 'on')"
  1381. >保 存
  1382. </el-button>
  1383. </template>
  1384. </div>
  1385. </el-dialog>
  1386. <el-dialog
  1387. title="停止医嘱"
  1388. :visible.sync="dialogStopFormVisible"
  1389. width="600px"
  1390. >
  1391. <el-form
  1392. ref="stopForm"
  1393. :model="stopForm"
  1394. :rules="stopRules"
  1395. label-width="90px"
  1396. >
  1397. <el-form-item label="停止时间 :" required prop="stop_time">
  1398. <el-date-picker
  1399. type="datetime"
  1400. format="yyyy-MM-dd HH:mm:ss"
  1401. value-format="yyyy-MM-dd HH:mm:ss"
  1402. placeholder="选择时间"
  1403. v-model="stopForm.stop_time"
  1404. style="width:50%"
  1405. ></el-date-picker>
  1406. </el-form-item>
  1407. </el-form>
  1408. <div slot="footer" class="dialog-footer">
  1409. <el-button @click="dialogStopFormVisible = false">取消</el-button>
  1410. <el-button
  1411. :disabled="
  1412. $store.getters.xt_user.subscibe.state == 3 ? true : false
  1413. "
  1414. type="primary"
  1415. @click="submitStopAdvice('stopForm')"
  1416. >保 存
  1417. </el-button>
  1418. </div>
  1419. </el-dialog>
  1420. <el-dialog
  1421. title="执行医嘱"
  1422. :visible.sync="execTimeDialogVisible"
  1423. width="600px"
  1424. >
  1425. <el-form
  1426. ref="execForm"
  1427. :model="execForm"
  1428. :rules="execRules"
  1429. label-width="90px"
  1430. >
  1431. <el-form-item label="执行时间 :" required prop="exec_time">
  1432. <el-date-picker
  1433. type="datetime"
  1434. format="yyyy-MM-dd HH:mm:ss"
  1435. value-format="yyyy-MM-dd HH:mm:ss"
  1436. placeholder="选择时间"
  1437. v-model="execForm.exec_time"
  1438. style="width:50%"
  1439. ></el-date-picker>
  1440. </el-form-item>
  1441. </el-form>
  1442. <div slot="footer" class="dialog-footer">
  1443. <el-button
  1444. :disabled="
  1445. $store.getters.xt_user.subscibe.state == 3 ? true : false
  1446. "
  1447. type="primary"
  1448. @click="submitExecAdvice('execForm')"
  1449. >保 存
  1450. </el-button>
  1451. <el-button type="primary" @click="execTimeDialogVisible = false"
  1452. >取消
  1453. </el-button>
  1454. </div>
  1455. </el-dialog>
  1456. </div>
  1457. <div style="display:none">
  1458. <div class="printForm" id="printCQadvice">
  1459. <h2 class="hospital_title">{{ orgname }}</h2>
  1460. <h1 class="title">长期医嘱单</h1>
  1461. <div class="info">
  1462. <ul>
  1463. <li>
  1464. <span class="name">姓名:</span>
  1465. <!-- <input type="text" class="InputBox" v-model="currentPatient.name"> -->
  1466. <span class="InputBox">&nbsp;{{ currentPatient.name }}</span>
  1467. </li>
  1468. <li>
  1469. <span class="name">性别:</span>
  1470. <!-- <input type="text" class="InputBox"> -->
  1471. <span class="InputBox"
  1472. >&nbsp;{{ tranSex(currentPatient.gender) }}</span
  1473. >
  1474. </li>
  1475. <li>
  1476. <span class="name">年龄:</span>
  1477. <!-- <input type="text" class="InputBox"> -->
  1478. <span class="InputBox"
  1479. >&nbsp;{{ tranAge(currentPatient.birthday) }}岁</span
  1480. >
  1481. </li>
  1482. <li>
  1483. <span class="name">科别:</span>
  1484. <!-- <input type="text" class="InputBox"> -->
  1485. <span class="InputBox">&nbsp;&nbsp;&nbsp;&nbsp;</span>
  1486. </li>
  1487. <li>
  1488. <span class="name">透析号:</span>
  1489. <!-- <input type="text" class="InputBox"> -->
  1490. <span class="InputBox"
  1491. >&nbsp;&nbsp;&nbsp;{{
  1492. currentPatient.dialysis_no
  1493. }}&nbsp;&nbsp;</span
  1494. >
  1495. </li>
  1496. </ul>
  1497. </div>
  1498. <table
  1499. border="1"
  1500. style="border:1px #999 solid;margin-top:20px;"
  1501. bordercolorlight="#fff"
  1502. bordercolordark="#fff"
  1503. width="100%"
  1504. cellpadding="0"
  1505. cellspacing="0"
  1506. class="printTable"
  1507. >
  1508. <tbody>
  1509. <tr align="center">
  1510. <th style="width:20%;" colspan="2" align="center">起始</th>
  1511. <th style="width:20%;" rowspan="2" align="">医嘱</th>
  1512. <th style="width:8%;" rowspan="2" align="center">医师签名</th>
  1513. <th style="width:6%;" rowspan="2" align="center">执行护士签名</th>
  1514. <th style="width:42%;" colspan="4" align="center">停止</th>
  1515. </tr>
  1516. <tr align="center">
  1517. <th align="center">日期</th>
  1518. <th align="center">时间</th>
  1519. <th style="width:10%;" align="center">日期</th>
  1520. <th style="width:10%;" align="center">时间</th>
  1521. <th style="width:10%;" align="center">医师签名</th>
  1522. <th style="width:6%;" align="center">执行护士签名</th>
  1523. </tr>
  1524. <tr
  1525. align="center"
  1526. v-for="(advice, index) in cqtableData"
  1527. :key="advice.id"
  1528. >
  1529. <td>
  1530. <span>{{ advice.start_time | parseTime("{y}-{m}-{d}") }}</span>
  1531. </td>
  1532. <td>
  1533. <span>{{ advice.start_time | parseTime("{h}:{i}") }}</span>
  1534. </td>
  1535. <td style="text-align:left">
  1536. <span v-if="advice.parent_id > 0">▲</span>
  1537. <span>{{ advice.advice_name }}</span>
  1538. <span v-if="advice.advice_desc"
  1539. >{{ advice.advice_desc }}{{ advice.drug_spec_unit }}</span
  1540. >
  1541. <!-- <span v-if="advice.drug_spec">{{advice.drug_spec}}{{advice.drug_spec_unit}}</span> -->
  1542. <span v-if="advice.prescribing_number"
  1543. >*{{ advice.prescribing_number
  1544. }}{{ advice.prescribing_number_unit }}</span
  1545. >
  1546. <span v-if="advice.single_dose != 0">
  1547. 单次用量 {{ advice.single_dose
  1548. }}{{ advice.single_dose_unit }}</span
  1549. >
  1550. <span>{{ advice.delivery_way }}</span>
  1551. <span>{{ advice.execution_frequency }}</span>
  1552. </td>
  1553. <td>
  1554. <div>
  1555. <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{
  1556. getXuserName(advice.advice_doctor)
  1557. }}</span>
  1558. <img
  1559. class="es-img"
  1560. :src="setAdminUserES(advice.advice_doctor)"
  1561. alt=""
  1562. srcset=""
  1563. v-else
  1564. />
  1565. </div>
  1566. </td>
  1567. <td></td>
  1568. <td>
  1569. <span
  1570. v-if="
  1571. advice.stop_state == 1 && isShowCQStartTime(index, advice)
  1572. "
  1573. >{{ advice.stop_time | parseTime("{y}-{m}-{d}") }}</span
  1574. >
  1575. </td>
  1576. <td>
  1577. <span
  1578. v-if="
  1579. advice.stop_state == 1 && isShowCQStartTime(index, advice)
  1580. "
  1581. >{{ advice.stop_time | parseTime("{h}:{i}") }}</span
  1582. >
  1583. </td>
  1584. <td>
  1585. <div v-if="isShowCQStartTime(index, advice)">
  1586. <span v-if="setAdminUserES(advice.stop_doctor) == ''">{{
  1587. getXuserName(advice.stop_doctor)
  1588. }}</span>
  1589. <img
  1590. class="es-img"
  1591. :src="setAdminUserES(advice.stop_doctor)"
  1592. alt=""
  1593. srcset=""
  1594. v-else
  1595. />
  1596. </div>
  1597. </td>
  1598. <td></td>
  1599. </tr>
  1600. </tbody>
  1601. </table>
  1602. </div>
  1603. </div>
  1604. <div style="display:none">
  1605. <div class="printForm" id="printLSadvice">
  1606. <h2 class="hospital_title">{{ orgname }}</h2>
  1607. <h1 class="title">临时医嘱单</h1>
  1608. <div class="info">
  1609. <ul>
  1610. <li>
  1611. <span class="name" style="width:50px;">姓名:</span>
  1612. <!-- <input type="text" class="InputBox" v-model="currentPatient.name"> -->
  1613. <span class="InputBox">&nbsp;{{ currentPatient.name }}</span>
  1614. </li>
  1615. <li>
  1616. <span class="name" style="width:50px;">性别:</span>
  1617. <!-- <input type="text" class="InputBox"> -->
  1618. <span class="InputBox"
  1619. >&nbsp;{{ tranSex(currentPatient.gender) }}</span
  1620. >
  1621. </li>
  1622. <li>
  1623. <span class="name" style="width:50px;">年龄:</span>
  1624. <!-- <input type="text" class="InputBox"> -->
  1625. <span class="InputBox"
  1626. >&nbsp;{{ tranAge(currentPatient.birthday) }}岁</span
  1627. >
  1628. </li>
  1629. <li>
  1630. <span class="name" style="width:30px;">科:</span>
  1631. <!-- <input type="text" class="InputBox"> -->
  1632. <span class="InputBox">&nbsp;&nbsp;&nbsp;&nbsp;</span>
  1633. </li>
  1634. <li>
  1635. <span class="name" style="width:30px;">区:</span>
  1636. <!-- <input type="text" class="InputBox"> -->
  1637. <span class="InputBox">&nbsp;&nbsp;&nbsp;&nbsp;</span>
  1638. </li>
  1639. <li>
  1640. <span class="name" style="width:30px;">房:</span>
  1641. <!-- <input type="text" class="InputBox"> -->
  1642. <span class="InputBox">&nbsp;&nbsp;&nbsp;&nbsp;</span>
  1643. </li>
  1644. <li>
  1645. <span class="name" style="width:30px;">床:</span>
  1646. <!-- <input type="text" class="InputBox"> -->
  1647. <span class="InputBox">&nbsp;&nbsp;&nbsp;&nbsp;</span>
  1648. </li>
  1649. <li>
  1650. <span class="name" style="width:70px;">透析号:</span>
  1651. <span class="InputBox"
  1652. >&nbsp;{{ currentPatient.dialysis_no }}&nbsp;&nbsp;&nbsp;</span
  1653. >
  1654. <!-- <input type="text" class="InputBox"> -->
  1655. </li>
  1656. </ul>
  1657. </div>
  1658. <table
  1659. border="1"
  1660. style="border:1px #999 solid;margin-top:20px;"
  1661. bordercolorlight="#fff"
  1662. bordercolordark="#fff"
  1663. width="100%"
  1664. cellpadding="0"
  1665. cellspacing="0"
  1666. class="printTable"
  1667. >
  1668. <tbody>
  1669. <tr align="center">
  1670. <th style="width:10%;" align="center">日期</th>
  1671. <th style="width:10%;" align="center">时间</th>
  1672. <th style="width:10%;" align="center">医生签名</th>
  1673. <th style="width:40%;" align="">医嘱内容</th>
  1674. <th style="width:10%;" align="center">执行时间</th>
  1675. <th style="width:10%;" align="center">护士签名</th>
  1676. </tr>
  1677. <tr align="center" v-for="advice in lstableData" :key="advice.id">
  1678. <td>
  1679. <span v-if="advice.parent_id == 0">{{
  1680. advice.start_time | parseTime("{y}-{m}-{d}")
  1681. }}</span>
  1682. </td>
  1683. <td>
  1684. <span v-if="advice.parent_id == 0">{{
  1685. advice.start_time | parseTime("{h}:{i}")
  1686. }}</span>
  1687. </td>
  1688. <td>
  1689. <div v-if="isShowCQStartTime(index, advice)">
  1690. <span v-if="setAdminUserES(advice.advice_doctor) == ''">{{
  1691. getXuserName(advice.advice_doctor)
  1692. }}</span>
  1693. <img
  1694. class="es-img"
  1695. :src="setAdminUserES(advice.advice_doctor)"
  1696. alt=""
  1697. srcset=""
  1698. v-else
  1699. />
  1700. </div>
  1701. </td>
  1702. <td style="text-align:left">
  1703. <span v-if="advice.parent_id > 0">▲</span>
  1704. <span>{{ advice.advice_name }}</span>
  1705. <span>{{ advice.advice_desc }}</span>
  1706. <span v-if="advice.advice_desc"
  1707. >{{ advice.advice_desc }}{{ advice.drug_spec_unit }}</span
  1708. >
  1709. <span v-if="advice.prescribing_number"
  1710. >*{{ advice.prescribing_number
  1711. }}{{ advice.prescribing_number_unit }}</span
  1712. >
  1713. <span v-if="advice.single_dose != 0"
  1714. >单次用量 {{ advice.single_dose
  1715. }}{{ advice.single_dose_unit }}</span
  1716. >
  1717. <span>{{ advice.delivery_way }}</span>
  1718. <span>{{ advice.execution_frequency }}</span>
  1719. </td>
  1720. <td>
  1721. <span v-if="advice.execution_time != 0">{{
  1722. advice.execution_time | parseTime("{y}-{m}-{d} {h}:{i}")
  1723. }}</span>
  1724. </td>
  1725. <td>
  1726. <div v-if="isShowCQStartTime(index, advice)">
  1727. <span v-if="setAdminUserES(advice.execution_staff) == ''">{{
  1728. getXuserName(advice.execution_staff)
  1729. }}</span>
  1730. <img
  1731. class="es-img"
  1732. :src="setAdminUserES(advice.execution_staff)"
  1733. alt=""
  1734. srcset=""
  1735. v-else
  1736. />
  1737. </div>
  1738. </td>
  1739. </tr>
  1740. </tbody>
  1741. </table>
  1742. </div>
  1743. </div>
  1744. <div style="display:none;">
  1745. <div id="printCQadvice_fq" class="advice-order">
  1746. <div class="ls-title">{{ orgname }}</div>
  1747. <div class="ls-type">长期医嘱单</div>
  1748. <div class="ls-name">
  1749. <div>
  1750. 姓名:<span class="item-value">{{ currentPatient.name }}</span>
  1751. </div>
  1752. <div>
  1753. 透析号:<span class="item-value">{{
  1754. currentPatient.dialysis_no
  1755. }}</span>
  1756. </div>
  1757. </div>
  1758. <table
  1759. cellspacing="0"
  1760. cellpadding="0"
  1761. border="1"
  1762. class="el-table__body"
  1763. style="width: 100%;"
  1764. >
  1765. <tbody>
  1766. <tr style="text-align:center;">
  1767. <td colspan="3">
  1768. 开始
  1769. </td>
  1770. <td colspan="2">
  1771. 停止
  1772. </td>
  1773. <td rowspan="2">
  1774. 备注
  1775. </td>
  1776. </tr>
  1777. <tr style="text-align:center;">
  1778. <td>时间</td>
  1779. <td style="max-width:50%">医嘱</td>
  1780. <td>医生</td>
  1781. <td>时间</td>
  1782. <td>医生</td>
  1783. </tr>
  1784. <tr v-for="(advice, index) in cqtableData" :key="advice.id">
  1785. <td>
  1786. <span v-if="isShowCQStartTime(index, advice)">{{
  1787. advice.start_time | parseTime("{y}-{m}-{d} {h}:{i}")
  1788. }}</span>
  1789. <span v-else></span>
  1790. </td>
  1791. <td>
  1792. <span>{{ advice.advice_name }}</span>
  1793. <span>{{ advice.advice_desc }}</span>
  1794. <span v-if="advice.single_dose"
  1795. >{{ advice.single_dose }}{{ advice.single_dose_unit }}</span
  1796. >
  1797. <span v-if="advice.prescribing_number"
  1798. >*{{ advice.prescribing_number
  1799. }}{{ advice.prescribing_number_unit }}</span
  1800. >
  1801. <span>{{ advice.delivery_way }}</span>
  1802. <span>{{ advice.execution_frequency }}</span>
  1803. </td>
  1804. <td>
  1805. <span v-if="advice.parent_id == 0">{{
  1806. getXuserName(advice.advice_doctor)
  1807. }}</span>
  1808. </td>
  1809. <td>
  1810. <span v-if="advice.stop_state == 1 && advice.parent_id == 0">{{
  1811. advice.stop_time | parseTime("{y}-{m}-{d} {h}:{i}")
  1812. }}</span>
  1813. <span v-else></span>
  1814. </td>
  1815. <td>
  1816. <span v-if="advice.stop_state == 1 && advice.parent_id == 0">{{
  1817. getXuserName(advice.stop_doctor)
  1818. }}</span>
  1819. <span v-else></span>
  1820. </td>
  1821. <td>
  1822. {{ advice.remark }}
  1823. </td>
  1824. </tr>
  1825. </tbody>
  1826. </table>
  1827. </div>
  1828. </div>
  1829. <div style="display:none;">
  1830. <div id="printLSadvice_fq" class="advice-order">
  1831. <div class="ls-title">{{ orgname }}</div>
  1832. <div class="ls-type">临时医嘱单</div>
  1833. <div class="ls-name">
  1834. <div>
  1835. 姓名:<span class="item-value">{{ currentPatient.name }}</span>
  1836. </div>
  1837. <div>
  1838. 透析号:<span class="item-value">{{
  1839. currentPatient.dialysis_no
  1840. }}</span>
  1841. </div>
  1842. </div>
  1843. <table
  1844. cellspacing="0"
  1845. cellpadding="0"
  1846. border="1"
  1847. class="el-table__body"
  1848. style="width: 100%;"
  1849. >
  1850. <thead>
  1851. <th>时间</th>
  1852. <th>医嘱</th>
  1853. <th>医生</th>
  1854. <th>执行护士</th>
  1855. <th>执行时间</th>
  1856. </thead>
  1857. <tbody>
  1858. <tr v-for="(advice, index) in lstableData" :key="advice.id">
  1859. <td>
  1860. <span v-if="isShowLSStartTime(index, advice)">{{
  1861. advice.start_time | parseTime("{y}-{m}-{d} {h}:{i}")
  1862. }}</span>
  1863. <span v-else></span>
  1864. </td>
  1865. <td>
  1866. <span>{{ advice.advice_name }}</span>
  1867. <span>{{ advice.advice_desc }}</span>
  1868. <span v-if="advice.single_dose"
  1869. >{{ advice.single_dose }}{{ advice.single_dose_unit }}</span
  1870. >
  1871. <span v-if="advice.advice_desc"
  1872. >{{ advice.advice_desc }}{{ advice.drug_spec_unit }}</span
  1873. >
  1874. <span v-if="advice.prescribing_number"
  1875. >*{{ advice.prescribing_number
  1876. }}{{ advice.prescribing_number_unit }}</span
  1877. >
  1878. <span>{{ advice.delivery_way }}</span>
  1879. <span>{{ advice.execution_frequency }}</span>
  1880. </td>
  1881. <td>
  1882. <span v-if="advice.parent_id == 0">{{
  1883. getXuserName(advice.advice_doctor)
  1884. }}</span>
  1885. </td>
  1886. <td>
  1887. <span v-if="advice.parent_id == 0">{{
  1888. getXuserName(advice.execution_staff)
  1889. }}</span>
  1890. </td>
  1891. <td>
  1892. <span v-if="advice.execution_time != 0">{{
  1893. advice.execution_time | parseTime("{y}-{m}-{d} {h}:{i}")
  1894. }}</span>
  1895. </td>
  1896. </tr>
  1897. </tbody>
  1898. </table>
  1899. </div>
  1900. </div>
  1901. </div>
  1902. </template>
  1903. <script>
  1904. import PatientSidebar from "./components/PatientSidebar";
  1905. import EditGroupAdvice from "./components/EditGroupAdvice";
  1906. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  1907. import {
  1908. CheckGroupAdvice,
  1909. CreateNewDoctorAdvice,
  1910. CreateNewGroupAdvice,
  1911. DeleteNewDoctorAdvice,
  1912. DeleteNewGroupAdvice,
  1913. EditNewDoctorAdvice,
  1914. ExecGroupAdvice,
  1915. getAdviceConfig,
  1916. getAllAdviceConfig,
  1917. getDoctorAdviceList,
  1918. StopDoctorAdvice,
  1919. getPatientSchedules,
  1920. getPrintInfo
  1921. } from "@/api/advice";
  1922. import { fetchPatient, PostRemind } from "@/api/patient";
  1923. import { jsGetAge, uParseTime } from "@/utils/tools";
  1924. import { getDataConfig } from "@/utils/data";
  1925. import { getSelfMedicalList,getDrugDescByDrugName } from "@/api/drug/drug"
  1926. let rowIndex = 1;
  1927. const rowKey = 0;
  1928. export default {
  1929. name: "doctorAdvice",
  1930. data() {
  1931. return {
  1932. weeks: [],
  1933. is_open_remind: "",
  1934. checkList: [],
  1935. rowKey: 0,
  1936. nameFormTitle: "",
  1937. adminusername: "",
  1938. aminuserid: 0,
  1939. orgname: "",
  1940. tempArr: [],
  1941. dialogConfigVisible: false,
  1942. currentPatient: {},
  1943. currentIndex: -1,
  1944. dialogTitle: "新增",
  1945. dialogFormVisible: false,
  1946. groupEditFormVisible: false,
  1947. nameFormVisible: false,
  1948. templateFormVisible: false,
  1949. oldTemplateFormVisible: false,
  1950. dialogStopFormVisible: false,
  1951. execTimeDialogVisible: false,
  1952. groupFormVisible: false,
  1953. isEdit: false,
  1954. isChild: false,
  1955. searchKey: "",
  1956. pickerOptions: {
  1957. shortcuts: [
  1958. {
  1959. text: "今天",
  1960. onClick(picker) {
  1961. picker.$emit("pick", new Date());
  1962. }
  1963. },
  1964. {
  1965. text: "昨天",
  1966. onClick(picker) {
  1967. const date = new Date();
  1968. date.setTime(date.getTime() - 3600 * 1000 * 24);
  1969. picker.$emit("pick", date);
  1970. }
  1971. },
  1972. {
  1973. text: "一周前",
  1974. onClick(picker) {
  1975. const date = new Date();
  1976. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  1977. picker.$emit("pick", date);
  1978. }
  1979. },
  1980. {
  1981. text: "清空",
  1982. onClick(picker) {
  1983. picker.$emit("pick");
  1984. }
  1985. }
  1986. ]
  1987. },
  1988. adviceType: 0,
  1989. adviceTypeArr: [
  1990. { value: 0, label: "全部" },
  1991. { value: 1, label: "长期" },
  1992. { value: 3, label: "临时" }
  1993. ],
  1994. adviceTypeOptions: [
  1995. { value: 1, label: "长期" },
  1996. { value: 3, label: "临时" }
  1997. ],
  1998. stopType: 0,
  1999. stopTypeArr: [
  2000. { value: 0, label: "全部" },
  2001. { value: 2, label: "未停止" },
  2002. { value: 1, label: "已停止" }
  2003. ],
  2004. adviceTableData: [],
  2005. doctorOptions: [],
  2006. adminUserOptions: null,
  2007. adviceTemplates: [],
  2008. adviceTemplateMaps: {},
  2009. drugOptions: [],
  2010. deliveryWayOptions: [],
  2011. executionFrequencyOptions: [],
  2012. unitsOption: [],
  2013. templateForm: { id: "" },
  2014. adviceForm: {
  2015. advice_type: "",
  2016. advice_date: "",
  2017. start_time: "",
  2018. advice_name: "",
  2019. advice_desc: "",
  2020. single_dose: "",
  2021. template_id: 0,
  2022. single_dose_unit: "",
  2023. prescribing_number: "",
  2024. prescribing_number_unit: "",
  2025. delivery_way: "",
  2026. execution_frequency: "",
  2027. advice_doctor: "",
  2028. remark: "",
  2029. parent_id: 0
  2030. },
  2031. nameForm: {
  2032. advice_name: "",
  2033. single_dose: "",
  2034. single_dose_unit: "",
  2035. drug_spec: "",
  2036. drug_spec_unit: "",
  2037. prescribing_number: "",
  2038. prescribing_number_unit: "",
  2039. delivery_way: "",
  2040. execution_frequency: "",
  2041. template_id: 0,
  2042. isEdit: 0,
  2043. index: 0,
  2044. id: 0,
  2045. children: []
  2046. },
  2047. groupForm: {
  2048. day_count: "",
  2049. advice_type: "",
  2050. advice_date: "",
  2051. start_time: "",
  2052. adviceNames: [],
  2053. advice_doctor: "",
  2054. remark: "",
  2055. parent_id: 0,
  2056. remind: 0,
  2057. frequency_type: 0
  2058. },
  2059. stopForm: {
  2060. id: 0,
  2061. stop_time: "",
  2062. stop_reason: ""
  2063. },
  2064. execForm: {
  2065. exec_time: "",
  2066. groupno: ""
  2067. },
  2068. templateRules: {
  2069. id: [{ required: true, message: "请选择医嘱模板" }]
  2070. },
  2071. adviceRules: {
  2072. advice_type: [{ required: true, message: "请选择医嘱类型" }],
  2073. advice_date: [{ required: true, message: "请选择开嘱时间" }],
  2074. start_time: [{ required: true, message: "请选择开始时间" }],
  2075. advice_name: [{ required: true, message: "请填写医嘱内容" }],
  2076. advice_doctor: [{ required: true, message: "请选择开嘱医生" }]
  2077. },
  2078. nameRules: {
  2079. advice_name: [{ required: true, message: "请填写医嘱内容" }]
  2080. },
  2081. groupRules: {
  2082. advice_type: [{ required: true, message: "请选择医嘱类型" }],
  2083. advice_date: [{ required: true, message: "请选择开嘱时间" }],
  2084. start_time: [{ required: true, message: "请选择开始时间" }],
  2085. advice_name: [{ required: true, message: "请填写医嘱内容" }],
  2086. advice_doctor: [{ required: true, message: "请选择开嘱医生" }],
  2087. frequency_type: [
  2088. { required: true, message: "请选择周期提醒", trigger: "change" }
  2089. ]
  2090. },
  2091. stopRules: {
  2092. stop_time: [{ required: true, message: "请选择停止时间" }]
  2093. },
  2094. execRules: {
  2095. exec_time: [{ required: true, message: "请选择时间" }]
  2096. },
  2097. listQuery: {
  2098. start_time: "",
  2099. end_time: "",
  2100. advice_type: 0,
  2101. stop_state: "",
  2102. keywords: "",
  2103. id: 0,
  2104. limit: 10,
  2105. page: 1
  2106. },
  2107. total: 0,
  2108. addLoading: false,
  2109. lstableData: [],
  2110. cqtableData: [],
  2111. groupSelectRow: null,
  2112. expandRowKeys: [],
  2113. operators: [],
  2114. operatorMaps: {},
  2115. selectedTemp: { id: 0, name: "", org_id: 0, list: [], rows: [] },
  2116. selectedTemplate: [],
  2117. allSelectedTemplate: [],
  2118. tableData: [],
  2119. multipleSelection: [],
  2120. patientID: 0,
  2121. temp: null,
  2122. schedulStatus: 0,
  2123. doctorAdvice: [],
  2124. dataAdvice: [],
  2125. medicals:[],
  2126. patient_id:"",
  2127. drugSpec:[]
  2128. };
  2129. },
  2130. methods: {
  2131. clickuseradvicecell(row, column, cell, event) {
  2132. // console.log("row1", row);
  2133. // console.log("column", column);
  2134. },
  2135. onTranPatient: function(tranPatient) {
  2136. this.currentPatient = tranPatient;
  2137. },
  2138. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  2139. if (columnIndex == 3) {
  2140. return "advicenamedisplay";
  2141. } else {
  2142. return "";
  2143. }
  2144. },
  2145. submitEditAdvice(formName) {
  2146. this.$refs[formName].validate(valid => {
  2147. if (valid) {
  2148. let mode = "";
  2149. if (this.adviceForm.advice_type == 1) {
  2150. mode = "1-3";
  2151. if (
  2152. this.adviceForm.advice_doctor !=
  2153. this.$store.getters.xt_user.user.id
  2154. ) {
  2155. mode = "1-4";
  2156. }
  2157. } else if (this.adviceForm.advice_type == 3) {
  2158. mode = "2-1";
  2159. if (
  2160. this.adviceForm.advice_doctor !=
  2161. this.$store.getters.xt_user.user.id
  2162. ) {
  2163. mode = "3-1";
  2164. }
  2165. }
  2166. EditNewDoctorAdvice(
  2167. this.patientID,
  2168. this.adviceForm.id,
  2169. this.adviceForm,
  2170. mode
  2171. ).then(response => {
  2172. if (response.data.state == 0) {
  2173. this.$message.error(response.data.msg);
  2174. return false;
  2175. } else {
  2176. this.$notify({
  2177. title: "成功",
  2178. message: "修改医嘱成功",
  2179. type: "success",
  2180. duration: 2000
  2181. });
  2182. this.dialogFormVisible = false;
  2183. this.resetForm(formName);
  2184. var advice = response.data.data.advice;
  2185. this.adviceTableData[this.currentIndex].drug_spec =
  2186. advice.drug_spec;
  2187. this.adviceTableData[this.currentIndex].drug_spec_unit =
  2188. advice.drug_spec_unit;
  2189. this.adviceTableData[this.currentIndex].start_time =
  2190. advice.start_time;
  2191. this.adviceTableData[this.currentIndex].advice_name =
  2192. advice.advice_name;
  2193. this.adviceTableData[this.currentIndex].advice_desc =
  2194. advice.advice_desc;
  2195. this.adviceTableData[this.currentIndex].single_dose =
  2196. advice.single_dose;
  2197. this.adviceTableData[this.currentIndex].single_dose_unit =
  2198. advice.single_dose_unit;
  2199. this.adviceTableData[this.currentIndex].delivery_way =
  2200. advice.delivery_way;
  2201. this.adviceTableData[this.currentIndex].execution_frequency =
  2202. advice.execution_frequency;
  2203. this.adviceTableData[this.currentIndex].prescribing_number =
  2204. advice.prescribing_number;
  2205. this.adviceTableData[this.currentIndex].prescribing_number_unit =
  2206. advice.prescribing_number_unit;
  2207. this.adviceTableData[this.currentIndex].advice_doctor =
  2208. advice.advice_doctor;
  2209. this.adviceTableData[this.currentIndex].remark = advice.remark;
  2210. this.currentIndex = -1;
  2211. return false;
  2212. }
  2213. });
  2214. }
  2215. });
  2216. },
  2217. submitgroupAdvice(formName) {
  2218. this.addLoading = true;
  2219. this.$refs[formName].validate(valid => {
  2220. if (valid) {
  2221. var submitForm = {
  2222. advice_type: this.groupForm.advice_type,
  2223. advice_date: this.groupForm.advice_date,
  2224. start_time: this.groupForm.start_time,
  2225. adviceNames: [],
  2226. advice_doctor: this.groupForm.advice_doctor,
  2227. remark: this.groupForm.remark,
  2228. parent_id: this.groupForm.parent_id
  2229. };
  2230. var adviceNames = [];
  2231. for (const index in this.groupForm.adviceNames) {
  2232. this.groupForm.adviceNames[
  2233. index
  2234. ].day_count = this.groupForm.adviceNames[
  2235. index
  2236. ].day_count.toString();
  2237. adviceNames.unshift(this.groupForm.adviceNames[index]);
  2238. }
  2239. submitForm.adviceNames = adviceNames;
  2240. let mode = "";
  2241. if (this.groupForm.advice_type == 1) {
  2242. mode = "1-2";
  2243. } else if (this.groupForm.advice_type == 3) {
  2244. mode = "1-1";
  2245. }
  2246. CreateNewGroupAdvice(this.patientID, 0, submitForm, mode).then(
  2247. response => {
  2248. if (response.data.state == 0) {
  2249. this.$message.error(response.data.msg);
  2250. this.addLoading = false;
  2251. return false;
  2252. } else {
  2253. this.addLoading = false;
  2254. this.$notify({
  2255. title: "成功",
  2256. message: "新增成功",
  2257. type: "success",
  2258. duration: 2000
  2259. });
  2260. if (
  2261. this.adviceType == this.groupForm.advice_type ||
  2262. this.adviceType == 0
  2263. ) {
  2264. var childMap = {};
  2265. for (const index in response.data.data.advices) {
  2266. if (response.data.data.advices[index].parent_id == 0) {
  2267. continue;
  2268. }
  2269. if (
  2270. response.data.data.advices[index].parent_id in
  2271. childMap ===
  2272. false
  2273. ) {
  2274. childMap[
  2275. response.data.data.advices[index].parent_id
  2276. ] = [];
  2277. }
  2278. childMap[
  2279. response.data.data.advices[index].parent_id
  2280. ].unshift(response.data.data.advices[index]);
  2281. }
  2282. var parentArr = [];
  2283. for (const index in response.data.data.advices) {
  2284. if (response.data.data.advices[index].parent_id > 0) {
  2285. continue;
  2286. }
  2287. parentArr.push(response.data.data.advices[index]);
  2288. }
  2289. for (const index in parentArr) {
  2290. if (parentArr[index].id in childMap) {
  2291. for (const j in childMap[parentArr[index].id]) {
  2292. this.adviceTableData.unshift(
  2293. childMap[parentArr[index].id][j]
  2294. );
  2295. }
  2296. }
  2297. this.adviceTableData.unshift(parentArr[index]);
  2298. }
  2299. }
  2300. this.resetForm(formName);
  2301. this.groupFormVisible = false;
  2302. return false;
  2303. }
  2304. }
  2305. );
  2306. } else {
  2307. this.addLoading = false;
  2308. }
  2309. });
  2310. },
  2311. submitNewAdvice(formName, action) {
  2312. this.$refs[formName].validate(valid => {
  2313. if (valid) {
  2314. let mode = "";
  2315. if (this.adviceForm.advice_type == 1) {
  2316. //长期
  2317. mode = "1-2";
  2318. } else if (this.adviceForm.advice_type == 3) {
  2319. //临时
  2320. mode = "1-1";
  2321. }
  2322. CreateNewDoctorAdvice(this.patientID, this.adviceForm, mode).then(
  2323. response => {
  2324. if (response.data.state == 0) {
  2325. this.$message.error(response.data.msg);
  2326. return false;
  2327. } else {
  2328. this.$notify({
  2329. title: "成功",
  2330. message: "新增医嘱成功",
  2331. type: "success",
  2332. duration: 2000
  2333. });
  2334. if (action != "re") {
  2335. this.dialogFormVisible = false;
  2336. }
  2337. if (
  2338. this.adviceType == this.adviceForm.advice_type ||
  2339. this.adviceType == 0
  2340. ) {
  2341. if (this.adviceForm.parent_id > 0) {
  2342. var spliceIndex = -1;
  2343. for (
  2344. let index = this.adviceTableData.length - 1;
  2345. ;
  2346. index--
  2347. ) {
  2348. if (
  2349. this.adviceTableData[index].parent_id ===
  2350. this.adviceForm.parent_id
  2351. ) {
  2352. spliceIndex = index;
  2353. break;
  2354. } else if (
  2355. this.adviceTableData[index].id ===
  2356. this.adviceForm.parent_id
  2357. ) {
  2358. spliceIndex = index;
  2359. break;
  2360. }
  2361. }
  2362. if (spliceIndex > -1) {
  2363. spliceIndex += 1;
  2364. if (spliceIndex === this.adviceTableData.length) {
  2365. this.adviceTableData.push(response.data.data.advice);
  2366. } else {
  2367. var swapData = this.adviceTableData.splice(spliceIndex);
  2368. this.adviceTableData.push(response.data.data.advice);
  2369. this.adviceTableData = this.adviceTableData.concat(
  2370. swapData
  2371. );
  2372. }
  2373. }
  2374. } else {
  2375. this.adviceTableData.unshift(response.data.data.advice);
  2376. }
  2377. }
  2378. this.resetForm(formName);
  2379. this.currentIndex = -1;
  2380. return false;
  2381. }
  2382. }
  2383. );
  2384. }
  2385. });
  2386. },
  2387. submitStopAdvice(formName) {
  2388. this.$refs[formName].validate(valid => {
  2389. if (valid) {
  2390. let mode = "1-5";
  2391. if (this.temp.advice_doctor != this.$store.getters.xt_user.user.id) {
  2392. mode = "1-8";
  2393. }
  2394. StopDoctorAdvice(this.stopForm.id, this.stopForm, mode).then(
  2395. response => {
  2396. if (response.data.state == 0) {
  2397. this.$message.error(response.data.msg);
  2398. return false;
  2399. } else {
  2400. this.$notify({
  2401. title: "成功",
  2402. message: "医嘱已经停止",
  2403. type: "success",
  2404. duration: 2000
  2405. });
  2406. // this.stopResetData(this.stopForm.id);
  2407. var atlen = this.adviceTableData.length;
  2408. var _this = this;
  2409. for (let index = atlen - 1; index >= 0; index--) {
  2410. if (
  2411. this.adviceTableData[index].id == this.stopForm.id ||
  2412. this.adviceTableData[index].parent_id == this.stopForm.id
  2413. ) {
  2414. if (_this.stopType == 0) {
  2415. this.adviceTableData[index].stop_state =
  2416. response.data.data.advice.stop_state;
  2417. this.adviceTableData[index].stop_doctor =
  2418. response.data.data.advice.stop_doctor;
  2419. this.adviceTableData[index].stop_time =
  2420. response.data.data.advice.stop_time;
  2421. } else if (_this.stopType == 2) {
  2422. this.adviceTableData.splice(index, 1);
  2423. }
  2424. }
  2425. }
  2426. this.dialogStopFormVisible = false;
  2427. }
  2428. }
  2429. );
  2430. }
  2431. });
  2432. },
  2433. submitExecAdvice(formName) {
  2434. this.$refs[formName].validate(valid => {
  2435. if (valid) {
  2436. let mode = "6-1";
  2437. ExecGroupAdvice(
  2438. this.execForm.groupno,
  2439. this.execForm.exec_time,
  2440. mode
  2441. ).then(response => {
  2442. if (response.data.state == 0) {
  2443. this.$message.error(response.data.msg);
  2444. return false;
  2445. } else {
  2446. this.$notify({
  2447. title: "成功",
  2448. message: "医嘱已经执行",
  2449. type: "success",
  2450. duration: 2000
  2451. });
  2452. var atlen = this.adviceTableData.length;
  2453. for (const index in this.adviceTableData) {
  2454. if (
  2455. this.adviceTableData[index].groupno == this.execForm.groupno
  2456. ) {
  2457. this.adviceTableData[index].execution_time =
  2458. response.data.data.advice.execution_time;
  2459. this.adviceTableData[index].execution_staff =
  2460. response.data.data.advice.execution_staff;
  2461. this.adviceTableData[index].execution_state = 1;
  2462. }
  2463. }
  2464. this.execTimeDialogVisible = false;
  2465. }
  2466. });
  2467. }
  2468. });
  2469. },
  2470. openAdviceTemplate() {
  2471. if (this.groupForm.advice_type == "") {
  2472. this.$message.error("请先选择医嘱类型");
  2473. return;
  2474. }
  2475. if (this.groupForm.advice_type == 1) {
  2476. this.getAdviceConfig(1);
  2477. } else if (this.groupForm.advice_type == 3) {
  2478. this.getAdviceConfig(0);
  2479. }
  2480. this.templateForm = { id: "" };
  2481. this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
  2482. this.selectedTemplate = [];
  2483. if (typeof this.$refs.templatetable !== "undefined") {
  2484. this.$refs.templatetable.setCurrentRow(null);
  2485. }
  2486. this.templateFormVisible = true;
  2487. },
  2488. openGroupChild() {
  2489. if (this.groupSelectRow === null) {
  2490. this.$message.error("未选择医嘱内容,无法添加子药");
  2491. return;
  2492. } else if (this.groupSelectRow.parent_row > 0) {
  2493. this.$message.error("子药不能添加子药");
  2494. return;
  2495. }
  2496. this.nameForm = {
  2497. advice_name: "",
  2498. single_dose: "",
  2499. single_dose_unit: "",
  2500. drug_spec: "",
  2501. drug_spec_unit: "",
  2502. prescribing_number: "",
  2503. prescribing_number_unit: "",
  2504. delivery_way: this.groupSelectRow.delivery_way,
  2505. execution_frequency: this.groupSelectRow.execution_frequency,
  2506. isEdit: 0,
  2507. index: 0,
  2508. children: [],
  2509. checkIds: [],
  2510. parent_row: this.groupSelectRow.row_key,
  2511. id: 0
  2512. };
  2513. this.isChild = true;
  2514. this.nameFormVisible = true;
  2515. this.nameFormTitle = "添加子药内容";
  2516. },
  2517. openGroupAdvice(isEdit) {
  2518. this.isChild = false;
  2519. if (isEdit) {
  2520. if (this.groupSelectRow === null) {
  2521. this.$message.error("未选择要修改的医嘱内容");
  2522. return;
  2523. }
  2524. if (this.groupSelectRow.parent_row) {
  2525. this.isChild = true;
  2526. }
  2527. this.nameForm = {
  2528. advice_name: this.groupSelectRow.advice_name,
  2529. advice_desc: this.groupSelectRow.advice_desc,
  2530. single_dose: this.groupSelectRow.single_dose,
  2531. single_dose_unit: this.groupSelectRow.single_dose_unit,
  2532. drug_spec: this.groupSelectRow.drug_spec,
  2533. drug_spec_unit: this.groupSelectRow.drug_spec_unit,
  2534. prescribing_number: this.groupSelectRow.prescribing_number,
  2535. prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
  2536. way:this.groupSelectRow.way,
  2537. drug_id:this.groupSelectRow.drug_id,
  2538. delivery_way: this.isChild ? "" : this.groupSelectRow.delivery_way,
  2539. execution_frequency: this.isChild
  2540. ? ""
  2541. : this.groupSelectRow.execution_frequency,
  2542. isEdit: 1,
  2543. index: this.groupSelectRow.index,
  2544. id: this.groupSelectRow.id,
  2545. children: [],
  2546. parent_row: this.groupSelectRow.parent_row,
  2547. day_count: this.groupSelectRow.day_count,
  2548. week_days: this.groupSelectRow.week_days,
  2549. frequency_type: this.groupSelectRow.frequency_type
  2550. };
  2551. this.weeks = this.groupSelectRow.week_days.split(",");
  2552. this.nameFormTitle = "修改医嘱内容";
  2553. } else {
  2554. if (this.groupForm.advice_type == "") {
  2555. this.$message.error("请先选择医嘱类型");
  2556. return;
  2557. }
  2558. this.nameForm = {
  2559. advice_name: "",
  2560. advice_desc: "",
  2561. single_dose: "",
  2562. single_dose_unit: "",
  2563. drug_spec: "",
  2564. drug_spec_unit: "",
  2565. prescribing_number: "",
  2566. prescribing_number_unit: "",
  2567. delivery_way: "",
  2568. execution_frequency: "",
  2569. day_count: "",
  2570. week_days: "",
  2571. frequency_type: 0,
  2572. template_id: "",
  2573. isEdit: 0,
  2574. index: 0,
  2575. id: 0,
  2576. children: [],
  2577. parent_row: 0,
  2578. way:"",
  2579. drug_id:''
  2580. };
  2581. this.nameFormTitle = "新增医嘱内容";
  2582. }
  2583. this.nameFormVisible = true;
  2584. },
  2585. openDeleteGroupAdvice() {
  2586. if (this.groupSelectRow === null) {
  2587. this.$message.error("未选择要删除的医嘱内容");
  2588. return;
  2589. }
  2590. var content = "";
  2591. if (this.groupSelectRow.children.length > 0) {
  2592. content = "确认删除此医嘱内容,包括它的子药?";
  2593. } else {
  2594. content = "确认删除此医嘱内容?";
  2595. }
  2596. var isChild = !!this.groupSelectRow.parent_row;
  2597. var title = isChild ? "删除子药内容" : "删除医嘱内容";
  2598. var msg = isChild ? "确认删除此子药内容?" : content;
  2599. this.$confirm(msg, title, {
  2600. confirmButtonText: "确定",
  2601. cancelButtonText: "取消",
  2602. type: "warning"
  2603. })
  2604. .then(() => {
  2605. if (isChild) {
  2606. for (const index in this.groupForm.adviceNames) {
  2607. if (
  2608. this.groupForm.adviceNames[index].row_key ==
  2609. this.groupSelectRow.parent_row
  2610. ) {
  2611. for (const j in this.groupForm.adviceNames[index].children) {
  2612. if (
  2613. this.groupForm.adviceNames[index].children[j].row_key ==
  2614. this.groupSelectRow.row_key
  2615. ) {
  2616. this.groupForm.adviceNames[index].children.splice(j, 1);
  2617. this.$set(
  2618. this.groupForm.adviceNames,
  2619. index,
  2620. this.groupForm.adviceNames[index]
  2621. );
  2622. this.toggleRowExpansion();
  2623. break;
  2624. }
  2625. }
  2626. }
  2627. }
  2628. } else {
  2629. for (const index in this.groupForm.adviceNames) {
  2630. if (
  2631. this.groupForm.adviceNames[index].row_key ==
  2632. this.groupSelectRow.row_key
  2633. ) {
  2634. this.groupForm.adviceNames.splice(index, 1);
  2635. this.toggleRowExpansion();
  2636. break;
  2637. }
  2638. }
  2639. }
  2640. })
  2641. .catch(() => {});
  2642. },
  2643. DeleteGroupAdvice(groupno, row) {
  2644. this.$confirm("确认删除这组医嘱?", "医嘱删除", {
  2645. confirmButtonText: "确定",
  2646. cancelButtonText: "取消",
  2647. type: "warning"
  2648. })
  2649. .then(() => {
  2650. // console.log(row);
  2651. let mode = "";
  2652. if (row.advice_type == 3) {
  2653. mode = "4-1";
  2654. if (row.advice_doctor != this.$store.getters.xt_user.user.id) {
  2655. mode = "5-1";
  2656. }
  2657. } else if (row.advice_type == 1) {
  2658. mode = "1-6";
  2659. if (row.advice_doctor != this.$store.getters.xt_user.user.id) {
  2660. mode = "1-7";
  2661. }
  2662. }
  2663. DeleteNewGroupAdvice(groupno, mode).then(response => {
  2664. if (response.data.state == 0) {
  2665. this.$message.error(response.data.msg)``;
  2666. return false;
  2667. } else {
  2668. this.$notify({
  2669. title: "成功",
  2670. message: "医嘱已经删除",
  2671. type: "success",
  2672. duration: 2000
  2673. });
  2674. var resetTableData = this.adviceTableData;
  2675. this.adviceTableData = [];
  2676. var that = this;
  2677. for (const key in resetTableData) {
  2678. if (resetTableData[key].groupno != groupno) {
  2679. that.adviceTableData.push(resetTableData[key]);
  2680. }
  2681. }
  2682. }
  2683. });
  2684. })
  2685. .catch(() => {});
  2686. },
  2687. openDelete(index, row) {
  2688. this.$confirm("确认删除此条医嘱?", "医嘱删除", {
  2689. confirmButtonText: "确定",
  2690. cancelButtonText: "取消",
  2691. type: "warning"
  2692. })
  2693. .then(() => {
  2694. let mode;
  2695. if (row.advice_type == 1) {
  2696. mode = "1-6";
  2697. if (row.advice_doctor != this.$store.getters.xt_user.user.id) {
  2698. mode = "1-7";
  2699. }
  2700. } else if (row.advice_type == 3) {
  2701. mode = "4-1";
  2702. if (row.advice_doctor != this.$store.getters.xt_user.user.id) {
  2703. mode = "5-1";
  2704. }
  2705. }
  2706. DeleteNewDoctorAdvice(row.id, mode).then(response => {
  2707. if (response.data.state == 0) {
  2708. this.$message.error(response.data.msg);
  2709. return false;
  2710. } else {
  2711. this.$notify({
  2712. title: "成功",
  2713. message: "医嘱已经删除",
  2714. type: "success",
  2715. duration: 2000
  2716. });
  2717. this.deleteResetData(index, row);
  2718. }
  2719. });
  2720. })
  2721. .catch(() => {});
  2722. },
  2723. resetForm(formName) {
  2724. this.$refs[formName].resetFields();
  2725. },
  2726. changeTime() {
  2727. this.getList();
  2728. },
  2729. changeKey() {
  2730. this.getList();
  2731. },
  2732. openExec(index, row) {
  2733. if (row.stop_state == 1 || row.execution_state == 1) {
  2734. this.$message.error("所选医嘱已停止或执行");
  2735. return false;
  2736. }
  2737. this.execForm = {
  2738. exec_time: "",
  2739. groupno: row.groupno
  2740. };
  2741. this.execTimeDialogVisible = true;
  2742. this.currentIndex = index;
  2743. },
  2744. openCheck(index, row) {
  2745. if (row.check_state == 1) {
  2746. this.$message.error("所选医嘱已核对");
  2747. return false;
  2748. }
  2749. if (row.execution_state != 1) {
  2750. this.$message.error("所选医嘱未执行,无法核对");
  2751. return false;
  2752. }
  2753. if (
  2754. row.execution_staff > 0 &&
  2755. row.execution_staff == this.$store.getters.xt_user.user.id
  2756. ) {
  2757. this.$message.error("核对与执行不能是同一人");
  2758. return false;
  2759. }
  2760. this.$confirm("确认提交核对?", "医嘱核对", {
  2761. confirmButtonText: "确定",
  2762. cancelButtonText: "取消",
  2763. closeOnClickModal: false,
  2764. type: "warning"
  2765. })
  2766. .then(() => {
  2767. this.deleLoading = true;
  2768. let mode = "7-1";
  2769. CheckGroupAdvice(row.groupno, mode).then(response => {
  2770. if (response.data.state == 0) {
  2771. this.$message.error(response.data.msg);
  2772. return false;
  2773. } else {
  2774. this.$notify({
  2775. title: "成功",
  2776. message: "核对成功",
  2777. type: "success",
  2778. duration: 2000
  2779. });
  2780. var atlen = this.adviceTableData.length;
  2781. for (const index in this.adviceTableData) {
  2782. if (this.adviceTableData[index].groupno == row.groupno) {
  2783. this.adviceTableData[index].checker =
  2784. response.data.data.advice.checker;
  2785. this.adviceTableData[index].check_time =
  2786. response.data.data.advice.check_time;
  2787. this.adviceTableData[index].check_state = 1;
  2788. }
  2789. }
  2790. }
  2791. });
  2792. })
  2793. .catch(() => {});
  2794. },
  2795. openStop(index, row) {
  2796. if (row.stop_state == 1 || row.execution_state == 1) {
  2797. this.$message.error("所选医嘱已停止!");
  2798. return false;
  2799. }
  2800. this.temp = row;
  2801. // console.log(row);
  2802. this.stopForm = {
  2803. id: row.parent_id > 0 ? row.parent_id : row.id,
  2804. stop_time: "",
  2805. stop_reason: "",
  2806. groupno: row.groupno
  2807. };
  2808. this.currentIndex = index;
  2809. this.dialogStopFormVisible = true;
  2810. },
  2811. openNew() {
  2812. var theDate = new Date();
  2813. var year = theDate.getFullYear();
  2814. var month = theDate.getMonth() + 1;
  2815. var dat = theDate.getDate();
  2816. month = month < 10 ? "0" + month : month;
  2817. dat = dat < 10 ? "0" + dat : dat;
  2818. var adviceDate = year + "-" + month + "-" + dat;
  2819. // this.groupForm.advice_date = adviceDate;
  2820. this.groupForm = {
  2821. advice_type: "",
  2822. advice_date: adviceDate,
  2823. start_time: "",
  2824. adviceNames: [],
  2825. advice_doctor: "",
  2826. remark: "",
  2827. parent_id: 0
  2828. };
  2829. this.rowKey = 0;
  2830. this.groupFormVisible = true;
  2831. },
  2832. openConfig() {},
  2833. openEditGroupAdvice(groupno) {
  2834. var groups = [];
  2835. this.rowKey = 0;
  2836. for (const index in this.adviceTableData) {
  2837. if (groupno == this.adviceTableData[index].groupno) {
  2838. groups.push(this.adviceTableData[index]);
  2839. }
  2840. }
  2841. if (groups.length == 0) {
  2842. return false;
  2843. }
  2844. this.groupForm = {
  2845. advice_type: groups[0].advice_type,
  2846. advice_date: uParseTime(groups[0].advice_date, "{y}-{m}-{d}"),
  2847. start_time: uParseTime(groups[0].start_time, "{y}-{m}-{d} {h}:{i}"),
  2848. adviceNames: [],
  2849. advice_doctor: groups[0].user_name,
  2850. doctor: groups[0].advice_doctor,
  2851. remark: groups[0].remark,
  2852. groupno: groupno
  2853. };
  2854. // console.log(groups[0]);
  2855. var childMap = {};
  2856. for (const index in groups) {
  2857. if (groups[index].parent_id == 0) {
  2858. continue;
  2859. }
  2860. if (groups[index].parent_id in childMap === false) {
  2861. childMap[groups[index].parent_id] = [];
  2862. }
  2863. childMap[groups[index].parent_id].push(groups[index]);
  2864. }
  2865. for (const index in groups) {
  2866. if (groups[index].parent_id > 0) {
  2867. continue;
  2868. }
  2869. this.rowKey++;
  2870. var item = {
  2871. advice_name: groups[index].advice_name,
  2872. advice_desc: groups[index].advice_desc,
  2873. single_dose: "" + groups[index].single_dose,
  2874. single_dose_unit: groups[index].single_dose_unit,
  2875. drug_spec: "" + groups[index].drug_spec,
  2876. drug_spec_unit: groups[index].drug_spec_unit,
  2877. prescribing_number: "" + groups[index].prescribing_number,
  2878. prescribing_number_unit: groups[index].prescribing_number_unit,
  2879. delivery_way: groups[index].delivery_way,
  2880. execution_frequency: groups[index].execution_frequency,
  2881. frequency_type: groups[index].frequency_type,
  2882. day_count: groups[index].day_count,
  2883. week_day: groups[index].week_day,
  2884. isEdit: 0,
  2885. index: 0,
  2886. id: groups[index].id,
  2887. children: [],
  2888. parent_row: 0,
  2889. row_key: this.rowKey,
  2890. table: []
  2891. };
  2892. if (item.id in childMap) {
  2893. for (const key in childMap[item.id]) {
  2894. this.rowKey++;
  2895. var child = {
  2896. advice_name: childMap[item.id][key].advice_name,
  2897. advice_desc: childMap[item.id][key].advice_desc,
  2898. single_dose: "" + childMap[item.id][key].single_dose,
  2899. single_dose_unit: childMap[item.id][key].single_dose_unit,
  2900. drug_spec: "" + childMap[item.id][key].drug_spec,
  2901. drug_spec_unit: childMap[item.id][key].drug_spec_unit,
  2902. prescribing_number:
  2903. "" + childMap[item.id][key].prescribing_number,
  2904. prescribing_number_unit:
  2905. childMap[item.id][key].prescribing_number_unit,
  2906. delivery_way: childMap[item.id][key].delivery_way,
  2907. execution_frequency: childMap[item.id][key].execution_frequency,
  2908. isEdit: 0,
  2909. index: 0,
  2910. id: childMap[item.id][key].id,
  2911. children: [],
  2912. parent_row: item.row_key,
  2913. row_key: this.rowKey
  2914. };
  2915. item.children.push(child);
  2916. }
  2917. this.$set(item, "children", item.children);
  2918. }
  2919. this.groupForm.adviceNames.push(item);
  2920. }
  2921. // console.log(this.groupForm);
  2922. this.$refs.editGroupForm.open();
  2923. },
  2924. openEdit(index, row) {
  2925. this.currentIndex = index;
  2926. (this.dialogTitle = "修改医嘱"), (this.isEdit = true);
  2927. if (row.stop_state == 1 || row.execution_state == 1) {
  2928. this.$message.error("所选医嘱已停止,不能修改!");
  2929. return false;
  2930. }
  2931. // if (row.advice_doctor != this.aminuserid) {
  2932. // this.$message.error("不能修改非本人添加的医嘱!");
  2933. // return false;
  2934. // }
  2935. // console.log(row);
  2936. this.setAdviceForm(row);
  2937. this.dialogFormVisible = true;
  2938. },
  2939. openNewChild(index, row) {
  2940. this.currentIndex = index;
  2941. this.dialogTitle = "新增子药";
  2942. this.isEdit = false;
  2943. if (row.stop_state == 1 || row.execution_state == 1) {
  2944. this.$message.error("所选医嘱已停止");
  2945. return false;
  2946. }
  2947. this.adviceForm = {
  2948. advice_type: row.advice_type,
  2949. advice_date: uParseTime(row.advice_date, "{y}-{m}-{d}"),
  2950. start_time: uParseTime(row.start_time, "{y}-{m}-{d} {h}:{i}"),
  2951. advice_name: "",
  2952. advice_desc: "",
  2953. single_dose: "",
  2954. single_dose_unit: "",
  2955. drug_spec: "",
  2956. drug_spec_unit: "",
  2957. prescribing_number: "",
  2958. prescribing_number_unit: "",
  2959. delivery_way: row.delivery_way,
  2960. execution_frequency: row.execution_frequency,
  2961. advice_doctor: row.advice_doctor,
  2962. remark: "",
  2963. parent_id: row.parent_id > 0 ? row.parent_id : row.id
  2964. };
  2965. this.dialogFormVisible = true;
  2966. },
  2967. changeAdviceName(key) {
  2968. if (key in this.adviceTemplateMaps) {
  2969. this.adviceForm.advice_name = this.adviceTemplateMaps[key].advice_name;
  2970. this.adviceForm.advice_desc = this.adviceTemplateMaps[key].advice_desc;
  2971. this.adviceForm.single_dose_unit = this.adviceTemplateMaps[
  2972. key
  2973. ].single_dose_unit;
  2974. this.adviceForm.single_dose =
  2975. this.adviceTemplateMaps[key].single_dose + "";
  2976. this.adviceForm.prescribing_number_unit = this.adviceTemplateMaps[
  2977. key
  2978. ].prescribing_number_unit;
  2979. this.adviceForm.prescribing_number =
  2980. this.adviceTemplateMaps[key].prescribing_number + "";
  2981. this.adviceForm.delivery_way = this.adviceTemplateMaps[
  2982. key
  2983. ].delivery_way;
  2984. this.adviceForm.execution_frequency = this.adviceTemplateMaps[
  2985. key
  2986. ].execution_frequency;
  2987. }
  2988. },
  2989. indexMethod(index) {
  2990. if (index === 0) {
  2991. rowIndex = 1;
  2992. }
  2993. var row = this.adviceTableData[index];
  2994. if (row.parent_id > 0) {
  2995. return "";
  2996. } else if (
  2997. index > 0 &&
  2998. row.groupno > 0 &&
  2999. row.groupno == this.adviceTableData[index - 1].groupno
  3000. ) {
  3001. return "";
  3002. }
  3003. return rowIndex++;
  3004. },
  3005. isShowStartTime(index, row) {
  3006. if (row.parent_id > 0) {
  3007. return false;
  3008. } else if (
  3009. index > 0 &&
  3010. row.groupno > 0 &&
  3011. row.groupno == this.adviceTableData[index - 1].groupno
  3012. ) {
  3013. return false;
  3014. }
  3015. return true;
  3016. },
  3017. isShowCQStartTime(index, row) {
  3018. if (row.parent_id > 0) {
  3019. return false;
  3020. } else if (
  3021. index > 0 &&
  3022. row.groupno > 0 &&
  3023. row.groupno == this.cqtableData[index - 1].groupno
  3024. ) {
  3025. return false;
  3026. }
  3027. return true;
  3028. },
  3029. isShowLSStartTime(index, row) {
  3030. if (row.parent_id > 0) {
  3031. return false;
  3032. } else if (
  3033. index > 0 &&
  3034. row.groupno > 0 &&
  3035. row.groupno == this.lstableData[index - 1].groupno
  3036. ) {
  3037. return false;
  3038. }
  3039. return true;
  3040. },
  3041. selectAdviceType(type) {
  3042. this.adviceType = type;
  3043. this.listQuery.advice_type = type;
  3044. this.getList();
  3045. },
  3046. selectStopType(type) {
  3047. this.stopType = type;
  3048. this.listQuery.stop_state = type;
  3049. this.getList();
  3050. },
  3051. deleteResetData(index, row) {
  3052. if (row.parent_id > 0) {
  3053. this.adviceTableData.splice(index, 1);
  3054. } else {
  3055. var resetTableData = this.adviceTableData;
  3056. this.adviceTableData = [];
  3057. var that = this;
  3058. resetTableData.forEach(function(item, itemindex) {
  3059. if (item.id != row.id && item.parent_id != row.id) {
  3060. that.adviceTableData.push(item);
  3061. }
  3062. });
  3063. }
  3064. },
  3065. stopResetData(id) {
  3066. var resetTableData = this.adviceTableData;
  3067. this.adviceTableData = [];
  3068. var that = this;
  3069. resetTableData.forEach(function(item, index) {
  3070. if (item.id != id && item.parent_id != id) {
  3071. that.adviceTableData.push(item);
  3072. }
  3073. });
  3074. },
  3075. fetchAllDoctorAndNurse() {
  3076. fetchAllDoctorAndNurse().then(response => {
  3077. if (response.data.state == 1) {
  3078. this.doctorOptions = response.data.data.doctors;
  3079. }
  3080. });
  3081. },
  3082. fetchAllAdminUsers() {
  3083. fetchAllAdminUsers().then(response => {
  3084. if (response.data.state == 1) {
  3085. this.adminUserOptions = response.data.data.users;
  3086. var alen = this.adminUserOptions.length;
  3087. for (let index = 0; index < alen; index++) {
  3088. if (this.adminUserOptions[index].user_type == 2) {
  3089. this.doctorOptions.push(this.adminUserOptions[index]);
  3090. }
  3091. }
  3092. }
  3093. });
  3094. },
  3095. getAdviceConfig(type) {
  3096. getAdviceConfig(type).then(response => {
  3097. if (response.data.state == 1) {
  3098. this.deliveryWayOptions =
  3099. response.data.data.drugways === null
  3100. ? []
  3101. : response.data.data.drugways;
  3102. this.executionFrequencyOptions =
  3103. response.data.data.efs === null ? [] : response.data.data.efs;
  3104. this.adviceTemplates =
  3105. response.data.data.advice_templates === null
  3106. ? []
  3107. : response.data.data.advice_templates;
  3108. var templateLen = this.adviceTemplates.length;
  3109. for (let index = 0; index < templateLen; index++) {
  3110. if (!this.adviceTemplates[index].DoctorAdviceTemplate) {
  3111. continue;
  3112. }
  3113. var DoctorAdviceTemplate = this.adviceTemplates[index]
  3114. .DoctorAdviceTemplate;
  3115. for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
  3116. DoctorAdviceTemplate[i].selection = false;
  3117. }
  3118. var item = this.adviceTemplates[index];
  3119. item.DoctorAdviceTemplate = [];
  3120. var datMap = {};
  3121. for (const key in DoctorAdviceTemplate) {
  3122. if (DoctorAdviceTemplate[key].parent_id == 0) {
  3123. datMap[DoctorAdviceTemplate[key].id] =
  3124. DoctorAdviceTemplate[key];
  3125. }
  3126. }
  3127. for (const key in DoctorAdviceTemplate) {
  3128. if (DoctorAdviceTemplate[key].parent_id in datMap) {
  3129. if ("children" in datMap[DoctorAdviceTemplate[key].parent_id]) {
  3130. datMap[DoctorAdviceTemplate[key].parent_id].children.push(
  3131. DoctorAdviceTemplate[key]
  3132. );
  3133. } else {
  3134. datMap[DoctorAdviceTemplate[key].parent_id].children = [];
  3135. datMap[DoctorAdviceTemplate[key].parent_id].children.push(
  3136. DoctorAdviceTemplate[key]
  3137. );
  3138. }
  3139. }
  3140. }
  3141. for (const key in datMap) {
  3142. item.DoctorAdviceTemplate.push(datMap[key]);
  3143. }
  3144. this.$set(
  3145. this.adviceTemplateMaps,
  3146. this.adviceTemplates[index].id,
  3147. item
  3148. );
  3149. }
  3150. }
  3151. });
  3152. },
  3153. getDoctorName(doctorid) {
  3154. if (doctorid <= 0) {
  3155. return "";
  3156. }
  3157. var name = "";
  3158. if (
  3159. this.doctorOptions == null ||
  3160. typeof this.doctorOptions.length === "undefined"
  3161. ) {
  3162. return name;
  3163. }
  3164. var leng = this.doctorOptions.length;
  3165. if (leng == 0) {
  3166. return name;
  3167. }
  3168. for (let index = 0; index < leng; index++) {
  3169. if (this.doctorOptions[index].id == doctorid) {
  3170. name = this.doctorOptions[index].name;
  3171. break;
  3172. }
  3173. }
  3174. return name;
  3175. },
  3176. getXuserName(id) {
  3177. if (id <= 0) {
  3178. return "";
  3179. }
  3180. var name = "";
  3181. if (
  3182. this.adminUserOptions == null ||
  3183. typeof this.adminUserOptions.length === "undefined"
  3184. ) {
  3185. return name;
  3186. }
  3187. var leng = this.adminUserOptions.length;
  3188. if (leng == 0) {
  3189. return name;
  3190. }
  3191. for (let index = 0; index < leng; index++) {
  3192. if (this.adminUserOptions[index].id == id) {
  3193. name = this.adminUserOptions[index].name;
  3194. break;
  3195. }
  3196. }
  3197. return name;
  3198. },
  3199. setAdviceForm(row) {
  3200. this.adviceForm = {
  3201. advice_type: row.advice_type,
  3202. advice_date: uParseTime(row.advice_date, "{y}-{m}-{d}"),
  3203. start_time: uParseTime(row.start_time, "{y}-{m}-{d} {h}:{i}"),
  3204. advice_name: row.advice_name,
  3205. advice_desc: row.advice_desc,
  3206. drug_spec: row.drug_spec != 0 ? row.drug_spec : "",
  3207. drug_spec_unit: row.drug_spec_unit,
  3208. single_dose: row.single_dose != 0 ? row.single_dose : "",
  3209. single_dose_unit: row.single_dose_unit,
  3210. prescribing_number:
  3211. row.prescribing_number != 0 ? row.prescribing_number : "",
  3212. prescribing_number_unit: row.prescribing_number_unit,
  3213. delivery_way: row.delivery_way,
  3214. execution_frequency: row.execution_frequency,
  3215. advice_doctor: row.advice_doctor,
  3216. remark: row.remark,
  3217. id: row.id,
  3218. parent_id: row.parent_id
  3219. };
  3220. },
  3221. getList() {
  3222. getDoctorAdviceList(this.listQuery).then(response => {
  3223. if (response.data.state == 1) {
  3224. this.adviceTableData = response.data.data.advices;
  3225. //console.log("数据是什么", this.adviceTableData);
  3226. var advice = response.data.data.advices;
  3227. var one = response.data.data.advicetwo;
  3228. let dataInfo = {};
  3229. one.forEach((item, index) => {
  3230. let { start_time } = item;
  3231. if (!dataInfo[start_time]) {
  3232. dataInfo[start_time] = {
  3233. start_time,
  3234. child: []
  3235. };
  3236. }
  3237. });
  3238. let list = Object.values(dataInfo);
  3239. // console.log("list", list);
  3240. list.map(item => {
  3241. for (let i = 0; i < advice.length; i++) {
  3242. if (
  3243. item.start_time === advice[i].start_time &&
  3244. advice[i].parent_id === 0
  3245. ) {
  3246. item.child.push(advice[i]);
  3247. }
  3248. }
  3249. });
  3250. let objarr = [];
  3251. for (let i = 0; i < advice.length; i++) {
  3252. if (advice[i].parent_id != 0) {
  3253. objarr.push(advice[i]);
  3254. }
  3255. }
  3256. this.childList = objarr;
  3257. let arr = this.doctorAdvice;
  3258. arr.push(...list.reverse());
  3259. // console.log("arr", arr);
  3260. this.doctorAdvice = arr;
  3261. var total = response.data.data.total;
  3262. // console.log("total", total);
  3263. this.total = total;
  3264. this.operators = response.data.data.operators;
  3265. if (this.operators.length > 0) {
  3266. var operatorsLen = this.operators.length;
  3267. for (var index = 0; index < operatorsLen; index++) {
  3268. this.$set(
  3269. this.operatorMaps,
  3270. this.operators[index].creator,
  3271. this.operators[index]
  3272. );
  3273. }
  3274. }
  3275. } else {
  3276. this.adviceTableData = [];
  3277. }
  3278. this.handleSpanTempArr();
  3279. });
  3280. },
  3281. groupClassName({ row, rowIndex }) {
  3282. row.index = rowIndex;
  3283. // row.row_key = rowIndex+1;
  3284. },
  3285. getRowKey(row) {
  3286. return row.row_key;
  3287. },
  3288. getMaxRowKey() {
  3289. return this.rowKey;
  3290. },
  3291. selectGroupAdvice(row) {
  3292. this.groupSelectRow = row;
  3293. },
  3294. selectAdvice(selection, row) {
  3295. if (this.adviceType != 3) {
  3296. this.lstableData = [];
  3297. } else if (this.adviceType != 1) {
  3298. this.cqtableData = [];
  3299. }
  3300. this.$refs.multipleTable.toggleRowSelection(row);
  3301. var dlen = this.adviceTableData.length;
  3302. if (row.parent_id > 0) {
  3303. for (let index = 0; index < dlen; index++) {
  3304. if (
  3305. this.adviceTableData[index].id == row.parent_id ||
  3306. this.adviceTableData[index].parent_id == row.parent_id
  3307. ) {
  3308. this.$refs.multipleTable.toggleRowSelection(
  3309. this.adviceTableData[index]
  3310. );
  3311. }
  3312. }
  3313. } else {
  3314. for (let index = 0; index < dlen; index++) {
  3315. if (
  3316. this.adviceTableData[index].parent_id == row.id ||
  3317. this.adviceTableData[index].id == row.id ||
  3318. this.adviceTableData[index].groupno == row.groupno
  3319. ) {
  3320. this.$refs.multipleTable.toggleRowSelection(
  3321. this.adviceTableData[index]
  3322. );
  3323. }
  3324. }
  3325. }
  3326. },
  3327. changeAdvice(selection) {
  3328. this.multipleSelection = selection;
  3329. },
  3330. handleClick(val) {
  3331. // console.log("val", val);
  3332. },
  3333. printThisInfo() {
  3334. if (this.adviceType == 1) {
  3335. if (this.cqtableData.length == 0) {
  3336. this.$message.error("请勾选需要打印的医嘱!");
  3337. return false;
  3338. }
  3339. const style =
  3340. "@media print {.printForm{width:960px} .printForm .hospital_title{font-size:20px;font-weight:400;text-align:center;letter-spacing:5px}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .info ul{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;align-items:center;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-justify-content:space-around;-moz-justify-content:space-around;-ms-justify-content:space-around;-o-justify-content:space-around;justify-content:space-around}.printForm .info ul li{display:flex;box-sizing:border-box;justify-content:space-around}.printForm .info ul li .InputBox{padding:0;border:0;border-bottom:1px #e5e5e5 solid;outline:0;width: 80px;}.printForm .printTable tr{padding:2px}.printForm .printTable tr>th{padding:6px 4px}.printForm .printTable tr>td{padding:6px 4px} .es-img {height: 25px;}";
  3341. setTimeout(() => {
  3342. printJS({
  3343. printable: "printCQadvice",
  3344. type: "html",
  3345. style: style,
  3346. scanStyles: false
  3347. });
  3348. }, 1);
  3349. } else if (this.adviceType == 3 || this.adviceType == 2) {
  3350. if (this.lstableData.length == 0) {
  3351. this.$message.error("请勾选需要打印的医嘱!");
  3352. return false;
  3353. }
  3354. const style =
  3355. "@media print {.printForm{width:960px} .printForm .hospital_title{font-size:20px;font-weight:400;text-align:center;letter-spacing:5px}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .title{font-size:30px;font-weight:500;text-align:center}.printForm .info ul{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;align-items:center;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-justify-content:space-around;-moz-justify-content:space-around;-ms-justify-content:space-around;-o-justify-content:space-around;justify-content:space-around}.printForm .info ul li{display:flex;box-sizing:border-box;justify-content:space-around}.printForm .info ul li .InputBox{padding:0;border:0;border-bottom:1px #e5e5e5 solid;outline:0;width: 80px;}.printForm .printTable tr{padding:2px}.printForm .printTable tr>th{padding:6px 4px}.printForm .printTable tr>td{padding:6px 4px} .es-img {height: 25px;}";
  3356. setTimeout(() => {
  3357. printJS({
  3358. printable: "printLSadvice",
  3359. type: "html",
  3360. style: style,
  3361. scanStyles: false
  3362. });
  3363. }, 1);
  3364. } else {
  3365. this.$message.error(
  3366. "请先将医嘱类型切换到长期或临时,勾选需要打印的医嘱!"
  3367. );
  3368. return false;
  3369. }
  3370. },
  3371. cellClassName({ row, column, rowIndex, columnIndex }) {
  3372. return "ls-table-row";
  3373. },
  3374. tranAge(birthday) {
  3375. var birth = uParseTime(birthday, "{y}-{m}-{d}");
  3376. return jsGetAge(birth, "-");
  3377. },
  3378. changeTemplateAdvice(selection) {
  3379. this.selectedTemplate = selection;
  3380. },
  3381. selectAllTemplateAdvice(selection) {
  3382. var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
  3383. .DoctorAdviceTemplate;
  3384. for (let y = 0; y < adviceArray.length; y++) {
  3385. adviceArray[y].selection = false;
  3386. }
  3387. if (selection.length > 0) {
  3388. for (let y = 0; y < adviceArray.length; y++) {
  3389. for (let i = 0; i < selection.length; i++) {
  3390. if (adviceArray[y].id == selection[i].advice_id) {
  3391. adviceArray[y].selection = true;
  3392. }
  3393. }
  3394. }
  3395. }
  3396. },
  3397. selectTemplateAdvice(selection, row) {
  3398. var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
  3399. .DoctorAdviceTemplate;
  3400. for (let y = 0; y < adviceArray.length; y++) {
  3401. adviceArray[y].selection = false;
  3402. }
  3403. if (selection.length > 0) {
  3404. for (let y = 0; y < adviceArray.length; y++) {
  3405. for (let i = 0; i < selection.length; i++) {
  3406. if (adviceArray[y].id == selection[i].advice_id) {
  3407. adviceArray[y].selection = true;
  3408. }
  3409. }
  3410. }
  3411. }
  3412. if (row.children.length > 0) {
  3413. for (const index in row.children) {
  3414. this.$refs.selecttemplatetable.toggleRowSelection(
  3415. row.children[index]
  3416. );
  3417. }
  3418. }
  3419. // 下面两步的作用是为了上选中的数据的输出顺序不变
  3420. for (const index in this.selectedTemp.list) {
  3421. this.$refs.selecttemplatetable.toggleRowSelection(
  3422. this.selectedTemp.list[index]
  3423. );
  3424. if (this.selectedTemp.list[index].children.length > 0) {
  3425. for (const j in this.selectedTemp.list[index].children) {
  3426. this.$refs.selecttemplatetable.toggleRowSelection(
  3427. this.selectedTemp.list[index].children[j]
  3428. );
  3429. }
  3430. }
  3431. }
  3432. for (const index in this.selectedTemp.list) {
  3433. this.$refs.selecttemplatetable.toggleRowSelection(
  3434. this.selectedTemp.list[index]
  3435. );
  3436. if (this.selectedTemp.list[index].children.length > 0) {
  3437. for (const j in this.selectedTemp.list[index].children) {
  3438. this.$refs.selecttemplatetable.toggleRowSelection(
  3439. this.selectedTemp.list[index].children[j]
  3440. );
  3441. }
  3442. }
  3443. }
  3444. // console.log(this.selectedTemp.list);
  3445. },
  3446. spanselecttable({ row, column, rowIndex, columnIndex }) {
  3447. if (columnIndex == 0) {
  3448. const _row = this.selectedTemp.rows[rowIndex];
  3449. const _col = _row > 0 ? 1 : 0;
  3450. return {
  3451. rowspan: _row,
  3452. colspan: _col
  3453. };
  3454. }
  3455. },
  3456. calcselectedTemp() {
  3457. var rowKeys = 0;
  3458. for (const index in this.selectedTemp.list) {
  3459. var pkey = rowKeys;
  3460. this.selectedTemp.rows[rowKeys] = 1;
  3461. if (this.selectedTemp.list[index].children.length > 0) {
  3462. for (const childindex in this.selectedTemp.list[index].children) {
  3463. rowKeys++;
  3464. this.selectedTemp.rows[pkey] += 1;
  3465. this.selectedTemp.rows[rowKeys] = 0;
  3466. }
  3467. }
  3468. rowKeys++;
  3469. this.$nextTick(function() {
  3470. if (this.selectedTemp.list[index].selection) {
  3471. this.$refs.selecttemplatetable.toggleRowSelection(
  3472. this.selectedTemp.list[index]
  3473. );
  3474. }
  3475. });
  3476. }
  3477. },
  3478. templateTableChange(currentRow, oldCurrentRow) {
  3479. this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
  3480. if (currentRow == null) {
  3481. return false;
  3482. }
  3483. this.selectedTemp.id = currentRow.id;
  3484. this.selectedTemp.name = currentRow.name;
  3485. this.selectedTemp.org_id = currentRow.org_id;
  3486. if (this.selectedTemp.id in this.adviceTemplateMaps) {
  3487. var mapid = this.selectedTemp.id;
  3488. var thisRowKey = 0;
  3489. for (const index in this.adviceTemplateMaps[mapid]
  3490. .DoctorAdviceTemplate) {
  3491. thisRowKey++;
  3492. var item = {
  3493. advice_name: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3494. index
  3495. ].advice_name,
  3496. advice_desc: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3497. index
  3498. ].advice_desc,
  3499. single_dose:
  3500. "" +
  3501. this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3502. .single_dose,
  3503. single_dose_unit: this.adviceTemplateMaps[mapid]
  3504. .DoctorAdviceTemplate[index].single_dose_unit,
  3505. drug_spec:
  3506. "" +
  3507. this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3508. .drug_spec,
  3509. drug_spec_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3510. index
  3511. ].drug_spec_unit,
  3512. prescribing_number:
  3513. "" +
  3514. this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3515. .prescribing_number,
  3516. prescribing_number_unit: this.adviceTemplateMaps[mapid]
  3517. .DoctorAdviceTemplate[index].prescribing_number_unit,
  3518. delivery_way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3519. index
  3520. ].delivery_way,
  3521. execution_frequency: this.adviceTemplateMaps[mapid]
  3522. .DoctorAdviceTemplate[index].execution_frequency,
  3523. advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3524. index
  3525. ].id,
  3526. selection: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3527. index
  3528. ].selection,
  3529. day_count: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3530. index
  3531. ].day_count,
  3532. week_days: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3533. index
  3534. ].week_days,
  3535. frequency_type: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3536. index
  3537. ].frequency_type,
  3538. isEdit: 0,
  3539. id: 0,
  3540. children: [],
  3541. parent_row: 0,
  3542. row_key: thisRowKey
  3543. };
  3544. if (
  3545. "children" in
  3546. this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] &&
  3547. this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children
  3548. .length > 0
  3549. ) {
  3550. var parentRow = thisRowKey;
  3551. var children = this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
  3552. index
  3553. ].children;
  3554. for (const key in children) {
  3555. thisRowKey++;
  3556. var child = {
  3557. advice_id: children[key].id,
  3558. advice_name: children[key].advice_name,
  3559. advice_desc: children[key].advice_desc,
  3560. single_dose: "" + children[key].single_dose,
  3561. single_dose_unit: children[key].single_dose_unit,
  3562. drug_spec: "" + children[key].drug_spec,
  3563. drug_spec_unit: children[key].drug_spec_unit,
  3564. prescribing_number: "" + children[key].prescribing_number,
  3565. prescribing_number_unit: children[key].prescribing_number_unit,
  3566. delivery_way: children[key].delivery_way,
  3567. execution_frequency: children[key].execution_frequency,
  3568. isEdit: 0,
  3569. id: 0,
  3570. children: [],
  3571. parent_row: parentRow,
  3572. row_key: thisRowKey
  3573. };
  3574. item.children.push(child);
  3575. }
  3576. this.$set(item, "children", item.children);
  3577. }
  3578. this.selectedTemp.list.unshift(item);
  3579. }
  3580. }
  3581. },
  3582. newAddTempForm() {
  3583. this.allSelectedTemplate = [];
  3584. var thisRowKey = 0;
  3585. for (const indexs in this.adviceTemplateMaps) {
  3586. const adviceTemplate = this.adviceTemplateMaps[indexs];
  3587. for (const index in adviceTemplate.DoctorAdviceTemplate) {
  3588. if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
  3589. thisRowKey++;
  3590. // console.log(adviceTemplate.DoctorAdviceTemplate[index].id);
  3591. var item = {
  3592. advice_name:
  3593. adviceTemplate.DoctorAdviceTemplate[index].advice_name,
  3594. advice_desc:
  3595. adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
  3596. single_dose:
  3597. "" + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
  3598. single_dose_unit:
  3599. adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
  3600. drug_spec:
  3601. "" + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
  3602. drug_spec_unit:
  3603. adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
  3604. prescribing_number:
  3605. "" +
  3606. adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
  3607. prescribing_number_unit:
  3608. adviceTemplate.DoctorAdviceTemplate[index]
  3609. .prescribing_number_unit,
  3610. delivery_way:
  3611. adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
  3612. execution_frequency:
  3613. adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
  3614. advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
  3615. selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
  3616. day_count: adviceTemplate.DoctorAdviceTemplate[index].day_count,
  3617. frequency_type:
  3618. adviceTemplate.DoctorAdviceTemplate[index].frequency_type,
  3619. week_days: adviceTemplate.DoctorAdviceTemplate[index].week_days,
  3620. template_id: "T" + adviceTemplate.DoctorAdviceTemplate[index].id,
  3621. isEdit: 0,
  3622. id: 0,
  3623. children: [],
  3624. parent_row: 0,
  3625. row_key: thisRowKey
  3626. };
  3627. if (
  3628. "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
  3629. adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
  3630. ) {
  3631. var parentRow = thisRowKey;
  3632. var children =
  3633. adviceTemplate.DoctorAdviceTemplate[index].children;
  3634. for (const key in children) {
  3635. thisRowKey++;
  3636. var child = {
  3637. advice_id: children[key].id,
  3638. template_id: "T" + children[key].id,
  3639. advice_name: children[key].advice_name,
  3640. advice_desc: children[key].advice_desc,
  3641. single_dose: "" + children[key].single_dose,
  3642. single_dose_unit: children[key].single_dose_unit,
  3643. drug_spec: "" + children[key].drug_spec,
  3644. drug_spec_unit: children[key].drug_spec_unit,
  3645. prescribing_number: "" + children[key].prescribing_number,
  3646. prescribing_number_unit:
  3647. children[key].prescribing_number_unit,
  3648. delivery_way: children[key].delivery_way,
  3649. execution_frequency: children[key].execution_frequency,
  3650. isEdit: 0,
  3651. id: 0,
  3652. children: [],
  3653. parent_row: parentRow,
  3654. row_key: thisRowKey
  3655. };
  3656. item.children.push(child);
  3657. this.allSelectedTemplate.unshift(child);
  3658. }
  3659. this.$set(item, "children", item.children);
  3660. }
  3661. this.allSelectedTemplate.unshift(item);
  3662. adviceTemplate.DoctorAdviceTemplate[index].selection = false;
  3663. }
  3664. }
  3665. }
  3666. var childMap = {};
  3667. for (const index in this.allSelectedTemplate) {
  3668. if (this.allSelectedTemplate[index].parent_row > 0) {
  3669. if (!(this.allSelectedTemplate[index].parent_row in childMap)) {
  3670. childMap[this.allSelectedTemplate[index].parent_row] = [];
  3671. }
  3672. childMap[this.allSelectedTemplate[index].parent_row].push(
  3673. this.allSelectedTemplate[index]
  3674. );
  3675. }
  3676. }
  3677. for (const index in this.allSelectedTemplate) {
  3678. if (this.allSelectedTemplate[index].parent_row > 0) {
  3679. continue;
  3680. }
  3681. this.rowKey++;
  3682. // console.log(this.allSelectedTemplate[index]);
  3683. var item = {
  3684. template_id: this.allSelectedTemplate[index].template_id,
  3685. advice_name: this.allSelectedTemplate[index].advice_name,
  3686. advice_desc: this.allSelectedTemplate[index].advice_desc,
  3687. single_dose: "" + this.allSelectedTemplate[index].single_dose,
  3688. single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
  3689. drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
  3690. drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
  3691. prescribing_number:
  3692. "" + this.allSelectedTemplate[index].prescribing_number,
  3693. prescribing_number_unit: this.allSelectedTemplate[index]
  3694. .prescribing_number_unit,
  3695. delivery_way: this.allSelectedTemplate[index].delivery_way,
  3696. execution_frequency: this.allSelectedTemplate[index]
  3697. .execution_frequency,
  3698. day_count: this.allSelectedTemplate[index].day_count,
  3699. frequency_type: this.allSelectedTemplate[index].frequency_type,
  3700. week_days: this.allSelectedTemplate[index].week_days,
  3701. isEdit: 0,
  3702. id: 0,
  3703. children: [],
  3704. parent_row: 0,
  3705. row_key: this.rowKey
  3706. };
  3707. if (this.allSelectedTemplate[index].children.length > 0) {
  3708. if (this.allSelectedTemplate[index].row_key in childMap) {
  3709. var parentRow = this.rowKey;
  3710. var children = childMap[this.allSelectedTemplate[index].row_key];
  3711. for (const key in children) {
  3712. this.rowKey++;
  3713. var child = {
  3714. template_id: children[key].template_id,
  3715. advice_name: children[key].advice_name,
  3716. advice_desc: children[key].advice_desc,
  3717. single_dose: "" + children[key].single_dose,
  3718. single_dose_unit: children[key].single_dose_unit,
  3719. drug_spec: "" + children[key].drug_spec,
  3720. drug_spec_unit: children[key].drug_spec_unit,
  3721. prescribing_number: "" + children[key].prescribing_number,
  3722. prescribing_number_unit: children[key].prescribing_number_unit,
  3723. delivery_way: children[key].delivery_way,
  3724. execution_frequency: children[key].execution_frequency,
  3725. isEdit: 0,
  3726. id: 0,
  3727. children: [],
  3728. parent_row: parentRow,
  3729. row_key: this.rowKey
  3730. };
  3731. item.children.push(child);
  3732. }
  3733. this.$set(item, "children", item.children);
  3734. }
  3735. }
  3736. this.groupForm.adviceNames.push(item);
  3737. }
  3738. // console.log(this.groupForm);
  3739. this.templateFormVisible = false;
  3740. // 清除数据源的选中记录
  3741. },
  3742. addTempForm(formName) {
  3743. var _this = this;
  3744. this.$refs[formName].validate(valid => {
  3745. if (valid) {
  3746. if (_this.templateForm.id in _this.adviceTemplateMaps) {
  3747. var mapid = _this.templateForm.id;
  3748. for (const index in _this.adviceTemplateMaps[mapid]
  3749. .DoctorAdviceTemplate) {
  3750. this.rowKey++;
  3751. var item = {
  3752. advice_name:
  3753. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3754. .advice_name,
  3755. advice_desc:
  3756. "" +
  3757. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3758. .advice_desc,
  3759. single_dose:
  3760. "" +
  3761. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3762. .single_dose,
  3763. single_dose_unit:
  3764. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3765. .single_dose_unit,
  3766. drug_spec:
  3767. "" +
  3768. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3769. .drug_spec,
  3770. drug_spec_unit:
  3771. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3772. .drug_spec_unit,
  3773. prescribing_number:
  3774. "" +
  3775. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3776. .prescribing_number,
  3777. prescribing_number_unit:
  3778. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3779. .prescribing_number_unit,
  3780. delivery_way:
  3781. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3782. .delivery_way,
  3783. execution_frequency:
  3784. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3785. .execution_frequency,
  3786. parent_id:
  3787. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3788. .parent_id,
  3789. isEdit: 0,
  3790. id: 0,
  3791. children: [],
  3792. parent_row: 0,
  3793. row_key: this.rowKey
  3794. };
  3795. if (
  3796. "children" in
  3797. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] &&
  3798. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3799. .children
  3800. ) {
  3801. var parentRow = this.rowKey;
  3802. var children =
  3803. _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
  3804. .children;
  3805. for (const key in children) {
  3806. this.rowKey++;
  3807. var child = {
  3808. advice_name: children[key].advice_name,
  3809. advice_desc: children[key].advice_desc,
  3810. single_dose: "" + children[key].single_dose,
  3811. single_dose_unit: children[key].single_dose_unit,
  3812. drug_spec: "" + children[key].drug_spec,
  3813. drug_spec_unit: children[key].drug_spec_unit,
  3814. prescribing_number: "" + children[key].prescribing_number,
  3815. prescribing_number_unit:
  3816. children[key].prescribing_number_unit,
  3817. delivery_way: children[key].delivery_way,
  3818. execution_frequency: children[key].execution_frequency,
  3819. isEdit: 0,
  3820. id: 0,
  3821. children: [],
  3822. parent_row: parentRow,
  3823. row_key: this.rowKey
  3824. };
  3825. item.children.push(child);
  3826. }
  3827. _this.$set(item, "children", item.children);
  3828. }
  3829. _this.groupForm.adviceNames.unshift(item);
  3830. // _this.groupForm.adviceNames.unshift(item);
  3831. _this.toggleRowExpansion();
  3832. }
  3833. }
  3834. _this.templateFormVisible = false;
  3835. }
  3836. });
  3837. },
  3838. submitNameForm(formName) {
  3839. var drug_name = ""
  3840. var name = ""
  3841. var way = 0
  3842. this.nameForm.drug_id = this.nameForm.advice_name
  3843. for(let i=0;i<this.medicals.length;i++){
  3844. if(this.nameForm.advice_name == this.medicals[i].id){
  3845. name = this.medicals[i].drug_name
  3846. way = this.medicals[i].way
  3847. }
  3848. }
  3849. if(way == 1){
  3850. drug_name = name
  3851. }
  3852. if(way == 2){
  3853. var arr = name.split("(自备药)")
  3854. drug_name = arr[0]
  3855. }
  3856. this.nameForm.advice_name = drug_name
  3857. this.nameForm.way = way
  3858. var _this = this;
  3859. this.$refs[formName].validate(valid => {
  3860. if (valid) {
  3861. if (_this.nameForm.isEdit) {
  3862. var ale = _this.groupForm.adviceNames.length;
  3863. if (_this.isChild) {
  3864. for (let index = 0; index < ale; index++) {
  3865. if (
  3866. _this.groupSelectRow.parent_row ==
  3867. _this.groupForm.adviceNames[index].row_key
  3868. ) {
  3869. var cle = _this.groupForm.adviceNames[index].children.length;
  3870. var children = _this.groupForm.adviceNames[index].children;
  3871. for (let j = 0; j < ale; j++) {
  3872. if (_this.groupSelectRow.row_key == children[j].row_key) {_this.groupForm.adviceNames[index].children[j].advice_name = _this.nameForm.advice_name;
  3873. _this.groupForm.adviceNames[index].children[j].advice_desc = _this.nameForm.advice_desc;
  3874. _this.groupForm.adviceNames[index].children[j].single_dose = "" + _this.nameForm.single_dose;
  3875. _this.groupForm.adviceNames[index].children[j].single_dose_unit = _this.nameForm.single_dose_unit;
  3876. _this.groupForm.adviceNames[index].children[j].drug_spec ="" + _this.nameForm.drug_spec;
  3877. _this.groupForm.adviceNames[index].children[j].drug_spec_unit = _this.nameForm.drug_spec_unit;
  3878. _this.groupForm.adviceNames[index].children[j].prescribing_number ="" + _this.nameForm.prescribing_number;
  3879. _this.groupForm.adviceNames[index].children[j].prescribing_number_unit =_this.nameForm.prescribing_number_unit;
  3880. _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
  3881. _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
  3882. _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
  3883. _this.groupForm.adviceNames[index].children[j].way = this.nameForm.way;
  3884. _this.$set(
  3885. _this.groupForm.adviceNames[index].children,
  3886. j,
  3887. _this.groupForm.adviceNames[index].children[j]
  3888. );
  3889. _this.toggleRowExpansion();
  3890. break;
  3891. }
  3892. }
  3893. }
  3894. }
  3895. } else {
  3896. for (let index = 0; index < ale; index++) {
  3897. if (
  3898. _this.groupSelectRow.row_key ==
  3899. _this.groupForm.adviceNames[index].row_key
  3900. ) {
  3901. _this.groupForm.adviceNames[index].advice_name =
  3902. _this.nameForm.advice_name;
  3903. _this.groupForm.adviceNames[index].advice_desc =
  3904. _this.nameForm.advice_desc;
  3905. _this.groupForm.adviceNames[index].single_dose =
  3906. "" + _this.nameForm.single_dose;
  3907. _this.groupForm.adviceNames[index].single_dose_unit =
  3908. _this.nameForm.single_dose_unit;
  3909. _this.groupForm.adviceNames[index].drug_spec =
  3910. "" + _this.nameForm.drug_spec;
  3911. _this.groupForm.adviceNames[index].drug_spec_unit =
  3912. _this.nameForm.drug_spec_unit;
  3913. _this.groupForm.adviceNames[index].prescribing_number =
  3914. "" + _this.nameForm.prescribing_number;
  3915. _this.groupForm.adviceNames[index].prescribing_number_unit =
  3916. _this.nameForm.prescribing_number_unit;
  3917. _this.groupForm.adviceNames[index].delivery_way =
  3918. _this.nameForm.delivery_way;
  3919. _this.groupForm.adviceNames[index].execution_frequency =
  3920. _this.nameForm.execution_frequency;
  3921. if (_this.nameForm.frequency_type == 1) {
  3922. _this.groupForm.adviceNames[index].frequency_type =
  3923. _this.nameForm.frequency_type;
  3924. _this.groupForm.adviceNames[index].day_count = "0";
  3925. _this.groupForm.adviceNames[index].week_days = "";
  3926. } else if (_this.nameForm.frequency_type == 2) {
  3927. _this.groupForm.adviceNames[index].frequency_type =
  3928. _this.nameForm.frequency_type;
  3929. _this.groupForm.adviceNames[index].day_count =
  3930. _this.nameForm.day_count;
  3931. _this.groupForm.adviceNames[index].week_days = "";
  3932. } else if (_this.nameForm.frequency_type == 3) {
  3933. _this.groupForm.adviceNames[index].frequency_type =
  3934. _this.nameForm.frequency_type;
  3935. _this.groupForm.adviceNames[index].day_count = "0";
  3936. _this.groupForm.adviceNames[index].week_days = this.weeks
  3937. .filter(function(s) {
  3938. return s && s.trim();
  3939. })
  3940. .join(",");
  3941. }
  3942. _this.$set(
  3943. _this.groupForm.adviceNames,
  3944. index,
  3945. _this.groupForm.adviceNames[index]
  3946. );
  3947. _this.toggleRowExpansion();
  3948. this.weeks = [];
  3949. break;
  3950. }
  3951. }
  3952. }
  3953. } else {
  3954. if (_this.isChild) {
  3955. _this.rowKey++;
  3956. _this.nameForm.row_key = _this.rowKey;
  3957. var ale = _this.groupForm.adviceNames.length;
  3958. for (let index = 0; index < ale; index++) {
  3959. if (
  3960. _this.nameForm.parent_row ==
  3961. _this.groupForm.adviceNames[index].row_key
  3962. ) {
  3963. _this.groupForm.adviceNames[index].children.push(
  3964. _this.nameForm
  3965. );
  3966. _this.$set(
  3967. _this.groupForm.adviceNames,
  3968. index,
  3969. _this.groupForm.adviceNames[index]
  3970. );
  3971. // _this.$refs.advicenametable.doLayout();
  3972. _this.toggleRowExpansion();
  3973. break;
  3974. }
  3975. }
  3976. } else {
  3977. _this.nameForm.template_id =
  3978. "D" + new Date().getTime() + this.getRandValue();
  3979. if (_this.nameForm.frequency_type == 1) {
  3980. _this.nameForm.frequency_type = _this.nameForm.frequency_type;
  3981. _this.nameForm.day_count = "0";
  3982. _this.nameForm.week_days = "";
  3983. } else if (this.nameForm.frequency_type == 2) {
  3984. _this.nameForm.frequency_type = _this.nameForm.frequency_type;
  3985. _this.nameForm.day_count = _this.nameForm.day_count;
  3986. _this.nameForm.week_days = "";
  3987. } else if (this.nameForm.frequency_type == 3) {
  3988. _this.nameForm.frequency_type = _this.nameForm.frequency_type;
  3989. _this.nameForm.day_count = "0";
  3990. _this.nameForm.week_days = this.weeks
  3991. .filter(function(s) {
  3992. return s && s.trim();
  3993. })
  3994. .join(",");
  3995. }
  3996. this.weeks = [];
  3997. _this.rowKey++;
  3998. _this.nameForm.row_key = _this.rowKey;
  3999. _this.groupForm.adviceNames.push(_this.nameForm);
  4000. _this.toggleRowExpansion();
  4001. }
  4002. }
  4003. _this.nameFormVisible = false;
  4004. }
  4005. });
  4006. },
  4007. setAdminUserES(id) {
  4008. if (id == 0) {
  4009. return "";
  4010. }
  4011. if (id in this.operatorMaps) {
  4012. return this.operatorMaps[id].url;
  4013. } else {
  4014. return "";
  4015. }
  4016. },
  4017. tranSex(gender) {
  4018. var sex = "未知";
  4019. switch (gender) {
  4020. case 1:
  4021. sex = "男";
  4022. break;
  4023. case 2:
  4024. sex = "女";
  4025. break;
  4026. default:
  4027. break;
  4028. }
  4029. return sex;
  4030. },
  4031. load(tree, treeNode, resolve) {},
  4032. toggleRowExpansion() {
  4033. for (const index in this.groupForm.adviceNames) {
  4034. this.$refs.advicenametable.toggleRowExpansion(
  4035. this.groupForm.adviceNames[index],
  4036. true
  4037. );
  4038. }
  4039. },
  4040. handleSpanTempArr() {
  4041. this.tempArr = [];
  4042. for (let i = 0; i < this.adviceTableData.length; i++) {
  4043. if (i === 0) {
  4044. this.tempArr.push(1);
  4045. this.pos = 0;
  4046. } else {
  4047. // 判断当前元素与上一个元素是否相同
  4048. if (
  4049. this.adviceTableData[i].groupno ===
  4050. this.adviceTableData[i - 1].groupno
  4051. ) {
  4052. this.tempArr[this.pos] += 1;
  4053. this.tempArr.push(0);
  4054. } else {
  4055. this.tempArr.push(1);
  4056. this.pos = i;
  4057. }
  4058. }
  4059. }
  4060. // let sameRowArr = [], sIdx = 0;
  4061. // this.adviceTemplates.forEach((item, index) => {
  4062. // item.index = index
  4063. // if (index === 0) {
  4064. // sameRowArr.push([index])
  4065. // } else {
  4066. // if (item.template_id === this.adviceTemplates[index - 1].template_id) {
  4067. // sameRowArr[sIdx].push(index)
  4068. // } else {
  4069. // sIdx = sIdx + 1;
  4070. // sameRowArr.push([index])
  4071. // }
  4072. // }
  4073. // })
  4074. // this.sameRowArr = sameRowArr;
  4075. },
  4076. mergeSpan({ row, column, rowIndex, columnIndex }) {
  4077. if (columnIndex === 0 || columnIndex === 1 || columnIndex === 2) {
  4078. const _row = this.tempArr[rowIndex];
  4079. const _col = _row > 0 ? 1 : 0;
  4080. return {
  4081. rowspan: _row,
  4082. colspan: _col
  4083. };
  4084. }
  4085. },
  4086. cancleDialog() {
  4087. this.templateFormVisible = false;
  4088. this.weeks = [];
  4089. for (const indexs in this.adviceTemplateMaps) {
  4090. const adviceTemplate = this.adviceTemplateMaps[indexs];
  4091. for (const index in adviceTemplate.DoctorAdviceTemplate) {
  4092. adviceTemplate.DoctorAdviceTemplate[index].selection = false;
  4093. }
  4094. }
  4095. },
  4096. changeRemind(val) {
  4097. const params = {
  4098. is_open_remind: val,
  4099. id: this.patientID
  4100. };
  4101. PostRemind(params).then(response => {
  4102. if (response.data.state == 1) {
  4103. this.is_open_remind = response.data.data.is_open_remind;
  4104. if (response.data.data.is_open_remind == 1) {
  4105. this.$message.success("开启成功");
  4106. } else {
  4107. this.$message.success("关闭成功");
  4108. }
  4109. } else {
  4110. this.$message.error(response.data.msg);
  4111. }
  4112. });
  4113. },
  4114. getPatient(params) {
  4115. fetchPatient(params.id).then(response => {
  4116. if (response.data.state == 1) {
  4117. var patietInfo = response.data.data.patient;
  4118. this.is_open_remind = patietInfo.is_open_remind;
  4119. } else {
  4120. this.$message.error(response.data.msg);
  4121. }
  4122. });
  4123. },
  4124. getRandValue() {
  4125. var charactors = "1234567890";
  4126. var value = "",
  4127. i;
  4128. for (let j = 1; j <= 4; j++) {
  4129. i = parseInt(10 * Math.random());
  4130. value = value + charactors.charAt(i);
  4131. }
  4132. return value;
  4133. },
  4134. getAllAdviceConfig: function() {
  4135. getAllAdviceConfig().then(response => {
  4136. if (response.data.state == 1) {
  4137. this.deliveryWayOptions =
  4138. response.data.data.drugways === null
  4139. ? []
  4140. : response.data.data.drugways;
  4141. this.executionFrequencyOptions =
  4142. response.data.data.efs === null ? [] : response.data.data.efs;
  4143. }
  4144. });
  4145. },
  4146. // 获取勾选中的行
  4147. getPrintInfo(ids) {
  4148. getPrintInfo({ ids: ids }).then(response => {
  4149. if (response.data.state === 1) {
  4150. var doctoradvice = response.data.data.doctoradvice;
  4151. // console.log("doctoradvice", doctoradvice);
  4152. this.dataAdvice = doctoradvice;
  4153. if (this.adviceType === 3 || this.adviceType === 2) {
  4154. this.lstableData = this.dataAdvice;
  4155. // console.log("---", this.multipleSelection);
  4156. } else if (this.adviceType === 1) {
  4157. this.cqtableData = doctoradvice;
  4158. }
  4159. }
  4160. });
  4161. },
  4162. getdata: function(data) {
  4163. data = data.sort();
  4164. for (var i = 0; i < data.length; i++) {
  4165. if (data[i] === data[i + 1]) {
  4166. data.splice(i, 1);
  4167. }
  4168. }
  4169. return data;
  4170. },
  4171. getPatientSchedules(id) {
  4172. getPatientSchedules(id).then(response => {
  4173. if (response.data.state === 1) {
  4174. var scheduls = response.data.data.scheduls;
  4175. // console.log("scheduls", scheduls);
  4176. this.schedulStatus = 1;
  4177. // console.log("sch22", this.schedulStatus);
  4178. }
  4179. if (response.data.state === 0) {
  4180. this.schedulStatus = 2;
  4181. // console.log("sch23", this.schedulStatus);
  4182. }
  4183. });
  4184. },
  4185. changeOptions(type) {
  4186. if (type == 3 && this.schedulStatus == 2) {
  4187. this.$message.error("该病人未排班,不能开临时医嘱!");
  4188. this.groupFormVisible = false;
  4189. }
  4190. },
  4191. handleCurrentChange(page) {
  4192. this.listQuery.page = page;
  4193. this.getList();
  4194. },
  4195. handleSizeChange(limit) {
  4196. this.listQuery.limit = limit;
  4197. this.getList();
  4198. },
  4199. getSelfMedicalList(id){
  4200. const params = {
  4201. patient_id:id
  4202. }
  4203. console.log("params9999999999",params)
  4204. getSelfMedicalList(params).then(response=>{
  4205. if(response.data.state == 1){
  4206. var medicalList = response.data.data.medicalList
  4207. //way字段区分数据源:1代表来自基础库 2代表来自药品库
  4208. for(let i=0;i<medicalList.length;i++){
  4209. medicalList[i].way = 2
  4210. }
  4211. for(let i=0;i<medicalList.length;i++){
  4212. medicalList[i].drug_name = medicalList[i].drug_name+"(自备药)"
  4213. }
  4214. var drugname = response.data.data.drugName
  4215. for(let i=0;i<drugname.length;i++){
  4216. drugname[i].way = 1
  4217. }
  4218. drugname.push(...medicalList)
  4219. this.medicals = drugname
  4220. }
  4221. })
  4222. },
  4223. changeDrugName(id){
  4224. var drug_name = ""
  4225. var name = ""
  4226. var way = 0
  4227. for(let i=0;i<this.medicals.length;i++){
  4228. if(id == this.medicals[i].id){
  4229. name = this.medicals[i].drug_name
  4230. way = this.medicals[i].way
  4231. }
  4232. }
  4233. if(way == 1){
  4234. drug_name = name
  4235. }
  4236. if(way == 2){
  4237. var arr = name.split("(自备药)")
  4238. drug_name = arr[0]
  4239. }
  4240. const params = {
  4241. drug_name:drug_name,
  4242. patient_id:this.$route.query.patient_id,
  4243. way:way,
  4244. }
  4245. getDrugDescByDrugName(params).then(response=>{
  4246. if(response.data.state == 1){
  4247. var drugspec = response.data.data.drugspec
  4248. if(drugspec[0].drug_spec !=0){
  4249. this.nameForm.advice_desc = drugspec[0].drug_spec
  4250. }
  4251. if(drugspec[0].min_unit!=0){
  4252. this.nameForm.drug_spec_unit = drugspec[0].min_unit
  4253. }
  4254. if(drugspec[0].delivery_way!=0){
  4255. this.nameForm.delivery_way = drugspec[0].delivery_way
  4256. }
  4257. if(drugspec[0].execution_frequency!=0){
  4258. this.nameForm.execution_frequency = drugspec[0].execution_frequency
  4259. }
  4260. if(drugspec[0].single_dose !=0){
  4261. this.nameForm.single_dose = drugspec[0].single_dose
  4262. if(drugspec[0].min_unit !=0){
  4263. this.nameForm.single_dose_unit = drugspec[0].min_unit
  4264. }
  4265. if(drugspec[0].min_unit!=0){
  4266. this.nameForm.prescribing_number_unit = drugspec[0].min_unit
  4267. }
  4268. if( drugspec[0].prescribing_number!=0){
  4269. this.nameForm.prescribing_number = drugspec[0].prescribing_number
  4270. }
  4271. this.drugSpec = drugspec
  4272. }
  4273. })
  4274. }
  4275. },
  4276. watch: {
  4277. adviceTableData: function() {
  4278. this.handleSpanTempArr();
  4279. },
  4280. "selectedTemp.list": function() {
  4281. this.calcselectedTemp();
  4282. },
  4283. multipleSelection: function() {
  4284. const arr = [];
  4285. const group = [];
  4286. const grouptwo = [];
  4287. const ids = [];
  4288. for (const i in this.multipleSelection) {
  4289. arr.push(this.multipleSelection[i]);
  4290. group.push(this.multipleSelection[i].groupno);
  4291. }
  4292. grouptwo.push(this.getdata(group));
  4293. // console.log('组号', group)
  4294. // console.log('组号2', grouptwo)
  4295. // console.log('ids', ids)
  4296. this.getPrintInfo(group);
  4297. }
  4298. },
  4299. components: {
  4300. PatientSidebar,
  4301. EditGroupAdvice
  4302. },
  4303. created() {
  4304. const id = this.$route.params && this.$route.params.id;
  4305. this.patientID = parseInt(id);
  4306. if (isNaN(this.patientID) || this.patientID <= 0) {
  4307. this.$notify.error({
  4308. title: "错误",
  4309. message: "无效的id"
  4310. });
  4311. this.$router.push("/patients/patients");
  4312. }
  4313. this.listQuery.id = this.patientID;
  4314. // var nowDate = new Date()
  4315. // var nowYear = nowDate.getFullYear()
  4316. // var nowMonth = nowDate.getMonth() + 1
  4317. // var nowDay = nowDate.getDate()
  4318. // this.listQuery.end_time =
  4319. // nowYear +
  4320. // '-' +
  4321. // (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  4322. // '-' +
  4323. // (nowDay < 10 ? '0' + nowDay : nowDay)
  4324. //
  4325. // nowDate.setMonth(nowDate.getMonth() - 1)
  4326. // nowYear = nowDate.getFullYear()
  4327. // nowMonth = nowDate.getMonth() + 1
  4328. // nowDay = nowDate.getDate()
  4329. //
  4330. // this.listQuery.start_time =
  4331. // nowYear +
  4332. // '-' +
  4333. // (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  4334. // '-' +
  4335. // (nowDay < 10 ? '0' + nowDay : nowDay)
  4336. // this.fetchAllDoctorAndNurse();
  4337. this.fetchAllAdminUsers();
  4338. this.getAllAdviceConfig();
  4339. this.getList();
  4340. const params = {
  4341. id: this.patientID
  4342. };
  4343. this.getPatient(params);
  4344. var xtuser = this.$store.getters.xt_user;
  4345. this.orgname = xtuser.org.org_name;
  4346. this.adminusername = xtuser.user.user_name;
  4347. this.aminuserid = xtuser.user.id;
  4348. this.unitsOption = getDataConfig("hemodialysis", "units");
  4349. //查询该病人是否有排班记录
  4350. this.getPatientSchedules(id);
  4351. this.getSelfMedicalList(id)
  4352. }
  4353. };
  4354. </script>
  4355. <style>
  4356. #oictable ::-webkit-scrollbar {
  4357. height: 15px;
  4358. }
  4359. </style>
  4360. <style rel="stylesheet/scss" lang="scss" scoped>
  4361. .printForm {
  4362. width: 960px;
  4363. }
  4364. .printForm .hospital_title {
  4365. font-size: 20px;
  4366. font-weight: 400;
  4367. text-align: center;
  4368. letter-spacing: 5px;
  4369. }
  4370. .printForm .title {
  4371. font-size: 30px;
  4372. font-weight: 500;
  4373. text-align: center;
  4374. }
  4375. .printForm .title {
  4376. font-size: 30px;
  4377. font-weight: 500;
  4378. text-align: center;
  4379. }
  4380. .printForm .info ul {
  4381. display: -webkit-box;
  4382. display: -moz-box;
  4383. display: -ms-flexbox;
  4384. display: -webkit-flex;
  4385. display: flex;
  4386. align-items: center;
  4387. -moz-box-sizing: border-box;
  4388. -webkit-box-sizing: border-box;
  4389. -o-box-sizing: border-box;
  4390. -ms-box-sizing: border-box;
  4391. box-sizing: border-box;
  4392. -webkit-justify-content: space-around;
  4393. -moz-justify-content: space-around;
  4394. -ms-justify-content: space-around;
  4395. -o-justify-content: space-around;
  4396. justify-content: space-around;
  4397. }
  4398. .printForm .info ul li {
  4399. display: flex;
  4400. box-sizing: border-box;
  4401. justify-content: space-around;
  4402. }
  4403. .printForm .info ul li .InputBox {
  4404. padding: 0;
  4405. border: none;
  4406. border-bottom: 1px #e5e5e5 solid;
  4407. outline: none;
  4408. width: 80px;
  4409. }
  4410. .printForm .printTable tr {
  4411. padding: 2px;
  4412. }
  4413. .printForm .printTable tr > th {
  4414. padding: 6px 4px;
  4415. }
  4416. .printForm .printTable tr > td {
  4417. padding: 6px 4px;
  4418. }
  4419. .es-img {
  4420. height: 25px;
  4421. }
  4422. .advice-container {
  4423. font-size: 15px;
  4424. .filter-container {
  4425. padding-bottom: 5px;
  4426. }
  4427. .search-component {
  4428. width: 500px;
  4429. .searchBox {
  4430. width: 300px;
  4431. height: 36px;
  4432. line-height: 36px;
  4433. padding-left: 15px;
  4434. border: 1px #dcdfe6 solid;
  4435. border-right: none;
  4436. outline: none;
  4437. float: left;
  4438. border-radius: 6px 0 0 6px;
  4439. font-size: 14px;
  4440. color: #333;
  4441. background: #fff;
  4442. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  4443. }
  4444. .searchBtn {
  4445. background-color: #409eff;
  4446. color: #fff;
  4447. font-size: 15px;
  4448. text-align: center;
  4449. height: 36px;
  4450. line-height: 36px;
  4451. float: left;
  4452. outline: none;
  4453. width: 70px;
  4454. border: none;
  4455. border-radius: 0 6px 6px 0;
  4456. font-family: "Microsoft Yahei";
  4457. cursor: pointer;
  4458. }
  4459. }
  4460. .amount {
  4461. font-weight: normal;
  4462. padding: 10px 0 0 0;
  4463. color: #606266;
  4464. font-size: 14px;
  4465. span {
  4466. color: #ef2525;
  4467. font-family: "Arial";
  4468. padding: 0 2px;
  4469. }
  4470. }
  4471. .el-dropdown-link {
  4472. cursor: pointer;
  4473. }
  4474. }
  4475. .advice-order .ls-title {
  4476. text-align: center;
  4477. font-weight: 600;
  4478. font-size: 30px;
  4479. line-height: 80px;
  4480. margin-bottom: 20px;
  4481. }
  4482. .advice-order .ls-type {
  4483. text-align: center;
  4484. margin-bottom: 20px;
  4485. }
  4486. .advice-order .ls-name {
  4487. display: flex;
  4488. align-items: center;
  4489. justify-content: space-between;
  4490. padding: 30px 2em;
  4491. }
  4492. </style>
  4493. <style>
  4494. .advice-order .el-table__body {
  4495. border: 1px solid #333;
  4496. }
  4497. .advice-order .el-table__body td {
  4498. border: 1px solid #333;
  4499. }
  4500. .advice-order .item-value {
  4501. flex: 1;
  4502. border-bottom: 1px solid #333;
  4503. }
  4504. .advice-order th,
  4505. .advice-order td {
  4506. padding: 5px 10px;
  4507. }
  4508. #user-advice-name-table .expanded {
  4509. display: table-row !important;
  4510. }
  4511. #user-advice-name-table .el-table__expand-icon {
  4512. -webkit-transform: rotate(90deg) !important;
  4513. transform: rotate(90deg) !important;
  4514. }
  4515. .user-advice-table-row:hover > td {
  4516. background: #fff !important;
  4517. }
  4518. .user-advice-table-row td:hover {
  4519. background: #fff !important;
  4520. }
  4521. #user-advice-select-template-table .el-table__row {
  4522. display: table-row !important;
  4523. }
  4524. #user-advice-select-template-table .el-table__expand-icon {
  4525. -webkit-transform: rotate(90deg) !important;
  4526. transform: rotate(90deg) !important;
  4527. }
  4528. .advicenamedisplay .cell {
  4529. float: left;
  4530. text-align: left;
  4531. }
  4532. </style>