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

doctorAdvice.vue 181KB

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