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

doctorAdvice.vue 169KB

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