血透系统PC前端

doctorAdvice.vue 136KB

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