血透系统PC前端

doctorAdvice.vue 142KB

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