血透系统PC前端

doctorAdvice.vue 142KB

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