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

doctorAdvice.vue 166KB

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