doctorAdvice.vue 172KB

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