血透系统PC前端

doctorAdvice.vue 136KB

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