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

doctorAdvice.vue 161KB

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