血透系统PC前端

doctorAdvice.vue 150KB

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