血透系统PC前端

doctorAdvice.vue 143KB

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