doctorAdvice.vue 182KB

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